summaryrefslogtreecommitdiff
path: root/src/mainboard/google/dedede
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2022-12-21 11:46:23 -0600
committerFelix Singer <felixsinger@posteo.net>2023-01-09 21:10:02 +0000
commitaf6029ba1a4b22c1f3fa4e1edbfa07c974f390df (patch)
treeb4467d533d7e518990a9a2412206cb151843983d /src/mainboard/google/dedede
parent3cd06cc427199309956b745cd04447948a1f9a82 (diff)
mb/google/dedede: Add method to set GPIOs in romstage
Add method variant_romstage_gpio_table() with empty weak implementation to allow variants to override as needed for touchscreen power sequencing (to be implemented in a subsequent commit). Call method in romstage to program any GPIOs the variant may need to set. TEST=tested with rest of patch train Change-Id: Ic216827a4b53d1d35913efca63a43d4672791c54 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/71186 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
Diffstat (limited to 'src/mainboard/google/dedede')
-rw-r--r--src/mainboard/google/dedede/romstage.c5
-rw-r--r--src/mainboard/google/dedede/variants/baseboard/Makefile.inc1
-rw-r--r--src/mainboard/google/dedede/variants/baseboard/gpio.c6
-rw-r--r--src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h1
4 files changed, 13 insertions, 0 deletions
diff --git a/src/mainboard/google/dedede/romstage.c b/src/mainboard/google/dedede/romstage.c
index 34810b46d4..3808371c4d 100644
--- a/src/mainboard/google/dedede/romstage.c
+++ b/src/mainboard/google/dedede/romstage.c
@@ -10,6 +10,8 @@
void mainboard_memory_init_params(FSPM_UPD *memupd)
{
+ const struct pad_config *pads;
+ size_t pads_num;
const struct mb_cfg *board_cfg = variant_memcfg_config();
const struct spd_info spd_info = {
.read_type = READ_SPD_CBFS,
@@ -18,4 +20,7 @@ void mainboard_memory_init_params(FSPM_UPD *memupd)
bool half_populated = variant_mem_is_half_populated();
memcfg_init(&memupd->FspmConfig, board_cfg, &spd_info, half_populated);
+
+ pads = variant_romstage_gpio_table(&pads_num);
+ gpio_configure_pads(pads, pads_num);
}
diff --git a/src/mainboard/google/dedede/variants/baseboard/Makefile.inc b/src/mainboard/google/dedede/variants/baseboard/Makefile.inc
index 4f87de9c41..64a81f9b62 100644
--- a/src/mainboard/google/dedede/variants/baseboard/Makefile.inc
+++ b/src/mainboard/google/dedede/variants/baseboard/Makefile.inc
@@ -1,5 +1,6 @@
bootblock-y += gpio.c
+romstage-y += gpio.c
romstage-y += memory.c
ramstage-y += gpio.c
diff --git a/src/mainboard/google/dedede/variants/baseboard/gpio.c b/src/mainboard/google/dedede/variants/baseboard/gpio.c
index 29ca2df68c..1f12fb7fe2 100644
--- a/src/mainboard/google/dedede/variants/baseboard/gpio.c
+++ b/src/mainboard/google/dedede/variants/baseboard/gpio.c
@@ -469,6 +469,12 @@ const struct pad_config *__weak variant_sleep_gpio_table(size_t *num)
return sleep_gpio_table;
}
+const struct pad_config *__weak variant_romstage_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_COMM0_NAME),
CROS_GPIO_WP_AH(GPIO_PCH_WP, CROS_GPIO_COMM0_NAME),
diff --git a/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h
index 53e740ca48..edb2b07e3a 100644
--- a/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h
@@ -14,6 +14,7 @@ const struct pad_config *baseboard_gpio_table(size_t *num);
const struct pad_config *variant_early_gpio_table(size_t *num);
const struct pad_config *variant_sleep_gpio_table(size_t *num);
const struct pad_config *variant_override_gpio_table(size_t *num);
+const struct pad_config *variant_romstage_gpio_table(size_t *num);
enum s0ix_entry {
S0IX_EXIT,