mb/google/nissa/var/rull: add ssd timing and modify ssd GPIO pins of rtd3
[coreboot2.git] / src / mainboard / google / peach_pit / chromeos.c
blobe1d8fa1a9a984f3b04104897861df297ff8650ec
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <boot/coreboot_tables.h>
4 #include <bootmode.h>
5 #include <ec/google/chromeec/ec.h>
6 #include <ec/google/chromeec/ec_commands.h>
7 #include <soc/cpu.h>
8 #include <soc/gpio.h>
9 #include <types.h>
10 #include <vendorcode/google/chromeos/chromeos.h>
12 void fill_lb_gpios(struct lb_gpios *gpios)
14 struct lb_gpio chromeos_gpios[] = {
15 /* Lid: active high (LID_GPIO) */
16 {EXYNOS5_GPX3, ACTIVE_HIGH, gpio_get_value(GPIO_X34), "lid"},
18 /* Power: virtual GPIO active low (POWER_GPIO) */
19 {EXYNOS5_GPX1, ACTIVE_LOW, gpio_get_value(GPIO_X12), "power"},
21 lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
24 int get_recovery_mode_switch(void)
26 uint64_t ec_events;
28 /* The GPIO is active low. */
29 if (!gpio_get_value(GPIO_X07)) // RECMODE_GPIO
30 return 1;
32 ec_events = google_chromeec_get_events_b();
33 return !!(ec_events &
34 EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY));
37 int get_write_protect_state(void)
39 return !gpio_get_value(GPIO_X30);
42 int get_ec_is_trusted(void)
44 /* EC is trusted if not in RW. */
45 return !gpio_get_value(GPIO_X23);