From 6b654ac5a6afa8e03d4d093be7cf27965b5c3c04 Mon Sep 17 00:00:00 2001 From: Baocheng Su Date: Tue, 18 Feb 2025 10:36:10 +0800 Subject: 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 Signed-off-by: Jan Kiszka Signed-off-by: Baocheng Su --- lib/smbios.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/smbios.c') 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); -- cgit v1.2.3