Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47310 )
Change subject: mb/google/zork: Add finalize GPIO routine ......................................................................
mb/google/zork: Add finalize GPIO routine
The fingerprint GPIOs need to be brought out of reset at the end of coreboot's boot sequence. This routine allows that to happen.
BUG=b:171837716 TEST=Boot, verify fingerprint works BRANCH=Zork
Signed-off-by: Martin Roth martinroth@chromium.org Change-Id: I11d14de44caa370f06b8da1277c8d88a7b3437bb
Change-Id: Iee178cc98259b490424c600c2ea6e55a2095670e --- M src/mainboard/google/zork/mainboard.c M src/mainboard/google/zork/variants/baseboard/gpio_baseboard_dalboz.c M src/mainboard/google/zork/variants/baseboard/gpio_baseboard_trembyle.c M src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/zork/variants/berknip/gpio.c M src/mainboard/google/zork/variants/morphius/gpio.c 6 files changed, 62 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/47310/1
diff --git a/src/mainboard/google/zork/mainboard.c b/src/mainboard/google/zork/mainboard.c index 9503d37..15957af 100644 --- a/src/mainboard/google/zork/mainboard.c +++ b/src/mainboard/google/zork/mainboard.c @@ -247,12 +247,13 @@
gnvs = acpi_get_gnvs();
- if (gnvs) { gnvs->tmps = CTL_TDP_SENSOR_ID; gnvs->tcrt = CRITICAL_TEMPERATURE; gnvs->tpsv = PASSIVE_TEMPERATURE; } + + finalize_gpios(); }
struct chip_operations mainboard_ops = { diff --git a/src/mainboard/google/zork/variants/baseboard/gpio_baseboard_dalboz.c b/src/mainboard/google/zork/variants/baseboard/gpio_baseboard_dalboz.c index e538aef..d5f8ed4 100644 --- a/src/mainboard/google/zork/variants/baseboard/gpio_baseboard_dalboz.c +++ b/src/mainboard/google/zork/variants/baseboard/gpio_baseboard_dalboz.c @@ -291,6 +291,10 @@ wifi_power_reset_configure_pre_v3(); }
+const __weak void finalize_gpios(void) +{ +} + const __weak struct soc_amd_gpio *variant_poweron_gpio_table(size_t *size, int slp_typ) { *size = 0; diff --git a/src/mainboard/google/zork/variants/baseboard/gpio_baseboard_trembyle.c b/src/mainboard/google/zork/variants/baseboard/gpio_baseboard_trembyle.c index 74e7ed2..bf27622 100644 --- a/src/mainboard/google/zork/variants/baseboard/gpio_baseboard_trembyle.c +++ b/src/mainboard/google/zork/variants/baseboard/gpio_baseboard_trembyle.c @@ -297,6 +297,11 @@ wifi_power_reset_configure_pre_v3(); }
+ +__weak void finalize_gpios(void) +{ +} + static const struct soc_amd_gpio gpio_fingerprint_poweron_table[] = { /* FPMCU_RST_L */ PAD_GPO(GPIO_11, LOW), diff --git a/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h index 61c8b3c..643fe39 100644 --- a/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h @@ -39,6 +39,9 @@ /* Determine whether to init fingerprint sensor or not */ int variant_init_fingerprint(void);
+/* Program any required GPIOs at the finalize phase */ +void finalize_gpios(void); + /* Modify devictree settings during ramstage. */ void variant_devtree_update(void); /* Update audio configuration in devicetree during ramstage. */ diff --git a/src/mainboard/google/zork/variants/berknip/gpio.c b/src/mainboard/google/zork/variants/berknip/gpio.c index ae2d02a..a4d5a64 100644 --- a/src/mainboard/google/zork/variants/berknip/gpio.c +++ b/src/mainboard/google/zork/variants/berknip/gpio.c @@ -3,6 +3,7 @@ #include <baseboard/gpio.h> #include <baseboard/variants.h> #include <boardid.h> +#include <delay.h> #include <gpio.h> #include <soc/gpio.h> #include <ec/google/chromeec/ec.h> @@ -52,6 +53,29 @@ PAD_NC(GPIO_5), };
+void finalize_gpios(void) +{ + uint32_t board_version; + + if (variant_init_fingerprint()) { + + if (google_chromeec_cbi_get_board_version(&board_version)) + board_version = 1; + + /* Berknip board versions prior to v4 need an extra delay here */ + if (board_version <= 3) { + mdelay(550); + } + /* + * Enable the FPMCU by enabling EN_PWR_FP, then bringing it out + * of reset by setting FPMCU_RST_L high 3ms later. + */ + gpio_set(GPIO_32, 1); + mdelay(3); + gpio_set(GPIO_11, 1); + } +} + const struct soc_amd_gpio *variant_override_gpio_table(size_t *size) { uint32_t board_version; diff --git a/src/mainboard/google/zork/variants/morphius/gpio.c b/src/mainboard/google/zork/variants/morphius/gpio.c index 9b36e37..14211b2 100644 --- a/src/mainboard/google/zork/variants/morphius/gpio.c +++ b/src/mainboard/google/zork/variants/morphius/gpio.c @@ -3,6 +3,7 @@ #include <baseboard/gpio.h> #include <baseboard/variants.h> #include <boardid.h> +#include <delay.h> #include <gpio.h> #include <soc/gpio.h> #include <ec/google/chromeec/ec.h> @@ -86,3 +87,26 @@ *size = 0; return NULL; } + +/* Assume all SKUS have a fingerprint sensor */ + +void finalize_gpios(void) +{ + uint32_t board_version; + + if (google_chromeec_cbi_get_board_version(&board_version)) + board_version = 1; + + /* Morphius board versions prior to v5 need an extra delay here */ + if (board_version <= 4) { + mdelay(550); + } + /* + * Enable the FPMCU by enabling EN_PWR_FP, then bringing it out + * of reset by setting FPMCU_RST_L high 3ms later. + */ + gpio_set(GPIO_32, 1); + mdelay(3); + gpio_set(GPIO_11, 1); +} +