summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2020-12-20 08:27:21 +0200
committerPatrick Georgi <pgeorgi@google.com>2021-01-18 07:23:53 +0000
commit0fcbd3a125ceb3b27db3094046b88c79db2cc32c (patch)
tree5f779e72f8c2c56d972ede9cbf5a9614c24b907b /src/arch/x86
parent661ad4666ca0e78195f6901fce7b44a7e56e6331 (diff)
ChromeOS: Refactor SMBIOS type0 bios_version()
Pointer to an empty string (filled with spaces) is stored inside GNVS. Rearrange things to avoid having <chromeos/gnvs.h> in SMBIOS code. Change-Id: I9405afbea29b896488b4cdd6dd32c4db686fe48c Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/49281 Reviewed-by: Lance Zhao Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/smbios.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c
index aaf989da19..3856acf0d2 100644
--- a/src/arch/x86/smbios.c
+++ b/src/arch/x86/smbios.c
@@ -16,9 +16,6 @@
#include <device/pci_ids.h>
#include <device/pci_def.h>
#include <device/pci.h>
-#if CONFIG(CHROMEOS)
-#include <vendorcode/google/chromeos/gnvs.h>
-#endif
#include <drivers/vpd/vpd.h>
#include <stdlib.h>
@@ -411,11 +408,12 @@ static int smbios_write_type0(unsigned long *current, int handle)
t->vendor = smbios_add_string(t->eos, "coreboot");
t->bios_release_date = smbios_add_string(t->eos, coreboot_dmi_date);
-#if CONFIG(CHROMEOS) && CONFIG(HAVE_ACPI_TABLES)
- u32 version_offset = (u32)smbios_string_table_len(t->eos);
- /* SMBIOS offsets start at 1 rather than 0 */
- chromeos_get_chromeos_acpi()->vbt10 = (uintptr_t)t->eos + (version_offset - 1);
-#endif
+ if (CONFIG(CHROMEOS)) {
+ uintptr_t version_address = (uintptr_t)t->eos;
+ /* SMBIOS offsets start at 1 rather than 0 */
+ version_address += (u32)smbios_string_table_len(t->eos) - 1;
+ smbios_type0_bios_version(version_address);
+ }
t->bios_version = smbios_add_string(t->eos, get_bios_version());
uint32_t rom_size = CONFIG_ROM_SIZE;
rom_size = MIN(CONFIG_ROM_SIZE, 16 * MiB);