summaryrefslogtreecommitdiff
path: root/src/mainboard/google/cheza/chromeos.c
diff options
context:
space:
mode:
authorT Michael Turney <mturney@codeaurora.org>2018-10-26 07:03:14 -0700
committerNico Huber <nico.h@gmx.de>2018-12-12 18:39:18 +0000
commit4ba64c99e3afc7689eab1f498134c43d40248d25 (patch)
tree220530dc1f5a0c3a15054cd94b80853811646e33 /src/mainboard/google/cheza/chromeos.c
parent82d6f90c5f5f3ede9e57503550fbe4408c59de3d (diff)
cheza: board-level GPIO support
Change-Id: I64e79904c7ad95091ea29d9f80444c4e3b493471 Signed-off-by: T Michael Turney <mturney@codeaurora.org> Reviewed-on: https://review.coreboot.org/c/29298 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/mainboard/google/cheza/chromeos.c')
-rw-r--r--src/mainboard/google/cheza/chromeos.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mainboard/google/cheza/chromeos.c b/src/mainboard/google/cheza/chromeos.c
index 538e46fa4b..1c2c4f5c5f 100644
--- a/src/mainboard/google/cheza/chromeos.c
+++ b/src/mainboard/google/cheza/chromeos.c
@@ -14,8 +14,35 @@
*/
#include <boot/coreboot_tables.h>
+#include <bootmode.h>
+#include "board.h"
+
+int get_write_protect_state(void)
+{
+ return !gpio_get(GPIO_WP_STATE);
+}
+
+void setup_chromeos_gpios(void)
+{
+ gpio_input_pullup(GPIO_EC_IN_RW);
+ gpio_input_pullup(GPIO_AP_EC_INT);
+ gpio_output(GPIO_AP_SUSPEND, 1);
+ gpio_input(GPIO_WP_STATE);
+ gpio_input_pullup(GPIO_H1_AP_INT);
+}
void fill_lb_gpios(struct lb_gpios *gpios)
{
+ struct lb_gpio chromeos_gpios[] = {
+ {GPIO_EC_IN_RW.addr, ACTIVE_LOW, gpio_get(GPIO_EC_IN_RW),
+ "EC in RW"},
+ {GPIO_AP_EC_INT.addr, ACTIVE_LOW, gpio_get(GPIO_AP_EC_INT),
+ "EC interrupt"},
+ {GPIO_WP_STATE.addr, ACTIVE_LOW, gpio_get(GPIO_WP_STATE),
+ "write protect"},
+ {GPIO_H1_AP_INT.addr, ACTIVE_LOW, gpio_get(GPIO_H1_AP_INT),
+ "TPM interrupt"},
+ };
+ lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
}