diff options
author | Scott Collyer <scollyer@google.com> | 2020-05-22 12:30:57 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-29 01:53:53 +0000 |
commit | c536b8d03a72d03ee126ab56e5b032287c7f8f2e (patch) | |
tree | 75120ba536197abcbfb5801f2a8e8cd17ed00481 /board/gingerbread | |
parent | ed596967eefda1eecc1044efb60a600af5779f6b (diff) | |
download | chrome-ec-c536b8d03a72d03ee126ab56e5b032287c7f8f2e.tar.gz |
quiche: Add power sequencing
This CL adds a function in baseboard that will sequence through a list
of gpio controlled power rails and chip resets. The table includes a
delay prior to executing the next entry. The table is intended to be
in board.c as the rails and delays can very much be board specific.
BUG=b:167430750
BRANCH=None
TEST=Verified that power rails come up and status LED is on.
Signed-off-by: Scott Collyer <scollyer@google.com>
Change-Id: I830dee9eb28d4648d274d8cbc49b6972cd70dba5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2213837
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'board/gingerbread')
-rw-r--r-- | board/gingerbread/board.c | 33 | ||||
-rw-r--r-- | board/gingerbread/gpio.inc | 50 |
2 files changed, 67 insertions, 16 deletions
diff --git a/board/gingerbread/board.c b/board/gingerbread/board.c index 58134eaa4d..00e7eedc2e 100644 --- a/board/gingerbread/board.c +++ b/board/gingerbread/board.c @@ -16,6 +16,39 @@ #include "gpio_list.h" /* Must come after other header files. */ +/* + * Table GPIO signals control both power rails and reset lines to various chips + * on the board. The order the signals are changed and the delay between GPIO + * signals is driven by USB/MST hub power sequencing requirements. + */ +const struct power_seq board_power_seq[] = { + {GPIO_EN_AC_JACK, 1, 20}, + {GPIO_EN_PP5000_A, 1, 31}, + {GPIO_EN_PP3300_A, 1, 35}, + {GPIO_STATUS_LED1, 0, 100}, + {GPIO_EN_BB, 1, 30}, + {GPIO_EN_PP1100_A, 1, 30}, + {GPIO_EN_PP1000_A, 1, 20}, + {GPIO_EN_PP1050_A, 1, 30}, + {GPIO_EN_PP1200_A, 1, 20}, + {GPIO_EN_PP5000_HSPORT, 1, 31}, + {GPIO_EN_DP_SINK, 1, 80}, + {GPIO_MST_LP_CTL_L, 1, 80}, + {GPIO_MST_RST_L, 1, 41}, + {GPIO_EC_HUB1_RESET_L, 1, 41}, + {GPIO_EC_HUB2_RESET_L, 1, 33}, + {GPIO_USBC_DP_PD_RST_L, 1, 100}, + {GPIO_USBC_UF_RESET_L, 1, 33}, + {GPIO_DEMUX_DUAL_DP_PD_N, 1, 100}, + {GPIO_DEMUX_DUAL_DP_RESET_N, 1, 100}, + {GPIO_DEMUX_DP_HDMI_PD_N, 1, 10}, + {GPIO_DEMUX_DUAL_DP_MODE, 1, 10}, + {GPIO_DEMUX_DP_HDMI_MODE, 1, 1}, + {GPIO_STATUS_LED2, 0, 100}, +}; + +const size_t board_power_seq_count = ARRAY_SIZE(board_power_seq); + static void board_init(void) { /* TODO */ diff --git a/board/gingerbread/gpio.inc b/board/gingerbread/gpio.inc index ab65d71374..90064bfdff 100644 --- a/board/gingerbread/gpio.inc +++ b/board/gingerbread/gpio.inc @@ -8,26 +8,44 @@ /* Declare symbolic names for all the GPIOs that we care about. * Note: Those with interrupt handlers must be declared first. */ -/* Wake Source interrupts */ -/* TODO(b/148624000): Change this pin assignment once schematics are final */ -GPIO_INT(EC_WP_L, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt) - /* Power sequencing interrupts */ - -/* Sensor Interrupts */ - -/* USB-C interrupts */ - -/* HDMI interrupts */ - -/* Volume button interrupts */ - -/* AP Signals */ - -/* USB and USBC Signals */ +GPIO(PWR_BTN, PIN(A, 0), GPIO_INPUT) +GPIO(EN_AC_JACK, PIN(A, 1), GPIO_OUT_LOW) +GPIO(EN_BB, PIN(C, 0), GPIO_OUT_LOW) +GPIO(EN_PP3300_A, PIN(C, 10), GPIO_OUT_LOW) +GPIO(EN_PP5000_A, PIN(C, 2), GPIO_OUT_LOW) +GPIO(EN_PP1200_A, PIN(C, 3), GPIO_OUT_LOW) +GPIO(EN_PP1100_A, PIN(C, 4), GPIO_OUT_LOW) +GPIO(EN_PP1000_A, PIN(C, 5), GPIO_OUT_LOW) +GPIO(EN_PP1050_A, PIN(C, 6), GPIO_OUT_LOW) +GPIO(EN_PP5000_HSPORT, PIN(C, 7), GPIO_OUT_LOW) +GPIO(STATUS_LED1, PIN(A, 2), GPIO_OUT_HIGH) +GPIO(STATUS_LED2, PIN(B, 12), GPIO_OUT_HIGH) + +/* MST Hub signals */ +GPIO(MST_LP_CTL_L, PIN(B, 9), GPIO_ODR_LOW) +GPIO(MST_RST_L, PIN(B, 3), GPIO_ODR_LOW) + +/* Display Demux signals */ +GPIO(DEMUX_DUAL_DP_MODE, PIN(D, 8), GPIO_OUT_LOW) +GPIO(DEMUX_DP_HDMI_MODE, PIN(D, 10), GPIO_OUT_LOW) +GPIO(DEMUX_DUAL_DP_RESET_N, PIN(B, 14), GPIO_ODR_HIGH) +GPIO(DEMUX_DUAL_DP_PD_N, PIN(D, 2), GPIO_ODR_HIGH) +GPIO(DEMUX_DP_HDMI_PD_N, PIN(D, 9), GPIO_ODR_HIGH) + +/* USBC Mux and Demux Signals */ +GPIO(EN_DP_SINK, PIN(B, 2), GPIO_OUT_LOW) +GPIO(DP_SINK_RESET, PIN(B, 1), GPIO_OUT_LOW) +GPIO(USBC_DP_PD_RST_L, PIN(C, 13), GPIO_ODR_LOW) +GPIO(USBC_UF_RESET_L, PIN(C, 11), GPIO_ODR_LOW) + +/* USB Hubs signals */ +GPIO(EC_HUB1_RESET_L, PIN(E, 13), GPIO_ODR_LOW) +GPIO(EC_HUB2_RESET_L, PIN(E, 14), GPIO_ODR_LOW) /* Misc Signals */ UNIMPLEMENTED(EC_ENTERING_RW) +UNIMPLEMENTED(EC_WP_L) /* UART */ |