summaryrefslogtreecommitdiff
path: root/arch/powerpc
AgeCommit message (Collapse)Author
5 daysMerge branch 'next'Tom Rini
8 dayssata: Rework the CMD_SATA and SATA symbolsTom Rini
Today we typically enable CMD_SATA in order to have the SATA functionality itself enabled, despite there being a clean split between the two symbols. This in turn leads to potential configuration problems. Split things so that SATA continues to be separate and not CMD_SATA instead depends, functionally, on AHCI being enabled. To do all of this: - Have X86 select AHCI directly rather than "default y" it later. - Make CMD_SATA be a default y option, given the split of platforms that enabled SATA and did, or did not, enable CMD_SATA. - Change "imply CMD_SATA" to "imply SATA" - Correct TARGET_VEXPRESS64_JUNO because you cannot select SATA_SIL without PCI (and in turn, SATA is needed for SATA_SIL). - Update a number of defconfigs to have no functional change. Signed-off-by: Tom Rini <[email protected]>
9 dayspowerpc/mpc83xx: Move alignment padding into __u_boot_list sectionJ. Neuschäfer
u-boot-dtb.bin is built by concatenating u-boot-nodtb.bin and u-boot.dtb. u-boot-nodtb.bin, in turn, is generated by objcopy'ing the contents of u-boot (U-Boot in ELF format) into a raw file. In order to find the bundled FDT (u-boot.dtb), the code in lib/fdtdec.c uses the _end symbol. Platform-specific linker scripts ensure that _end is 8-byte aligned, which is required by libfdt. For the PowerPC MPC83xx platform, the ALIGN(8) directive was outside a section, with the unfortunate effect that the potentially generated padding bytes would not be copied by objcopy. This resulted in a discrepancy between the _end symbol on the one hand, and the size of u-boot-nodtb.bin and thus the starting location of the actual FDT on the other side. Under these conditions, the FDT could not be found and boot would fail early. This commit fixes it by moving the ALIGN(8) into the __u_boot_list section, which is non-empty and thus copied into u-boot-nodtb.bin. Signed-off-by: J. Neuschäfer <[email protected]> Reviewed-by: Tom Rini <[email protected]>
12 dayscore: Rework REGMAP symbols implementationTom Rini
As exposed by "make randconfig", we have an issue with the dependencies for REGMAP (and xPL variants). As this is a library function, it should always be selected and not depended on by other functionality. This is largely done correctly today, so just correct the few outliers. Acked-by: Anshul Dalal <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2026-03-18powerpc: Call bootm_final()Simon Glass
Replace the open-coded bootstage_fdt_add_report() and bootstage_report() with a call to bootm_final(). This also adds the "Starting kernel" message, board_quiesce_devices() and dm_remove_devices_active() which were not previously called on PowerPC. Signed-off-by: Simon Glass <[email protected]>
2026-01-28board: nxp: Rename board directory from board/freescale to board/nxpAlice Guo
This patch renames the board directory from board/freescale to board/nxp because NXP now provides Board Support Packages (BSPs) and tools for the former Freescale i.MX and other i.MX products. All relevant references have been updated accordingly. This change does not affect functionality. Signed-off-by: Alice Guo <[email protected]> Reviewed-by: Fabio Estevam <[email protected]>
2026-01-20powerpc: Update linker scripts to ensure appended device tree is alignedTom Rini
With commit 0535e46d55d7 ("scripts/dtc: Update to upstream version v1.7.2-35-g52f07dcca47c") it is now a fatal error to U-Boot if our device tree is not 8-byte aligned. In commit 85f586035d75 ("ARM: OMAP2+: Pad SPL binary to 8-byte alignment before DTB") Beleswar Padhi explains that we must have ALIGN(x) statements inside of a section to ensure that padding is included and not simply that the linker address counter is incremented. To that end, this patch: - Aligns the final section before _end by 8-bytes by adding '. = ALIGN(8);' or changing an existing ALIGN(4) statement. - Ensure that we do have alignment by adding an ASSERT so that when not aligned we fail to link (and explain why). Signed-off-by: Tom Rini <[email protected]>
2026-01-13powerpc: mpc83xx: Check the size of peripheral structsJ. Neuschäfer
Peripheral registers on MPC83xx-series chips are declared in immap_83xx.h as a set of structs that ultimately fill the entire MMIO space of 1 MiB. This patch introduces a compile-time check of the size of each peripheral struct. The purpose of these checks is two-fold: 1. To quickly tell readers of the code the total size of each struct 2. To verify that the size does not change when a struct is edited If the size of a peripheral struct were to change by a few bytes due to an editing error, the result would be mayhem for all following peripherals, because all offsets would shift by the amount of the error. All new checks have been compile-tested. Signed-off-by: J. Neuschäfer <[email protected]>
2025-12-05powerpc: remove unused legacy LED APIQuentin Schulz
No PPC upstream defconfig actually enables CONFIG_LED_STATUS and we're trying to get rid of the legacy LED API, so let's remove one of its last users. Signed-off-by: Quentin Schulz <[email protected]>
2025-10-03cmd: spl: Remove ATAG support from this commandTom Rini
While we continue to have some systems which support extremely legacy OS booting methods, we do not have use cases for supporting this in Falcon mode anymore. Remove this support and references from the documentation. Co-developed-by: Anshul Dalal <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2025-06-25lmb: replace lmb_reserve() and lmb_alloc_addr() API'sSughosh Ganu
There currently are multiple allocation API's in the LMB module. There are a couple of API's for allocating memory(lmb_alloc() and lmb_alloc_base()), and then there are two for requesting a reservation for a particular memory region (lmb_reserve() and lmb_alloc_addr()). Introduce a single API lmb_alloc_mem() which will cater to all types of allocation requests and replace lmb_reserve() and lmb_alloc_addr() with the new API. Moreover, the lmb_reserve() API is pretty similar to the lmb_alloc_addr() API, with the one difference being that the lmb_reserve() API allows for reserving any address passed to it -- the address need not be part of the LMB memory map. The lmb_alloc_addr() does check that the address being requested is actually part of the LMB memory map. There is no need to support reserving memory regions which are outside the LMB memory map. Remove the lmb_reserve() API functionality and use the functionality provided by lmb_alloc_addr() instead. The lmb_alloc_addr() will check if the requested address is part of the LMB memory map and return an error if not. Signed-off-by: Sughosh Ganu <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
2025-06-14Merge patch series "Hex value prefix case cleanup"Tom Rini
E Shattow <[email protected]> says: Make consistent use of lowercase hexadecimal prefix '0x' throughout U-Boot. There are a few remaining uses of uppercase 'X' to denote hexadecimal prefix or placeholder in documentation and error messages. External devicetree-rebasing dts/upstream and the generated code of xilinx/zynq are ignored for the series. Link: https://lore.kernel.org/r/[email protected]
2025-06-14arch: use lowercase hex prefix styleE Shattow
Use consistent lowercase hex prefix style in arch/* Signed-off-by: E Shattow <[email protected]>
2025-06-13Merge patch series "drop volatile from global data"Tom Rini
Rasmus Villemoes <[email protected]> says: There's really no reason for the gd pointer to have the volatile qualifier. In fact, I claim that it's completely unnecessary and just pessimizes code generation and forces ugly casts in lots of places. For example, see the casts in drivers/core/tag.c where elements are added to gd->dm_taglist, or a helper such as cyclic_get_list() that should not be needed. Also, it is what ends up standing in the way of an otherwise innocent code cleanup of list.h: https://lore.kernel.org/u-boot/20250522165656.GB2179216@bill-the-cat/ Note that riscv, x86 as well as arm64 with LTO enabled has not had this volatile qualifier, so it's unlikely there's any generic code that depends on it. Link: https://lore.kernel.org/r/[email protected]
2025-06-13powerpc: drop volatile qualifier from gd pointerRasmus Villemoes
Signed-off-by: Rasmus Villemoes <[email protected]>
2025-06-02Merge patch series "Audit include list for include/[a-m]*.h"Tom Rini
Tom Rini <[email protected]> says: Hey all, Related to my other series I've posted recently on cleaning up some headers, this series here is the result of at least lightly auditing the #includes used in include/[a-m]*.h. This ignores subdirectories, as at least in part I think the top-level includes we've constructed are the most likely places to have some extra transitive include paths. I'm sure there's exceptions and I'll likely audit deeper once this first pass is done. This only gets as far as "include/m*.h" because I didn't want this to get too big. This also sets aside <miiphy.h> and <phy.h>. While miiphy.h does not directly need <phy.h> there are *so* many users and I think I had half of the tree just about not building when I first tried. It might be worth further investigation, but it might just be OK as-is. Link: https://lore.kernel.org/r/[email protected]
2025-06-02include/mmc.h: Audit include listTom Rini
This file does not need <linux/sizes.h> nor <linux/compiler.h> so remove them. This exposes however that a number of other files had been relying on this implicit include for <linux/sizes.h> so add that where needed. Signed-off-by: Tom Rini <[email protected]>
2025-05-30PowerPC / Layerscape: Finish migration to DM_SERIALTom Rini
Migrate the few ARM Layerscape platforms that had not been switched along with all remaining PowerPC platforms to DM_SERIAL. For PowerPC, this means that platforms which use SPL/TPL, keeping the non-DM serial driver enabled there as they do not use DM. We also rework the guards on how to define CFG_SYS_NS16550_CLK so that this is mostly in one place now. Signed-off-by: Tom Rini <[email protected]>
2025-03-14Merge tag 'mmu-next-14032025' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-tpm into next Up to now we configure the entire memory space for U-Boot as RWX. For modern architectures and security requirements, it's better to map the memory properly. This pull request adds basics support for mapping the U-Boot binary with proper (RO, RW, RW^X) memory permissions on aarch64 right after we relocate U-Boot in the top of DRAM. It's worrth noting that the linker script annotations are only added for the aarch64 architecture. We can, in the future, try to unify the linker -- at least for the architectures that have enough in common and expand this
2025-03-14treewide: Add a function to change page permissionsIlias Apalodimas
For armv8 we are adding proper page permissions for the relocated U-Boot binary. Add a weak function that can be used across architectures to change the page permissions Tested-by: Neil Armstrong <[email protected]> # on AML-S905X-CC Signed-off-by: Ilias Apalodimas <[email protected]>
2025-03-13mmc: fsl_esdhc: Migrate ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE to KconfigTom Rini
The flag for enabling the ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE quirk can be handled easily enough in Kconfig. This lets us remove a function but not obviously correct usage of the IS_ENABLED() macro. Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Peng Fan <[email protected]>
2024-12-30Merge patch series "Misc. PowerPC MPC83xx fixes/cleanups"Tom Rini
J. Neuschäfer <[email protected]> says: This patchset contains a few small fixes/cleanups for the MPC83xx platform. Link: https://lore.kernel.org/r/[email protected]
2024-12-30powerpc: mpc83xx: Use defined constant for SPCR[TBEN]J. Neuschäfer
To increase readability, use the defined constant instead of specifying SPCR[TBEN] as a number. Reviewed-by: Sinan Akman <[email protected]> Signed-off-by: J. Neuschäfer <[email protected]>
2024-12-30powerpc: mpc83xx: Allow including initreg.h into multiple filesJ. Neuschäfer
Globals defined in headers can result in multiple-definition errors while linking, if they are visible beyond the current translation unit. This hasn't been a problem for initreg.h so far, but would become a problem in the next patch, where I use a constant from initreg.h in a second C file. Reviewed-by: Sinan Akman <[email protected]> Signed-off-by: J. Neuschäfer <[email protected]>
2024-12-30Merge patch series "powerpc: Fix and enforce distinction between immediates ↵Tom Rini
and registers" J. Neuschäfer <[email protected]> says: This patchset changes the definition r0 etc. to %r0, so that the assembler can check that registers are only used where expected, and fixes the fallout. Link: https://lore.kernel.org/r/[email protected]
2024-12-30powerpc: Introduce and enforce assembler checks on GPR usageJ. Neuschäfer
PowerPC general-purpose registers are historically specified as plain numbers (0-31), which makes them hard to distinguish from immediates. For this reason, include/ppc_asm.tmpl defines aliases named r0-r31. This can still lead to uncaught mistakes if a register is used in place of a number. Instead of (e.g.) 5 use %r5, which will result in an assembler warning if used as a number. Turn these warnings into errors by passing `--fatal-warnings` to the assembler. I verified with gazerbeam_defconfig (MPC83xx) and qemu-ppce500_defconfig (MPC85xx) that this patch results in the same machine code. Signed-off-by: J. Neuschäfer <[email protected]>
2024-12-30powerpc: Fix 0 vs. r0 confusion in X/D-form instructionsJ. Neuschäfer
Instructions such as dcbi are in the X-form; they have RA and RB fields and the effective address (EA) is computed as (RA|0)+(RB). In words, this means that if RA is zero, the left-hand side of the addition is zero, otherwise the corresponding GPR is used. r0 can never be used on the left-hand side of a X-form instruction. For D-form instructions such as addis, the Power ISA illustrates this in the instruction pseudo-code: if RA = 0 then RT <- EXTS(SI || 0x0000) else RT <- (RA) + EXIS(SI || 0x0000) In all of these cases, RA=0 indicates the value zero, not register r0. I verified with gazerbeam_defconfig (MPC83xx) and qemu-ppce500_defconfig (MPC85xx) that this patch results in the same machine code. Signed-off-by: J. Neuschäfer <[email protected]>
2024-12-30lmb: Remove lmb_reserve_flags()Ilias Apalodimas
lmb_reserve() is just calling lmb_reserve_flags() with LMB_NONE. There's not much we gain from this abstraction. So let's remove the latter, add the flags argument to lmb_reserve() and make the code a bit easier to follow. Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Sam Protsenko <[email protected]> Tested-by: Sam Protsenko <[email protected]> Signed-off-by: Ilias Apalodimas <[email protected]>
2024-10-14dts: Deduplicate dtbs targetMarek Vasut
The dtbs: target is almost identical in all architecture Makefiles. All architecture Makefiles include scripts/Makefile.dts . Deduplicate the dtbs: target into scripts/Makefile.dts . No functional change. Reviewed-by: Sumit Garg <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]> Tested-by: Caleb Connolly <[email protected]> #qcom, OF_UPSTREAM
2024-10-11global: Rename SPL_TPL_ to PHASE_Simon Glass
Use PHASE_ as the symbol to select a particular XPL build. This means that SPL_TPL_ is no-longer set. Update the comment in bootstage to refer to this symbol, instead of SPL_ Signed-off-by: Simon Glass <[email protected]>
2024-10-11arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILDSimon Glass
Use the new symbol to refer to any 'SPL' build, including TPL and VPL Signed-off-by: Simon Glass <[email protected]>
2024-09-03lmb: do away with arch_lmb_reserve()Sughosh Ganu
All of the current definitions of arch_lmb_reserve() are doing the same thing -- reserve the region of memory occupied by U-Boot, starting from the current stack address to the ram_top. Introduce a function lmb_reserve_uboot_region() which does this, and do away with the arch_lmb_reserve() function. Instead of using the current value of stack pointer for starting the reserved region, have a fixed value, considering the stack size config value. Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Simon Glass <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
2024-09-03ppc: lmb: move arch specific lmb reservations to arch_misc_init()Sughosh Ganu
All the current function definitions of arch_lmb_reserve() are doing the same thing -- reserve the U-Boot memory region. The powerpc(ppc) architecture, in addition, is making some LMB reservations for the bootm related image loading. Move these ppc specific reservations to the arch_misc_init() function. This allows to move the U-Boot memory region reservation to a different function, and remove arch_lmb_reserve() in a subsequent commit. Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-09-03lmb: make LMB memory map persistent and globalSughosh Ganu
The current LMB API's for allocating and reserving memory use a per-caller based memory view. Memory allocated by a caller can then be overwritten by another caller. Make these allocations and reservations persistent using the alloced list data structure. Two alloced lists are declared -- one for the available(free) memory, and one for the used memory. Once full, the list can then be extended at runtime. [sjg: Use a stack to store pointer of lmb struct when running lmb tests] Signed-off-by: Sughosh Ganu <[email protected]> Signed-off-by: Simon Glass <[email protected]> [sjg: Optimise the logic to add a region in lmb_add_region_flags()]
2024-08-26global_data: Move pci_clk to m68k and powerpcSimon Glass
Only m68k and powerpc use this field, so move it to the arch-specific info, to reduce the size for other archs. Signed-off-by: Simon Glass <[email protected]>
2024-07-15ppc: Remove duplicate newlinesMarek Vasut
Drop all duplicate newlines. No functional change. Signed-off-by: Marek Vasut <[email protected]>
2024-07-13turris_1x: Normalize Kconfig usageTom Rini
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 <[email protected]>
2024-07-12Merge patch series "Add Turris 1.x board"Tom Rini
Marek Mojík <[email protected]> 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ár
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 <[email protected]> Signed-off-by: Marek Mojík <[email protected]> Reviewed-by: Marek Behún <[email protected]>
2024-07-12powerpc: use CONFIG_IS_ENABLED() when checking for DM_SERIAL in ↵Marek Mojík
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 <[email protected]> Reviewed-by: Marek Behún <[email protected]>
2024-07-12powerpc: mpc85xx: use CONFIG_VAL() for SYS_MONITOR_BASE in start.sMarek Mojík
Use CONFIG_VAL() for SYS_MONITOR_BASE in start.S so that correct value is used for SPL. Signed-off-by: Marek Mojík <[email protected]> Reviewed-by: Marek Behún <[email protected]>
2024-07-12powerpc: mpc8xxx: Extend find_law() to find_law_by_addr_id()Pali Rohár
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 <[email protected]> Signed-off-by: Marek Mojík <[email protected]> Reviewed-by: Marek Behún <[email protected]>
2024-07-03powerpc: Add the old invalidate_icache_all functionTom Rini
Add the old invalidate_icache_all function that prints a warning that was previously found in cmd/cache.c Signed-off-by: Tom Rini <[email protected]>
2024-07-03powerpc: Implement a default flush_dcache_allTom Rini
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 <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-06-16powerpc: mpc85xx: remove dead watchdog-related codeRasmus Villemoes
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 <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2024-06-16powerpc: mpc83xx: remove unused watchdog_reset() functionRasmus Villemoes
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 <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
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 <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
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 <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-06global: Make <asm/global_data.h> include <asm/u-boot.h>Tom Rini
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 <[email protected]>
2024-05-06powerpc: Remove <common.h> and add needed includesTom Rini
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 <[email protected]>