[PATCH 1/2] smbios: Simplify reporting of unknown values

Simon Glass sjg at chromium.org
Mon Sep 12 20:31:39 CEST 2022


Hi Ilias,

On Tue, 6 Sept 2022 at 07:44, Ilias Apalodimas
<ilias.apalodimas at linaro.org> wrote:
>
> If a value is not valid during the DT or SYSINFO parsing,  we explicitly
> set that to "Unknown Product" and "Unknown" for the product and
> manufacturer respectively.  It's cleaner if we move the checks insisde
> smbios_add_string() and always report "Unknown" regardless of the missing
> field.
>
> pre-patch dmidecode
> <snip>
> Handle 0x0001, DMI type 1, 27 bytes
> System Information
>         Manufacturer: Unknown
>         Product Name: Unknown Product
>         Version: Not Specified
>         Serial Number: Not Specified
>         UUID: Not Settable
>         Wake-up Type: Reserved
>         SKU Number: Not Specified
>         Family: Not Specified
>
> Handle 0x0002, DMI type 2, 14 bytes
> Base Board Information
>         Manufacturer: Unknown
>         Product Name: Unknown Product
>         Version: Not Specified
>         Serial Number: Not Specified
>         Asset Tag: Not Specified
>         Features:
>                 Board is a hosting board
>         Location In Chassis: Not Specified
>         Chassis Handle: 0x0000
>         Type: Motherboard
> <snip>
>
> post-patch dmidecode:
>
> Handle 0x0001, DMI type 1, 27 bytes
> System Information
>         Manufacturer: Unknown
>         Product Name: Unknown
>         Version: Unknown
>         Serial Number: Unknown
>         UUID: Not Settable
>         Wake-up Type: Reserved
>         SKU Number: Unknown
>         Family: Unknown
>
> Handle 0x0002, DMI type 2, 14 bytes
> Base Board Information
>         Manufacturer: Unknown
>         Product Name: Unknown
>         Version: Unknown
>         Serial Number: Not Specified
>         Asset Tag: Unknown
>         Features:
>                 Board is a hosting board
>         Location In Chassis: Not Specified
>         Chassis Handle: 0x0000
>         Type: Motherboard
>
> Signed-off-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> ---
>  lib/smbios.c | 17 +++--------------
>  1 file changed, 3 insertions(+), 14 deletions(-)

Perhaps a better fix is to drop the smbios info?

What upstream projects use this information to show things to the
user? You showed a screenshot of some sort of system-info app. We
could teach it about falling back to the device tree. That way we are
not adding fake information to SMBIOS.

Also, SMBIOS is a legacy thing and a PITA to work with. How about we
use the device tree binding for the same info:

    smbios {
        compatible = "u-boot,sysinfo-smbios";

        smbios {
            system {
                manufacturer = "pine64";
                product = "rock64_rk3328";
            };

            baseboard {
                manufacturer = "pine64";
                product = "rock64_rk3328";
            };

            chassis {
                manufacturer = "pine64";
                product = "rock64_rk3328";
            };
        };
    };

This is easy to parse and gets us away from all this legacy junk that
we don't need.

Regards,
Simon


More information about the U-Boot mailing list