From 8a1fcf475401f32208c48376205a443a3acbf5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Fri, 12 Feb 2021 18:43:36 +0200 Subject: vc/google/chromeos: Refactor GNVS init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the support code for filling ChromeOS GNVS from acpi/chromeos-gnvs.c to vc/google/chromeos/gnvs.c. Change-Id: I7e92206561812eb3dc69739df49b6c3a93853858 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/50612 Reviewed-by: Tim Wawrzynczak Reviewed-by: Furquan Shaikh Reviewed-by: Angel Pons Reviewed-by: Lance Zhao Tested-by: build bot (Jenkins) --- src/acpi/Makefile.inc | 1 - src/acpi/chromeos-gnvs.c | 38 -------------------------------------- src/acpi/gnvs.c | 6 ++++-- 3 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 src/acpi/chromeos-gnvs.c (limited to 'src/acpi') diff --git a/src/acpi/Makefile.inc b/src/acpi/Makefile.inc index 3c3bd9ed12..efa7e3bb4f 100644 --- a/src/acpi/Makefile.inc +++ b/src/acpi/Makefile.inc @@ -10,7 +10,6 @@ ramstage-$(CONFIG_PCI) += acpigen_pci.c ramstage-y += acpigen_ps2_keybd.c ramstage-y += acpigen_usb.c ramstage-y += device.c -ramstage-$(CONFIG_CHROMEOS_NVS) += chromeos-gnvs.c ramstage-$(CONFIG_ACPI_SOC_NVS) += gnvs.c ramstage-y += pld.c ramstage-y += sata.c diff --git a/src/acpi/chromeos-gnvs.c b/src/acpi/chromeos-gnvs.c deleted file mode 100644 index 060d56d44b..0000000000 --- a/src/acpi/chromeos-gnvs.c +++ /dev/null @@ -1,38 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include -#include - -void gnvs_assign_chromeos(void *gnvs_section) -{ - chromeos_acpi_t *gnvs_chromeos = gnvs_section; - - chromeos_init_chromeos_acpi(gnvs_chromeos); - - /* EC can override to ECFW_RW. */ - gnvs_chromeos->vbt2 = ACTIVE_ECFW_RO; - - if (CONFIG(EC_GOOGLE_CHROMEEC) && !google_ec_running_ro()) - gnvs_chromeos->vbt2 = ACTIVE_ECFW_RW; -} - -void gnvs_set_ecfw_rw(void) -{ - chromeos_acpi_t *gnvs_chromeos = chromeos_get_chromeos_acpi(); - if (!gnvs_chromeos) - return; - - gnvs_chromeos->vbt2 = ACTIVE_ECFW_RW; -} - -void smbios_type0_bios_version(uintptr_t address) -{ - chromeos_acpi_t *gnvs_chromeos = chromeos_get_chromeos_acpi(); - if (!gnvs_chromeos) - return; - - /* Location of smbios_type0.bios_version() string filled with spaces. */ - gnvs_chromeos->vbt10 = address; -} diff --git a/src/acpi/gnvs.c b/src/acpi/gnvs.c index 3decebbcb0..fc1a70db06 100644 --- a/src/acpi/gnvs.c +++ b/src/acpi/gnvs.c @@ -38,8 +38,10 @@ void acpi_create_gnvs(void) if (CONFIG(CONSOLE_CBMEM)) gnvs->cbmc = (uintptr_t)cbmem_find(CBMEM_ID_CONSOLE); - if (CONFIG(CHROMEOS_NVS)) - gnvs_assign_chromeos((u8 *)gnvs + GNVS_CHROMEOS_ACPI_OFFSET); + if (CONFIG(CHROMEOS_NVS)) { + chromeos_acpi_t *init = (void *)((u8 *)gnvs + GNVS_CHROMEOS_ACPI_OFFSET); + chromeos_init_chromeos_acpi(init); + } } void *acpi_get_gnvs(void) -- cgit v1.2.3