summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2022-03-28 22:40:47 -0500
committerFelix Held <felix-coreboot@felixheld.de>2022-12-21 13:40:31 +0000
commit34ffa64ba8993b167ff3723a5aa86588b9a8e8ba (patch)
treeb21a3e0e51951bd05a842f6fb39a7d89e68ba6c0
parent53bf72b131d68216b589306ab68b787a6de4c18c (diff)
downloadcoreboot-34ffa64ba8993b167ff3723a5aa86588b9a8e8ba.tar.gz
coreboot-34ffa64ba8993b167ff3723a5aa86588b9a8e8ba.tar.bz2
coreboot-34ffa64ba8993b167ff3723a5aa86588b9a8e8ba.zip
mb/google/octopus: Implement touchscreen/digitizer power sequencing
For octopus variants with a touchscreen/digitizer, drive the enable and reset GPIOs high in romstage, then disable the reset GPIOs in ramstage. Where available, only set the GPIOs for SKUs which have a touchscreen. This will allow coreboot to detect the presence of i2c touchscreens during ACPI SSDT generation (implemented in a subsequent commit). TEST=tested with rest of patch train Change-Id: Ia725b4054069c0a4f60afd7e0bca6e2fd5fdcbba Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63212 Reviewed-by: Raul Rangel <rrangel@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/mainboard/google/octopus/variants/ampton/Makefile.inc2
-rw-r--r--src/mainboard/google/octopus/variants/ampton/gpio.c20
-rw-r--r--src/mainboard/google/octopus/variants/bloog/Makefile.inc2
-rw-r--r--src/mainboard/google/octopus/variants/bloog/gpio.c19
-rw-r--r--src/mainboard/google/octopus/variants/bobba/Makefile.inc2
-rw-r--r--src/mainboard/google/octopus/variants/bobba/gpio.c31
-rw-r--r--src/mainboard/google/octopus/variants/dood/Makefile.inc2
-rw-r--r--src/mainboard/google/octopus/variants/dood/gpio.c23
-rw-r--r--src/mainboard/google/octopus/variants/fleex/Makefile.inc2
-rw-r--r--src/mainboard/google/octopus/variants/fleex/gpio.c23
-rw-r--r--src/mainboard/google/octopus/variants/foob/Makefile.inc1
-rw-r--r--src/mainboard/google/octopus/variants/foob/gpio.c35
-rw-r--r--src/mainboard/google/octopus/variants/garg/Makefile.inc2
-rw-r--r--src/mainboard/google/octopus/variants/garg/gpio.c34
-rw-r--r--src/mainboard/google/octopus/variants/meep/Makefile.inc2
-rw-r--r--src/mainboard/google/octopus/variants/meep/gpio.c31
-rw-r--r--src/mainboard/google/octopus/variants/phaser/Makefile.inc1
-rw-r--r--src/mainboard/google/octopus/variants/phaser/gpio.c36
-rw-r--r--src/mainboard/google/octopus/variants/yorp/Makefile.inc1
-rw-r--r--src/mainboard/google/octopus/variants/yorp/gpio.c32
20 files changed, 278 insertions, 23 deletions
diff --git a/src/mainboard/google/octopus/variants/ampton/Makefile.inc b/src/mainboard/google/octopus/variants/ampton/Makefile.inc
index 7c092e44c237..dc1c1fe1eb4f 100644
--- a/src/mainboard/google/octopus/variants/ampton/Makefile.inc
+++ b/src/mainboard/google/octopus/variants/ampton/Makefile.inc
@@ -1,5 +1,7 @@
bootblock-y += gpio.c
+romstage-y += gpio.c
+
ramstage-y += gpio.c
smm-y += gpio.c
diff --git a/src/mainboard/google/octopus/variants/ampton/gpio.c b/src/mainboard/google/octopus/variants/ampton/gpio.c
index 4c4c3d661cef..c67dc255f1f9 100644
--- a/src/mainboard/google/octopus/variants/ampton/gpio.c
+++ b/src/mainboard/google/octopus/variants/ampton/gpio.c
@@ -53,13 +53,14 @@ static const struct pad_config variant_override_table[] = {
/* LPSS */
PAD_CFG_GPIO_HI_Z(GPIO_81, UP_20K, DEEP, HIZCRx0, DISPUPD), /* GPIO_81_DEBUG (Boot halt) -- MIPI60 DEBUG */
PAD_NC(GPIO_84, NONE), /* LPSS_SPI_2_CLK - unused */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),/* GPIO_105 -- TOUCHSCREEN_RST */
PAD_CFG_GPI_APIC_IOS(GPIO_137, NONE, DEEP, EDGE_BOTH, INVERT, HIZCRx1,
DISPUPD),/* GPIO_137 -- HP_INT_ODL */
PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),/* GPIO_140 -- PEN_RESET */
PAD_NC(GPIO_143, UP_20K), /* GPIO_143 - NC */
PAD_NC(GPIO_144, UP_20K), /* GPIO_144 - PEN_EJECT */
PAD_NC(GPIO_145, UP_20K), /* GPIO_145 - PEN_EJECT */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0, DISPUPD), /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD), /* EN_PP3300_TOUCHSCREEN */
/* AUDIO COMMUNITY GPIOS*/
PAD_NC(GPIO_157, DN_20K),/* AVS_I2S0_BCLK -- unused */
@@ -115,3 +116,20 @@ const struct pad_config *variant_early_gpio_table(size_t *num)
*num = ARRAY_SIZE(early_gpio_table);
return early_gpio_table;
}
+
+/* GPIOs needed to be set in romstage. */
+static const struct pad_config romstage_gpio_table[] = {
+ /* Enable touchscreen, hold in reset */
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+};
+
+const struct pad_config *variant_romstage_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}
diff --git a/src/mainboard/google/octopus/variants/bloog/Makefile.inc b/src/mainboard/google/octopus/variants/bloog/Makefile.inc
index 98c1e441b00b..5228e706f14e 100644
--- a/src/mainboard/google/octopus/variants/bloog/Makefile.inc
+++ b/src/mainboard/google/octopus/variants/bloog/Makefile.inc
@@ -1,5 +1,7 @@
bootblock-y += gpio.c
+romstage-y += gpio.c
+
ramstage-y += gpio.c
ramstage-y += variant.c
diff --git a/src/mainboard/google/octopus/variants/bloog/gpio.c b/src/mainboard/google/octopus/variants/bloog/gpio.c
index cea0451849d5..79a50976b7b7 100644
--- a/src/mainboard/google/octopus/variants/bloog/gpio.c
+++ b/src/mainboard/google/octopus/variants/bloog/gpio.c
@@ -30,8 +30,10 @@ static const struct pad_config default_override_table[] = {
PAD_CFG_GPI_APIC_IOS(GPIO_137, NONE, DEEP, LEVEL, INVERT, HIZCRx1,
DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0,
DISPUPD),
};
@@ -40,3 +42,18 @@ const struct pad_config *variant_override_gpio_table(size_t *num)
*num = ARRAY_SIZE(default_override_table);
return default_override_table;
}
+
+/* GPIOs needed to be set in romstage. */
+static const struct pad_config romstage_gpio_table[] = {
+ /* Enable touchscreen, hold in reset */
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+};
+
+const struct pad_config *variant_romstage_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}
diff --git a/src/mainboard/google/octopus/variants/bobba/Makefile.inc b/src/mainboard/google/octopus/variants/bobba/Makefile.inc
index 7ee7e70d4bda..a854b669d3b0 100644
--- a/src/mainboard/google/octopus/variants/bobba/Makefile.inc
+++ b/src/mainboard/google/octopus/variants/bobba/Makefile.inc
@@ -1,5 +1,7 @@
bootblock-y += gpio.c
+romstage-y += gpio.c
+
ramstage-y += gpio.c
ramstage-y += variant.c
diff --git a/src/mainboard/google/octopus/variants/bobba/gpio.c b/src/mainboard/google/octopus/variants/bobba/gpio.c
index f5ba83a9335c..089bc3a10510 100644
--- a/src/mainboard/google/octopus/variants/bobba/gpio.c
+++ b/src/mainboard/google/octopus/variants/bobba/gpio.c
@@ -21,8 +21,11 @@ static const struct pad_config default_override_table[] = {
DISPUPD),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
- DISPUPD),
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
PAD_NC(GPIO_213, DN_20K),
};
@@ -36,8 +39,11 @@ static const struct pad_config lte_override_table[] = {
DISPUPD),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
- DISPUPD),
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
PAD_NC(GPIO_213, DN_20K),
@@ -87,3 +93,20 @@ const struct pad_config *variant_early_override_gpio_table(size_t *num)
return lte_early_override_table;
}
+
+/* GPIOs needed to be set in romstage. */
+static const struct pad_config romstage_gpio_table[] = {
+ /* Enable touchscreen, hold in reset */
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+};
+
+const struct pad_config *variant_romstage_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}
diff --git a/src/mainboard/google/octopus/variants/dood/Makefile.inc b/src/mainboard/google/octopus/variants/dood/Makefile.inc
index 7ee7e70d4bda..a854b669d3b0 100644
--- a/src/mainboard/google/octopus/variants/dood/Makefile.inc
+++ b/src/mainboard/google/octopus/variants/dood/Makefile.inc
@@ -1,5 +1,7 @@
bootblock-y += gpio.c
+romstage-y += gpio.c
+
ramstage-y += gpio.c
ramstage-y += variant.c
diff --git a/src/mainboard/google/octopus/variants/dood/gpio.c b/src/mainboard/google/octopus/variants/dood/gpio.c
index 639e9ca54d7f..ca709ed8401e 100644
--- a/src/mainboard/google/octopus/variants/dood/gpio.c
+++ b/src/mainboard/google/octopus/variants/dood/gpio.c
@@ -16,8 +16,10 @@ enum {
static const struct pad_config default_override_table[] = {
PAD_NC(GPIO_104, UP_20K),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0,
DISPUPD),
PAD_NC(GPIO_213, DN_20K),
@@ -27,8 +29,10 @@ static const struct pad_config lte_override_table[] = {
/* Default override table. */
PAD_NC(GPIO_104, UP_20K),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0,
DISPUPD),
PAD_NC(GPIO_213, DN_20K),
@@ -77,3 +81,18 @@ const struct pad_config *variant_early_override_gpio_table(size_t *num)
return lte_early_override_table;
}
+
+/* GPIOs needed to be set in romstage. */
+static const struct pad_config romstage_gpio_table[] = {
+ /* Enable touchscreen, hold in reset */
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+};
+
+const struct pad_config *variant_romstage_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}
diff --git a/src/mainboard/google/octopus/variants/fleex/Makefile.inc b/src/mainboard/google/octopus/variants/fleex/Makefile.inc
index 2835934d6ea2..9a649bda6a34 100644
--- a/src/mainboard/google/octopus/variants/fleex/Makefile.inc
+++ b/src/mainboard/google/octopus/variants/fleex/Makefile.inc
@@ -1,5 +1,7 @@
bootblock-y += gpio.c
+romstage-y += gpio.c
+
ramstage-y += gpio.c
ramstage-y += variant.c
diff --git a/src/mainboard/google/octopus/variants/fleex/gpio.c b/src/mainboard/google/octopus/variants/fleex/gpio.c
index 732fe6861c52..f8875d026c17 100644
--- a/src/mainboard/google/octopus/variants/fleex/gpio.c
+++ b/src/mainboard/google/octopus/variants/fleex/gpio.c
@@ -23,7 +23,11 @@ static const struct pad_config default_override_table[] = {
PAD_NC(GPIO_145, UP_20K),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
/* AVS_I2S1_MCLK -- PLT_RST_LTE_L */
PAD_CFG_GPO(GPIO_161, 1, DEEP),
@@ -56,3 +60,20 @@ const struct pad_config *variant_early_override_gpio_table(size_t *num)
return lte_early_override_table;
}
+
+/* GPIOs needed to be set in romstage. */
+static const struct pad_config romstage_gpio_table[] = {
+ /* Enable touchscreen, hold in reset */
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+};
+
+const struct pad_config *variant_romstage_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}
diff --git a/src/mainboard/google/octopus/variants/foob/Makefile.inc b/src/mainboard/google/octopus/variants/foob/Makefile.inc
index a291304bc038..86a10df2a08f 100644
--- a/src/mainboard/google/octopus/variants/foob/Makefile.inc
+++ b/src/mainboard/google/octopus/variants/foob/Makefile.inc
@@ -1,3 +1,4 @@
bootblock-y += gpio.c
+romstage-y += gpio.c
ramstage-y += gpio.c
ramstage-y += variant.c
diff --git a/src/mainboard/google/octopus/variants/foob/gpio.c b/src/mainboard/google/octopus/variants/foob/gpio.c
index 1cc044e45ee6..c824b962eff4 100644
--- a/src/mainboard/google/octopus/variants/foob/gpio.c
+++ b/src/mainboard/google/octopus/variants/foob/gpio.c
@@ -14,8 +14,11 @@ static const struct pad_config default_override_table[] = {
PAD_NC(GPIO_143, UP_20K),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
- DISPUPD),
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
PAD_NC(GPIO_161, DN_20K),
@@ -67,3 +70,31 @@ const struct pad_config *variant_override_gpio_table(size_t *num)
return c;
}
+
+/* Touchscreen GPIOs needed to be set in romstage. */
+static const struct pad_config romstage_touch_gpio_table[] = {
+ /* Enable touchscreen, hold in reset */
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+};
+
+const struct pad_config *variant_romstage_gpio_table(size_t *num)
+{
+ const struct pad_config *c;
+ uint32_t sku_id;
+
+ sku_id = google_chromeec_get_board_sku();
+ if (no_touchscreen_sku(sku_id)) {
+ c = NULL;
+ *num = 0;
+ } else {
+ c = romstage_touch_gpio_table;
+ *num = ARRAY_SIZE(romstage_touch_gpio_table);
+ }
+
+ return c;
+}
diff --git a/src/mainboard/google/octopus/variants/garg/Makefile.inc b/src/mainboard/google/octopus/variants/garg/Makefile.inc
index a443e8d39892..16211b7eaba6 100644
--- a/src/mainboard/google/octopus/variants/garg/Makefile.inc
+++ b/src/mainboard/google/octopus/variants/garg/Makefile.inc
@@ -1,5 +1,7 @@
bootblock-y += gpio.c
+romstage-y += gpio.c
+
ramstage-y += gpio.c
ramstage-y += variant.c
diff --git a/src/mainboard/google/octopus/variants/garg/gpio.c b/src/mainboard/google/octopus/variants/garg/gpio.c
index dad442bc45d0..4f198814c644 100644
--- a/src/mainboard/google/octopus/variants/garg/gpio.c
+++ b/src/mainboard/google/octopus/variants/garg/gpio.c
@@ -14,9 +14,10 @@ static const struct pad_config default_override_table[] = {
PAD_CFG_GPI_APIC_IOS(GPIO_137, NONE, DEEP, LEVEL, INVERT, HIZCRx1,
DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
- DISPUPD),
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
PAD_NC(GPIO_213, DN_20K),
};
@@ -35,9 +36,10 @@ static const struct pad_config hdmi_override_table[] = {
PAD_CFG_GPI_APIC_IOS(GPIO_137, NONE, DEEP, LEVEL, INVERT, HIZCRx1,
DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
- DISPUPD),
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
PAD_NC(GPIO_213, DN_20K),
@@ -52,8 +54,11 @@ static const struct pad_config lte_override_table[] = {
DISPUPD),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
- DISPUPD),
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
PAD_NC(GPIO_213, DN_20K),
@@ -108,3 +113,20 @@ const struct pad_config *variant_early_override_gpio_table(size_t *num)
return lte_early_override_table;
}
+
+/* GPIOs needed to be set in romstage. */
+static const struct pad_config romstage_gpio_table[] = {
+ /* Enable touchscreen, hold in reset */
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+};
+
+const struct pad_config *variant_romstage_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}
diff --git a/src/mainboard/google/octopus/variants/meep/Makefile.inc b/src/mainboard/google/octopus/variants/meep/Makefile.inc
index 7a6301c01b14..7277888358a0 100644
--- a/src/mainboard/google/octopus/variants/meep/Makefile.inc
+++ b/src/mainboard/google/octopus/variants/meep/Makefile.inc
@@ -1,5 +1,7 @@
bootblock-y += gpio.c
+romstage-y += gpio.c
+
ramstage-y += gpio.c
ramstage-y += variant.c
diff --git a/src/mainboard/google/octopus/variants/meep/gpio.c b/src/mainboard/google/octopus/variants/meep/gpio.c
index 3aa8d9dac2f7..106c26688e9e 100644
--- a/src/mainboard/google/octopus/variants/meep/gpio.c
+++ b/src/mainboard/google/octopus/variants/meep/gpio.c
@@ -15,8 +15,11 @@ static const struct pad_config default_override_table[] = {
DISPUPD),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
- DISPUPD),
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
};
static const struct pad_config hdmi_sku_override_table[] = {
@@ -34,8 +37,11 @@ static const struct pad_config hdmi_sku_override_table[] = {
DISPUPD),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
- DISPUPD),
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
};
const struct pad_config *variant_override_gpio_table(size_t *num)
@@ -55,3 +61,20 @@ const struct pad_config *variant_override_gpio_table(size_t *num)
return default_override_table;
}
}
+
+/* GPIOs needed to be set in romstage. */
+static const struct pad_config romstage_gpio_table[] = {
+ /* Enable touchscreen, hold in reset */
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+};
+
+const struct pad_config *variant_romstage_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}
diff --git a/src/mainboard/google/octopus/variants/phaser/Makefile.inc b/src/mainboard/google/octopus/variants/phaser/Makefile.inc
index 22ef41c3a2c8..1b171c5e31c8 100644
--- a/src/mainboard/google/octopus/variants/phaser/Makefile.inc
+++ b/src/mainboard/google/octopus/variants/phaser/Makefile.inc
@@ -1,5 +1,6 @@
bootblock-y += gpio.c
+romstage-y += gpio.c
romstage-y += memory.c
ramstage-y += variant.c
diff --git a/src/mainboard/google/octopus/variants/phaser/gpio.c b/src/mainboard/google/octopus/variants/phaser/gpio.c
index f227b019a94c..f0142c96bdac 100644
--- a/src/mainboard/google/octopus/variants/phaser/gpio.c
+++ b/src/mainboard/google/octopus/variants/phaser/gpio.c
@@ -19,8 +19,11 @@ static const struct pad_config default_override_table[] = {
PAD_NC(GPIO_143, UP_20K),
/* EN_PP3300_TOUCHSCREEN */
- PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
- DISPUPD),
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
PAD_NC(GPIO_161, DN_20K),
@@ -79,3 +82,32 @@ const struct pad_config *variant_override_gpio_table(size_t *num)
return c;
}
+
+
+/* Touchscreen GPIOs needed to be set in romstage. */
+static const struct pad_config romstage_touch_gpio_table[] = {
+ /* Enable touchscreen, hold in reset */
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+};
+
+const struct pad_config *variant_romstage_gpio_table(size_t *num)
+{
+ const struct pad_config *c;
+ uint32_t sku_id = SKU_UNKNOWN;
+
+ google_chromeec_cbi_get_sku_id(&sku_id);
+ if (no_touchscreen_sku(sku_id)) {
+ c = NULL;
+ *num = 0;
+ } else {
+ c = romstage_touch_gpio_table;
+ *num = ARRAY_SIZE(romstage_touch_gpio_table);
+ }
+
+ return c;
+}
diff --git a/src/mainboard/google/octopus/variants/yorp/Makefile.inc b/src/mainboard/google/octopus/variants/yorp/Makefile.inc
index 4b48156a52b1..0ec849f5b563 100644
--- a/src/mainboard/google/octopus/variants/yorp/Makefile.inc
+++ b/src/mainboard/google/octopus/variants/yorp/Makefile.inc
@@ -1 +1,2 @@
bootblock-y += gpio.c
+romstage-y += gpio.c
diff --git a/src/mainboard/google/octopus/variants/yorp/gpio.c b/src/mainboard/google/octopus/variants/yorp/gpio.c
index 63763b34aaa7..c8b56f068f12 100644
--- a/src/mainboard/google/octopus/variants/yorp/gpio.c
+++ b/src/mainboard/google/octopus/variants/yorp/gpio.c
@@ -38,3 +38,35 @@ const struct pad_config *variant_early_gpio_table(size_t *num)
*num = ARRAY_SIZE(early_gpio_table);
return early_gpio_table;
}
+
+static const struct pad_config default_override_table[] = {
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 0, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+};
+
+const struct pad_config *variant_override_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(default_override_table);
+ return default_override_table;
+}
+
+/* GPIOs needed to be set in romstage. */
+static const struct pad_config romstage_gpio_table[] = {
+ /* Enable touchscreen, hold in reset */
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 1, DEEP, NONE, Tx0RxDCRx0, DISPUPD),
+ /* GPIO_105 -- TOUCHSCREEN_RST */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_105, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+ /* GPIO_140 -- PEN_RESET */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_140, 1, DEEP, NONE, Tx1RxDCRx0, DISPUPD),
+};
+
+const struct pad_config *variant_romstage_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}