[PATCH v2] board_f: Add support for CONFIG_OF_BOARD_FIXUP for XIP images

Tom Rini trini at konsulko.com
Mon Nov 21 18:45:32 CET 2022


On Mon, Nov 21, 2022 at 06:42:01PM +0100, Pali Rohár wrote:
> + Tom
> 
> On Wednesday 02 November 2022 00:23:03 Pali Rohár wrote:
> > On Monday 10 October 2022 17:48:58 Simon Glass wrote:
> > > Hi,
> > > 
> > > On Sun, 28 Aug 2022 at 09:19, Marek Behún <kabel at kernel.org> wrote:
> > > >
> > > > From: Pali Rohár <pali at kernel.org>
> > > >
> > > > 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_DTB_READONLY_BEFORE_RELOC 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 at kernel.org>
> > > > Signed-off-by: Marek Behún <kabel at kernel.org>
> > > > ---
> > > > Changes since v1:
> > > > - just changed the new Kconfig option name and associated help string
> > > > ---
> > > >  common/board_f.c | 8 +++++++-
> > > >  dts/Kconfig      | 6 ++++++
> > > >  2 files changed, 13 insertions(+), 1 deletion(-)
> > > 
> > > Can we just make this the normal behaviour? I think it makes more
> > > sense to change the FDT after we have relocated it.

Can we?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20221121/15543d65/attachment.sig>


More information about the U-Boot mailing list