mb/google/skywalker: Add MIPI panel support with TM_TL121BVMS07_00C
Add support for MIPI panel on padme and enable TM_TL121BVMS07_00C as the default panel. The panel uses AW37503 as the bias IC, with supply set to ±5.9V. Add AW37503 initialization and power-on sequence are configured according to the specification. The developer/recovery screen is not functional yet as the vendor is still debugging it. This change is proposed to enable firmware build. BUG=b:432353024 TEST=emerge-skywalker coreboot Change-Id: I37a1c0352a8619ce5b10727cdeef524ccb1107ef Signed-off-by: Yang Wu <wuyang5@huaqin.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/89218 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
4fc5f7a843
commit
6af7d299b2
6 changed files with 107 additions and 2 deletions
|
|
@ -41,6 +41,7 @@ config BOARD_SPECIFIC_OPTIONS
|
|||
select RTC
|
||||
select COMMONLIB_STORAGE
|
||||
select COMMONLIB_STORAGE_MMC
|
||||
select MIPI_PANEL_TM_TL121BVMS07_00C if BOARD_GOOGLE_PADME
|
||||
|
||||
config MAINBOARD_DIR
|
||||
string
|
||||
|
|
|
|||
|
|
@ -13,3 +13,5 @@ ramstage-y += boardid.c
|
|||
ramstage-y += mainboard.c
|
||||
ramstage-y += panel.c
|
||||
ramstage-y += regulator.c
|
||||
|
||||
ramstage-$(CONFIG_BOARD_GOOGLE_PADME) += panel_padme.c
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <soc/usb.h>
|
||||
|
||||
#include "gpio.h"
|
||||
#include "panel.h"
|
||||
#include "storage.h"
|
||||
|
||||
#define AFE_SE_SECURE_CON1 (AUDIO_BASE + 0x5634)
|
||||
|
|
@ -88,6 +89,8 @@ enum mtk_storage_type mainboard_get_storage_type(void)
|
|||
|
||||
static void mainboard_init(struct device *dev)
|
||||
{
|
||||
mt6359p_init_pmif_arb();
|
||||
|
||||
if (mainboard_get_storage_type() == STORAGE_EMMC) {
|
||||
mtk_msdc_configure_emmc(true);
|
||||
mtcmos_ufs_power_off();
|
||||
|
|
|
|||
|
|
@ -1,12 +1,34 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
|
||||
|
||||
#include <console/console.h>
|
||||
#include <delay.h>
|
||||
#include <device/i2c_simple.h>
|
||||
|
||||
#include <gpio.h>
|
||||
#include <soc/display.h>
|
||||
#include <soc/regulator.h>
|
||||
|
||||
#include "gpio.h"
|
||||
#include "panel.h"
|
||||
|
||||
static void aw37503_init(unsigned int bus)
|
||||
{
|
||||
i2c_write_field(bus, PMIC_AW37503_SLAVE, 0x00, 0x13, 0x1F, 0);
|
||||
i2c_write_field(bus, PMIC_AW37503_SLAVE, 0x01, 0x13, 0x1F, 0);
|
||||
i2c_write_field(bus, PMIC_AW37503_SLAVE, 0x21, 0x4C, 0xFF, 0);
|
||||
i2c_write_field(bus, PMIC_AW37503_SLAVE, 0x03, 0x43, 0xFF, 0);
|
||||
i2c_write_field(bus, PMIC_AW37503_SLAVE, 0x21, 0x00, 0xFF, 0);
|
||||
}
|
||||
|
||||
static bool is_pmic_aw37503(unsigned int bus)
|
||||
{
|
||||
u8 vendor_id;
|
||||
return (!i2c_read_field(bus, PMIC_AW37503_SLAVE,
|
||||
0x04, &vendor_id, 0x0F, 0) && vendor_id == 0x01);
|
||||
}
|
||||
|
||||
/* Set up backlight control pins as output pins, and set them to power off by default */
|
||||
static void configure_backlight(void)
|
||||
void panel_configure_backlight(void)
|
||||
{
|
||||
gpio_output(GPIO_EDP_BL_EN_1V8, 0);
|
||||
gpio_output(GPIO_BL_PWM_1V8, 0);
|
||||
|
|
@ -19,8 +41,39 @@ static void power_on_panel(void)
|
|||
gpio_set_pull(GPIO_EDP_HPD_1V8, GPIO_PULL_DISABLE, GPIO_PULL_UP);
|
||||
}
|
||||
|
||||
void mipi_panel_power_on(void)
|
||||
{
|
||||
struct aw37503_config config = {
|
||||
.i2c_bus = PMIC_I2C_BUS,
|
||||
.en = GPIO_TCHSCR_REPORT_DISABLE,
|
||||
};
|
||||
gpio_output(config.en, 0);
|
||||
mdelay(1);
|
||||
|
||||
mainboard_set_regulator_voltage(MTK_REGULATOR_VCN18, 1800000);
|
||||
mtk_i2c_bus_init(config.i2c_bus, I2C_SPEED_FAST);
|
||||
|
||||
mainboard_enable_regulator(MTK_REGULATOR_VCN18, true);
|
||||
mdelay(5);
|
||||
|
||||
if (is_pmic_aw37503(config.i2c_bus)) {
|
||||
printk(BIOS_DEBUG, "Initialize and power on PMIC AW37503\n");
|
||||
aw37503_init(config.i2c_bus);
|
||||
gpio_output(config.en, 1);
|
||||
mdelay(10);
|
||||
}
|
||||
gpio_output(GPIO_EN_PP3300_EDP_X, 0);
|
||||
mdelay(1);
|
||||
gpio_output(GPIO_EN_PP3300_EDP_X, 1);
|
||||
mdelay(1);
|
||||
gpio_output(GPIO_TCHSCR_RST_1V8_L, 0);
|
||||
mdelay(1);
|
||||
gpio_output(GPIO_TCHSCR_RST_1V8_L, 1);
|
||||
mdelay(6);
|
||||
}
|
||||
|
||||
static struct panel_description panel = {
|
||||
.configure_backlight = configure_backlight,
|
||||
.configure_backlight = panel_configure_backlight,
|
||||
.power_on = power_on_panel,
|
||||
.disp_path = DISP_PATH_EDP,
|
||||
.orientation = LB_FB_ORIENTATION_NORMAL,
|
||||
|
|
@ -28,5 +81,8 @@ static struct panel_description panel = {
|
|||
|
||||
struct panel_description *get_active_panel(void)
|
||||
{
|
||||
if (CONFIG(BOARD_GOOGLE_PADME))
|
||||
return get_panel_description();
|
||||
|
||||
return &panel;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,24 @@
|
|||
#ifndef __MAINBOARD_GOOGLE_SKYWALKER_PANEL_H__
|
||||
#define __MAINBOARD_GOOGLE_SKYWALKER_PANEL_H__
|
||||
|
||||
#include <gpio.h>
|
||||
#include <soc/display.h>
|
||||
#include <soc/i2c.h>
|
||||
|
||||
#define PMIC_AW37503_SLAVE 0x3E
|
||||
#define PMIC_I2C_BUS I2C6
|
||||
|
||||
struct aw37503_config {
|
||||
uint32_t i2c_bus;
|
||||
gpio_t en;
|
||||
};
|
||||
|
||||
uint8_t panel_id(void);
|
||||
|
||||
void panel_configure_backlight(void);
|
||||
void mipi_panel_power_on(void);
|
||||
|
||||
/* Return the mipi panel description */
|
||||
struct panel_description *get_panel_description(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
25
src/mainboard/google/skywalker/panel_padme.c
Normal file
25
src/mainboard/google/skywalker/panel_padme.c
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <console/console.h>
|
||||
|
||||
#include "gpio.h"
|
||||
#include "panel.h"
|
||||
|
||||
static struct panel_description padme_panels[] = {
|
||||
[0x22] = {
|
||||
.configure_backlight = panel_configure_backlight,
|
||||
.power_on = mipi_panel_power_on,
|
||||
.name = "TM_TL121BVMS07_00C",
|
||||
.disp_path = DISP_PATH_MIPI,
|
||||
.orientation = LB_FB_ORIENTATION_LEFT_UP,
|
||||
},
|
||||
};
|
||||
|
||||
struct panel_description *get_panel_description(void)
|
||||
{
|
||||
uint8_t id = panel_id();
|
||||
if (id >= ARRAY_SIZE(padme_panels))
|
||||
return NULL;
|
||||
|
||||
return &padme_panels[id];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue