aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/dedede/variants/drawcia/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/dedede/variants/drawcia/gpio.c')
-rw-r--r--src/mainboard/google/dedede/variants/drawcia/gpio.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mainboard/google/dedede/variants/drawcia/gpio.c b/src/mainboard/google/dedede/variants/drawcia/gpio.c
new file mode 100644
index 0000000000..a91a94ee55
--- /dev/null
+++ b/src/mainboard/google/dedede/variants/drawcia/gpio.c
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <baseboard/gpio.h>
+#include <baseboard/variants.h>
+#include <fw_config.h>
+#include <console/console.h>
+#include <ec/google/chromeec/ec.h>
+
+/* Pad configuration in ramstage*/
+static const struct pad_config pre_board6_gpio_table[] = {
+
+ /* C12 : AP_PEN_DET_ODL */
+ PAD_CFG_GPI_GPIO_DRIVER(GPP_C12, UP_20K, DEEP),
+};
+
+/* bid6: Pad configuration for board version 6 afterward in ramstage*/
+static const struct pad_config board6_gpio_table[] = {
+
+ /* C12 : AP_PEN_DET_ODL has an external pull-up and hence no pad termination.*/
+ PAD_CFG_GPI_GPIO_DRIVER(GPP_C12, NONE, DEEP),
+};
+
+const struct pad_config *variant_override_gpio_table(size_t *num)
+{
+ uint32_t board_version;
+ *num = ARRAY_SIZE(pre_board6_gpio_table);
+
+ if (!google_chromeec_cbi_get_board_version(&board_version)) {
+ if (board_version >= 6) {
+ *num = ARRAY_SIZE(board6_gpio_table);
+ return board6_gpio_table;
+ }
+ }
+
+ return pre_board6_gpio_table;
+}