Eric Lai | 366fba2 | 2022-05-24 09:25:57 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
| 3 | #include <baseboard/gpio.h> |
| 4 | #include <bootmode.h> |
| 5 | #include <boot/coreboot_tables.h> |
| 6 | #include <gpio.h> |
| 7 | #include <types.h> |
| 8 | |
| 9 | void fill_lb_gpios(struct lb_gpios *gpios) |
| 10 | { |
| 11 | struct lb_gpio chromeos_gpios[] = { |
Subrata Banik | 3ff6b2f | 2023-09-07 12:57:42 +0000 | [diff] [blame] | 12 | #if CONFIG(VBOOT_LID_SWITCH) |
Eric Lai | 366fba2 | 2022-05-24 09:25:57 +0800 | [diff] [blame] | 13 | {-1, ACTIVE_HIGH, get_lid_switch(), "lid"}, |
Subrata Banik | 3ff6b2f | 2023-09-07 12:57:42 +0000 | [diff] [blame] | 14 | #else |
| 15 | /* fake LID open to avoid shutdown in depthcharge */ |
| 16 | {-1, ACTIVE_HIGH, 1, "lid"}, |
| 17 | #endif |
Eric Lai | 366fba2 | 2022-05-24 09:25:57 +0800 | [diff] [blame] | 18 | {-1, ACTIVE_HIGH, 0, "power"}, |
| 19 | {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"}, |
Kapil Porwal | 4060860 | 2022-08-30 11:54:45 +0000 | [diff] [blame] | 20 | {-1, ACTIVE_HIGH, 0, "EC in RW"}, |
Eric Lai | 366fba2 | 2022-05-24 09:25:57 +0800 | [diff] [blame] | 21 | }; |
| 22 | lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios)); |
| 23 | } |
| 24 | |
| 25 | int get_write_protect_state(void) |
| 26 | { |
| 27 | return gpio_get(GPIO_PCH_WP); |
| 28 | } |
| 29 | |
| 30 | int get_ec_is_trusted(void) |
| 31 | { |
Kapil Porwal | 4060860 | 2022-08-30 11:54:45 +0000 | [diff] [blame] | 32 | /* VB2_CONTEXT_EC_TRUSTED should be set according to the Ti50 boot mode. */ |
| 33 | return 0; |
Eric Lai | 366fba2 | 2022-05-24 09:25:57 +0800 | [diff] [blame] | 34 | } |