aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc
AgeCommit message (Collapse)AuthorFilesLines
2024-07-15ppc: Remove duplicate newlinesMarek Vasut28-43/+0
Drop all duplicate newlines. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-07-13turris_1x: Normalize Kconfig usageTom Rini1-0/+4
We don't set many options in the board Kconfig entry file but instead use defconfigs, select in some cases on the target itself, or update the "default" options of the main entries when needed. In this case we can remove most of the board Kconfig entries and just add them to the defconfig like other platforms. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-07-12Merge patch series "Add Turris 1.x board"Tom Rini8-4/+549
Marek Mojík <marek.mojik@nic.cz> says: Hello all, this is a continuation of previous work by Pali to add support for the Turris 1.x board. As the patches were based on u-boot v2022.04, a nontrivial rebasing was needed. Some notes: - Some options that are in SD defconfig are disabled in NOR defconfig because over the years u-boot grew and the old NOR defconfig will not fit into NOR memory. - SD boot with RAM larger than 2GB will only allocate 2GB of RAM (We were not able to fix this yet)
2024-07-12powerpc: Add support for CZ.NIC Turris 1.x routersPali Rohár4-0/+536
Add support for CZ.NIC Turris 1.x routers. CZ.NIC Turris 1.0 (RTRS01) and 1.1 (RTRS02) are open source routers, they have dual-core PowerPC Freescale P2020 CPU and are based on reference Freescale P2020RDB-PC-A board design. Hardware design is fully open source, all firmware and hardware design files are available at Turris project website: https://docs.turris.cz/hw/turris-1x/turris-1x/ https://project.turris.cz/en/hardware.html The P2020 BootROM can load U-Boot either from NOR flash or from SD card. We add the new defconfigs, turris_1x_nor_defconfig, which configures U-Boot for building the NOR image, and turris_1x_sdcard_defconfig, which configures U-Boot for building an image suitable for SD card. The defconfig for NOR image is stripped-down a - many config options enabled in SD defconfig are disabled for NOR defconfig. This is because U-Boot grew non-trivially in the last two years and it would not fit into the space allocated for U-Boot in the NOR memory. In the future we may try to use LTO to reduce the size of the code and enable more options. The design of CZ.NIC Turris 1.x routers is based on Freescale P2020RDB-PC-A board, so some code from boards/freescale/p1_p2_rdb_pc is used and linked into Turris 1.x board code. Turris 1.x code in this patch uses modern distroboot and can boot Linux kernel from various locations, including NAND, SD card, USB flash disks, NVMe disks or SATA disks (connected to extra SATA/SCSI PCIe controllers). Via distroboot is implemented also rescue NOR boot for factory recovery, triggered by reset button, like on other existing Turris routers. SD boot with RAM larger than 2GB will only allocate 2GB of RAM (We were not able to fix this yet) [ Because various CONFIG_ macros were migrated to Kconfig since the last time this worked on upstream U-Boot (in 2022), a non-trivial rebasing was needed and some issues were solved. ] Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Mojík <marek.mojik@nic.cz> Reviewed-by: Marek Behún <kabel@kernel.org>
2024-07-12powerpc: use CONFIG_IS_ENABLED() when checking for DM_SERIAL in ↵Marek Mojík1-1/+1
include/asm/config.h Use the CONFIG_IS_ENABLED() macro when checking for DM_SERIAL so that CFG_SYS_NS16550_CLK is not defined as get_serial_clock() in SPL if SPL does not have DM_SERIAL enabled. Signed-off-by: Marek Mojík <marek.mojik@nic.cz> Reviewed-by: Marek Behún <kabel@kernel.org>
2024-07-12powerpc: mpc85xx: use CONFIG_VAL() for SYS_MONITOR_BASE in start.sMarek Mojík1-1/+1
Use CONFIG_VAL() for SYS_MONITOR_BASE in start.S so that correct value is used for SPL. Signed-off-by: Marek Mojík <marek.mojik@nic.cz> Reviewed-by: Marek Behún <kabel@kernel.org>
2024-07-12powerpc: mpc8xxx: Extend find_law() to find_law_by_addr_id()Pali Rohár2-2/+11
The find_law() function searches for LAW just by physical address. This is unsuitable for cases with overlapping LAWs. Extend it to find_law_by_addr_id(), which searches for LAW by physical address and target id. Add a static inline definition of the original find_law() into fsl_law.h header. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Mojík <marek.mojik@nic.cz> Reviewed-by: Marek Behún <kabel@kernel.org>
2024-07-03powerpc: Add the old invalidate_icache_all functionTom Rini1-0/+6
Add the old invalidate_icache_all function that prints a warning that was previously found in cmd/cache.c Signed-off-by: Tom Rini <trini@konsulko.com>
2024-07-03powerpc: Implement a default flush_dcache_allTom Rini1-0/+9
Implement a weak default version of flush_dcache_all which is based on the ARM default, which is to flush the entire range via flush_dcache_range(...). Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-06-16powerpc: mpc85xx: remove dead watchdog-related codeRasmus Villemoes1-31/+0
Nothing in-tree calls watchdog_reset() anymore (that stopped two years ago with the removal of the WATCHDOG_RESET macro). So that function is dead code. That was the only caller of reset_85xx_watchdog(), so that can obviously also be removed. Finally, init_85xx_watchdog() is/was also not called from anywhere, so that can go away as well, which nicely also removes a bit of arch-specific code from the generic watchdog.h header. Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Stefan Roese <sr@denx.de>
2024-06-16powerpc: mpc83xx: remove unused watchdog_reset() functionRasmus Villemoes1-15/+0
There is no longer any code in tree that calls a watchdog_reset() function. The macro WATCHDOG_RESET, which used to emit a call to watchdog_reset(), got removed two years ago. Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Stefan Roese <sr@denx.de>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"WIP/20May2024-nextTom Rini78-73/+52
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini78-52/+73
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-06global: Make <asm/global_data.h> include <asm/u-boot.h>Tom Rini31-25/+30
This follows the example of RISC-V where <asm/global_data.h> includes <asm/u-boot.h> directly as "gd" includes a reference to bd_info already and so the first must include the second anyhow. We then remove <asm/u-boot.h> from all of the places which include references to "gd" an so have <asm/global_data.h> already. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-06powerpc: Remove <common.h> and add needed includesTom Rini75-73/+47
Remove <common.h> from all powerpc architecture files and when needed add missing include files directly. This typically involves using <asm/u-boot.h> instead due to the difficult nested structure of the PowerPC includes themselves. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-04-18Merge branch 'for-2024.07' of ↵Tom Rini4-7/+74
https://source.denx.de/u-boot/custodians/u-boot-mpc8xx This pull request adds support for temperature sensors et FPGA loading on boards from CS GROUP France. CI: https://source.denx.de/u-boot/custodians/u-boot-mpc8xx/-/pipelines/20416
2024-04-18Revert "Merge patch series "pxe: Allow extlinux booting without CMDLINE ↵Tom Rini1-1/+1
enabled"" As reported by Jonas Karlman this series breaks booting on some AArch64 platforms with common use cases. For now the best path forward is to revert the series. This reverts commit 777c28460947371ada40868dc994dfe8537d7115, reversing changes made to ab3453e7b12daef47b9e91da2a2a3d48615dc6fc. Link: https://lore.kernel.org/u-boot/50dfa3d6-a1ca-4492-a3fc-8d8c56b40b43@kwiboo.se/ Signed-off-by: Tom Rini <trini@konsulko.com>
2024-04-18board: cssi: Load FPGA on MCR3000 boardChristophe Leroy1-1/+5
Unlike CMPC885 and CMPCPRO boards, the FPGA of MCR3000 board doesn't load code automatically but needs to be loaded by software through SPI. Until now it was loaded later by Linux, but we'd like U-boot to have access to some information that require the FPGA, like board address in racks. So, implemented the load of FPGA in U-boot. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> --- To avoid spamming your email boxes, the code isn't included in the emailed patch but will be present in the PULL request
2024-04-18powerpc: 8xx: Set SDMA configuration register correclyChristophe Leroy1-0/+6
SDMA configuration register needs to be set up only once and doesn't belong to drivers. Also, the value to be used is different on mpc885. So do the init in cpu_init_f() with 0x40 for mpc885 and 0x1 for others. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2024-04-18board: cssi: add support for reading temperatureChristophe Leroy3-2/+28
All CSSI boards have an LM74 chip as temperature sensor. Enable it. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2024-04-18board: cssi: Add support for SPI bus on MCR3000 boardChristophe Leroy1-0/+31
MCR3000 board has some components tied to the SPI bus, like the Texas Instruments LM74 temperature sensor. Add support for SPI bus. The SPI chipselects are a bit special in the way that they are driven by 3 bits in a register of the board's CPLD where the value writen in those bits exclusively activates one of the 7 possible chipselects and value 0 sets all chipselets to inactive. So add a special GPIO driver that simulates GPIOs for those chipselect. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2024-04-18board: cssi: Fix SPI nodes in DTSChristophe Leroy2-5/+5
When adding additional SPI peripherals, the reg property needs to be added, and this leads to the following error: arch/powerpc/dts/cmpc885.dtb: Warning (reg_format): /immr@ff000000/spi@aa0/temp@1:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1) arch/powerpc/dts/cmpc885.dtb: Warning (reg_format): /immr@ff000000/spi@aa0/temp@2:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1) Fix it by removing cell-index and cell-size which is unused and add reg property. Also fix node name to be in line with reg value. Also add missing compatible for eeprom node. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2024-04-10Merge patch series "pxe: Allow extlinux booting without CMDLINE enabled"Tom Rini1-1/+1
Simon Glass <sjg@chromium.org> says: This series is the culmanation of the current line of refactoring series. It adjusts pxe to call the booting functionality directly rather than going through the command-line interface. With this is is possible to boot using the extlinux bootmeth without the command line enabled. It also updates fastboot to do a similar thing.
2024-04-10treewide: Make arch-specific bootm code depend on BOOTMSimon Glass1-1/+1
Allow these functions to be compiled in when CONFIG_BOOTM is enabled, even if CONFIG_CMD_BOOTM is not. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Angelo Dureghello <angelo@kernel-space.org>
2023-12-21Merge patch series "Complete decoupling of bootm logic from commands"WIP/21Dec2023-nextTom Rini2-2/+13
Simon Glass <sjg@chromium.org> says: This series continues refactoring the bootm code to allow it to be used with CONFIG_COMMAND disabled. The OS-handling code is refactored and a new bootm_run() function is created to run through the bootm stages. This completes the work. A booti_go() function is created also, in case it proves useful, but at last for now standard boot does not use this. This is cmdd (part d of CMDLINE refactoring) It depends on dm/bootstda-working which depends on dm/cmdc-working
2023-12-21bootm: Adjust arguments of boot_os_fnSimon Glass1-2/+3
Adjust boot_os_fn to use struct bootm_info instead of the separate argc, argv and image parameters. Update the handlers accordingly. Few of the functions make use of the arguments, so this improves code size slightly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-12-21ppc: Add a reset_cpu() functionSimon Glass1-0/+10
The current do_reset() is called from a command context. Add a function which can be used from anywhere, as is done on ARM. This is only needed if CONFIG_SYSRESET is disabled. Since there are lots of reset functions, this one actually just calls do_reset(). Future refactoring could correct this. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-12-21global: Rework architecture global_data.h to include <linux/types.h>Tom Rini1-1/+0
In most cases, the architecture global data currently makes use of assorted linux types, but does not include <linux/types.h> to provide them. Add <linux/types.h> instead of relying on indirect inclusion. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-28Merge patch series "Import "string" I/O functions from Linux"Tom Rini1-0/+11
To quote the author: This series imports generic versions of ioread_rep/iowrite_rep and reads/writes from Linux. Some cleanup is done to make sure that all platforms have proper defines for implemented functions and there are no redefinitions.
2023-11-28powerpc: io.h: Add defines for __raw_{read, write} functionsIgor Prusov1-0/+11
Add defines for __raw_{read,write}{b,w,l}() functions to make make asm-generic/io.h aware of them. Signed-off-by: Igor Prusov <ivprusov@salutedevices.com>
2023-11-16powerpc: mpc8xx: Remove usage of common.hChristophe Leroy8-8/+4
Remove inclusion of common.h and add relevant includes when necessary. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2023-11-07powerpc: Rework <asm/fsl_lbc.h> includesTom Rini1-3/+0
This file should not include <config.h> nor should it include <common.h> so remove both. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-07powerpc: mpc83xx: Rework includes slightlyTom Rini2-0/+3
In order to not rely on common.h providing a number of common includes, cleanup what we include directly in order to be able to drop common.h later. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-07fsl_qe: Drop common.hTom Rini2-2/+0
In both include/fsl_qe.h and then also remove common.h from the files which had included fsl_qe.h Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-07powerpc: Switch <asm/global_data.h> to <linux/types.h>Tom Rini1-1/+1
In matching other architectures that have their global_data.h need to bring in a types.h header, switch to <linux/types.h> on PowerPC. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-28mpc85xx: relocate code in non-SPL buildMartin Fäcknitz1-1/+1
When building a non-SPL image, relocation is needed. This patch restores the old behaviour before commit b35316fb67cb ("Convert CONFIG_SPL_INIT_MINIMAL et al to Kconfig") was only defined if CONFIG_SPL_BUILD was defined. Fixes: b35316fb67cb ("Convert CONFIG_SPL_INIT_MINIMAL et al to Kconfig") Signed-off-by: Martin Fäcknitz <faecknitz@hotsplots.de>
2023-10-06spl: Use SYS_MALLOC_F instead of SYS_MALLOC_F_LENSimon Glass2-3/+3
Use the new SPL/TPL/VPL_SYS_MALLOC_F symbols to determine whether the malloc pool exists. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2023-08-09Kconfigs: Correct default of "0" on hex type entriesTom Rini1-1/+1
It is not a parse error to have a default value of "0" for a "hex" type entry, instead of "0x0". However, "0" and "0x0" are not treated the same even by the tools themselves. Correct this by changing the default value from "0" to "0x0" for all hex type questions that had the incorrect default. Fix one instance (in two configs) of a default of "0" being used on a hex question to be "0x0". Remove the cases where a defconfig had set a value of "0x0" to be used as the default had been "0". Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-19Merge tag 'fsl-qoriq-2023-7-13' of ↵WIP/19Jul2023Tom Rini12-8/+80
https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq Enable DM_SERIAL for T2080RDB, T4240RDB, T1042D4RDB, T1024RDB
2023-07-14powerpc: Fix flush_cache() speed regressionChristophe Leroy1-5/+5
Flushing kernel image after decompression was taking 113 milliseconds with U-boot 2022.10. With U-boot 2023.01 and 2023.04, flushing the same amount of memory takes approx 1.5 seconds. With U-boot 2023.07-rc6, it takes 6.5 seconds. powerpc flush_cache() function used to call WATCHDOG_RESET() after flushing every cacheline. At that time WATCHDOG_RESET() was light so the operation was almost seamless. But commit 29caf9305b6 ("cyclic: Use schedule() instead of WATCHDOG_RESET()") replaced WATCHDOG_RESET() by schedule() and that started to hurt with U-boot 2022.10. And in U-boot 2023.07-rc6 that's even worse after commit 26e8ebcd7cb ("watchdog: mpc8xxx: Make it generic"). In the meantime commit 729c1fe656 ("powerpc: introduce CONFIG_CACHE_FLUSH_WATCHDOG_THRESHOLD") gives us the opportinity to only call schedule() every given chunk of data instead of every cacheline. As explained in that commit there is no point in pinging the watchdog after every cacheline flush, so lets define a sensible default chunk size of 4k which matches to size of a page on most powerpc platforms. With that new default threshold, the culprit flushing performed after kernel image decompression now takes 85 milliseconds on a powerpc 8xx. Fixes: 29caf9305b6 ("cyclic: Use schedule() instead of WATCHDOG_RESET()") Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2023-07-13powerpc: dts: t1024rdb: tag serial nodes with bootph-allCamelia Groza1-0/+12
Make sure the serial driver is initialized before relocation by tagging the serial nodes with "bootph-all". Add these u-boot specific properties to an *-u-boot.dtsi file. Signed-off-by: Camelia Groza <camelia.groza@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-07-13powerpc: dts: t1024rdb: add serial nodesCamelia Groza2-2/+8
Add the serial node descriptions similar to Linux v6.4 for the t1024rdb board and its dependencies. Signed-off-by: Camelia Groza <camelia.groza@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-07-13powerpc: dts: t1042d4rdb: tag serial nodes with bootph-allCamelia Groza1-0/+12
Make sure the serial driver is initialized before relocation by tagging the serial nodes with "bootph-all". Add these u-boot specific properties to an *-u-boot.dtsi file. Signed-off-by: Camelia Groza <camelia.groza@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-07-13powerpc: dts: t1042d4rdb: add serial nodesCamelia Groza2-2/+8
Add the serial node descriptions similar to Linux v6.4 for the t1042d4rdb board and its dependencies. Signed-off-by: Camelia Groza <camelia.groza@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-07-13powerpc: dts: t4240rdb: tag serial nodes with bootph-allCamelia Groza1-0/+12
Make sure the serial driver is initialized before relocation by tagging the serial nodes with "bootph-all". Add these u-boot specific properties to an *-u-boot.dtsi file. Signed-off-by: Camelia Groza <camelia.groza@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-07-13powerpc: dts: t4240rdb: add serial nodesCamelia Groza2-2/+8
Add the serial node descriptions similar to Linux v6.4 for the t4240rdb board and its dependencies. Signed-off-by: Camelia Groza <camelia.groza@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-07-13powerpc: dts: t2080rdb: tag serial nodes with bootph-allCamelia Groza1-0/+12
Make sure the serial driver is initialized before relocation by tagging the serial nodes with "bootph-all". Add these u-boot specific properties to an *-u-boot.dtsi file. Signed-off-by: Camelia Groza <camelia.groza@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-07-13powerpc: dts: t2080rdb: add serial nodesCamelia Groza2-2/+8
Add the serial node descriptions similar to Linux v6.4 for the t2080rdb board and its dependencies. Signed-off-by: Camelia Groza <camelia.groza@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-05-31powerpc: use asm-generic/unaligned.hJens Wiklander1-16/+2
Powerpc configurations are apparently able to do unaligned accesses. But in an attempt to clean up and handle unaligned accesses in the same way we ignore that and use the common asm-generic/unaligned.h directly instead. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-05-31include: Remove unused header filesTom Rini2-70/+0
As part of various code clean-ups we have on occasion missed removing unused header files. None of these files are referenced anywhere else at this point. Signed-off-by: Tom Rini <trini@konsulko.com>