| 1 |
|
| 2 |
|
| 3 |
#include <bootmode.h> |
| 4 |
#include <boot/coreboot_tables.h> |
| 5 |
#include <soc/gpio.h> |
| 6 |
#include <types.h> |
| 7 |
#include <vendorcode/google/chromeos/chromeos.h> |
| 8 |
|
| 9 |
|
| 10 |
#define WP_STATUS_PAD 36 |
| 11 |
|
| 12 |
|
| 13 |
#define EC_IN_RW_PAD 59 |
| 14 |
|
| 15 |
void fill_lb_gpios(struct lb_gpios *gpios) |
| 16 |
{ |
| 17 |
struct lb_gpio chromeos_gpios[] = { |
| 18 |
{-1, ACTIVE_HIGH, get_lid_switch(), "lid"}, |
| 19 |
{-1, ACTIVE_HIGH, 0, "power"}, |
| 20 |
{-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"}, |
| 21 |
}; |
| 22 |
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios)); |
| 23 |
} |
| 24 |
|
| 25 |
int get_write_protect_state(void) |
| 26 |
{ |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
if (ENV_ROMSTAGE_OR_BEFORE) |
| 35 |
ssus_disable_internal_pull(WP_STATUS_PAD); |
| 36 |
|
| 37 |
|
| 38 |
return ssus_get_gpio(WP_STATUS_PAD); |
| 39 |
} |
| 40 |
|
| 41 |
static const struct cros_gpio cros_gpios[] = { |
| 42 |
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME), |
| 43 |
CROS_GPIO_WP_AH(0x2006, CROS_GPIO_DEVICE_NAME), |
| 44 |
}; |
| 45 |
DECLARE_CROS_GPIOS(cros_gpios); |
| 46 |
|
| 47 |
int get_ec_is_trusted(void) |
| 48 |
{ |
| 49 |
|
| 50 |
return !score_get_gpio(EC_IN_RW_PAD); |
| 51 |
} |