diff options
-rw-r--r-- | board/cr50/board.c | 18 | ||||
-rw-r--r-- | board/cr50/gpio.inc | 5 | ||||
-rw-r--r-- | include/system.h | 2 |
3 files changed, 19 insertions, 6 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index 83d8957e5b..fc0b87dc69 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -193,9 +193,17 @@ static void init_runlevel(const enum permission_level desired_level) } } +static void configure_board_specific_gpios(void) +{ + /* Add a pullup to sys_rst_l */ + if (system_get_board_properties() & BOARD_NEEDS_SYS_RST_PULL_UP) + GWRITE_FIELD(PINMUX, DIOM0_CTL, PU, 1); +} + /* Initialize board. */ static void board_init(void) { + configure_board_specific_gpios(); init_pmu(); init_interrupts(); init_trng(); @@ -551,10 +559,16 @@ void system_init_board_properties(void) properties = 0; /* Read DIOA1 strap pin */ - if (gpio_get_level(GPIO_STRAP0)) + if (gpio_get_level(GPIO_STRAP0)) { /* Strap is pulled high -> Kevin SPI TPM option */ properties |= BOARD_SLAVE_CONFIG_SPI; - else { + /* Add an internal pull up on sys_rst_l */ + /* + * TODO(crosbug.com/p/54059): Remove once SYS_RST_L can + * be pulled up externally. + */ + properties |= BOARD_NEEDS_SYS_RST_PULL_UP; + } else { /* Strap is low -> Reef I2C TPM option */ properties |= BOARD_SLAVE_CONFIG_I2C; /* One PHY is connected to the AP */ diff --git a/board/cr50/gpio.inc b/board/cr50/gpio.inc index e68124d561..454fe729bc 100644 --- a/board/cr50/gpio.inc +++ b/board/cr50/gpio.inc @@ -11,11 +11,8 @@ * We can assert SYS_RST_L but so can the EC, so we need react if it's pulled * low. The ARM core can't trigger an interrupt if it's driving it as an output * so we attach two internal GPIOs to the same pad. - * TODO: Remove this internal pullup at some point. It's only here so that - * boards that don't have an external pullup don't trigger due to noise. */ -GPIO_INT(SYS_RST_L_IN, PIN(1, 0), GPIO_INT_FALLING | GPIO_PULL_UP, - sys_rst_asserted) +GPIO_INT(SYS_RST_L_IN, PIN(1, 0), GPIO_INT_FALLING, sys_rst_asserted) GPIO_INT(AP_ON, PIN(1, 1), GPIO_INT_RISING, device_state_on) GPIO_INT(EC_ON, PIN(1, 2), GPIO_INT_RISING, device_state_on) GPIO_INT(SERVO_UART1_ON, PIN(1, 3), GPIO_INT_RISING | GPIO_PULL_DOWN, diff --git a/include/system.h b/include/system.h index 5bca2c6321..12f771df8d 100644 --- a/include/system.h +++ b/include/system.h @@ -478,6 +478,8 @@ void system_clear_retry_counter(void); #define BOARD_DISABLE_UART0_RX (1 << 3) /* Disable UART0 RX */ #define BOARD_MARK_UPDATE_ON_USB_REQ (1 << 4) /* update is good once the */ /* controller gets a request */ +/* TODO(crosbug.com/p/54059): Remove when sys_rst_l has an external pullup */ +#define BOARD_NEEDS_SYS_RST_PULL_UP (1 << 5) /* Add a pullup to sys_rst_l */ /** * Get board properites |