[coreboot-gerrit] Change in coreboot[master]: mb/google/octopus: Close unused I2C bus 7 include SCL and SDA
Peichao Li (Code Review)
gerrit at coreboot.org
Wed Sep 19 04:56:42 CEST 2018
Peichao Li has uploaded this change for review. ( https://review.coreboot.org/28669
Change subject: mb/google/octopus: Close unused I2C bus 7 include SCL and SDA
......................................................................
mb/google/octopus: Close unused I2C bus 7 include SCL and SDA
Since I2C bus 7 attached the touchscreen device however Phaser units
that haven't it. So for avoiding side effects, we need close I2C bus
7 SCL and SDA respectilvely.
BUG=
TEST=according to sku_id(Phaser: 0x1, Phaser360: 0x2, Phaser360s: 0x3)
distinguish whether close these gpios.
Change-Id: I8ad17761f2a053dc329bbec0a0a3284d47289666
Signed-off-by: peichao.wang <peichao.wang at bitland.corp-partner.google.com>
---
M src/mainboard/google/octopus/variants/phaser/gpio.c
1 file changed, 54 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/28669/1
diff --git a/src/mainboard/google/octopus/variants/phaser/gpio.c b/src/mainboard/google/octopus/variants/phaser/gpio.c
index 1c39e65..1856e0b 100644
--- a/src/mainboard/google/octopus/variants/phaser/gpio.c
+++ b/src/mainboard/google/octopus/variants/phaser/gpio.c
@@ -18,6 +18,12 @@
#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 +45,31 @@
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),
@@ -51,7 +82,8 @@
const struct pad_config *variant_override_gpio_table(size_t *num)
{
- const struct pad_config *c;
+ const struct pad_config *c, *d;
+ static uint32_t sku_id = SKU_UNKNOWN;
switch (board_id()) {
case 0:
@@ -64,7 +96,27 @@
*num = ARRAY_SIZE(default_override_table);
}
- return c;
+ if (google_chromeec_cbi_get_sku_id(&sku_id))
+ {
+ sku_id = SKU_UNKNOWN;
+ printk(BIOS_ERR, "%s: Unexpected SKU ID %u\n",
+ __func__, sku_id);
+ return NULL;
+ }
+ printk(BIOS_ERR, "caf debug SKU ID is %u\n", sku_id);
+ if (sku_id == 1)
+ {
+ d = sku1_default_override_table;
+ *num = ARRAY_SIZE(sku1_default_override_table);
+ printk(BIOS_ERR, "caf debug 1\n");
+ return d;
+ }
+ else
+ {
+ printk(BIOS_ERR, "caf debug 2\n");
+ return c;
+ }
+
}
/* GPIOs needed prior to ramstage. */
--
To view, visit https://review.coreboot.org/28669
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ad17761f2a053dc329bbec0a0a3284d47289666
Gerrit-Change-Number: 28669
Gerrit-PatchSet: 1
Gerrit-Owner: Peichao Li <peichao.wang at bitland.corp-partner.google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180919/21aaf4d0/attachment.html>
More information about the coreboot-gerrit
mailing list