diff options
author | Baocheng Su <baocheng.su@siemens.com> | 2025-02-18 10:36:10 +0800 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-02-28 08:41:54 -0600 |
commit | 6b654ac5a6afa8e03d4d093be7cf27965b5c3c04 (patch) | |
tree | df3c1852ebfab1054c4f583526d55ce918ff0997 | |
parent | 92880a58cafc93c0907b9d3a6b13e6425366b7c0 (diff) | |
download | u-boot-6b654ac5a6afa8e03d4d093be7cf27965b5c3c04.tar.gz |
smbios: Fill UUID from sysinfo when available
Allow for the sysinfo drivers to provide a system UUID to SMBIOS. Will
be first used by the IOT2050 boards.
Signed-off-by: Li Hua Qian <huaqian.li@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Baocheng Su <baocheng.su@siemens.com>
-rw-r--r-- | include/sysinfo.h | 1 | ||||
-rw-r--r-- | lib/smbios.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/sysinfo.h b/include/sysinfo.h index ba2ac273e8e..14e923c6589 100644 --- a/include/sysinfo.h +++ b/include/sysinfo.h @@ -57,6 +57,7 @@ enum sysinfo_id { SYSID_SM_SYSTEM_WAKEUP, SYSID_SM_SYSTEM_SKU, SYSID_SM_SYSTEM_FAMILY, + SYSID_SM_SYSTEM_UUID, /* Baseboard (or Module) Information (Type 2) */ SYSID_SM_BASEBOARD_MANUFACTURER, diff --git a/lib/smbios.c b/lib/smbios.c index 78cee8c0c26..7c9701a57f9 100644 --- a/lib/smbios.c +++ b/lib/smbios.c @@ -429,6 +429,8 @@ static int smbios_write_type1(ulong *current, int handle, struct smbios_type1 *t; int len = sizeof(*t); char *serial_str = env_get("serial#"); + size_t uuid_len; + void *uuid; t = map_sysmem(*current, len); memset(t, 0, len); @@ -450,6 +452,10 @@ static int smbios_write_type1(ulong *current, int handle, SYSID_SM_SYSTEM_SERIAL, NULL); } + if (!sysinfo_get_data(ctx->dev, SYSID_SM_SYSTEM_UUID, &uuid, + &uuid_len) && + uuid_len == sizeof(t->uuid)) + memcpy(t->uuid, uuid, sizeof(t->uuid)); t->wakeup_type = smbios_get_val_si(ctx, "wakeup-type", SYSID_SM_SYSTEM_WAKEUP, SMBIOS_WAKEUP_TYPE_UNKNOWN); |