diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-02-12 18:43:36 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-04-30 06:46:07 +0000 |
commit | 8a1fcf475401f32208c48376205a443a3acbf5c1 (patch) | |
tree | 53f94d48a2d0fd877171ad69209255592207875f /src/acpi | |
parent | 715cdc370c6dcfd47f247de9ff8ccd24f0a2fa03 (diff) |
vc/google/chromeos: Refactor GNVS init
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 <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50612
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Lance Zhao
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/acpi')
-rw-r--r-- | src/acpi/Makefile.inc | 1 | ||||
-rw-r--r-- | src/acpi/chromeos-gnvs.c | 38 | ||||
-rw-r--r-- | src/acpi/gnvs.c | 6 |
3 files changed, 4 insertions, 41 deletions
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 <acpi/acpi_gnvs.h> -#include <ec/google/chromeec/ec.h> -#include <smbios.h> -#include <vendorcode/google/chromeos/gnvs.h> - -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) |