coreboot-kgpe-d16/src/acpi/chromeos-gnvs.c
Kyösti Mälkki 82f6b932e9 mb/x/acpi_tables: Move EC_RW detection
These boards without ChromeEC do not set ACTIVE_EC_RW
flag as part of the gnvs_assign_chromeos() function.
Create abstraction to avoid <vendorcode/chromeos/x> include.

Change-Id: Ic6029e1807fcfe7dd2c766ce8221e347b6b096f9
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48777
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-01-10 11:18:05 +00:00

29 lines
687 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#include <acpi/acpi_gnvs.h>
#include <ec/google/chromeec/ec.h>
#include <vendorcode/google/chromeos/gnvs.h>
void gnvs_assign_chromeos(void)
{
chromeos_acpi_t *gnvs_chromeos = gnvs_chromeos_ptr(acpi_get_gnvs());
if (!gnvs_chromeos)
return;
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 = gnvs_chromeos_ptr(acpi_get_gnvs());
if (!gnvs_chromeos)
return;
gnvs_chromeos->vbt2 = ACTIVE_ECFW_RW;
}