[PATCH 01/10] dtoc: add support to scan drivers

Simon Glass sjg at chromium.org
Thu Jun 11 18:44:40 CEST 2020


Hi Walter,

On Thu, 11 Jun 2020 at 10:15, Walter Lozano <walter.lozano at collabora.com> wrote:
>
> Hi Simon,
>
> On 8/6/20 12:49, Walter Lozano wrote:
> > Hi Simon,
> >
> > On 4/6/20 12:59, Simon Glass wrote:
> >> Hi Walter,
> >>
> >> On Fri, 29 May 2020 at 12:15, Walter Lozano
> >> <walter.lozano at collabora.com> wrote:
> >>> Currently dtoc scans dtbs to convert them to struct platdata and
> >>> to generate U_BOOT_DEVICE entries. These entries need to be filled
> >>> with the driver name, but at this moment the information used is the
> >>> compatible name present in the dtb. This causes that only nodes with
> >>> a compatible name that matches a driver name generate a working
> >>> entry.
> >>>
> >>> In order to improve this behaviour, this patch adds to dtoc the
> >>> capability of scan drivers source code to generate a list of valid
> >>> driver
> >>> names. This allows to rise a warning in the case that an U_BOOT_DEVICE
> >>> entry will try to use a name not valid.
> >>>
> >>> Additionally, in order to add more flexibility to the solution, adds
> >>> the
> >>> U_BOOT_DRIVER_ALIAS macro, which generates no code at all, but
> >>> allows an
> >>> easy way to declare driver name aliases. Thanks to this, dtoc can look
> >>> for the driver name based on its alias when it populates the
> >>> U_BOOT_DEVICE
> >>> entry.
> >>>
> >>> Signed-off-by: Walter Lozano <walter.lozano at collabora.com>
> >>> ---
> >>>   include/dm/device.h        |  7 ++++
> >>>   tools/dtoc/dtb_platdata.py | 83
> >>> ++++++++++++++++++++++++++++++++++++--
> >>>   2 files changed, 86 insertions(+), 4 deletions(-)
> >>>

[..]

> >>> +        """
> >>> +        compat_c, aliases_c = get_compat_name(node)
> >>> +        if compat_c not in self._drivers:
> >>> +            compat_c_old = compat_c
> >>> +            compat_c = self._driver_aliases.get(compat_c)
> >>> +            if not compat_c:
> >>> +                print('WARNING: the driver %s was not found in the
> >>> driver list' % (compat_c_old))
> >> This creates lots of warnings at present. Either we need a patch to
> >> clean up the differences in the source code, or we need to disable the
> >> warning.
> >
> >
> > Regarding this, maybe we should have a list of driver names we don't
> > expect to support, like simple_bus. For this to work probably the best
> > approach is to have a config option similar to CONFIG_OF_REMOVE_PROPS,
> > so each config can add their owns.
>
> I've been thinking about this issue, I think it would be better to only
> print the warning if build is issue with
>
> make V=1
>
> What do you think?

Can we not fix the warnings?

Regards,
Simon


More information about the U-Boot mailing list