On 25.10.24 03:08, Tom Rini wrote:
> On Tue, Oct 22, 2024 at 08:04:28AM +0200, Jan Kiszka wrote:
> 
>> From: Jan Kiszka <[email protected]>
>>
>> Allow for the sysinfo drivers to provide a system UUID to SMBIOS. Will
>> be first used by the IOT2050 boards.
>>
>> Based on original patch by Li Hua Qian.
>>
>> Signed-off-by: Jan Kiszka <[email protected]>
>> Reviewed-by: Simon Glass <[email protected]>
>> ---
>>  include/sysinfo.h | 1 +
>>  lib/smbios.c      | 4 ++++
>>  2 files changed, 5 insertions(+)
>>
>> diff --git a/include/sysinfo.h b/include/sysinfo.h
>> index 8a77ef44856..1c5008b5f23 100644
>> --- a/include/sysinfo.h
>> +++ b/include/sysinfo.h
>> @@ -49,6 +49,7 @@ enum sysinfo_id {
>>      SYSINFO_ID_SMBIOS_SYSTEM_SERIAL,
>>      SYSINFO_ID_SMBIOS_SYSTEM_SKU,
>>      SYSINFO_ID_SMBIOS_SYSTEM_FAMILY,
>> +    SYSINFO_ID_SMBIOS_SYSTEM_UUID,
>>      SYSINFO_ID_SMBIOS_BASEBOARD_MANUFACTURER,
>>      SYSINFO_ID_SMBIOS_BASEBOARD_PRODUCT,
>>      SYSINFO_ID_SMBIOS_BASEBOARD_VERSION,
>> diff --git a/lib/smbios.c b/lib/smbios.c
>> index 7c24ea129eb..1441fa4cde6 100644
>> --- a/lib/smbios.c
>> +++ b/lib/smbios.c
>> @@ -387,6 +387,7 @@ static int smbios_write_type1(ulong *current, int handle,
>>      struct smbios_type1 *t;
>>      int len = sizeof(struct smbios_type1);
>>      char *serial_str = env_get("serial#");
>> +    char uuid[sizeof(t->uuid)];
>>  
>>      t = map_sysmem(*current, len);
>>      memset(t, 0, sizeof(struct smbios_type1));
>> @@ -409,6 +410,9 @@ static int smbios_write_type1(ulong *current, int handle,
>>                                                    
>> SYSINFO_ID_SMBIOS_SYSTEM_SERIAL,
>>                                                    NULL);
>>      }
>> +    if (!sysinfo_get_str(ctx->dev, SYSINFO_ID_SMBIOS_SYSTEM_UUID,
>> +                         sizeof(uuid), uuid))
>> +            strncpy((char *)t->uuid, uuid, sizeof(t->uuid));
>>      t->wakeup_type = SMBIOS_WAKEUP_TYPE_UNKNOWN;
>>      t->sku_number = smbios_add_prop_si(ctx, "sku",
>>                                         SYSINFO_ID_SMBIOS_SYSTEM_SKU, NULL);
> 
> This commit leads to sandbox (and sandbox with clang) failing a ton of
> tests:
> https://source.denx.de/u-boot/u-boot/-/jobs/929474
> 
> Without this commit in the series, iot2050 fails to build.
> 

Strange on first sight - we will look into this. As this patch and the
following 2 are only adding a feature, maybe you could already merge the
first 10 patches? Would make v3 shorter for us.

Thanks,
Jan

-- 
Siemens AG, Technology
Linux Expert Center

Reply via email to