summaryrefslogtreecommitdiff
path: root/src/mainboard/google/oak/mainboard.c
diff options
context:
space:
mode:
authorDaniel Kurtz <djkurtz@chromium.org>2017-04-20 15:31:33 +0800
committerJulius Werner <jwerner@chromium.org>2017-04-25 02:37:26 +0200
commit8e055f8f5335ef72ca019317594e036f0b6cec37 (patch)
tree981b50fe6482b174070c43c9baa6a6e6b64c2953 /src/mainboard/google/oak/mainboard.c
parentb927fe19549eaf045e9372f21d1ba19f65fc669f (diff)
downloadcoreboot-8e055f8f5335ef72ca019317594e036f0b6cec37.tar.xz
google/oak: Enable dual DSI for rowan and the BOE 8-lane MIPI/DSI panel
Unlike other oak derivatives, Rowan uses an 8-lane BOE tv097qxm-nu0 MIPI/DSI panel that requires dual DSI support. Rework oak display initialization to special case Rowan, which uses a provided edid struct for its panel, special panel backlight sequencing and needs to configure mtk_ddp and mtk_dsi to use dual dsi mode. BRANCH=none BUG=b:35774871 TEST=Boot Rowan in developer mode and see output on the panel Change-Id: I136ba5bd1ab12c4ad92995e066fc6d6cf54d0898 Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-on: https://review.coreboot.org/19389 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/mainboard/google/oak/mainboard.c')
-rw-r--r--src/mainboard/google/oak/mainboard.c92
1 files changed, 80 insertions, 12 deletions
diff --git a/src/mainboard/google/oak/mainboard.c b/src/mainboard/google/oak/mainboard.c
index 4320f6ec1c..38311e50f1 100644
--- a/src/mainboard/google/oak/mainboard.c
+++ b/src/mainboard/google/oak/mainboard.c
@@ -182,8 +182,6 @@ static void configure_backlight(void)
static void configure_display(void)
{
- mtcmos_display_power_on();
-
/* board from Rev2 */
gpio_output(PAD_CMMCLK, 1); /* PANEL_3V3_ENABLE */
/* vgp2 set to 3.3V for ps8640 */
@@ -207,12 +205,54 @@ static void configure_display(void)
udelay(100);
}
-static void display_startup(void)
+static void configure_backlight_rowan(void)
+{
+ gpio_output(PAD_DAIPCMOUT, 0); /* PANEL_LCD_POWER_EN */
+ gpio_output(PAD_DISP_PWM0, 0); /* DISP_PWM0 */
+ gpio_output(PAD_PCM_TX, 0); /* PANEL_POWER_EN */
+}
+
+static void configure_display_rowan(void)
+{
+ gpio_output(PAD_UCTS2, 1); /* VDDIO_EN */
+ /* delay 15 ms for panel vddio to stabilize */
+ mdelay(15);
+
+ gpio_output(PAD_SRCLKENAI2, 1); /* LCD_RESET */
+ udelay(20);
+ gpio_output(PAD_SRCLKENAI2, 0); /* LCD_RESET */
+ udelay(20);
+ gpio_output(PAD_SRCLKENAI2, 1); /* LCD_RESET */
+ mdelay(20);
+
+ /* Rowan panel avdd */
+ gpio_output(PAD_URTS2, 1);
+
+ /* Rowan panel avee */
+ gpio_output(PAD_URTS0, 1);
+
+ /* panel.delay.prepare */
+ mdelay(20);
+}
+
+static const struct edid rowan_boe_edid = {
+ .panel_bits_per_color = 8,
+ .panel_bits_per_pixel = 24,
+ .mode = {
+ .name = "1536x2048@60Hz",
+ .pixel_clock = 241646,
+ .lvds_dual_channel = 1,
+ .refresh = 60,
+ .ha = 1536, .hbl = 404, .hso = 200, .hspw = 4, .hborder = 0,
+ .va = 2048, .vbl = 28, .vso = 12, .vspw = 2, .vborder = 0,
+ .phsync = '-', .pvsync = '-',
+ .x_mm = 147, .y_mm = 196,
+ },
+};
+
+static int read_edid_from_ps8640(struct edid *edid)
{
- struct edid edid;
u8 i2c_bus, i2c_addr;
- int ret;
- bool dual_dsi_mode = false;
if (board_id() + CONFIG_BOARD_ID_ADJUSTMENT > 6) {
i2c_bus = 0;
@@ -225,16 +265,42 @@ static void display_startup(void)
mtk_i2c_bus_init(i2c_bus);
ps8640_init(i2c_bus, i2c_addr);
- if (ps8640_get_edid(i2c_bus, i2c_addr, &edid)) {
+ if (ps8640_get_edid(i2c_bus, i2c_addr, edid)) {
printk(BIOS_ERR, "Can't get panel's edid\n");
- return;
+ return -1;
+ }
+
+ return 0;
+}
+
+static void display_startup(void)
+{
+ struct edid edid;
+ int ret;
+ u32 mipi_dsi_flags;
+ bool dual_dsi_mode;
+
+ if (IS_ENABLED(CONFIG_BOARD_GOOGLE_ROWAN)) {
+ edid = rowan_boe_edid;
+ dual_dsi_mode = true;
+ mipi_dsi_flags = MIPI_DSI_MODE_VIDEO |
+ MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
+ MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET |
+ MIPI_DSI_CLOCK_NON_CONTINUOUS;
+ } else {
+ if (read_edid_from_ps8640(&edid) < 0)
+ return;
+
+ dual_dsi_mode = false;
+ mipi_dsi_flags = MIPI_DSI_MODE_VIDEO |
+ MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
}
edid_set_framebuffer_bits_per_pixel(&edid, 32, 0);
mtk_ddp_init(dual_dsi_mode);
- ret = mtk_dsi_init(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
- MIPI_DSI_FMT_RGB888, 4, dual_dsi_mode, &edid);
+ ret = mtk_dsi_init(mipi_dsi_flags, MIPI_DSI_FMT_RGB888, 4,
+ dual_dsi_mode, &edid);
if (ret < 0) {
printk(BIOS_ERR, "dsi init fail\n");
return;
@@ -262,13 +328,15 @@ static void mainboard_init(device_t dev)
mtk_dsi_pin_drv_ctrl();
if (display_init_required()) {
+ mtcmos_display_power_on();
if (IS_ENABLED(CONFIG_BOARD_GOOGLE_ROWAN)) {
- /* display initialization for Rowan */
+ configure_backlight_rowan();
+ configure_display_rowan();
} else {
configure_backlight();
configure_display();
- display_startup();
}
+ display_startup();
} else {
printk(BIOS_INFO, "Skipping display init.\n");
}