2020-06-17 00:04:44 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
|
|
|
|
#include <acpi/acpi_gnvs.h>
|
|
|
|
#include <ec/google/chromeec/ec.h>
|
2020-12-20 07:27:21 +01:00
|
|
|
#include <smbios.h>
|
2020-06-17 00:04:44 +02:00
|
|
|
#include <vendorcode/google/chromeos/gnvs.h>
|
|
|
|
|
2020-12-19 15:19:44 +01:00
|
|
|
void gnvs_assign_chromeos(void *gnvs_section)
|
2020-06-17 00:04:44 +02:00
|
|
|
{
|
2020-12-19 15:19:44 +01:00
|
|
|
chromeos_acpi_t *gnvs_chromeos = gnvs_section;
|
2020-06-17 12:45:16 +02:00
|
|
|
|
2020-06-17 00:04:44 +02:00
|
|
|
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;
|
|
|
|
}
|
2020-06-17 07:15:39 +02:00
|
|
|
|
|
|
|
void gnvs_set_ecfw_rw(void)
|
|
|
|
{
|
2020-12-19 15:19:44 +01:00
|
|
|
chromeos_acpi_t *gnvs_chromeos = chromeos_get_chromeos_acpi();
|
2020-06-17 07:15:39 +02:00
|
|
|
if (!gnvs_chromeos)
|
|
|
|
return;
|
|
|
|
|
|
|
|
gnvs_chromeos->vbt2 = ACTIVE_ECFW_RW;
|
|
|
|
}
|
2020-12-20 07:27:21 +01:00
|
|
|
|
|
|
|
void smbios_type0_bios_version(uintptr_t address)
|
|
|
|
{
|
2020-12-19 15:19:44 +01:00
|
|
|
chromeos_acpi_t *gnvs_chromeos = chromeos_get_chromeos_acpi();
|
2020-12-20 07:27:21 +01:00
|
|
|
if (!gnvs_chromeos)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Location of smbios_type0.bios_version() string filled with spaces. */
|
|
|
|
gnvs_chromeos->vbt10 = address;
|
|
|
|
}
|