diff options
author | Tommie <tong.lin@bitland.corp-partner.google.com> | 2019-12-23 13:33:34 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-12-26 10:51:51 +0000 |
commit | 325fd3462e0b4088f915a7583295334779f5270e (patch) | |
tree | 1dedbad6bafc57f9f2f8f49584ae8efec93b2e77 /src | |
parent | 086f0faf756a2d4e71fd9c1d27335af240418b19 (diff) | |
download | coreboot-325fd3462e0b4088f915a7583295334779f5270e.tar.xz |
mb/google/octopus: Add two new sku IDs for foob
Declare these sku IDs:
-SKU: 1 Foob, 1-cam, no touch, no pen.
-SKU: 9 Foob360, 2-cam, touch, pen.
BUG=b:145837644
BRANCH=octopus
TEST=emerge-octopus coreboot
Signed-off-by: tong.lin <tong.lin@bitland.corp-partner.google.com>
Change-Id: Iffcbb3f6f945ea299ff687a383a82b88dcd11ea1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37906
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marco Chen <marcochen@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mainboard/google/octopus/variants/foob/Makefile.inc | 2 | ||||
-rw-r--r-- | src/mainboard/google/octopus/variants/foob/gpio.c | 45 | ||||
-rw-r--r-- | src/mainboard/google/octopus/variants/foob/variant.c | 36 |
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; +} |