Felix Singer submitted this change.

View Change


Approvals: build bot (Jenkins): Verified Felix Singer: Looks good to me, approved
mb/google/dedede: Implement touchscreen power sequencing

For touchscreens on dedede variants, drive the enable GPIO high
starting in romstage, then disable the reset GPIO in ramstage. This will
allow coreboot to detect the presence of i2c touchscreens during ACPI
SSDT generation (implemented in a subsequent commit).

Since the fast majority of dedede variants have a touchscreen option,
and those that do use the same GPIOs for enable/reset, set the GPIOs for
touchscreen operation in the baseboard and then override for the few (3)
variants that do not have a touchscreen.

BUG=b:121309055
TEST=tested with rest of patch train

Change-Id: Ib95e23545cc3e8589ddbd9e18cd0533bec9333e0
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71187
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
---
M src/mainboard/google/dedede/variants/baseboard/gpio.c
M src/mainboard/google/dedede/variants/beadrix/gpio.c
M src/mainboard/google/dedede/variants/cappy2/gpio.c
M src/mainboard/google/dedede/variants/sasuke/gpio.c
4 files changed, 88 insertions(+), 4 deletions(-)

diff --git a/src/mainboard/google/dedede/variants/baseboard/gpio.c b/src/mainboard/google/dedede/variants/baseboard/gpio.c
index 1f12fb7..f377d9a 100644
--- a/src/mainboard/google/dedede/variants/baseboard/gpio.c
+++ b/src/mainboard/google/dedede/variants/baseboard/gpio.c
@@ -165,9 +165,9 @@
/* D4 : TOUCH_INT_ODL */
PAD_CFG_GPI_APIC(GPP_D4, NONE, PLTRST, LEVEL, INVERT),
/* D5 : TOUCH_RESET_L */
- PAD_CFG_GPO(GPP_D5, 0, DEEP),
+ PAD_CFG_GPO(GPP_D5, 1, DEEP),
/* D6 : EN_PP3300_TOUCH_S0 */
- PAD_CFG_GPO(GPP_D6, 0, DEEP),
+ PAD_CFG_GPO(GPP_D6, 1, DEEP),
/* D7 : EMR_INT_ODL */
PAD_NC(GPP_D7, NONE),
/* D8 : GPP_D8/GSPI2_CS0B/UART0A_RXD */
@@ -469,10 +469,18 @@
return sleep_gpio_table;
}

+static const struct pad_config romstage_gpio_table[] = {
+ /* Enable touchscreen, hold in reset */
+ /* D5 : TOUCH_RESET_L */
+ PAD_CFG_GPO(GPP_D5, 0, DEEP),
+ /* D6 : EN_PP3300_TOUCH_S0 */
+ PAD_CFG_GPO(GPP_D6, 1, DEEP),
+};
+
const struct pad_config *__weak variant_romstage_gpio_table(size_t *num)
{
- *num = 0;
- return NULL;
+ *num = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
}

static const struct cros_gpio cros_gpios[] = {
diff --git a/src/mainboard/google/dedede/variants/beadrix/gpio.c b/src/mainboard/google/dedede/variants/beadrix/gpio.c
index cf7d6ef..131cb96 100644
--- a/src/mainboard/google/dedede/variants/beadrix/gpio.c
+++ b/src/mainboard/google/dedede/variants/beadrix/gpio.c
@@ -28,6 +28,10 @@

/* D0 : WWAN_HOST_WAKE ==> WWAN_WDISABLE_L */
PAD_CFG_GPO(GPP_D0, 1, DEEP),
+ /* D5 : TOUCH_RESET_L */
+ PAD_NC(GPP_D5, NONE),
+ /* D6 : EN_PP3300_TOUCH_S0 */
+ PAD_NC(GPP_D6, NONE),
/* D12 : WCAM_RST_L ==> NC */
PAD_NC(GPP_D12, NONE),
/* D13 : EN_PP2800_CAMERA */
@@ -102,6 +106,20 @@
return gpio_table;
}

+static const struct pad_config romstage_gpio_table[] = {
+ /* no touchscreen present */
+ /* D5 : TOUCH_RESET_L */
+ PAD_NC(GPP_D5, NONE),
+ /* D6 : EN_PP3300_TOUCH_S0 */
+ PAD_NC(GPP_D6, NONE),
+};
+
+const struct pad_config *__weak variant_romstage_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}
+
static void fw_config_handle(void *unused)
{
if (!fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_1C_LTE)))
diff --git a/src/mainboard/google/dedede/variants/cappy2/gpio.c b/src/mainboard/google/dedede/variants/cappy2/gpio.c
index 87f5e46..d5bc9ae 100644
--- a/src/mainboard/google/dedede/variants/cappy2/gpio.c
+++ b/src/mainboard/google/dedede/variants/cappy2/gpio.c
@@ -7,6 +7,10 @@

/* Pad configuration in ramstage */
static const struct pad_config gpio_table[] = {
+ /* D5 : TOUCH_RESET_L */
+ PAD_NC(GPP_D5, NONE),
+ /* D6 : EN_PP3300_TOUCH_S0 */
+ PAD_NC(GPP_D6, NONE),
/* D15 : EN_PP3300_CAMERA */
PAD_CFG_GPO(GPP_D15, 1, PLTRST),
/* H16 : AP_SUB_IO_L ==> HP_RST_ODL */
@@ -27,6 +31,20 @@
PAD_NC(GPP_D18, NONE),
};

+static const struct pad_config romstage_gpio_table[] = {
+ /* no touchscreen present */
+ /* D5 : TOUCH_RESET_L */
+ PAD_NC(GPP_D5, NONE),
+ /* D6 : EN_PP3300_TOUCH_S0 */
+ PAD_NC(GPP_D6, NONE),
+};
+
+const struct pad_config *__weak variant_romstage_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}
+
static void fw_config_handle(void *unused)
{
if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE, AUDIO_CODEC_ALC5682)))
diff --git a/src/mainboard/google/dedede/variants/sasuke/gpio.c b/src/mainboard/google/dedede/variants/sasuke/gpio.c
index 8aa9f29..011b6e7 100644
--- a/src/mainboard/google/dedede/variants/sasuke/gpio.c
+++ b/src/mainboard/google/dedede/variants/sasuke/gpio.c
@@ -70,3 +70,17 @@
*num = ARRAY_SIZE(gpio_table);
return gpio_table;
}
+
+static const struct pad_config romstage_gpio_table[] = {
+ /* no touchscreen present */
+ /* D5 : TOUCH_RESET_L */
+ PAD_NC(GPP_D5, NONE),
+ /* D6 : EN_PP3300_TOUCH_S0 */
+ PAD_NC(GPP_D6, NONE),
+};
+
+const struct pad_config *__weak variant_romstage_gpio_table(size_t *num)
+{
+ *num = ARRAY_SIZE(romstage_gpio_table);
+ return romstage_gpio_table;
+}

To view, visit change 71187. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib95e23545cc3e8589ddbd9e18cd0533bec9333e0
Gerrit-Change-Number: 71187
Gerrit-PatchSet: 4
Gerrit-Owner: Matt DeVillier <matt.devillier@gmail.com>
Gerrit-Reviewer: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged