From 31fa74cf7d6d40f55bcc54b237e4e47d39024740 Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Tue, 6 Sep 2016 10:05:01 -0700 Subject: cr50: remove the pullup on sys_rst on kevin There is leakage on SYS_RST_ODL from the internal pullup cr50 has on DIOM0. This change removes the internal pullup on reef. On Kevin there is a bug preventing the EC from being able to pull sys_rst_l up high enoug for cr50 to detect that it is pulled high. This change adds an internal pullup back when cr50 detects that it is on a kevin or gru. BUG=chrome-os-partner:56945 BUG=chrome-os-partner:53544 BRANCH=none TEST=On gru and kevin remove servo verify when apreset is run on the EC it resets cr50 and the AP. Run pinmux and check that there is a pullup on diom0 on kevin but not on gru. Change-Id: Ica4f557745967b93e0bd9c8462916b1f735756ac Signed-off-by: Mary Ruthven Reviewed-on: https://chromium-review.googlesource.com/381322 Reviewed-by: Vadim Bendebury --- board/cr50/board.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'board/cr50/board.c') 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 */ -- cgit v1.2.1