mb/google/geralt: Add power-on sequence for BOE_TV110C9M_LL0
For Geralt, we use BOE_TV110C9M_LL0 as MIPI firmware display, so add the power-on sequence for BOE_TV110C9M_LL0. BUG=b:244208960 TEST=test firmware display pass for BOE_TV110C9M_LL0 on Geralt. 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> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72749 Reviewed-by: Yidi Lin <yidilin@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
parent
84bb5f4e19
commit
d7b7460d6e
|
@ -18,6 +18,9 @@
|
|||
#define GPIO_EDP_HPD_1V8 GPIO(GPIO17)
|
||||
#define GPIO_EN_PP3300_EDP_DISP_X GPIO(DSI1_LCM_RST)
|
||||
|
||||
#define GPIO_DISP_RST_1V8_L GPIO(DSI0_LCM_RST)
|
||||
#define GPIO_EN_PPVAR_MIPI_DISP GPIO(GPIO03)
|
||||
#define GPIO_EN_PPVAR_MIPI_DISP_150MA GPIO(GPIO04)
|
||||
#define GPIO_MIPI_BL_PWM_1V8 GPIO(DISP_PWM0)
|
||||
|
||||
#define GPIO_SD_CD_ODL GPIO(I2SIN_MCK)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <boardid.h>
|
||||
#include <cbfs.h>
|
||||
#include <console/console.h>
|
||||
#include <device/i2c_simple.h>
|
||||
#include <edid.h>
|
||||
#include <gpio.h>
|
||||
#include <soc/gpio_common.h>
|
||||
|
@ -11,6 +12,21 @@
|
|||
#include "gpio.h"
|
||||
#include "panel.h"
|
||||
|
||||
int panel_pmic_reg_mask(u32 bus, u8 chip, u8 addr, u8 val, u8 mask)
|
||||
{
|
||||
u8 msg = 0;
|
||||
|
||||
if (i2c_read_field(bus, chip, addr, &msg, 0xFF, 0) < 0) {
|
||||
printk(BIOS_ERR, "Failed to read i2c: addr(%u)\n", addr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
msg &= ~mask;
|
||||
msg |= val;
|
||||
|
||||
return i2c_write_field(bus, chip, addr, msg, 0xFF, 0);
|
||||
}
|
||||
|
||||
static void get_mipi_cmd_from_cbfs(struct panel_description *desc)
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -17,6 +17,7 @@ struct panel_description {
|
|||
};
|
||||
|
||||
void fill_lp_backlight_gpios(struct lb_gpios *gpios);
|
||||
int panel_pmic_reg_mask(u32 bus, u8 chip, u8 addr, u8 val, u8 mask);
|
||||
uint32_t panel_id(void);
|
||||
struct panel_description *get_panel_description(uint32_t panel_id);
|
||||
struct panel_description *get_active_panel(void);
|
||||
|
|
|
@ -2,13 +2,21 @@
|
|||
|
||||
#include <boardid.h>
|
||||
#include <boot/coreboot_tables.h>
|
||||
#include <console/console.h>
|
||||
#include <delay.h>
|
||||
#include <gpio.h>
|
||||
#include <soc/gpio_common.h>
|
||||
#include <soc/i2c.h>
|
||||
#include <soc/regulator.h>
|
||||
#include <soc/pmif.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "gpio.h"
|
||||
#include "panel.h"
|
||||
|
||||
#define PMIC_TPS65132_I2C I2C3
|
||||
#define PMIC_TPS65132_SLAVE 0x3E
|
||||
|
||||
static void configure_mipi_pwm_backlight(void)
|
||||
{
|
||||
gpio_output(GPIO_AP_DISP_BKLTEN, 0);
|
||||
|
@ -22,7 +30,34 @@ static void configure_edp_aux_backlight(void)
|
|||
|
||||
static void power_on_mipi_boe_tv110c9m_ll0(void)
|
||||
{
|
||||
/* TODO: Add the poweron for BOE_TV110C9M_LL0 when we get BOE_TV110C9M_LL0 */
|
||||
/* 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);
|
||||
mdelay(1);
|
||||
gpio_output(GPIO_DISP_RST_1V8_L, 1);
|
||||
mdelay(6);
|
||||
}
|
||||
|
||||
static void power_on_edp_mutto_b152731e1(void)
|
||||
|
|
|
@ -49,6 +49,7 @@ ramstage-y += ../common/mt6359p.c mt6359p.c
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue