diff options
Diffstat (limited to 'src/mainboard/google/octopus/variants/phaser')
-rw-r--r-- | src/mainboard/google/octopus/variants/phaser/gpio.c | 41 | ||||
-rw-r--r-- | src/mainboard/google/octopus/variants/phaser/variant.c | 14 |
2 files changed, 52 insertions, 3 deletions
diff --git a/src/mainboard/google/octopus/variants/phaser/gpio.c b/src/mainboard/google/octopus/variants/phaser/gpio.c index 1c39e6592e..fb84a1624b 100644 --- a/src/mainboard/google/octopus/variants/phaser/gpio.c +++ b/src/mainboard/google/octopus/variants/phaser/gpio.c @@ -18,6 +18,10 @@ #include <boardid.h> #include <gpio.h> #include <soc/gpio.h> +#include <ec/google/chromeec/ec.h> +#include <console/console.h> + +#define SKU_UNKNOWN 0xFFFFFFFF static const struct pad_config default_override_table[] = { PAD_NC(GPIO_52, UP_20K), @@ -39,6 +43,31 @@ static const struct pad_config default_override_table[] = { PAD_NC(GPIO_214, DN_20K), }; +static const struct pad_config sku1_default_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_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0, + DISPUPD), + + PAD_NC(GPIO_161, DN_20K), + + /* EN_PP3300_WLAN_L */ + PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_178, 0, DEEP, NONE, Tx0RxDCRx0, + DISPUPD), + + PAD_NC(GPIO_213, DN_20K), + PAD_NC(GPIO_214, DN_20K), +}; + static const struct pad_config bid0_override_table[] = { PAD_NC(GPIO_52, UP_20K), PAD_NC(GPIO_53, UP_20K), @@ -52,6 +81,7 @@ static const struct pad_config bid0_override_table[] = { const struct pad_config *variant_override_gpio_table(size_t *num) { const struct pad_config *c; + uint32_t sku_id = SKU_UNKNOWN; switch (board_id()) { case 0: @@ -60,10 +90,15 @@ const struct pad_config *variant_override_gpio_table(size_t *num) *num = ARRAY_SIZE(bid0_override_table); break; default: - c = default_override_table; - *num = ARRAY_SIZE(default_override_table); + google_chromeec_cbi_get_sku_id(&sku_id); + if (sku_id == 1) { + c = sku1_default_override_table; + *num = ARRAY_SIZE(sku1_default_override_table); + } else { + c = default_override_table; + *num = ARRAY_SIZE(default_override_table); + } } - return c; } diff --git a/src/mainboard/google/octopus/variants/phaser/variant.c b/src/mainboard/google/octopus/variants/phaser/variant.c index 1ead5e230c..f04d8585cc 100644 --- a/src/mainboard/google/octopus/variants/phaser/variant.c +++ b/src/mainboard/google/octopus/variants/phaser/variant.c @@ -22,6 +22,9 @@ #include <soc/gpio.h> #include <soc/pci_devs.h> #include <string.h> +#include <ec/google/chromeec/ec.h> + +#define SKU_UNKNOWN 0xFFFFFFFF extern struct chip_operations drivers_i2c_generic_ops; extern struct chip_operations drivers_i2c_hid_ops; @@ -29,6 +32,7 @@ extern struct chip_operations drivers_i2c_hid_ops; void variant_update_devtree(struct device *dev) { uint32_t bid; + uint32_t sku_id = SKU_UNKNOWN; struct device *touchscreen_i2c_host; struct device *child; const struct bus *children_bus; @@ -46,6 +50,16 @@ void variant_update_devtree(struct device *dev) if (touchscreen_i2c_host == NULL) return; + /* According to the sku id decide whether update touch + * screen device information: + * 1. sku id is 1 then dev->enabled = 0. + */ + google_chromeec_cbi_get_sku_id(&sku_id); + if (sku_id == 1) { + touchscreen_i2c_host->enabled = 0; + return; + } + children_bus = touchscreen_i2c_host->link_list; child = NULL; |