From 358cbb3a3061cc0cf3c16aebf042061b5c7908ca Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Thu, 14 Feb 2019 14:19:22 +0100 Subject: SMBIOS: Update BIOS Information (Type 0) to version V3.2.0 Add Extended BIOS ROM Size field. Change-Id: Iec35c8c66210f0ddc07a2ca6f976a1f8fc53037d Signed-off-by: Elyes HAOUAS Reviewed-on: https://review.coreboot.org/c/31416 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/arch/x86/smbios.c | 11 +++++++---- src/include/smbios.h | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index c0545ce779..f816647ee2 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -371,14 +371,17 @@ static int smbios_write_type0(unsigned long *current, int handle) #endif #endif /* CONFIG_CHROMEOS */ - /* As a work around to prevent a compiler error, temporarily specify - * 16 MiB flash sizes when ROM size >= 16 MiB. An update is necessary - * once the SMBIOS specification addresses ROM sizes > 16 MiB. - */ uint32_t rom_size = CONFIG_ROM_SIZE; rom_size = MIN(CONFIG_ROM_SIZE, 16 * MiB); t->bios_rom_size = (rom_size / 65535) - 1; + if (CONFIG_ROM_SIZE >= 1 * GiB) { + t->extended_bios_rom_size = + DIV_ROUND_UP(CONFIG_ROM_SIZE, GiB) | (1 << 14); + } else { + t->extended_bios_rom_size = DIV_ROUND_UP(CONFIG_ROM_SIZE, MiB); + } + t->system_bios_major_release = 4; t->bios_characteristics = BIOS_CHARACTERISTICS_PCI_SUPPORTED | diff --git a/src/include/smbios.h b/src/include/smbios.h index 34a3e5b39b..38ebcdcab0 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -250,6 +250,7 @@ struct smbios_type0 { u8 system_bios_minor_release; u8 ec_major_release; u8 ec_minor_release; + u16 extended_bios_rom_size; u8 eos[2]; } __packed; -- cgit v1.2.3