aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-12-31 08:25:49 -0700
committerSimon Glass <sjg@chromium.org>2024-01-07 13:45:07 -0700
commit138e69149b84180753da4dca59d4cb4f03da3ca7 (patch)
treef7c9bf2182ec1741106adcad294c491bc369f947 /lib
parentb2b58e1ef5c3f60ce6db1d6192c265d4ee45b170 (diff)
downloadu-boot-138e69149b84180753da4dca59d4cb4f03da3ca7.zip
u-boot-138e69149b84180753da4dca59d4cb4f03da3ca7.tar.gz
u-boot-138e69149b84180753da4dca59d4cb4f03da3ca7.tar.bz2
efi: Use the correct GUID for the SMBIOS table
EFI does not use the 'anchor string' to determine the SMBIOS table version, instead preferring to have two separate GUIDs. Use the correct one, depending on the table version. Call unmap_system() to balance to the use of map_sysmem() Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_smbios.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_smbios.c b/lib/efi_loader/efi_smbios.c
index 49adc87..5cbce6d 100644
--- a/lib/efi_loader/efi_smbios.c
+++ b/lib/efi_loader/efi_smbios.c
@@ -14,6 +14,8 @@
#include <smbios.h>
#include <linux/sizes.h>
+const efi_guid_t smbios3_guid = SMBIOS3_TABLE_GUID;
+
enum {
TABLE_SIZE = SZ_4K,
};
@@ -25,8 +27,10 @@ enum {
*/
efi_status_t efi_smbios_register(void)
{
+ const efi_guid_t *guid;
ulong addr;
efi_status_t ret;
+ void *buf;
addr = gd_smbios_start();
if (!addr) {
@@ -42,8 +46,12 @@ efi_status_t efi_smbios_register(void)
log_debug("EFI using SMBIOS tables at %lx\n", addr);
/* Install SMBIOS information as configuration table */
- return efi_install_configuration_table(&smbios_guid,
- map_sysmem(addr, 0));
+ buf = map_sysmem(addr, 0);
+ guid = !memcmp(buf, "_SM_", 4) ? &smbios_guid : &smbios3_guid;
+ ret = efi_install_configuration_table(guid, buf);
+ unmap_sysmem(buf);
+
+ return ret;
}
static int install_smbios_table(void)