[PATCH v5 12/29] dm: core: Add basic ACPI support

Simon Glass sjg at chromium.org
Thu Apr 9 18:25:52 CEST 2020


Hi Andy,

On Thu, 9 Apr 2020 at 03:02, Andy Shevchenko <andy.shevchenko at gmail.com> wrote:
>
> On Thu, Apr 9, 2020 at 2:01 AM Simon Glass <sjg at chromium.org> wrote:
> >
> > ACPI (Advanced Configuration and Power Interface) is a standard for
> > specifying information about a platform. It is a little like device
> > tree but the bindings are part of the specification and it supports an
> > interpreted bytecode language.
> >
> > Driver model does not use ACPI for U-Boot's configuration, but it is
> > convenient to have it support generation of ACPI tables for passing to
> > Linux, etc.
> >
> > As a starting point, add an optional set of ACPI operations to each
> > device. Initially only a single operation is available, to obtain the
> > ACPI name for the device. More operations are added later.
> >
> > Enable ACPI for sandbox to ensure build coverage and so that we can add
> > tests.
>
> > +int acpi_copy_name(char *out_name, const char *name)
> > +{
> > +       strncpy(out_name, name, ACPI_NAME_MAX);
>
> _LEN.
>
> The idea as I tried to explain that name can have only 4 bytes at the
> end of the page. I dunno what U-Boot does if you access out of the
> boundaries to the page which is not mapped to MMU (in OSes it will be
> page fault). Does U-Boot map all pages to MMU?
>
> In any case, the code above has this subtle issue. We may live with
> it, but since it's a generic kinda function, better to be pedantic
> about it.

OK I will change it. The documentation is pretty clear on how to use
this function, but I suppose people might not read it.

Regards,
Simon


More information about the U-Boot mailing list