summaryrefslogtreecommitdiffstats
path: root/src/mainboard/google/cherry
diff options
context:
space:
mode:
authorYidi Lin <yidilin@chromium.org>2024-01-09 11:50:27 +0800
committerFelix Held <felix-coreboot@felixheld.de>2024-01-10 14:21:20 +0000
commitc4e14c2929c9b510c05ac7e54a9d0c441056f5e5 (patch)
treec5d9c2a80eeec2bfb028a6b6868b3daf6429fc98 /src/mainboard/google/cherry
parentcb7c4fdbd6c75d4ce9a2a5136b45f887bcf21d15 (diff)
downloadcoreboot-c4e14c2929c9b510c05ac7e54a9d0c441056f5e5.tar.gz
coreboot-c4e14c2929c9b510c05ac7e54a9d0c441056f5e5.tar.bz2
coreboot-c4e14c2929c9b510c05ac7e54a9d0c441056f5e5.zip
mb/google/cherry: Use common mtk_display_init()
TEST=check FW screen on dojo Change-Id: Ie870899226588ac2a2e80f77e434455f4913d387 Signed-off-by: Yidi Lin <yidilin@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79778 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/mainboard/google/cherry')
-rw-r--r--src/mainboard/google/cherry/mainboard.c52
1 files changed, 12 insertions, 40 deletions
diff --git a/src/mainboard/google/cherry/mainboard.c b/src/mainboard/google/cherry/mainboard.c
index c1593ca999ff..0e78f62a8754 100644
--- a/src/mainboard/google/cherry/mainboard.c
+++ b/src/mainboard/google/cherry/mainboard.c
@@ -7,13 +7,10 @@
#include <device/device.h>
#include <device/mmio.h>
#include <ec/google/chromeec/ec.h>
-#include <edid.h>
-#include <framebuffer_info.h>
#include <gpio.h>
#include <soc/bl31.h>
-#include <soc/ddp.h>
+#include <soc/display.h>
#include <soc/dpm.h>
-#include <soc/dptx.h>
#include <soc/i2c.h>
#include <soc/msdc.h>
#include <soc/mtcmos.h>
@@ -58,7 +55,7 @@ bool mainboard_needs_pcie_init(void)
}
/* Set up backlight control pins as output pin and power-off by default */
-static void configure_panel_backlight(void)
+static void configure_backlight(void)
{
gpio_output(GPIO_AP_EDP_BKLTEN, 0);
gpio_output(GPIO_BL_PWM_1V8, 0);
@@ -72,41 +69,16 @@ static void power_on_panel(void)
gpio_output(GPIO_EN_PP3300_DISP_X, 1);
}
-static bool configure_display(void)
-{
- struct edid edid;
- struct fb_info *info;
- const char *name;
-
- printk(BIOS_INFO, "%s: Starting display initialization\n", __func__);
-
- mtcmos_display_power_on();
- mtcmos_protect_display_bus();
- configure_panel_backlight();
- power_on_panel();
-
- mtk_ddp_init();
- mdelay(200);
-
- if (mtk_edp_init(&edid) < 0) {
- printk(BIOS_ERR, "%s: Failed to initialize eDP\n", __func__);
- return false;
- }
- name = edid.ascii_string;
- if (name[0] == '\0')
- name = "unknown name";
- printk(BIOS_INFO, "%s: '%s %s' %dx%d@%dHz\n", __func__,
- edid.manufacturer_name, name, edid.mode.ha, edid.mode.va,
- edid.mode.refresh);
-
- edid_set_framebuffer_bits_per_pixel(&edid, 32, 0);
-
- mtk_ddp_mode_set(&edid);
- info = fb_new_framebuffer_info_from_edid(&edid, (uintptr_t)0);
- if (info)
- fb_set_orientation(info, LB_FB_ORIENTATION_NORMAL);
+static struct panel_description panel = {
+ .configure_backlight = configure_backlight,
+ .power_on = power_on_panel,
+ .disp_path = DISP_PATH_EDP,
+ .orientation = LB_FB_ORIENTATION_NORMAL,
+};
- return true;
+struct panel_description *get_active_panel(void)
+{
+ return &panel;
}
static void configure_i2s(void)
@@ -133,7 +105,7 @@ static void configure_audio(void)
static void mainboard_init(struct device *dev)
{
if (display_init_required())
- configure_display();
+ mtk_display_init();
else
printk(BIOS_INFO, "%s: Skipped display initialization\n", __func__);