diff options
author | Nick Vaccaro <nvaccaro@google.com> | 2021-02-16 19:06:16 -0800 |
---|---|---|
committer | Nick Vaccaro <nvaccaro@google.com> | 2021-03-05 04:28:36 +0000 |
commit | 2f78ce0995a6dd0630802a918438c4d3b1c328fc (patch) | |
tree | d4fce211c6f5e4f34daf0bbe7c5de58468d74fc5 /src/mainboard/google/volteer/variants/eldrid | |
parent | 29144554fb1e258f5a6bce86c5c2d75620039dd2 (diff) | |
download | coreboot-2f78ce0995a6dd0630802a918438c4d3b1c328fc.tar.gz coreboot-2f78ce0995a6dd0630802a918438c4d3b1c328fc.tar.bz2 coreboot-2f78ce0995a6dd0630802a918438c4d3b1c328fc.zip |
mb/google/volteer: Fix FPMCU pwr/rst gpio handling
1. No gpio control in bootblock
2. Power on and then deassert reset at the end of ramstage gpio
3. 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 #3 and wrapping
around to #2.
This change affects the following volteer variants that include an FPMCU:
1. Drobit
2. Eldrid
3. Elemi
4. Halvor
5. Malefor
6. Terrador
7. Trondo
8. Voema
9. Volteer2
10. Voxel
BUG=b:178094376
TEST=none
Change-Id: Ib51815349cea299907c10d6c56c27bd239e499e7
Signed-off-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50828
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/mainboard/google/volteer/variants/eldrid')
3 files changed, 38 insertions, 4 deletions
diff --git a/src/mainboard/google/volteer/variants/eldrid/Makefile.inc b/src/mainboard/google/volteer/variants/eldrid/Makefile.inc index 343c7dbb954b..3454eec9654c 100644 --- a/src/mainboard/google/volteer/variants/eldrid/Makefile.inc +++ b/src/mainboard/google/volteer/variants/eldrid/Makefile.inc @@ -5,3 +5,4 @@ romstage-y += memory.c bootblock-y += gpio.c ramstage-y += gpio.c +ramstage-y += ramstage.c diff --git a/src/mainboard/google/volteer/variants/eldrid/gpio.c b/src/mainboard/google/volteer/variants/eldrid/gpio.c index 6810ba50b6cb..8712f9cc6f06 100644 --- a/src/mainboard/google/volteer/variants/eldrid/gpio.c +++ b/src/mainboard/google/volteer/variants/eldrid/gpio.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ +#include <acpi/acpi.h> #include <baseboard/gpio.h> #include <baseboard/variants.h> #include <commonlib/helpers.h> @@ -18,8 +19,6 @@ static const struct pad_config override_gpio_table[] = { PAD_NC(GPP_A15, NONE), /* A16 : USB_OC3# ==> USB_C0_OC_ODL */ PAD_CFG_NF(GPP_A16, NONE, DEEP, NF1), - /* A21 : DDPC_CTRCLK ==> EN_FP_PWR */ - PAD_CFG_GPO(GPP_A21, 1, DEEP), /* A23 : I2S1_SCLK ==> I2S1_SPKR_SCLK */ PAD_CFG_NF(GPP_A23, NONE, DEEP, NF1), @@ -59,8 +58,6 @@ static const struct pad_config override_gpio_table[] = { PAD_CFG_GPI_INT(GPP_C20, NONE, PLTRST, LEVEL), /* C22 : UART2_RTS# ==> PCH_FPMCU_BOOT0 */ PAD_CFG_GPO(GPP_C22, 0, DEEP), - /* C23 : UART2_CTS# ==> FPMCU_RST_ODL */ - PAD_CFG_GPO(GPP_C23, 1, DEEP), /* D4 : IMGCLKOUT0# ==> CAMMERA_SWITCH */ PAD_CFG_GPI_INT(GPP_D4, NONE, PLTRST, EDGE_BOTH), @@ -219,3 +216,19 @@ const struct pad_config *variant_early_gpio_table(size_t *num) *num = ARRAY_SIZE(early_gpio_table); return early_gpio_table; } + +/* GPIO settings before entering S5 */ +static const struct pad_config s5_sleep_gpio_table[] = { + PAD_CFG_GPO(GPP_C23, 0, DEEP), /* FPMCU_RST_ODL */ + PAD_CFG_GPO(GPP_A21, 0, DEEP), /* EN_FP_PWR */ +}; + +const struct pad_config *variant_sleep_gpio_table(u8 slp_typ, size_t *num) +{ + if (slp_typ == ACPI_S5) { + *num = ARRAY_SIZE(s5_sleep_gpio_table); + return s5_sleep_gpio_table; + } + *num = 0; + return NULL; +} diff --git a/src/mainboard/google/volteer/variants/eldrid/ramstage.c b/src/mainboard/google/volteer/variants/eldrid/ramstage.c new file mode 100644 index 000000000000..b19899282421 --- /dev/null +++ b/src/mainboard/google/volteer/variants/eldrid/ramstage.c @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <delay.h> +#include <gpio.h> +#include <baseboard/variants.h> +#include <soc/gpio.h> + +void variant_ramstage_init(void) +{ + /* + * Assert FPMCU reset and enable power to FPMCU, + * wait for power rail to stabilize, + * and then deassert FPMCU reset. + * Waiting for the power rail to stabilize can take a while. + */ + gpio_output(GPP_C23, 0); + gpio_output(GPP_A21, 1); + mdelay(1); + gpio_output(GPP_C23, 1); +} |