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 | |
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>
-rw-r--r-- | baseboard/herobrine/baseboard.h | 1 | ||||
-rw-r--r-- | baseboard/trogdor/power.c | 16 | ||||
-rw-r--r-- | board/herobrine_npcx9/board.h | 2 | ||||
-rw-r--r-- | board/herobrine_npcx9/gpio.inc | 2 | ||||
-rw-r--r-- | power/qcom.c | 14 | ||||
-rw-r--r-- | zephyr/projects/herobrine/herobrine_npcx9/gpio.dts | 6 | ||||
-rw-r--r-- | zephyr/projects/herobrine/herobrine_npcx9/prj.conf | 1 |
7 files changed, 22 insertions, 20 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); } diff --git a/board/herobrine_npcx9/board.h b/board/herobrine_npcx9/board.h index 09c4697672..e0ca39fac0 100644 --- a/board/herobrine_npcx9/board.h +++ b/board/herobrine_npcx9/board.h @@ -68,7 +68,7 @@ #define GPIO_WP_L GPIO_EC_WP_ODL #define GPIO_SWITCHCAP_PG GPIO_SRC_VPH_PWR_PG #define GPIO_ACOK_OD GPIO_CHG_ACOK_OD -#define GPIO_EN_PP5000 GPIO_EN_PP5000_S3 +#define GPIO_EN_PP5000 GPIO_EN_PP5000_S5 #define GPIO_POWER_GOOD GPIO_MB_POWER_GOOD #define GPIO_EC_INT_L GPIO_AP_EC_INT_L #define GPIO_DP_HOT_PLUG_DET GPIO_DP_HOT_PLUG_DET_R diff --git a/board/herobrine_npcx9/gpio.inc b/board/herobrine_npcx9/gpio.inc index 9e1b9b67d3..239bedd95d 100644 --- a/board/herobrine_npcx9/gpio.inc +++ b/board/herobrine_npcx9/gpio.inc @@ -52,7 +52,7 @@ GPIO(AP_EC_INT_L, PIN(5, 6), GPIO_ODR_HIGH) /* Interrupt line between /* Power enables */ GPIO(SWITCHCAP_ON, PIN(D, 5), GPIO_OUT_LOW) /* Enable switch cap */ -GPIO(EN_PP5000_S3, PIN(7, 3), GPIO_OUT_LOW) /* Enable PP5000 */ +GPIO(EN_PP5000_S5, PIN(7, 3), GPIO_OUT_HIGH) /* Enable PP5000 */ GPIO(EC_BL_DISABLE_L, PIN(B, 6), GPIO_OUT_LOW) /* Backlight disable signal from EC */ /* Sensors */ diff --git a/power/qcom.c b/power/qcom.c index e2b0ff3fd5..e18e9da165 100644 --- a/power/qcom.c +++ b/power/qcom.c @@ -619,13 +619,6 @@ static void power_off(void) set_system_power(0); } - /* 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) */ - lid_opened = 0; } @@ -661,13 +654,6 @@ static int power_on(void) { int ret; - /* Enable 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) */ - ret = set_system_power(1); if (ret != EC_SUCCESS) return ret; diff --git a/zephyr/projects/herobrine/herobrine_npcx9/gpio.dts b/zephyr/projects/herobrine/herobrine_npcx9/gpio.dts index 639fe30a3b..1f5052af04 100644 --- a/zephyr/projects/herobrine/herobrine_npcx9/gpio.dts +++ b/zephyr/projects/herobrine/herobrine_npcx9/gpio.dts @@ -157,10 +157,10 @@ enum-name = "GPIO_SWITCHCAP_ON"; label = "SWITCHCAP_ON"; }; - en_pp5000_s3 { - gpios = <&gpio7 3 GPIO_OUT_LOW>; + en_pp5000_s5 { + gpios = <&gpio7 3 GPIO_OUT_HIGH>; enum-name = "GPIO_EN_PP5000"; - label = "EN_PP5000_S3"; + label = "EN_PP5000_S5"; }; ec_bl_disable_l { gpios = <&gpiob 6 GPIO_OUT_LOW>; diff --git a/zephyr/projects/herobrine/herobrine_npcx9/prj.conf b/zephyr/projects/herobrine/herobrine_npcx9/prj.conf index 95f4005857..75a1e79702 100644 --- a/zephyr/projects/herobrine/herobrine_npcx9/prj.conf +++ b/zephyr/projects/herobrine/herobrine_npcx9/prj.conf @@ -45,6 +45,7 @@ CONFIG_PLATFORM_EC_BOARD_VERSION_GPIO=y # Power Sequencing CONFIG_PLATFORM_EC_POWERSEQ=y CONFIG_PLATFORM_EC_POWERSEQ_HOST_SLEEP=y +CONFIG_PLATFORM_EC_POWERSEQ_PP5000_CONTROL=n CONFIG_PLATFORM_EC_POWER_SLEEP_FAILURE_DETECTION=y CONFIG_PLATFORM_EC_CHIPSET_RESET_HOOK=y CONFIG_PLATFORM_EC_CHIPSET_RESUME_INIT_HOOK=y |