mb/google/trogdor: Add mipi panel for mrbland

Add mipi panel support for mrbland
- Setup gpio and modify LCD sequence.
- Use the following panel for mrbland:
  AUO B101UAN08.3
  BOE TV101WUM-N53
- Use panel_id to distinguish which mipi panel to use.

BUG=b:195516474,b:197300875,b:197300876
BRANCH=none
TEST=emerge-strongbad coreboot

Change-Id: Ib7cd2da429b114bf6bad5af312044a0f01319b46
Signed-off-by: Zanxi Chen <chenzanxi@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57336
Reviewed-by: Bob Moragues <moragues@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Zanxi Chen 2021-09-02 15:26:31 +08:00 committed by Julius Werner
parent 4757a7ea33
commit 2ef4b7ed18
4 changed files with 68 additions and 6 deletions

View File

@ -14,8 +14,10 @@ config TROGDOR_HAS_BRIDGE_BACKLIGHT
config TROGDOR_HAS_MIPI_PANEL
bool
default y if BOARD_GOOGLE_MRBLAND
select MIPI_PANEL_AUO_B101UAN08_3 if BOARD_GOOGLE_MRBLAND
select MIPI_PANEL_BOE_TV101WUM_N53 if BOARD_GOOGLE_MRBLAND
default n
select MIPI_PANEL_VIS_RM69299
config TROGDOR_HAS_FINGERPRINT
bool

View File

@ -15,13 +15,28 @@
#define GPIO_AMP_ENABLE GPIO(23)
/* Display specific GPIOS */
#define GPIO_BACKLIGHT_ENABLE GPIO(12)
#define GPIO_BACKLIGHT_ENABLE ((CONFIG(TROGDOR_HAS_MIPI_PANEL)) ? GPIO(85) : GPIO(12))
/* MIPI panel specific GPIOs. Only for mipi_panel-enabled devices (e.g. Mrbland). */
#if CONFIG(TROGDOR_HAS_MIPI_PANEL)
#define GPIO_MIPI_1V8_ENABLE GPIO(86)
#define GPIO_AVDD_LCD_ENABLE GPIO(88)
#define GPIO_AVEE_LCD_ENABLE GPIO(21)
#define GPIO_VDD_RESET_1V8 GPIO(87)
#define GPIO_EDP_BRIDGE_ENABLE dead_code_t(gpio_t)
#define GPIO_EN_PP3300_DX_EDP dead_code_t(gpio_t)
#else
#define GPIO_MIPI_1V8_ENABLE dead_code_t(gpio_t)
#define GPIO_AVDD_LCD_ENABLE dead_code_t(gpio_t)
#define GPIO_AVEE_LCD_ENABLE dead_code_t(gpio_t)
#define GPIO_VDD_RESET_1V8 dead_code_t(gpio_t)
#define GPIO_EDP_BRIDGE_ENABLE (CONFIG(TROGDOR_REV0) ? GPIO(14) : GPIO(104))
#define GPIO_EN_PP3300_DX_EDP (CONFIG(TROGDOR_REV0) ? GPIO(106) : \
(CONFIG(BOARD_GOOGLE_TROGDOR) && board_id() == 1 ? GPIO(30) : \
(CONFIG(BOARD_GOOGLE_COACHZ) && board_id() == 0 ? GPIO(52) : \
(CONFIG(BOARD_GOOGLE_LAZOR) || CONFIG(BOARD_GOOGLE_POMPOM) ? GPIO(30) : \
GPIO(67)))))
#endif
/* Fingerprint-specific GPIOs. Only for fingerprint-enabled devices (e.g. CoachZ). */
#if CONFIG(TROGDOR_HAS_FINGERPRINT)

View File

@ -12,10 +12,17 @@ void setup_chromeos_gpios(void)
gpio_input_pullup(GPIO_SD_CD_L);
gpio_input_irq(GPIO_H1_AP_INT, IRQ_TYPE_RISING_EDGE, GPIO_PULL_UP);
gpio_output(GPIO_AMP_ENABLE, 0);
gpio_output(GPIO_BACKLIGHT_ENABLE, 0);
gpio_output(GPIO_EN_PP3300_DX_EDP, 0);
gpio_output(GPIO_EDP_BRIDGE_ENABLE, 0);
if (CONFIG(TROGDOR_HAS_MIPI_PANEL)) {
gpio_output(GPIO_MIPI_1V8_ENABLE, 0);
gpio_output(GPIO_AVDD_LCD_ENABLE, 0);
gpio_output(GPIO_VDD_RESET_1V8, 0);
gpio_output(GPIO_AVEE_LCD_ENABLE, 0);
} else {
gpio_output(GPIO_EN_PP3300_DX_EDP, 0);
gpio_output(GPIO_EDP_BRIDGE_ENABLE, 0);
}
if (CONFIG(TROGDOR_HAS_FINGERPRINT)) {
gpio_output(GPIO_FPMCU_BOOT0, 0);

View File

@ -78,9 +78,46 @@ static void power_on_bridge(void)
gpio_output(GPIO_EN_PP3300_DX_EDP, 1);
}
static void configure_mipi_panel(void)
{
int panel_id = sku_id() >> 8;
gpio_output(GPIO_MIPI_1V8_ENABLE, 1);
mdelay(5);
gpio_output(GPIO_AVDD_LCD_ENABLE, 1);
mdelay(5);
gpio_output(GPIO_AVEE_LCD_ENABLE, 1);
mdelay(15);
gpio_output(GPIO_VDD_RESET_1V8, 1);
mdelay(15);
/*
* In mrbland, BOE panel_id = 3, it needs 15ms delay and
* do reset again according to spec(See in b/197300876).
*/
if (CONFIG(BOARD_GOOGLE_MRBLAND) && (panel_id == 3)) {
gpio_output(GPIO_VDD_RESET_1V8, 0);
mdelay(5);
gpio_output(GPIO_VDD_RESET_1V8, 1);
}
}
static struct panel_serializable_data *get_mipi_panel(void)
{
const char *cbfs_filename = "panel-VIS_RM69299";
const char *cbfs_filename = NULL;
int panel_id = sku_id() >> 8;
if (CONFIG(BOARD_GOOGLE_MRBLAND)) {
switch (panel_id) {
case 3:
cbfs_filename = "panel-BOE_TV101WUM_N53";
break;
case 6:
cbfs_filename = "panel-AUO_B101UAN08_3";
break;
}
}
if (!cbfs_filename)
return NULL;
struct panel_serializable_data *panel = cbfs_map(cbfs_filename, NULL);
if (!panel) {
@ -126,6 +163,7 @@ static void display_startup(void)
}
if (CONFIG(TROGDOR_HAS_MIPI_PANEL)) {
configure_mipi_panel();
panel = get_mipi_panel();
if (!panel)
return;