Tommie Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37906 )
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
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 --- M src/mainboard/google/octopus/variants/foob/Makefile.inc M src/mainboard/google/octopus/variants/foob/gpio.c A src/mainboard/google/octopus/variants/foob/variant.c 3 files changed, 80 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/37906/1
diff --git a/src/mainboard/google/octopus/variants/foob/Makefile.inc b/src/mainboard/google/octopus/variants/foob/Makefile.inc index 9fb63f5..a291304 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 27ce0ee..4665fb9 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 @@ PAD_NC(GPIO_214, DN_20K), };
+static const struct pad_config sku1_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; + + google_chromeec_cbi_get_sku_id(&sku_id); + if (no_touchscreen_sku(sku_id)) { + c = sku1_override_table; + *num = ARRAY_SIZE(sku1_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 0000000..7f8e378 --- /dev/null +++ b/src/mainboard/google/octopus/variants/foob/variant.c @@ -0,0 +1,36 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2018 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. */ + google_chromeec_cbi_get_sku_id(&sku_id); + if (no_touchscreen_sku(sku_id)) + touchscreen_i2c_host->enabled = 0; +}
Henry Sun has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37906 )
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
Patch Set 1: Code-Review+1
For Foob new SKUs
Peichao Li has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37906 )
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
Patch Set 1: Code-Review+1
Marco Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37906 )
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... File src/mainboard/google/octopus/variants/foob/gpio.c:
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... PS1, Line 42: sku1_override_table non_touchscreen_override_table might be more meaningful?
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... File src/mainboard/google/octopus/variants/foob/variant.c:
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... PS1, Line 4: * Copyright 2018 Google LLC 2019?
Marco Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37906 )
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... File src/mainboard/google/octopus/variants/foob/gpio.c:
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... PS1, Line 75: google_chromeec_cbi_get_sku_id(&sku_id); get_board_sku() from mainboard.c? And the benefit is we don't need to query from EC again.
Hello Peichao Li, Henry Sun, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/37906
to look at the new patch set (#2).
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
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 --- M src/mainboard/google/octopus/variants/foob/Makefile.inc M src/mainboard/google/octopus/variants/foob/gpio.c A src/mainboard/google/octopus/variants/foob/variant.c 3 files changed, 80 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/37906/2
Henry Sun has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37906 )
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
Patch Set 2: Code-Review+1
Marco Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37906 )
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37906/2/src/mainboard/google/octopu... File src/mainboard/google/octopus/variants/foob/variant.c:
https://review.coreboot.org/c/coreboot/+/37906/2/src/mainboard/google/octopu... PS2, Line 33: google_chromeec_cbi_get_sku_id(&sku_id); This is another place for using get_board_sku()? On the other hand, if no_touchscreen_sku() always needs sku_id then you can just put "sku_id = get_board_sku()" inside this function? But this is not the strong opinion so even if just change to use get_board_sku() here is fine. Thanks.
Hello Peichao Li, Henry Sun, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/37906
to look at the new patch set (#3).
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
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 --- M src/mainboard/google/octopus/variants/foob/Makefile.inc M src/mainboard/google/octopus/variants/foob/gpio.c A src/mainboard/google/octopus/variants/foob/variant.c 3 files changed, 80 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/37906/3
Peichao Li has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37906 )
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
Patch Set 3:
(4 comments)
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... File src/mainboard/google/octopus/variants/foob/gpio.c:
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... PS1, Line 42: sku1_override_table
non_touchscreen_override_table might be more meaningful?
Done
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... PS1, Line 75: google_chromeec_cbi_get_sku_id(&sku_id);
get_board_sku() from mainboard.c? And the benefit is we don't need to query from EC again.
Done
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... File src/mainboard/google/octopus/variants/foob/variant.c:
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... PS1, Line 4: * Copyright 2018 Google LLC
2019?
Done
https://review.coreboot.org/c/coreboot/+/37906/2/src/mainboard/google/octopu... File src/mainboard/google/octopus/variants/foob/variant.c:
https://review.coreboot.org/c/coreboot/+/37906/2/src/mainboard/google/octopu... PS2, Line 33: google_chromeec_cbi_get_sku_id(&sku_id);
This is another place for using get_board_sku()? On the other hand, if no_touchscreen_sku() always n […]
Done
Tommie Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37906 )
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
Patch Set 3: Code-Review+1
(4 comments)
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... File src/mainboard/google/octopus/variants/foob/gpio.c:
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... PS1, Line 42: sku1_override_table
non_touchscreen_override_table might be more meaningful?
Done
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... PS1, Line 75: google_chromeec_cbi_get_sku_id(&sku_id);
get_board_sku() from mainboard.c? And the benefit is we don't need to query from EC again.
Done
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... File src/mainboard/google/octopus/variants/foob/variant.c:
https://review.coreboot.org/c/coreboot/+/37906/1/src/mainboard/google/octopu... PS1, Line 4: * Copyright 2018 Google LLC
2019?
Done
https://review.coreboot.org/c/coreboot/+/37906/2/src/mainboard/google/octopu... File src/mainboard/google/octopus/variants/foob/variant.c:
https://review.coreboot.org/c/coreboot/+/37906/2/src/mainboard/google/octopu... PS2, Line 33: google_chromeec_cbi_get_sku_id(&sku_id);
This is another place for using get_board_sku()? On the other hand, if no_touchscreen_sku() always n […]
Done
Marco Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37906 )
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
Patch Set 3: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/37906 )
Change subject: mb/google/octopus: Add two new sku IDs for foob ......................................................................
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 --- M src/mainboard/google/octopus/variants/foob/Makefile.inc M src/mainboard/google/octopus/variants/foob/gpio.c A src/mainboard/google/octopus/variants/foob/variant.c 3 files changed, 80 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Marco Chen: Looks good to me, approved Tommie Lin: Looks good to me, but someone else must approve
diff --git a/src/mainboard/google/octopus/variants/foob/Makefile.inc b/src/mainboard/google/octopus/variants/foob/Makefile.inc index 9fb63f5..a291304 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 27ce0ee..dec2ff5 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 @@ 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 0000000..dcc11dd --- /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; +}