[PATCH v3 13/19] x86: Record the position of the SMBIOS tables
Simon Glass
sjg at chromium.org
Sat Aug 19 23:22:51 CEST 2023
Remember where these end up so that we can pass this information on to
the EFI layer.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
(no changes since v2)
Changes in v2:
- Add new patch
arch/sandbox/include/asm/global_data.h | 1 +
arch/x86/include/asm/global_data.h | 1 +
arch/x86/lib/tables.c | 3 +++
include/asm-generic/global_data.h | 8 ++++++++
4 files changed, 13 insertions(+)
diff --git a/arch/sandbox/include/asm/global_data.h b/arch/sandbox/include/asm/global_data.h
index f0ab3ba5c146..c6977735029d 100644
--- a/arch/sandbox/include/asm/global_data.h
+++ b/arch/sandbox/include/asm/global_data.h
@@ -17,6 +17,7 @@ struct arch_global_data {
ulong table_end; /* End address of x86 tables */
ulong table_start_high; /* Start address of high x86 tables */
ulong table_end_high; /* End address of high x86 tables */
+ ulong smbios_start; /* Start address of SMBIOS table */
};
#include <asm-generic/global_data.h>
diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h
index ea58259ad774..6f4a7130f1da 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -127,6 +127,7 @@ struct arch_global_data {
ulong table_end; /* End address of x86 tables */
ulong table_start_high; /* Start address of high x86 tables */
ulong table_end_high; /* End address of high x86 tables */
+ ulong smbios_start; /* Start address of SMBIOS table */
};
#endif
diff --git a/arch/x86/lib/tables.c b/arch/x86/lib/tables.c
index 67bc0a72aebc..5b5070f7ca57 100644
--- a/arch/x86/lib/tables.c
+++ b/arch/x86/lib/tables.c
@@ -97,6 +97,9 @@ int write_tables(void)
int size = table->size ? : CONFIG_ROM_TABLE_SIZE;
u32 rom_table_end;
+ if (!strcmp("smbios", table->name))
+ gd->arch.smbios_start = rom_addr;
+
if (IS_ENABLED(CONFIG_BLOBLIST_TABLES) && table->tag) {
if (!gd->arch.table_end)
gd->arch.table_end = rom_addr;
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index 8fc205ded1a3..3421daea3632 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -552,6 +552,14 @@ static_assert(sizeof(struct global_data) == GD_SIZE);
#define gd_set_acpi_start(addr)
#endif
+#ifdef CONFIG_SMBIOS
+#define gd_smbios_start() gd->smbios_start
+#define gd_set_smbios_start(addr) gd->arch.smbios_start = addr
+#else
+#define gd_smbios_start() 0UL
+#define gd_set_smbios_start(addr)
+#endif
+
#if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
#define gd_multi_dtb_fit() gd->multi_dtb_fit
#define gd_set_multi_dtb_fit(_dtb) gd->multi_dtb_fit = _dtb
--
2.42.0.rc1.204.g551eb34607-goog
More information about the U-Boot
mailing list