[coreboot-gerrit] Change in coreboot[master]: gru: Initialize I2C bus for ARC2C0608

Julius Werner (Code Review) gerrit at coreboot.org
Thu Apr 6 20:45:56 CEST 2017


Julius Werner has submitted this change and it was merged. ( https://review.coreboot.org/19105 )

Change subject: gru: Initialize I2C bus for ARC2C0608
......................................................................


gru: Initialize I2C bus for ARC2C0608

BUG=b:35583511
TEST=check i2c bus 0 initializes from ap console log

Change-Id: Ibb6709159f5ed28ad0b62397d2ddb504dec55167
Signed-off-by: Philip Chen <philipchen at google.com>
Reviewed-on: https://review.coreboot.org/19105
Tested-by: build bot (Jenkins)
Reviewed-by: Julius Werner <jwerner at chromium.org>
---
M src/mainboard/google/gru/mainboard.c
1 file changed, 3 insertions(+), 31 deletions(-)

Approvals:
  Julius Werner: Looks good to me, approved
  build bot (Jenkins): Verified



diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c
index bb9b6fc..1c823f3 100644
--- a/src/mainboard/google/gru/mainboard.c
+++ b/src/mainboard/google/gru/mainboard.c
@@ -333,30 +333,8 @@
 	register_apio_suspend();
 }
 
-static void enable_backlight_booster(void)
+static void prepare_backlight_i2c(void)
 {
-	const struct {
-		uint8_t reg;
-		uint8_t value;
-	} i2c_writes[] = {
-		{1, 0x84},
-		{1, 0x85},
-		{0, 0x26}
-	};
-	int i;
-	const int booster_i2c_port = 0;
-	uint8_t i2c_buf[2];
-	struct i2c_seg i2c_command = { .read = 0, .chip = 0x2c,
-				       .buf = i2c_buf, .len = sizeof(i2c_buf)
-	};
-
-	/*
-	 * This function is called on Gru right after BL_EN is asserted. It
-	 * takes time for the switcher chip to come online, let's wait a bit
-	 * to let the voltage settle, so that the chip can be accessed.
-	 */
-	udelay(1000);
-
 	gpio_input(GPIO(1, B, 7));	/* I2C0_SDA remove pull_up */
 	gpio_input(GPIO(1, C, 0));	/* I2C0_SCL remove pull_up */
 
@@ -364,20 +342,14 @@
 
 	write32(&rk3399_pmugrf->iomux_i2c0_sda, IOMUX_I2C0_SDA);
 	write32(&rk3399_pmugrf->iomux_i2c0_scl, IOMUX_I2C0_SCL);
-
-	for (i = 0; i < ARRAY_SIZE(i2c_writes); i++) {
-		i2c_buf[0] = i2c_writes[i].reg;
-		i2c_buf[1] = i2c_writes[i].value;
-		i2c_transfer(booster_i2c_port, &i2c_command, 1);
-	}
 }
 
 void mainboard_power_on_backlight(void)
 {
 	gpio_output(GPIO_BACKLIGHT, 1);  /* BL_EN */
 
-	if (IS_ENABLED(CONFIG_BOARD_GOOGLE_GRU) && board_id() == 0)
-		enable_backlight_booster();
+	if (IS_ENABLED(CONFIG_BOARD_GOOGLE_GRU))
+		prepare_backlight_i2c();
 }
 
 static void mainboard_enable(device_t dev)

-- 
To view, visit https://review.coreboot.org/19105
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb6709159f5ed28ad0b62397d2ddb504dec55167
Gerrit-PatchSet: 4
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Philip Chen <philipchen at google.com>
Gerrit-Reviewer: Julius Werner <jwerner at chromium.org>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Philip Chen <philipchen at google.com>
Gerrit-Reviewer: build bot (Jenkins)



More information about the coreboot-gerrit mailing list