]> git.dujemihanovic.xyz Git - u-boot.git/commit
board_f: Add support for CONFIG_OF_BOARD_FIXUP for XIP images
authorPali Rohár <pali@kernel.org>
Thu, 6 Jun 2024 16:33:21 +0000 (18:33 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 12 Jul 2024 19:07:43 +0000 (13:07 -0600)
commit0858e03b3d1f5d8270fe658f11cc8159dd32e595
tree6af663811e9967a0a7211d14a7a68e2a758561e3
parent03de305ec48b0bb28554372abb40ccd46dbe0bf9
board_f: Add support for CONFIG_OF_BOARD_FIXUP for XIP images

When U-Boot is running from flash memory (execute in place) then
gd->fdt_blob before relocation points to read-only flash memory.

So U-Boot calls board_fix_fdt() with read-only gd->fdt_blob pointer which
cause immediate CPU crash when callback is trying to modify gd->fdt_blob.

Fix this issue by introducing a new config option OF_INITIAL_DTB_READONLY
which moves fix_fdt callback after the reloc_fdt callback. This makes
CONFIG_OF_BOARD_FIXUP working also if U-Boot before relocation is not
running from read/write (S)RAM memory.

This is required for mpc85xx boards when booting from flash NOR.

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>
common/board_f.c
dts/Kconfig