summaryrefslogtreecommitdiff
path: root/src/mainboard/google/zork
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@amd.corp-partner.google.com>2022-11-11 16:14:33 -0600
committerEric Lai <eric_lai@quanta.corp-partner.google.com>2022-11-16 03:03:28 +0000
commitc429ee1d9764398fe9dbb3e34b03bd3bd6d95ed9 (patch)
treef32d69cba464773cd5226e2123cad76658a7e6db /src/mainboard/google/zork
parent150b809edf83d938b9dbb1bb94823b32393dd3fd (diff)
mg/google/zork: Add functionality to set GPIOs in romstage
Add (empty) baseboard GPIO tables, getter functions, and call to gpio_configure_pads() in romstage, in preparation for adding touchscreen GPIO configuration/power sequencing. Change-Id: If0f626dbc7e601c2f49759e49a0baf027bf25f96 Signed-off-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/69482 Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Diffstat (limited to 'src/mainboard/google/zork')
-rw-r--r--src/mainboard/google/zork/romstage.c10
-rw-r--r--src/mainboard/google/zork/variants/baseboard/gpio_baseboard_dalboz.c8
-rw-r--r--src/mainboard/google/zork/variants/baseboard/gpio_baseboard_trembyle.c8
-rw-r--r--src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h3
4 files changed, 29 insertions, 0 deletions
diff --git a/src/mainboard/google/zork/romstage.c b/src/mainboard/google/zork/romstage.c
index f72789a3e0..9c709745b6 100644
--- a/src/mainboard/google/zork/romstage.c
+++ b/src/mainboard/google/zork/romstage.c
@@ -2,6 +2,7 @@
#include <baseboard/variants.h>
#include <soc/fsp.h>
+#include <soc/platform_descriptors.h>
void __weak variant_updm_update(FSP_M_CONFIG *mcfg) {}
@@ -9,3 +10,12 @@ void mainboard_updm_update(FSP_M_CONFIG *mcfg)
{
variant_updm_update(mcfg);
}
+
+void mb_pre_fspm(void)
+{
+ const struct soc_amd_gpio *gpios;
+ size_t num_gpios;
+
+ gpios = baseboard_romstage_gpio_table(&num_gpios);
+ gpio_configure_pads(gpios, num_gpios);
+}
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 70e456ccb5..3953a92e2d 100644
--- a/src/mainboard/google/zork/variants/baseboard/gpio_baseboard_dalboz.c
+++ b/src/mainboard/google/zork/variants/baseboard/gpio_baseboard_dalboz.c
@@ -353,3 +353,11 @@ const struct soc_amd_gpio *variant_early_gpio_table(size_t *size)
*size = ARRAY_SIZE(early_gpio_table);
return early_gpio_table;
}
+
+static const struct soc_amd_gpio romstage_gpio_table[] = {};
+
+const struct soc_amd_gpio *baseboard_romstage_gpio_table(size_t *size)
+{
+ *size = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}
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 455684e595..17c00db4a8 100644
--- a/src/mainboard/google/zork/variants/baseboard/gpio_baseboard_trembyle.c
+++ b/src/mainboard/google/zork/variants/baseboard/gpio_baseboard_trembyle.c
@@ -402,3 +402,11 @@ const struct soc_amd_gpio *variant_early_gpio_table(size_t *size)
*size = ARRAY_SIZE(early_gpio_table);
return early_gpio_table;
}
+
+static const struct soc_amd_gpio romstage_gpio_table[] = {};
+
+const struct soc_amd_gpio *baseboard_romstage_gpio_table(size_t *size)
+{
+ *size = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}
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 c76ca026ae..2e97aabf79 100644
--- a/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/zork/variants/baseboard/include/baseboard/variants.h
@@ -23,6 +23,9 @@ const struct soc_amd_gpio *variant_override_gpio_table(size_t *size);
/* This function provides GPIO init in bootblock. */
const struct soc_amd_gpio *variant_bootblock_gpio_table(size_t *size, int slp_typ);
+/* This function provides GPIO settings for romstage. */
+const struct soc_amd_gpio *baseboard_romstage_gpio_table(size_t *size);
+
/*
* This function provides GPIO table for the pads that need to be configured when entering
* sleep.