aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainboard/google/brya/variants/marasov/Makefile.inc1
-rw-r--r--src/mainboard/google/brya/variants/marasov/fw_config.c28
-rw-r--r--src/mainboard/google/brya/variants/marasov/overridetree.cb8
3 files changed, 36 insertions, 1 deletions
diff --git a/src/mainboard/google/brya/variants/marasov/Makefile.inc b/src/mainboard/google/brya/variants/marasov/Makefile.inc
index 139345f260..4d25f34ea1 100644
--- a/src/mainboard/google/brya/variants/marasov/Makefile.inc
+++ b/src/mainboard/google/brya/variants/marasov/Makefile.inc
@@ -2,6 +2,7 @@
bootblock-y += gpio.c
romstage-y += gpio.c
+ramstage-$(CONFIG_FW_CONFIG) += fw_config.c
romstage-y += memory.c
diff --git a/src/mainboard/google/brya/variants/marasov/fw_config.c b/src/mainboard/google/brya/variants/marasov/fw_config.c
new file mode 100644
index 0000000000..73ae600df9
--- /dev/null
+++ b/src/mainboard/google/brya/variants/marasov/fw_config.c
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <bootstate.h>
+#include <console/console.h>
+#include <fw_config.h>
+#include <gpio.h>
+
+static const struct pad_config touch_enable_pads[] = {
+ /* C0 : SMBCLK ==> EN_PP3300_TCHSCR */
+ PAD_CFG_GPO(GPP_C0, 1, DEEP),
+};
+
+static const struct pad_config touch_disable_pads[] = {
+ /* C0 : SMBCLK ==> NC */
+ PAD_NC(GPP_C0, NONE),
+};
+
+static void fw_config_handle(void *unused)
+{
+ if (fw_config_probe(FW_CONFIG(TOUCH, TOUCH_ELAN0001))) {
+ printk(BIOS_INFO, "Configure Touch GPIO GPP_C0 to GPO_H.\n");
+ gpio_configure_pads(touch_enable_pads, ARRAY_SIZE(touch_enable_pads));
+ } else {
+ printk(BIOS_INFO, "Configure Touch GPIO GPP_C0 to NC.\n");
+ gpio_configure_pads(touch_disable_pads, ARRAY_SIZE(touch_disable_pads));
+ }
+}
+BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);
diff --git a/src/mainboard/google/brya/variants/marasov/overridetree.cb b/src/mainboard/google/brya/variants/marasov/overridetree.cb
index bf9d5e037c..e90df9e8f0 100644
--- a/src/mainboard/google/brya/variants/marasov/overridetree.cb
+++ b/src/mainboard/google/brya/variants/marasov/overridetree.cb
@@ -12,6 +12,10 @@ fw_config
option UFC_USB 0
option UFC_MIPI 1
end
+ field TOUCH 5 5
+ option TOUCH_NONE 0
+ option TOUCH_ELAN0001 1
+ end
field STORAGE 30 31
option STORAGE_UNKNOWN 0
option STORAGE_NVME 1
@@ -163,7 +167,9 @@ chip soc/intel/alderlake
register "stop_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_C6)"
register "stop_off_delay_ms" = "1"
register "has_power_resource" = "1"
- device i2c 10 on end
+ device i2c 10 on
+ probe TOUCH TOUCH_ELAN0001
+ end
end
end #I2C3
device ref i2c5 on