From 1efb6e84b7e048c0ccbd8f6ae3a2610585ca90bd Mon Sep 17 00:00:00 2001 From: Jon Murphy Date: Thu, 1 Aug 2024 21:02:47 -0600 Subject: mb/google/hatch/var/dratini: Add FP enable Add FP enable/disable based on SKU ID for Dratini. This is meant to resolve a UMA issue with Dratini devices that had the FPMCU populated on non-fp devices. Since the FPMCU is present, and the firmware enables the power GPIO's based on variant, not SKU, the devices were reporting data on fingerprint errantly. BUG=b:354769653 BUG=b:200825114 TEST=Flash to Dratini, test FP. Disable test SKU, flash on Dratini, test FP. To test, run `ectool --name=cros_fp version` in the shell When enabled, the fpmcu fw version should be displayed. When disabled, an error should be displayed because the fpmcu is inaccessible. Change-Id: Ifc450f51b00b9c3b62268ce94884f5749a3e18c0 Signed-off-by: Jon Murphy Reviewed-on: https://review.coreboot.org/c/coreboot/+/83745 Tested-by: build bot (Jenkins) Reviewed-by: Martin L Roth Reviewed-by: Paul Menzel --- .../hatch/variants/dratini/include/variant/sku.h | 8 +++++ .../google/hatch/variants/dratini/ramstage.c | 34 ++++++++++++++++------ 2 files changed, 33 insertions(+), 9 deletions(-) (limited to 'src/mainboard/google/hatch/variants') diff --git a/src/mainboard/google/hatch/variants/dratini/include/variant/sku.h b/src/mainboard/google/hatch/variants/dratini/include/variant/sku.h index c44e0dbdbe..89f670821e 100644 --- a/src/mainboard/google/hatch/variants/dratini/include/variant/sku.h +++ b/src/mainboard/google/hatch/variants/dratini/include/variant/sku.h @@ -4,6 +4,14 @@ #define __MAINBOARD_SKU_H__ enum { + SKU_1_DRATINI = 1, + SKU_2_DRATINI = 2, + SKU_3_DRATINI = 3, + SKU_4_DRATINI = 4, + SKU_5_DRATINI = 5, + SKU_6_DRATINI = 6, + SKU_7_DRATINI = 7, + SKU_8_DRATINI = 8, SKU_21_DRAGONAIR = 21, SKU_22_DRAGONAIR = 22, SKU_23_DRAGONAIR = 23, diff --git a/src/mainboard/google/hatch/variants/dratini/ramstage.c b/src/mainboard/google/hatch/variants/dratini/ramstage.c index 240bcaeb93..302ef83c55 100644 --- a/src/mainboard/google/hatch/variants/dratini/ramstage.c +++ b/src/mainboard/google/hatch/variants/dratini/ramstage.c @@ -3,16 +3,32 @@ #include #include #include +#include +#include void variant_ramstage_init(void) { - /* - * 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, - * a minimum of 400us on Kohaku. - */ - gpio_output(GPP_C11, 1); - mdelay(4); - gpio_output(GPP_A12, 1); + uint32_t sku_id = google_chromeec_get_board_sku(); + + switch (sku_id) { + case SKU_2_DRATINI: + case SKU_4_DRATINI: + case SKU_6_DRATINI: + case SKU_8_DRATINI: + case SKU_21_DRAGONAIR: + case SKU_22_DRAGONAIR: + /* + * 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, + * a minimum of 400us on Kohaku. + */ + gpio_output(GPP_C11, 1); + mdelay(4); + gpio_output(GPP_A12, 1); + break; + default: + /* SKU does not have FP Sensor, do not enable FPMCU */ + break; + } } -- cgit v1.2.3