Unable to implement board fdt-fixup for imx8m CPU
Simon Glass
sjg at chromium.org
Tue Apr 25 01:33:50 CEST 2023
Hi Hugo,
On Mon, 24 Apr 2023 at 15:57, Hugo Villeneuve <hugo at hugovil.com> wrote:
>
> On Mon, 24 Apr 2023 15:01:35 -0600
> Simon Glass <sjg at chromium.org> wrote:
>
> > Hi Hugo,
> >
> > On Mon, 24 Apr 2023 at 14:53, Hugo Villeneuve <hugo at hugovil.com> wrote:
> > >
> > > Hi,
> > > according to this document:
> > >
> > > doc/develop/driver-model/fdt-fixup.rst
> > >
> > > it is suggested that boards implement the board_fix_fdt() function to tweak the device tree. I am trying to do just that, but unfortunately I cannot because the following source file already has an implementation of board_fix_fdt():
> > >
> > > arch/arm/mach-imx/imx8m/soc.c
> > >
> > > For all boards using a imx8m CPU, how can we implement board_fix_fdt()?
> >
> > If you enable CONFIG_EVENT you can use EVT_FT_FIXUP to add as many
> > fixup functions as you need.
> >
> > Migration to use that mechanism everywhere hasn't really started, but
> > I think it would be useful.
>
> Hi Simon,
> to be more precise, I need to modify the FDT used by U-Boot to tweak some ethernet PHY properties before initializing the ethernet controller. I do _not_ need to fix the FDT before booting in the OS.
>
> With that in mind, do you still think using CONFIG_EVENT is the way to go? I am not sure from my reading of the source code because it seems that fixup events are called just before booting into the OS.
Well you could create a new event type and send it at a different
type, if that helps. In general these weak functions are a pain IMO,
since it is hard to know which one is called, and you can ultimately
only have one main function and a backup. So I am encouraging the use
of events instead.
Regards,
Simon
More information about the U-Boot
mailing list