From bc441c72ce7739a5a4ef647e3331afe5fbddc86e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 18 Feb 2021 06:26:52 +0200 Subject: mb/google: Move ECFW_RW setting for non-ChromeEC boards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The boolean is stored in ChromeOS NVS, not GNVS. Change-Id: I5c424a052d484228a456f8f0ad4fb0bed3165e09 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/50877 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/mainboard/google/butterfly/acpi_tables.c | 7 ------- src/mainboard/google/butterfly/chromeos.c | 7 +++++++ src/mainboard/google/parrot/acpi_tables.c | 4 ---- src/mainboard/google/parrot/chromeos.c | 5 ++++- src/mainboard/google/parrot/ec.h | 1 - src/mainboard/google/stout/acpi_tables.c | 7 ------- src/mainboard/google/stout/chromeos.c | 3 +++ 7 files changed, 14 insertions(+), 20 deletions(-) (limited to 'src/mainboard/google') diff --git a/src/mainboard/google/butterfly/acpi_tables.c b/src/mainboard/google/butterfly/acpi_tables.c index c3324aac5e..aa02f67be5 100644 --- a/src/mainboard/google/butterfly/acpi_tables.c +++ b/src/mainboard/google/butterfly/acpi_tables.c @@ -14,13 +14,6 @@ void mainboard_fill_gnvs(struct global_nvs *gnvs) gnvs->s5u0 = 0; gnvs->s5u1 = 0; - // TODO: MLR - // The firmware read/write status is a "virtual" switch and - // will be handled elsewhere. Until then hard-code to - // read/write instead of read-only for developer mode. - if (CONFIG(CHROMEOS_NVS)) - gnvs_set_ecfw_rw(); - // the lid is open by default. gnvs->lids = 1; diff --git a/src/mainboard/google/butterfly/chromeos.c b/src/mainboard/google/butterfly/chromeos.c index c4eb66ab64..356e97b7b5 100644 --- a/src/mainboard/google/butterfly/chromeos.c +++ b/src/mainboard/google/butterfly/chromeos.c @@ -68,5 +68,12 @@ static const struct cros_gpio cros_gpios[] = { void mainboard_chromeos_acpi_generate(void) { + // TODO: MLR + // The firmware read/write status is a "virtual" switch and + // will be handled elsewhere. Until then hard-code to + // read/write instead of read-only for developer mode. + if (CONFIG(CHROMEOS_NVS)) + chromeos_set_ecfw_rw(); + chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); } diff --git a/src/mainboard/google/parrot/acpi_tables.c b/src/mainboard/google/parrot/acpi_tables.c index 535edb8d36..0c7120de75 100644 --- a/src/mainboard/google/parrot/acpi_tables.c +++ b/src/mainboard/google/parrot/acpi_tables.c @@ -3,7 +3,6 @@ #include #include #include -#include #include "ec.h" #include @@ -21,9 +20,6 @@ void mainboard_fill_gnvs(struct global_nvs *gnvs) gnvs->s5u0 = 0; gnvs->s5u1 = 0; - if (CONFIG(CHROMEOS_NVS) && !parrot_ec_running_ro()) - gnvs_set_ecfw_rw(); - /* EC handles all active thermal and fan control on Parrot. */ gnvs->tcrt = CRITICAL_TEMPERATURE; gnvs->tpsv = PASSIVE_TEMPERATURE; diff --git a/src/mainboard/google/parrot/chromeos.c b/src/mainboard/google/parrot/chromeos.c index 93ed0674d7..03b0d476f3 100644 --- a/src/mainboard/google/parrot/chromeos.c +++ b/src/mainboard/google/parrot/chromeos.c @@ -51,7 +51,7 @@ int get_recovery_mode_switch(void) return gpio; } -int parrot_ec_running_ro(void) +static int parrot_ec_running_ro(void) { return !get_gpio(68); } @@ -63,5 +63,8 @@ static const struct cros_gpio cros_gpios[] = { void mainboard_chromeos_acpi_generate(void) { + if (CONFIG(CHROMEOS_NVS) && !parrot_ec_running_ro()) + chromeos_set_ecfw_rw(); + chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); } diff --git a/src/mainboard/google/parrot/ec.h b/src/mainboard/google/parrot/ec.h index 98c81b6f4e..ff9d558e27 100644 --- a/src/mainboard/google/parrot/ec.h +++ b/src/mainboard/google/parrot/ec.h @@ -43,7 +43,6 @@ #ifndef __ACPI__ extern void parrot_ec_init(void); u8 parrot_rev(void); -int parrot_ec_running_ro(void); #endif #endif // PARROT_EC_H diff --git a/src/mainboard/google/stout/acpi_tables.c b/src/mainboard/google/stout/acpi_tables.c index 19549afa25..07e6319897 100644 --- a/src/mainboard/google/stout/acpi_tables.c +++ b/src/mainboard/google/stout/acpi_tables.c @@ -2,10 +2,6 @@ #include #include -#include -#include -#include -#include "ec.h" #include "onboard.h" #include @@ -22,9 +18,6 @@ void mainboard_fill_gnvs(struct global_nvs *gnvs) gnvs->s5u0 = 0; gnvs->s5u1 = 0; - if (CONFIG(CHROMEOS_NVS) && !get_recovery_mode_switch()) - gnvs_set_ecfw_rw(); - /* EC handles all thermal and fan control on Stout. */ gnvs->tcrt = CRITICAL_TEMPERATURE; gnvs->tpsv = PASSIVE_TEMPERATURE; diff --git a/src/mainboard/google/stout/chromeos.c b/src/mainboard/google/stout/chromeos.c index dfab358abc..07fdee3281 100644 --- a/src/mainboard/google/stout/chromeos.c +++ b/src/mainboard/google/stout/chromeos.c @@ -81,5 +81,8 @@ static const struct cros_gpio cros_gpios[] = { void mainboard_chromeos_acpi_generate(void) { + if (CONFIG(CHROMEOS_NVS) && !get_recovery_mode_switch()) + chromeos_set_ecfw_rw(); + chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); } -- cgit v1.2.3