aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/hatch/variants/baseboard
diff options
context:
space:
mode:
authorCraig Hesling <hesling@chromium.org>2019-11-27 11:50:47 -0800
committerShelley Chen <shchen@google.com>2019-12-05 21:27:42 +0000
commitfcd8c9e99e7f70e2b9494f2fa28a08ba13126daa (patch)
treea790a0ea2baceebe2bf83015cbd39d5112e9e781 /src/mainboard/google/hatch/variants/baseboard
parent344b331783a3c315ed6d34cbe980cd08c12e3574 (diff)
hatch: Fix FPMCU pwr/rst gpio handling
1. No gpio control in bootblock 2. Disable power and assert reset in ramstage gpio 3. Power on and then deassert reset at the end of ramstage gpio 4. Disable power and assert reset when entering S5 On "reboot", the amount of time the power is disabled for is equivalent to the amount of time between triggering #4 and wrapping around to #3, which is about 400ms on Kohaku. Since #2 forces power off for FPMCU, S3 resume will still not work properly. Additionally, we must ensure that GPP_A12 is reconfigured as an output before going to any sleep state, since user space could have configured it to use its native3 function. See https://review.coreboot.org/c/coreboot/+/32111 for more detail. The control signals have been validated on a Kohaku in the following scenarios: 1. Cold startup 2. Issuing a "reboot" command 3. Issuing a "halt -p" and powering back on within 10 seconds 4. Issuing a "halt -p" and powering back on after 10 seconds 5. Entering and leaving S3 (does not work properly) 6. Entering and leaving S0iX BRANCH=hatch BUG=b/142751685 TEST=Verify all signals as mentioned above TEST=reboot flash_fp_mcu /opt/google/biod/fw/dartmonkey_v2.0.2417-af88cc91a.bin TEST=halt -p # power back on within 10 seconds flash_fp_mcu /opt/google/biod/fw/dartmonkey_v2.0.2417-af88cc91a.bin TEST=halt -p # power back on after 10 seconds flash_fp_mcu /opt/google/biod/fw/dartmonkey_v2.0.2417-af88cc91a.bin Change-Id: I2e3ff42715611d519677a4256bdd172ec98687f9 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37459 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/mainboard/google/hatch/variants/baseboard')
-rw-r--r--src/mainboard/google/hatch/variants/baseboard/gpio.c15
-rw-r--r--src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h3
2 files changed, 12 insertions, 6 deletions
diff --git a/src/mainboard/google/hatch/variants/baseboard/gpio.c b/src/mainboard/google/hatch/variants/baseboard/gpio.c
index 598600bda3..94cb2e53a2 100644
--- a/src/mainboard/google/hatch/variants/baseboard/gpio.c
+++ b/src/mainboard/google/hatch/variants/baseboard/gpio.c
@@ -38,7 +38,7 @@ static const struct pad_config gpio_table[] = {
/* A11 : PCH_SPI_FPMCU_CS_L */
PAD_CFG_NF(GPP_A11, NONE, DEEP, NF2),
/* A12 : FPMCU_RST_ODL */
- PAD_CFG_GPO(GPP_A12, 1, DEEP),
+ PAD_CFG_GPO(GPP_A12, 0, DEEP),
/* A13 : SUSWARN_L */
PAD_CFG_NF(GPP_A13, NONE, DEEP, NF1),
/* A14 : ESPI_RST_L */
@@ -133,7 +133,7 @@ static const struct pad_config gpio_table[] = {
/* C10 : GPP_10 ==> GPP_C10_TP */
PAD_NC(GPP_C10, NONE),
/* C11 : GPP_11 ==> EN_FP_RAILS */
- PAD_CFG_GPO(GPP_C11, 1, DEEP),
+ PAD_CFG_GPO(GPP_C11, 0, DEEP),
/* C12 : GPP_C12 ==> NC */
PAD_NC(GPP_C12, NONE),
/* C13 : EC_PCH_INT_L */
@@ -398,8 +398,10 @@ const struct pad_config *base_gpio_table(size_t *num)
}
/*
- * Default GPIO settings before entering sleep. Configure A12: FPMCU_RST_ODL
- * as GPO before entering sleep.
+ * Default GPIO settings before entering non-S5 sleep states.
+ * Configure A12: FPMCU_RST_ODL as GPO before entering sleep.
+ * This guarantees that A12's native3 function is disabled.
+ * See https://review.coreboot.org/c/coreboot/+/32111 .
*/
static const struct pad_config default_sleep_gpio_table[] = {
PAD_CFG_GPO(GPP_A12, 1, DEEP), /* FPMCU_RST_ODL */
@@ -408,10 +410,11 @@ static const struct pad_config default_sleep_gpio_table[] = {
/*
* GPIO settings before entering S5, which are same as
* default_sleep_gpio_table but also,
- * turn off EN_PP3300_WWAN.
+ * turn off EN_PP3300_WWAN and FPMCU.
*/
static const struct pad_config s5_sleep_gpio_table[] = {
- PAD_CFG_GPO(GPP_A12, 1, DEEP), /* FPMCU_RST_ODL */
+ PAD_CFG_GPO(GPP_A12, 0, DEEP), /* FPMCU_RST_ODL */
+ PAD_CFG_GPO(GPP_C11, 0, DEEP), /* PCH_FP_PWR_EN */
PAD_CFG_GPO(GPP_A18, 0, DEEP), /* EN_PP3300_WWAN */
};
diff --git a/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h
index 920e428484..1542d9bc54 100644
--- a/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/hatch/variants/baseboard/include/baseboard/variants.h
@@ -50,4 +50,7 @@ uint32_t get_board_sku(void);
/* Modify devictree settings during ramstage. */
void variant_devtree_update(void);
+/* Perform variant specific initialization early on in ramstage. */
+void variant_ramstage_init(void);
+
#endif /* BASEBOARD_VARIANTS_H */