yangcong has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/73443 )
Change subject: mb/google/geralt:set tps65132s program eeprom ......................................................................
mb/google/geralt:set tps65132s program eeprom
For Geralt,it is necessary to increase the AVDD/AVEE of TPS65132S PMIC to +-5.7V,so write the default value in eeprom to +-5.7V when configure display for the first time. In this way,the default voltage is +-5.7V when you start or enter the kernel next time.
BUG=b:268292556 TEST=test firmware display pass and AVDD/AVEE is +-5.7V on Geralt.
Change-Id: I29236818444cac84d42386a371cd8934048ff948 Signed-off-by: yangcong yangcong5@huaqin.corp-partner.google.com --- M src/mainboard/google/geralt/display.c M src/mainboard/google/geralt/panel_geralt.c 2 files changed, 64 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/73443/1
diff --git a/src/mainboard/google/geralt/display.c b/src/mainboard/google/geralt/display.c index 396d6e0..0e153bd 100644 --- a/src/mainboard/google/geralt/display.c +++ b/src/mainboard/google/geralt/display.c @@ -3,6 +3,7 @@ #include <assert.h> #include <console/console.h> #include <delay.h> +#include <device/i2c_simple.h> #include <edid.h> #include <framebuffer_info.h> #include <gpio.h> @@ -10,11 +11,54 @@ #include <soc/dptx.h> #include <soc/dsi.h> #include <soc/gpio_common.h> +#include <soc/i2c.h> #include <soc/mtcmos.h>
#include "display.h" +#include "gpio.h" #include "panel.h"
+#define PMIC_TPS65132_I2C I2C3 +#define PMIC_TPS65132_SLAVE 0x3E + +static void tps65132s_program_eeprom(void) +{ + u8 value = 0; + u8 value1 = 0; + + /* Initialize I2C3 for PMIC TPS65132 */ + mtk_i2c_bus_init(PMIC_TPS65132_I2C, I2C_SPEED_FAST); + mdelay(10); + + gpio_output(GPIO_EN_PPVAR_MIPI_DISP, 1); + gpio_output(GPIO_EN_PPVAR_MIPI_DISP_150MA, 1); + mdelay(10); + + i2c_read_field(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0x00, &value, 0xFF, 0); + i2c_read_field(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0x01, &value1, 0xFF, 0); + + if (!(value == 0x11 && value1 == 0x11)) { + + printk(BIOS_INFO, "Just set AVDD AVEE 5.7V to EEPROM Data in first time.\n"); + /* Set AVDD = 5.7V */ + if (panel_pmic_reg_mask(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0x00, 0x11, 0x1F) < 0) + return; + + /* Set AVEE = -5.7V */ + if (panel_pmic_reg_mask(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0x01, 0x11, 0x1F) < 0) + return; + + /* Set EEPROM Data */ + if (panel_pmic_reg_mask(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0xFF, 0x80, 0xFC) < 0) + return; + mdelay(50); + } + + gpio_output(GPIO_EN_PPVAR_MIPI_DISP, 0); + gpio_output(GPIO_EN_PPVAR_MIPI_DISP_150MA, 0); + mdelay(5); +} + int configure_display(void) { struct edid edid; @@ -26,6 +70,7 @@
printk(BIOS_INFO, "%s: Starting display initialization\n", __func__);
+ tps65132s_program_eeprom(); mtcmos_display_power_on();
panel->configure_panel_backlight(); diff --git a/src/mainboard/google/geralt/panel_geralt.c b/src/mainboard/google/geralt/panel_geralt.c index 2991360..60c1f5f5 100644 --- a/src/mainboard/google/geralt/panel_geralt.c +++ b/src/mainboard/google/geralt/panel_geralt.c @@ -14,8 +14,6 @@ #include "gpio.h" #include "panel.h"
-#define PMIC_TPS65132_I2C I2C3 -#define PMIC_TPS65132_SLAVE 0x3E
static void configure_mipi_pwm_backlight(void) { @@ -33,25 +31,12 @@ /* Enable VM18V */ mainboard_enable_regulator(MTK_REGULATOR_VDD18, true);
- /* Initialize I2C3 for PMIC TPS65132 */ - mtk_i2c_bus_init(PMIC_TPS65132_I2C, I2C_SPEED_FAST); - mdelay(10); - gpio_output(GPIO_DISP_RST_1V8_L, 0); mdelay(1);
gpio_output(GPIO_EN_PPVAR_MIPI_DISP, 1); gpio_output(GPIO_EN_PPVAR_MIPI_DISP_150MA, 1); mdelay(10); - - /* Set AVDD = 5.7V */ - if (panel_pmic_reg_mask(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0x00, 0x11, 0x1F) < 0) - return; - - /* Set AVEE = -5.7V */ - if (panel_pmic_reg_mask(PMIC_TPS65132_I2C, PMIC_TPS65132_SLAVE, 0x01, 0x11, 0x1F) < 0) - return; - gpio_output(GPIO_DISP_RST_1V8_L, 1); mdelay(1); gpio_output(GPIO_DISP_RST_1V8_L, 0);