[PATCH v6 2/2] schemas: Add schema for U-Boot driver model 'phase tags'

Simon Glass sjg at chromium.org
Wed Jan 18 18:33:34 CET 2023


+U-Boot Mailing List

Hi Rob,

On Fri, 13 Jan 2023 at 14:00, Simon Glass <sjg at chromium.org> wrote:
>
> Hi Rob,
>
> On Fri, 13 Jan 2023 at 13:58, Simon Glass <sjg at chromium.org> wrote:
> >
> > U-Boot has some particular challenges with device tree and devices:
> >
> > - U-Boot has multiple build phases, such as a Secondary Program Loader
> >   (SPL) phase which typically runs in a pre-SDRAM environment where code
> >   and data space are limited. In particular, there may not be enough
> >   space for the full device tree blob. U-Boot uses various automated
> >   techniques to reduce the size from perhaps 40KB to 3KB. It is not
> >   always possible to handle these tags entirely at build time, since
> >   U-Boot proper must have the full device tree, even though we do not
> >   want it to process all nodes until after relocation.
> > - Some U-Boot phases needs to run before the clocks are properly set up,
> >   where the CPU may be running very slowly. Therefore it is important to
> >   bind only those devices which are actually needed in that phase
> > - U-Boot uses lazy initialisation for its devices, with 'bind' and
> >   'probe' being separate steps. Even if a device is bound, it is not
> >   actually probed until it is used. This is necessary to keep the boot
> >   time reasonable, e.g. to under a second
>
> [..]
>
> Unfortunately I still don't have the hang of this schema validation. I
> would like to do this:
>
> $ dtc -O dtb -o test.dtb test/bootphases.dts && tools/dt-validate -m test.dtb
> test.dtb: /some-device: failed to match any schema with compatible:
> ['vendor,soc1-ip']
>
> but I don't get any errors when I manage test/bootphases.dts e.g. with
> misnamed properties.
>
> I thought I had this working, but that was back in November. What am I
> doing wrong?

Any thoughts on this and the patch? I would like to send a PR but it
seems sensible to sort this out first, since it may mask some
problems.

Regards,
Simon


More information about the U-Boot mailing list