[Concept,v2,14/22] efi: app: Pick up the SMBIOS table
Commit Message
From: Simon Glass <sjg@chromium.org>
If an SMBIOS table is available, pick it up so that it can be parsed, or
examined with the 'smbios' command.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
(no changes since v1)
lib/Kconfig | 3 ++-
lib/efi_client/efi_app.c | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
@@ -1168,7 +1168,7 @@ config SPL_OID_REGISTRY
config SMBIOS
bool "SMBIOS support"
- depends on X86 || EFI_LOADER
+ depends on X86 || EFI_LOADER || EFI_APP
default y
select LAST_STAGE_INIT
imply CMD_SMBIOS if X86
@@ -1183,6 +1183,7 @@ config SMBIOS
config SMBIOS_PARSER
bool "SMBIOS parser"
+ default y if EFI_APP
help
A simple parser for SMBIOS data.
@@ -159,6 +159,7 @@ static void free_memory(struct efi_priv *priv)
static void scan_tables(struct efi_system_table *sys_table)
{
efi_guid_t acpi = EFI_ACPI_TABLE_GUID;
+ efi_guid_t smbios = SMBIOS3_TABLE_GUID;
uint i;
for (i = 0; i < sys_table->nr_tables; i++) {
@@ -166,6 +167,8 @@ static void scan_tables(struct efi_system_table *sys_table)
if (!memcmp(&tab->guid, &acpi, sizeof(efi_guid_t)))
gd_set_acpi_start(map_to_sysmem(tab->table));
+ else if (!memcmp(&tab->guid, &smbios, sizeof(efi_guid_t)))
+ gd->arch.smbios_start = map_to_sysmem(tab->table);
}
}