[PATCH 2/2 v2] smbios: Fallback to the default DT if sysinfo nodes are missing

Ilias Apalodimas ilias.apalodimas at linaro.org
Wed Dec 6 17:03:14 CET 2023


Hi Simon,

On Sat, 2 Dec 2023 at 20:28, Simon Glass <sjg at chromium.org> wrote:
>
> Hi Ilias,
>
> On Wed, 29 Nov 2023 at 23:50, Ilias Apalodimas
> <ilias.apalodimas at linaro.org> wrote:
> >
> > Hi Simon,
> >
> > [...]
> >
> >> > Changes since v1:
> >> > - Tokenize the DT node entry and use the appropriate value instead of
> >> >   the entire string
> >> > - Removed Peters tested/reviewed-by tags due to the above
> >> >  lib/smbios.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++---
> >> >  1 file changed, 90 insertions(+), 4 deletions(-)
> >> >
> >>
> >> Can this be put behind a Kconfig? It adds quite a bit of code which
> >> punishes those boards which do the right thing.
> >
> >
> > Sure but OTOH the code increase should be really minimal. But I don't mind I can add a Kconfig
> >
> >>
> >> > +
> >> > +       dt_str = ofnode_read_string(ofnode_root(), nprop->dt_str);
> >>
> >> Could this use ofnode_read_string_index() ?
> >
> >
> > Maybe, I'll have a look and change it if that works

Unless I am missing something this doesn't work.
This is designed to return a string index from a DT property that's defined as
foo_property = "value1", "value2" isn't it?

The code above is trying to read an existing property (e.g compatible)
and get the string after the comma delimiter.
Perhaps I should add this in drivers/core/ofnode.c instead?

> >
> > [...]
> >
> >>
> >> Any chance of a test for this code?
> >
> >
> > Sure, but any suggestions on where to add the test?
> > SMBIOS tables are populated on OS booting, do we have a test somewhere that boots an OS?
>
> They are written on startup, right? They should certainly be in place
> before U-Boot enters the command line.

Not always.  I am not sure if x86 does that, but on the rest of the
architectures, they are only initialized when the efi smbios code
runs. Wasn't this something you were trying to change?

>
> > Any other ideas?
>
> Probably a test in test/lib/ would work. We actually have
> smbios-parser.c which might help?

That doesn't seem too helpful either. But I can add a test in
test/dm/ofnode.c if we move the parsing function to ofnode.c. The
generic SMBIOS tests can be added when the SMBIOS code is refactored.

Regards
/Ilias
>
> Regards,
> Simon


More information about the U-Boot mailing list