jitao shi has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31590
Change subject: google/kukui: Add panel config data for display ......................................................................
google/kukui: Add panel config data for display
BUG=b:80501386,b:117254947 BRANCH=none TEST=Boots correctly on Kukui
Change-Id: Ife4a724ff1ddc36b29f37690a22c1b344e0629f7 Signed-off-by: Jitao Shi jitao.shi@mediatek.com --- M src/mainboard/google/kukui/mainboard.c 1 file changed, 58 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/31590/1
diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c index 950dca4..bf9bd02 100644 --- a/src/mainboard/google/kukui/mainboard.c +++ b/src/mainboard/google/kukui/mainboard.c @@ -15,9 +15,12 @@
#include <bootmode.h> #include <console/console.h> +#include <delay.h> #include <device/device.h> #include <edid.h> +#include <gpio.h> #include <soc/ddp.h> +#include <soc/dsi.h> #include <soc/gpio.h> #include <soc/mmu_operations.h> #include <soc/mtcmos.h> @@ -42,13 +45,66 @@ setup_usb_host(); }
+/* Setup backlight control pins as output pin and power-off by default */ +static void configure_backlight(void) +{ + /* Configure PANEL_LCD_POWER_EN */ + gpio_output(GPIO(PERIPHERAL_EN13), 1); + gpio_output(GPIO(DISP_PWM), 1); /* DISP_PWM0 */ +} + +static void configure_display(void) +{ + /* board from p0 */ + gpio_output(GPIO(LCM_RST), 0); + udelay(100); + gpio_output(GPIO(LCM_RST), 1); + mdelay(20); +} + +static const struct edid kukui_innolux_edid = { + .panel_bits_per_color = 8, + .panel_bits_per_pixel = 24, + .mode = { + .name = "768x1024@60Hz", + .pixel_clock = 56900, + .lvds_dual_channel = 0, + .refresh = 60, + .ha = 768, .hbl = 120, .hso = 40, .hspw = 40, .hborder = 0, + .va = 1024, .vbl = 44, .vso = 20, .vspw = 4, .vborder = 0, + .phsync = '-', .pvsync = '-', + .x_mm = 120, .y_mm = 160, + }, +}; + +struct lcm_init_table lcm_init_cmd[] = { + {INIT_CMD, 1, {MIPI_DCS_EXIT_SLEEP_MODE}}, + {DELAY_CMD, 120, {}}, + {INIT_CMD, 1, {MIPI_DCS_SET_DISPLAY_ON}}, + {DELAY_CMD, 120, {}}, +}; + + static void display_startup(void) { + int ret = 0; + u32 mipi_dsi_flags; struct edid edid;
+ edid = kukui_innolux_edid; + mipi_dsi_flags = MIPI_DSI_MODE_VIDEO | + MIPI_DSI_MODE_VIDEO_SYNC_PULSE | + MIPI_DSI_MODE_LPM; + edid_set_framebuffer_bits_per_pixel(&edid, 32, 0);
mtk_ddp_init(); + ret = mtk_dsi_init(mipi_dsi_flags, MIPI_DSI_FMT_RGB888, 4, + false, &edid, lcm_init_cmd, sizeof(lcm_init_cmd) / sizeof(struct lcm_init_table)); + if (ret < 0) { + printk(BIOS_ERR, "dsi init fail\n"); + return; + }
mtk_ddp_mode_set(&edid);
@@ -62,6 +118,8 @@ mtcmos_display_power_on(); mtcmos_protect_display_bus();
+ configure_backlight(); + configure_display(); display_startup(); } else { printk(BIOS_INFO, "Skipping display init.\n");