summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/octopus/variants/foob/Makefile.inc2
-rw-r--r--src/mainboard/google/octopus/variants/foob/gpio.c45
-rw-r--r--src/mainboard/google/octopus/variants/foob/variant.c36
3 files changed, 80 insertions, 3 deletions
diff --git a/src/mainboard/google/octopus/variants/foob/Makefile.inc b/src/mainboard/google/octopus/variants/foob/Makefile.inc
index 9fb63f5f43..a291304bc0 100644
--- a/src/mainboard/google/octopus/variants/foob/Makefile.inc
+++ b/src/mainboard/google/octopus/variants/foob/Makefile.inc
@@ -1,3 +1,3 @@
bootblock-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 27ce0eea61..dec2ff550d 100644
--- a/src/mainboard/google/octopus/variants/foob/gpio.c
+++ b/src/mainboard/google/octopus/variants/foob/gpio.c
@@ -20,6 +20,8 @@
#include <soc/gpio.h>
#include <ec/google/chromeec/ec.h>
+#define SKU_UNKNOWN 0xFFFFFFFF
+
static const struct pad_config default_override_table[] = {
PAD_NC(GPIO_52, UP_20K),
PAD_NC(GPIO_53, UP_20K),
@@ -37,8 +39,47 @@ static const struct pad_config default_override_table[] = {
PAD_NC(GPIO_214, DN_20K),
};
+static const struct pad_config non_touchscreen_override_table[] = {
+ /* disable I2C7 SCL and SDA */
+ PAD_NC(GPIO_114, UP_20K), /* LPSS_I2C7_SDA */
+ PAD_NC(GPIO_115, UP_20K), /* LPSS_I2C7_SCL */
+
+ PAD_NC(GPIO_52, UP_20K),
+ PAD_NC(GPIO_53, UP_20K),
+ PAD_NC(GPIO_67, UP_20K),
+ PAD_NC(GPIO_117, UP_20K),
+ PAD_NC(GPIO_143, UP_20K),
+
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_NC(GPIO_146, UP_20K),
+
+ PAD_NC(GPIO_161, DN_20K),
+
+ PAD_NC(GPIO_213, DN_20K),
+ PAD_NC(GPIO_214, DN_20K),
+};
+
+bool no_touchscreen_sku(uint32_t sku_id)
+{
+ if (sku_id != 9)
+ return true;
+ else
+ return false;
+}
+
const struct pad_config *variant_override_gpio_table(size_t *num)
{
- *num = ARRAY_SIZE(default_override_table);
- return default_override_table;
+ const struct pad_config *c;
+ uint32_t sku_id = SKU_UNKNOWN;
+
+ sku_id = get_board_sku();
+ if (no_touchscreen_sku(sku_id)) {
+ c = non_touchscreen_override_table;
+ *num = ARRAY_SIZE(non_touchscreen_override_table);
+ } else {
+ c = default_override_table;
+ *num = ARRAY_SIZE(default_override_table);
+ }
+
+ return c;
}
diff --git a/src/mainboard/google/octopus/variants/foob/variant.c b/src/mainboard/google/octopus/variants/foob/variant.c
new file mode 100644
index 0000000000..dcc11dd0bb
--- /dev/null
+++ b/src/mainboard/google/octopus/variants/foob/variant.c
@@ -0,0 +1,36 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 Google LLC
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <baseboard/variants.h>
+#include <soc/pci_devs.h>
+#include <ec/google/chromeec/ec.h>
+
+#define SKU_UNKNOWN 0xFFFFFFFF
+
+void variant_update_devtree(struct device *dev)
+{
+ uint32_t sku_id = SKU_UNKNOWN;
+ struct device *touchscreen_i2c_host;
+
+ touchscreen_i2c_host = pcidev_path_on_root(PCH_DEVFN_I2C7);
+
+ if (touchscreen_i2c_host == NULL)
+ return;
+
+ /* SKU ID 1 does not have a touchscreen device, hence disable it. */
+ sku_id = get_board_sku();
+ if (no_touchscreen_sku(sku_id))
+ touchscreen_i2c_host->enabled = 0;
+}