From 19b8edade10b5d0423a1439b1a610d7e89161b7a Mon Sep 17 00:00:00 2001 From: Mike Lee Date: Tue, 9 Mar 2021 23:13:16 +0800 Subject: Blipper: Add GPIO_EC_ENTERING_RW2 This commit adds a new GPIO, GPIO_EC_ENTERING_RW2 which does the same thing as GPIO_EC_ENTERING_RW. However, it's on a pin that's more well behaved around init time. This commit also overrides the board_pulse_ec_entering_rw() function such that both lines can be pulsed. BUG=b:182063215 BRANCH=dedede TEST=Build and flash blipper, verify it boots. Signed-off-by: Mike Lee Change-Id: If15afb6058c5019f05c13be23fa624226330168b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2745183 Reviewed-by: Aseda Aboagye Commit-Queue: Aseda Aboagye --- board/blipper/board.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'board/blipper/board.c') diff --git a/board/blipper/board.c b/board/blipper/board.c index 78ffaa8f5b..5cb2390474 100644 --- a/board/blipper/board.c +++ b/board/blipper/board.c @@ -198,6 +198,21 @@ void board_init(void) } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); +__override void board_pulse_entering_rw(void) +{ + /* + * On the ITE variants, the EC_ENTERING_RW signal was connected to a pin + * which is active high by default. This causes Cr50 to think that the + * EC has jumped to its RW image even though this may not be the case. + * The pin is changed to GPIO_EC_ENTERING_RW2. + */ + gpio_set_level(GPIO_EC_ENTERING_RW, 1); + gpio_set_level(GPIO_EC_ENTERING_RW2, 1); + usleep(MSEC); + gpio_set_level(GPIO_EC_ENTERING_RW, 0); + gpio_set_level(GPIO_EC_ENTERING_RW2, 0); +} + void board_reset_pd_mcu(void) { /* -- cgit v1.2.1