Debian Codegraph @

src/mainboard/google/cyan/chromeos.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <bootmode.h>
4 #include <boot/coreboot_tables.h>
5 #include <device/mmio.h>
6 #include <gpio.h>
7 #include <types.h>
8 #include <vendorcode/google/chromeos/chromeos.h>
9
10 #include "onboard.h"
11
12 void fill_lb_gpios(struct lb_gpios *gpios)
13 {
14 struct lb_gpio chromeos_gpios[] = {
15 {-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
16 {-1, ACTIVE_HIGH, 0, "power"},
17 {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
18 };
19 lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
20 }
21
22 int get_write_protect_state(void)
23 {
24 return !!gpio_get(WP_GPIO);
25 }
26
27 static const struct cros_gpio cros_gpios[] = {
28 CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
29 CROS_GPIO_WP_AH(0x10013, CROS_GPIO_DEVICE_NAME),
30 };
31 DECLARE_CROS_GPIOS(cros_gpios);
32
33 int get_ec_is_trusted(void)
34 {
35 /* Do not have a Chrome EC involved in entering recovery mode;
36 Always return trusted. */
37 return 1;
38 }