diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2024-07-23 16:44:23 +0200 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2024-07-31 08:29:16 +0200 |
commit | 8c919fcd20ce0a832c6e4fc4413ebac0d2a8f125 (patch) | |
tree | 50a7fa14094af4c320d221253cc250e0547e773a /lib/smbios.c | |
parent | 272df36494a5d98805a83df2f1b6d026854e2a57 (diff) |
smbios: add extended Extended BIOS ROM Size
U-Boot claims to create SMBIOS 3.7 tables. The type 0 table has
a field Extended BIOS ROM Size since version 3.1.
BIOS ROM sizes of 16 MiB or above must be written to this field.
Add and fill the missing field.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib/smbios.c')
-rw-r--r-- | lib/smbios.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/smbios.c b/lib/smbios.c index 4126466e34a..7c24ea129eb 100644 --- a/lib/smbios.c +++ b/lib/smbios.c @@ -22,6 +22,7 @@ #include <cpu.h> #include <dm/uclass-internal.h> #endif +#include <linux/sizes.h> /* Safeguard for checking that U_BOOT_VERSION_NUM macros are compatible with U_BOOT_DMI */ #if U_BOOT_VERSION_NUM < 2000 || U_BOOT_VERSION_NUM > 2099 || \ @@ -348,7 +349,13 @@ static int smbios_write_type0(ulong *current, int handle, #endif t->bios_release_date = smbios_add_prop(ctx, NULL, U_BOOT_DMI_DATE); #ifdef CONFIG_ROM_SIZE - t->bios_rom_size = (CONFIG_ROM_SIZE / 65536) - 1; + if (CONFIG_ROM_SIZE < SZ_16M) { + t->bios_rom_size = (CONFIG_ROM_SIZE / 65536) - 1; + } else { + /* CONFIG_ROM_SIZE < 8 GiB */ + t->bios_rom_size = 0xff; + t->extended_bios_rom_size = CONFIG_ROM_SIZE >> 20; + } #endif t->bios_characteristics = BIOS_CHARACTERISTICS_PCI_SUPPORTED | BIOS_CHARACTERISTICS_SELECTABLE_BOOT | |