Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59015 )
Change subject: google/cyan: Split chromeos.c ......................................................................
google/cyan: Split chromeos.c
Change-Id: Iace21fb93658648e90b56a8d90a9b00155976cbb Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/mainboard/google/cyan/Makefile.inc A src/mainboard/google/cyan/bootmode.c M src/mainboard/google/cyan/chromeos.c A src/mainboard/google/cyan/onboard.h 4 files changed, 21 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/59015/1
diff --git a/src/mainboard/google/cyan/Makefile.inc b/src/mainboard/google/cyan/Makefile.inc index 4d10b66..b9f858f 100644 --- a/src/mainboard/google/cyan/Makefile.inc +++ b/src/mainboard/google/cyan/Makefile.inc @@ -2,7 +2,6 @@
bootblock-$(CONFIG_ENABLE_BUILTIN_COM1) += com_init.c
-romstage-$(CONFIG_CHROMEOS) += chromeos.c romstage-y += spd/spd.c
ramstage-$(CONFIG_CHROMEOS) += chromeos.c diff --git a/src/mainboard/google/cyan/bootmode.c b/src/mainboard/google/cyan/bootmode.c new file mode 100644 index 0000000..a212d23 --- /dev/null +++ b/src/mainboard/google/cyan/bootmode.c @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <bootmode.h> +#include <gpio.h> +#include <soc/gpio.h> +#include "onboard.h" + +int get_write_protect_state(void) +{ + return !!gpio_get(WP_GPIO); +} diff --git a/src/mainboard/google/cyan/chromeos.c b/src/mainboard/google/cyan/chromeos.c index 4123600..5c1cc8b 100644 --- a/src/mainboard/google/cyan/chromeos.c +++ b/src/mainboard/google/cyan/chromeos.c @@ -3,12 +3,10 @@ #include <bootmode.h> #include <boot/coreboot_tables.h> #include <commonlib/helpers.h> -#include <gpio.h> #include <soc/gpio.h> #include <vendorcode/google/chromeos/chromeos.h>
-/* The WP status pin lives on MF_ISH_GPIO_4 */ -#define WP_GPIO GP_E_22 +#include "onboard.h"
void fill_lb_gpios(struct lb_gpios *gpios) { @@ -20,11 +18,6 @@ lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios)); }
-int get_write_protect_state(void) -{ - return !!gpio_get(WP_GPIO); -} - static const struct cros_gpio cros_gpios[] = { CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME), CROS_GPIO_WP_AH(0x10013, CROS_GPIO_DEVICE_NAME), diff --git a/src/mainboard/google/cyan/onboard.h b/src/mainboard/google/cyan/onboard.h new file mode 100644 index 0000000..dd33a38 --- /dev/null +++ b/src/mainboard/google/cyan/onboard.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef CYAN_ONBOARD_H +#define CYAN_ONBOARD_H + +/* Write protect active high. */ +#define WP_GPIO GP_E_22 + +#endif