Commit Graph
106187 Commits
Author SHA1 Message Date
Franz SchnyderandFabio Estevam 3ac3708d16 board: toradex: add initial support for aquila imx95
Add initial U-Boot support for Aquila iMX95 SoM.

Link: https://www.toradex.com/computer-on-modules/aquila-arm-family/nxp-imx95
Link: https://www.toradex.com/products/carrier-board/aquila-development-board-kit
Signed-off-by: Franz Schnyder <franz.schnyder@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2026-06-26 23:02:45 -03:00
Krzysztof DrobińskiandFabio Estevam 807b17928a imx93: Add support for OPTEE
OPTEE-OS starts correctly when "opteed" is enabled for Secure Payload
Dispatcher in TF-A (tested on OP-TEE version: 4.9.0), however imx93
devices require a patch for OPTEE targets because binman does not see
the tee.bin file when it is available.

Enable conditional OPTEE support for imx93 devices.

Signed-off-by: Krzysztof Drobiński <krzysztof@kd-solutions.pl>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
2026-06-26 17:08:59 -03:00
Mathieu Dubois-BriandandFabio Estevam 223d0f0de8 binman: Add optee binary to i.MX9 platform types
OP-TEE tee.bin is generated externally and might be missing during the
build.

Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
2026-06-26 17:08:59 -03:00
Aristo ChenandFabio Estevam 8d21d74bdf mx6sabre: Move environment variables to .env files
Move the shared environment from CFG_EXTRA_ENV_SETTINGS in
mx6sabre_common.h to a common text environment fragment in
include/env/nxp/mx6sabre_common.env. The mx6sabresd and mx6sabreauto
board environments include this fragment and add their own console
setting, which is the only board specific difference between them. The
eMMC firmware update variables remain guarded by CONFIG_SUPPORT_EMMC_BOOT
inside the fragment. The now unused CONSOLE_DEV defines and the
linux/stringify.h include are dropped.

The generated default environment is unchanged for both boards. This was
verified by comparing the output of scripts/get_default_envs.sh before
and after the change, which produced identical results.

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:08:26 -03:00
Aristo ChenandFabio Estevam 4377bd764c mx6ullevk: Move environment variables to .env file
Move the board environment from CFG_EXTRA_ENV_SETTINGS in the config
header to board/nxp/mx6ullevk/mx6ullevk.env for better maintainability.
The file is named after CONFIG_SYS_BOARD so it is selected automatically
without setting CONFIG_ENV_SOURCE_FILE. Drop the now unused
linux/stringify.h include.

The generated default environment is unchanged. This was verified by
comparing the output of scripts/get_default_envs.sh before and after the
change, which produced identical results.

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:08:26 -03:00
Aristo ChenandFabio Estevam 599fd74e0c mx7ulp_evk: Move environment variables to .env file
Move the board environment from CFG_EXTRA_ENV_SETTINGS in the config
header to board/nxp/mx7ulp_evk/mx7ulp_evk.env for better
maintainability. The file is named after CONFIG_SYS_BOARD so it is
selected automatically without setting CONFIG_ENV_SOURCE_FILE.

The generated default environment is unchanged. This was verified by
comparing the output of scripts/get_default_envs.sh before and after the
change, which produced identical results.

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:08:26 -03:00
Peng FanandFabio Estevam 6f14516278 imx9: Select OF_LIVE
Enable the live DT to reduce the DT parsing time.
Test data on i.MX95-EVK:

Before:
Accumulated time:
                26,205  dm_spl
               483,991  dm_f
                22,977  dm_r
After:
Accumulated time:
                26,229  dm_spl
               484,772  dm_f
                 2,667  of_live
                 1,003  dm_r

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:07:57 -03:00
Peng FanandFabio Estevam e0dc9f254f imx8m_evk: Select OF_LIVE
Enable the live DT to reduce the DT parsing time.

Test data on i.MX8MP shows that boot time is decreased by ~%6

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:07:32 -03:00
Peng FanandFabio Estevam 94b5e618c7 imx9: soc: Use livetree API for fdt access
Use livetree API, otherwise it will fail to read properties from the device
tree when OF_LIVE is enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:07:18 -03:00
Peng FanandFabio Estevam 170291f042 misc: ele: Use dev_read_addr
Use dev_read_addr which supports livetree API, otherwise driver
will fail to get addr when OF_LIVE is enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:07:06 -03:00
Peng FanandFabio Estevam 8db4311b4b gpio: imx_rgpio2p: Use dev_read_addr_index
Use dev_read_addr_index which supports livetree API, otherwise driver
will fail to get addr when OF_LIVE is enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:06:54 -03:00
Peng FanandFabio Estevam b4610c7177 serial: lpuart: Use livetree API for fdt access
Use livetree API, otherwise driver will fail to read properties
from the device tree when OF_LIVE is enabled.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:06:39 -03:00
Peng FanandFabio Estevam fd1072d0d5 imx8m: dts: Update ddr firmware name
Update to latest ddr firmware name, otherwise user may use legacy ddr
firmware from linux-firmware-imx release.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:06:15 -03:00
Peng FanandFabio Estevam 902cf2bf67 imx: Guard print_cpuinfo with !CONFIG_IS_ENABLED(CPU)
When CONFIG_CPU is enabled, print_cpuinfo is defined in common/board_f.c
with static property. However in imx cpu.c, print_cpuinfo is not a local
function, so guard it with !CONFIG_IS_ENABLED(CPU).

And all i.MX8M boards has CONFIG_CPU and CONFIG_CPU_IMX set, so remove the
dead code.

However legacy print_cpuinfo also print reset reason, to keep reset
reason printed as before, export get_reset_reason() and invoke it
at arch_misc_init().

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:05:56 -03:00
Peng FanandFabio Estevam 2571e319c5 imx7ulp: cleanup get_imx_type
There is only one SoC and no external user of get_imx_type for i.MX7ULP,
so directly embed the string in print_cpuinfo and drop get_imx_type().

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:05:36 -03:00
Peng FanandFabio Estevam 0f09e834ac imx8ulp: cleanup get_imx_type
There is only one SoC and no external user of get_imx_type for i.MX8ULP,
so directly embed the string in print_cpuinfo and drop get_imx_type().

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:05:15 -03:00
Peng FanandFabio Estevam f59da150c9 imx952: Update gpio node regs
Same to 85319b2e67 ("board: toradex: smarc-imx95: remove gpio1 reg"),
there is no need to use dual base for i.MX952 gpio, so drop the U-Boot
specific reg changes.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2026-06-26 17:00:22 -03:00
Peng FanandFabio Estevam e0fa78b215 imx8m: Imply DM_THERMAL
CONFIG_IMX_TMU depends on CONFIG_DM_THERMAL, so when selecting IMX_TMU,
DM_THERMAL should also be selected.

Update i.MX8M based defconfigs.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2026-06-26 17:00:22 -03:00
Tom Rini 63f6cc8ba6 Merge patch series "Kconfig restyle part 2"
Johan Jonker <jbx6244@gmail.com> says:

The Kconfig menu attribute '---help---' is deprecated.
If we change to "help" the text has to indent.
This again has to align with other attributes,
so we have to restyle them as well.
And as there's a script then change all Kconfig files
excluding 'arch' and 'board' directories from part 1.

Restyle all Kconfigs:
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Problems:
People creating indents in help texts.
The script doesn't care. It puts everything left aligned.

Help texts with empty lines. It stops aligning as help test.

Other fixes:
While using checkpatch.pl or the script some issues showed up,
so fix them as well.

Link: https://lore.kernel.org/r/ef462dea-69aa-48df-9f7c-af2e6c54e52a@gmail.com
2026-06-25 15:01:03 -06:00
Johan JonkerandTom Rini 58ecf78d2b Kconfig: restyle
Restyle Kconfig:
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 15:01:00 -06:00
Johan JonkerandTom Rini 145d58e2c7 Kconfig: drivers: restyle remaining
Restyle all Kconfigs for the rest of "drivers":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
[trini: Add missing indentation on a few more multi-paragraph help texts]
Signed-off-by: Tom Rini <trini@konsulko.com>
2026-06-25 15:00:58 -06:00
Johan JonkerandTom Rini 173ffc7bcf Kconfig: gpio: add empty line
Restyle by adding an empty line between configs.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:59:44 -06:00
Johan JonkerandTom Rini 55ae284935 Kconfig: video: restyle
Restyle all Kconfigs for "video":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
[trini: Add missing indentation on a multi-paragraph help text]
Signed-off-by: Tom Rini <trini@konsulko.com>
2026-06-25 14:59:30 -06:00
Johan JonkerandTom Rini 8b09b702d4 Kconfig: usb: restyle
Restyle all Kconfigs for "usb":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:58:13 -06:00
Johan JonkerandTom Rini b2c5dd6048 Kconfig: power: restyle
Restyle all Kconfigs for "power":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
[trini: Add missing indentation on a few more multi-paragraph help texts]
Signed-off-by: Tom Rini <trini@konsulko.com>
2026-06-25 14:57:42 -06:00
Johan JonkerandTom Rini 591086d49d Kconfig: pinctrl: restyle
Restyle all Kconfigs for "pinctrl":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:53:58 -06:00
Johan JonkerandTom Rini 2b92ad8622 Kconfig: net: restyle
Restyle all Kconfigs for "net":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:53:51 -06:00
Johan JonkerandTom Rini 11b7a94757 Kconfig: mtd: restyle
Restyle all Kconfigs for "mtd":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
[trini: Add missing indentation on a few more multi-paragraph help texts]
Signed-off-by: Tom Rini <trini@konsulko.com>
2026-06-25 14:53:19 -06:00
Johan JonkerandTom Rini 54cac2bf5c Kconfig: i2c: restyle
Restyle all Kconfigs for "i2c":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:15:37 -06:00
Johan JonkerandTom Rini f934012cd9 Kconfig: net: restyle
Restyle all Kconfigs for "net":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:15:33 -06:00
Johan JonkerandTom Rini 8e85b5c761 Kconfig: lib: restyle
Restyle all Kconfigs for "lib":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:13:44 -06:00
Johan JonkerandTom Rini 5c1ab62653 Kconfig: fs: restyle
Restyle all Kconfigs for "fs":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:13:42 -06:00
Johan JonkerandTom Rini 5bae190bde Kconfig: dts: restyle
Restyle all Kconfigs for "dts":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:13:40 -06:00
Johan JonkerandTom Rini 7ffcbd87d2 Kconfig: disk: restyle
Restyle all Kconfigs for "disk":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:13:38 -06:00
Johan JonkerandTom Rini 89957a4f58 Kconfig: common: restyle
Restyle all Kconfigs for "common":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:13:36 -06:00
Johan JonkerandTom Rini 6f9303f330 Kconfig: cmd: restyle
Restyle all Kconfigs for "cmd":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:13:34 -06:00
Johan JonkerandTom Rini c28e57164d Kconfig: boot: restyle
Restyle all Kconfigs for "boot":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2026-06-25 14:13:31 -06:00
Tom Rini 39e9806303 Merge patch series "Kconfig restyle"
Johan Jonker <jbx6244@gmail.com> says:

The Kconfig menu attribute '---help---' is deprecated.
If we change to "help" the text has to indent.
This again has to align with other attributes,
so we have to restyle them as well.
And as there's a script then change all Kconfig
to start with the 'arch' and 'board' directories.

Restyle all Kconfigs:
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Problems:
People creating indents in help texts.
The script doesn't care. It puts everything left aligned.

Help texts with empty lines. It stops aligning as help test.

Other fixes:
While using checkpatch.pl or the script some issues showed up,
so fix them as well.

Link: https://lore.kernel.org/r/d1270724-50eb-450d-8847-a3271ea27a2a@gmail.com
2026-06-25 14:07:01 -06:00
Johan JonkerandTom Rini df3d87bd69 Kconfig: board: restyle
Restyle all Kconfigs:
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-06-25 14:06:55 -06:00
Johan JonkerandTom Rini f952ddb7ec Kconfig: arch: restyle
Restyle all Kconfigs other then "arm":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-06-25 14:06:55 -06:00
Johan JonkerandTom Rini 0caac78a06 Kconfig: arm: restyle
Restyle all Kconfigs for "arm":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-06-25 14:06:18 -06:00
Johan JonkerandTom Rini 2ffe968701 Kconfig: misc: add empty line
Restyle by adding an empty line between configs.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-06-25 14:06:18 -06:00
Johan JonkerandTom Rini d20d285cf0 Kconfig: themal: fix typo
While restyling Kconfig the script checkpatch.pl gives
this info:

WARNING: Possible repeated word: 'for'

Fix by changing 'for for' to 'for'.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-06-25 14:06:18 -06:00
Johan JonkerandTom Rini 08fc979a61 Kconfig: power: pmic: fix typo
While restyling Kconfig the script checkpatch.pl gives
this info:

WARNING: 'refered' may be misspelled - perhaps 'referred'?

Fix by changing 'refered' to 'referred'.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-06-25 14:06:18 -06:00
Johan JonkerandTom Rini 4b199a549f Kconfig: powerpc: mpc85xx: fix typo
While restyling Kconfig the script checkpatch.pl gives
this info:

WARNING: 'Enble' may be misspelled - perhaps 'Enable'?

Fix by changing 'Enble' to 'Enable'.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-06-25 14:06:18 -06:00
Johan JonkerandTom Rini 0c0074f983 Kconfig: armv7: fix typo
While restyling Kconfig the script checkpatch.pl gives
this info:

WARNING: 'suppport' may be misspelled - perhaps 'support'?

Fix by changing 'suppport' to 'support'.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-06-25 14:06:17 -06:00
Tom Rini 19eafbadf2 Merge patch series "Relocate U-Boot in the last bank"
Ilias Apalodimas <ilias.apalodimas@linaro.org> says:

There was a discussion recently on the mailing lists regarding our
management of memory above ram_top [0]. The tl;dr is that we have two problems.

The first one is that U-Boot always relocates to the top of the first available
bank unless there's special board code to sidestep that. The second is we don't
successfully deal with devices that can only do 32-bit DMA.

This patch series deals with the first problem by adding a Kconfig option
allowing platforms to relocate to the top of the last discovered bank.

It's worth noting that this is easily testable with QEMU

qemu-system-aarch64 -m 8192 -smp 2 -nographic -cpu cortex-a57 \
    -machine virt,secure=off \
    -bios u-boot.bin \
    -device virtio-rng-pci \
    -drive id=os,if=none,file="$image" \
    -device virtio-blk-device,drive=os \
    -object memory-backend-ram,id=ram0,size=4G \
    -object memory-backend-ram,id=ram1,size=4G \
    -numa node,memdev=ram0 \
    -numa node,memdev=ram1

# RELOC_ADDR_TOP not set
Hit any key to stop autoboot: 0
=> bdinfo
[...]
relocaddr   = 0x000000013f66c000
reloc off   = 0x000000013f66c000
[...]
lmb_dump_all:
 memory.count = 0x1
 memory[0]	[0x40000000-0x23fffffff], 0x200000000 bytes, flags: none
 reserved.count = 0x2
 reserved[0]	[0x13d507000-0x13d509fff], 0x3000 bytes, flags: no-notify, no-overwrite
reserved[1]	[0x13d50aff0-0x23fffffff], 0x102af5010 bytes, flags: no-overwrite
devicetree  = board
[...]
TLB addr    = 0x000000013ffe0000
irq_sp      = 0x000000013e50aff0
sp start    = 0x000000013e50aff0
Early malloc usage: e88 / 2000
=>

# RELOC_ADDR_TOP enabled

=> bdinfo
[...]
relocaddr   = 0x000000023f66c000
reloc off   = 0x000000023f66c000
[...]
lmb_dump_all:
 memory.count = 0x1
 memory[0]	[0x40000000-0x23fffffff], 0x200000000 bytes, flags: none
 reserved.count = 0x2
 reserved[0]	[0x23d507000-0x23d509fff], 0x3000 bytes, flags: no-notify, no-overwrite
 reserved[1]	[0x23d50aff0-0x23fffffff], 0x2af5010 bytes, flags: no-overwrite
devicetree  = board
[...]
TLB addr    = 0x000000023ffe0000
irq_sp      = 0x000000023e50aff0
sp start    = 0x000000023e50aff0
Early malloc usage: e88 / 2000
=>

[0] https://lore.kernel.org/u-boot/CAC_iWjKFAzpj3B_MEW7-dnOrcAV-rfkhXXo8Bv0KgLNP2VJxRA@mail.gmail.com/

Link: https://lore.kernel.org/r/20260617074846.84362-1-ilias.apalodimas@linaro.org
2026-06-24 18:13:25 -06:00
Ilias ApalodimasandTom Rini fb537c85bc doc: Add a warning about using RELOC_ADDR_TOP
Since devices that can't DMA above 4GiB will misbehave with this option
enabled add a warning on the documentation.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
2026-06-24 18:13:24 -06:00
Ilias ApalodimasandTom Rini aefd4a769b configs: Enable RELOC_ADDR_TOP on arm64 QEMU
Since we added an option for relocating U-Boot to the last memory bank,
enable it for QEMU to get some coverage

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
2026-06-24 18:13:24 -06:00
Ilias ApalodimasandTom Rini 55a3421769 common: Add an option to relocate on ram top
Right now we only relocate u-boot to the top of the first
memory bank unless the board specific code overwrites it.
This is problematic when loading big binaries as it
fragments the contiguous memory space for no apparent reason.

On certain platforms, it is currently not possible to relocate U-Boot
above the 32bit boundary, due to various dependencies on content located
below the 32bit boundary. One such example is ethernet, where the packet
buffer built into U-Boot binary is placed below the 32bit boundary and
allows loading of data via ethernet even above 32bit boundary due to
memory copy from the packet buffer to the destination location.

A previous patch moves the bi_dram[] info from bd to gd and make
the memory bank information available early. So move the
dram_init_banksize() INITCALL before the relocation address calculation
and use it to derive the address.

Also add a Kconfig option and allow the common code to relocate U-Boot
to the top of the last discovered bank.
It's worth noting that this patch changes when dram_init_banksize()
is called. It's now called  much earlier in the board init process.
That is a significant ordering change for every board with a custom
dram_init_banksize(), and it is unconditional (not gated on RELOC_ADDR_TOP).

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>  # Radxa ROCK 5B
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
2026-06-24 18:13:24 -06:00