mb/google/poppy: Add support for variant SKU romstage GPIO configs
Add functionality that allows a variant SKU to have a specific set of
GPIO configs in romstage (modeled after the existing one in
ramstage)
BUG=b:245954151
TEST=builds
Change-Id: I593a23951306908fadc00e6bc8d9d310f09c5e4b
Signed-off-by: Tarun Tuli <taruntuli@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73211
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Shelley Chen <shchen@google.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
diff --git a/src/mainboard/google/poppy/romstage.c b/src/mainboard/google/poppy/romstage.c
index 7fd4409..f73ca5f 100644
--- a/src/mainboard/google/poppy/romstage.c
+++ b/src/mainboard/google/poppy/romstage.c
@@ -140,6 +140,8 @@
pads = variant_romstage_gpio_table(&num);
gpio_configure_pads(pads, num);
+ pads = variant_romstage_sku_gpio_table(&num);
+ gpio_configure_pads(pads, num);
memset(&p, 0, sizeof(p));
variant_memory_params(&p);
diff --git a/src/mainboard/google/poppy/variants/baseboard/gpio.c b/src/mainboard/google/poppy/variants/baseboard/gpio.c
index 9048e29..ee2b1dc 100644
--- a/src/mainboard/google/poppy/variants/baseboard/gpio.c
+++ b/src/mainboard/google/poppy/variants/baseboard/gpio.c
@@ -383,6 +383,13 @@
return NULL;
}
+const struct pad_config * __weak
+ variant_romstage_sku_gpio_table(size_t *num)
+{
+ *num = 0;
+ return NULL;
+}
+
static const struct cros_gpio cros_gpios[] = {
CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL, CROS_GPIO_DEVICE_NAME),
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_DEVICE_NAME),
diff --git a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
index 9e4bfc5..603a2ba 100644
--- a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
@@ -21,6 +21,7 @@
/* Config gpio by different sku id */
const struct pad_config *variant_sku_gpio_table(size_t *num);
+const struct pad_config *variant_romstage_sku_gpio_table(size_t *num);
enum memory_type {
MEMORY_LPDDR3,