diff options
author | Wai-Hong Tam <waihong@google.com> | 2021-09-15 16:57:06 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-16 23:02:46 +0000 |
commit | ac36a80c3206c55d365804f561cc89ab1550e99f (patch) | |
tree | 073ccc519196c923c061501704e8e0fc885125c0 /baseboard | |
parent | e740b27b1dc5b8065b9c618950823c3054ea2bb0 (diff) | |
download | chrome-ec-ac36a80c3206c55d365804f561cc89ab1550e99f.tar.gz |
herobrine: Always enable the 5V rail
Prepare the next hardware revision. It has a PPC chip which requires 5V
rail in S5. The 5V rail enable pin should be turned on whenever the
EC is powered.
Since the existing 5V rail enabling is done inside the qcom power
sequence. Trogdor and Herobrine both shares this qcom power sequence.
For Trogdor, this CL moves the 5V rail enabling from the qcom power
sequence to the board level hook.
For Herobrine, this CL updates the GPIO name and modifies the default
level to HIGH. The CONFIG of 5V control should be disabled. As no board
level hook to modify the 5V rail, the 5V is always on.
BRANCH=None
BUG=b:199804198
TEST=Booted both Zephyr and EC-OS images on Herobrine. Checked the 5V
rail is enabled in S0 and S5.
TEST=Booted both Zephyr and EC-OS images on Lazor. Checked the 5V rail
is enabled in S0 and disabled in S5.
Change-Id: Ifa98ee0c4e970dd89952e94cc6a0e289798e6a57
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3163918
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r-- | baseboard/herobrine/baseboard.h | 1 | ||||
-rw-r--r-- | baseboard/trogdor/power.c | 16 |
2 files changed, 16 insertions, 1 deletions
diff --git a/baseboard/herobrine/baseboard.h b/baseboard/herobrine/baseboard.h index 8b014a4e77..108f7f8cf5 100644 --- a/baseboard/herobrine/baseboard.h +++ b/baseboard/herobrine/baseboard.h @@ -153,7 +153,6 @@ #define CONFIG_CHIPSET_RESET_HOOK #define CONFIG_CHIPSET_RESUME_INIT_HOOK #define CONFIG_POWER_COMMON -#define CONFIG_POWER_PP5000_CONTROL #define CONFIG_POWER_TRACK_HOST_SLEEP_STATE #define CONFIG_POWER_SLEEP_FAILURE_DETECTION #define CONFIG_CMD_AP_RESET_LOG diff --git a/baseboard/trogdor/power.c b/baseboard/trogdor/power.c index 0a55b49d3d..b539539c98 100644 --- a/baseboard/trogdor/power.c +++ b/baseboard/trogdor/power.c @@ -5,16 +5,32 @@ #include "gpio.h" #include "hooks.h" +#include "power.h" +#include "task.h" void board_chipset_pre_init(void) { /* Turn on the 3.3V rail */ gpio_set_level(GPIO_EN_PP3300_A, 1); + + /* Turn on the 5V rail. */ +#ifdef CONFIG_POWER_PP5000_CONTROL + power_5v_enable(task_get_current(), 1); +#else /* !defined(CONFIG_POWER_PP5000_CONTROL) */ + gpio_set_level(GPIO_EN_PP5000, 1); +#endif /* defined(CONFIG_POWER_PP5000_CONTROL) */ } DECLARE_HOOK(HOOK_CHIPSET_PRE_INIT, board_chipset_pre_init, HOOK_PRIO_DEFAULT); void board_chipset_shutdown_complete(void) { + /* Turn off the 5V rail. */ +#ifdef CONFIG_POWER_PP5000_CONTROL + power_5v_enable(task_get_current(), 0); +#else /* !defined(CONFIG_POWER_PP5000_CONTROL) */ + gpio_set_level(GPIO_EN_PP5000, 0); +#endif /* defined(CONFIG_POWER_PP5000_CONTROL) */ + /* Turn off the 3.3V and 5V rails. */ gpio_set_level(GPIO_EN_PP3300_A, 0); } |