diff options
author | Bo-Chen Chen <rex-bc.chen@mediatek.com> | 2022-11-30 15:16:47 +0800 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-12-12 13:55:19 +0000 |
commit | 7d94b2b489ae4406c1fbd3cdf2c90de59865a405 (patch) | |
tree | e6db5657703fd2307539d0095d9dbc6eac97c254 /src/mainboard/google/geralt | |
parent | c07ccd9aac15e3f6621a6750e53c551f734b6e52 (diff) |
mb/google/geralt: Add support for MIPI display
Both eDP and MIPI interfaces are supported in geralt project, so we can
initialize the different displays according to the panel ID.
This patch also generalizes the display initialization. So
`configure_edp_panel_backlight` and `power_on_edp_panel` can be removed.
BUG=b:244208960
TEST=test firmware display pass for MIPI panel on MT8188 EVB.
Change-Id: I7ae9318f56c70446516e197635acaffb8197ab53
Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70406
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/geralt')
-rw-r--r-- | src/mainboard/google/geralt/display.c | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/src/mainboard/google/geralt/display.c b/src/mainboard/google/geralt/display.c index 5c81434fea..396d6e0c03 100644 --- a/src/mainboard/google/geralt/display.c +++ b/src/mainboard/google/geralt/display.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include <assert.h> #include <console/console.h> #include <delay.h> #include <edid.h> @@ -7,45 +8,53 @@ #include <gpio.h> #include <soc/ddp.h> #include <soc/dptx.h> +#include <soc/dsi.h> #include <soc/gpio_common.h> #include <soc/mtcmos.h> #include "display.h" -#include "gpio.h" - -/* Set up backlight control pins as output pin and power-off by default */ -static void configure_edp_panel_backlight(void) -{ - gpio_output(GPIO_AP_DISP_BKLTEN, 0); - gpio_output(GPIO_EDP_BL_PWM_1V8, 0); -} - -static void power_on_edp_panel(void) -{ - gpio_output(GPIO_EN_PP3300_EDP_DISP_X, 1); - gpio_set_pull(GPIO_EDP_HPD_1V8, GPIO_PULL_ENABLE, GPIO_PULL_UP); - gpio_set_mode(GPIO_EDP_HPD_1V8, 4); -} +#include "panel.h" int configure_display(void) { struct edid edid; struct fb_info *info; const char *name; + struct panel_description *panel = get_active_panel(); + if (!panel) + return -1; printk(BIOS_INFO, "%s: Starting display initialization\n", __func__); mtcmos_display_power_on(); - configure_edp_panel_backlight(); - power_on_edp_panel(); + + panel->configure_panel_backlight(); + panel->power_on(); mtk_ddp_init(); mdelay(200); - if (mtk_edp_init(&edid) < 0) { - printk(BIOS_ERR, "%s: Failed to initialize eDP\n", __func__); - return -1; + if (panel->disp_path == DISP_PATH_EDP) { + if (mtk_edp_init(&edid) < 0) { + printk(BIOS_ERR, "%s: Failed to initialize eDP\n", __func__); + return -1; + } + + } else { + u32 mipi_dsi_flags = (MIPI_DSI_MODE_VIDEO | + MIPI_DSI_MODE_VIDEO_SYNC_PULSE | + MIPI_DSI_MODE_LPM | + MIPI_DSI_MODE_EOT_PACKET); + + edid = panel->s->edid; + + if (mtk_dsi_init(mipi_dsi_flags, MIPI_DSI_FMT_RGB888, 4, &edid, + panel->s->init) < 0) { + printk(BIOS_ERR, "%s: Failed in DSI init\n", __func__); + return -1; + } } + name = edid.ascii_string; if (name[0] == '\0') name = "unknown name"; @@ -55,7 +64,7 @@ int configure_display(void) edid_set_framebuffer_bits_per_pixel(&edid, 32, 0); - mtk_ddp_mode_set(&edid, DISP_PATH_EDP); + mtk_ddp_mode_set(&edid, panel->disp_path); info = fb_new_framebuffer_info_from_edid(&edid, (uintptr_t)0); if (info) fb_set_orientation(info, LB_FB_ORIENTATION_NORMAL); |