Attention is currently required from: Hung-Te Lin, Rex-BC Chen.
Hello Rex-BC Chen,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/72749
to review the following change.
Change subject: mb/google/geralt: Add power on sequence for BOE_TV110C9M_LL0 ......................................................................
mb/google/geralt: Add power on sequence for BOE_TV110C9M_LL0
Add power sequence to power on BOE_TV110C9M_LL0 on Geralt proto board.
BUG=b:244208960 TEST=test firmware display pass for BOE_TV110C9M_LL0 on Geralt proto board
Change-Id: I3ef0b2e26d8cc0dc35c2985363ee4c3557dac8a9 Signed-off-by: Rex-BC Chen rex-bc.chen@mediatek.com Signed-off-by: Liju-Clr Chen liju-clr.chen@mediatek.com --- M src/mainboard/google/geralt/panel_geralt.c M src/soc/mediatek/mt8188/Makefile.inc 2 files changed, 73 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/72749/1
diff --git a/src/mainboard/google/geralt/panel_geralt.c b/src/mainboard/google/geralt/panel_geralt.c index bbb1060..78dd8f9 100644 --- a/src/mainboard/google/geralt/panel_geralt.c +++ b/src/mainboard/google/geralt/panel_geralt.c @@ -2,13 +2,36 @@
#include <boardid.h> #include <boot/coreboot_tables.h> +#include <console/console.h> +#include <device/i2c_simple.h> +#include <delay.h> #include <gpio.h> #include <soc/gpio_common.h> +#include <soc/i2c.h> +#include <soc/regulator.h> +#include <soc/mt6359p.h> +#include <soc/pmif.h> #include <string.h>
#include "gpio.h" #include "panel.h"
+#define MIPI_PANEL_I2C I2C3 +#define MIPI_PANEL_SLAVE 0x3E + +static int mipi_panel_reg_mask (u8 addr, u8 val, u8 mask) +{ + u8 msg = 0; + + if (i2c_read_field(MIPI_PANEL_I2C, MIPI_PANEL_SLAVE, addr, &msg, 0xFF, 0)) + printk(BIOS_ERR, "Rex: failed to read i2c: %d\n", addr); + + msg &= ~mask; + msg |= val; + + return i2c_write_field(MIPI_PANEL_I2C, MIPI_PANEL_SLAVE, addr, msg, 0xFF, 0); +} + static void configure_mipi_pwm_backlight(void) { gpio_output(GPIO_AP_DISP_BKLTEN, 0); @@ -22,7 +45,38 @@
static void power_on_mipi_boe_tv110c9m_ll0(void) { - /* TODO: Add the poweron for BOE_TV110C9M_LL0 when we get BOE_TV110C9M_LL0 */ + int ret = 0; + + /* Enable VM18V */ + mt6359p_init(); + mainboard_enable_regulator(MTK_REGULATOR_VDD18, true); + + /* Initialize I2C3 */ + mtk_i2c_bus_init(MIPI_PANEL_I2C, I2C_SPEED_FAST); + mdelay(10); + + gpio_output(GPIO(DSI0_LCM_RST), 0); + mdelay(1); + + gpio_output(GPIO(GPIO03), 1); + gpio_output(GPIO(GPIO04), 1); + mdelay(10); + + /* Set AVDD = 5.7V */ + ret = mipi_panel_reg_mask(0x00, 0x11, 0x1F); + + /* Set AVEE = -5.7V */ + ret = mipi_panel_reg_mask(0x01, 0x11, 0x1F); + + /* Disable AVDD & AVEE discharge when power on*/ + ret = mipi_panel_reg_mask(0x03, 0x30, 0xFF); + + gpio_output(GPIO(DSI0_LCM_RST), 1); + mdelay(1); + gpio_output(GPIO(DSI0_LCM_RST), 0); + mdelay(1); + gpio_output(GPIO(DSI0_LCM_RST), 1); + mdelay(6); }
static void power_on_edp_mutto_b152731e1(void) diff --git a/src/soc/mediatek/mt8188/Makefile.inc b/src/soc/mediatek/mt8188/Makefile.inc index 7ac988b..95df6dc 100644 --- a/src/soc/mediatek/mt8188/Makefile.inc +++ b/src/soc/mediatek/mt8188/Makefile.inc @@ -49,6 +49,7 @@ ramstage-y += ../common/mtcmos.c mtcmos.c ramstage-y += ../common/pmif.c ../common/pmif_clk.c pmif_clk.c ramstage-y += ../common/pmif_spi.c pmif_spi.c +ramstage-y += ../common/pmif_spmi.c pmif_spmi.c ramstage-y += ../common/rtc.c ../common/rtc_osc_init.c ../common/rtc_mt6359p.c ramstage-y += soc.c ramstage-y += ../common/spm.c spm.c