From 4ce67c02b215c570bb62305318a801c724e70c2f Mon Sep 17 00:00:00 2001 From: Vinod Polimera Date: Mon, 30 May 2022 18:03:41 +0530 Subject: mb/google/herobrine: Add support to enable display This change adds support to enable edp gpios, display init for herobrine. BUG=b:182963902,b:216687885 TEST=Validated on qualcomm sc7280 development board. Monitor name: LQ140M1JW49 Change-Id: I01dbe23afbb3d41d87f24cb7dcfa456cb7f133fb Signed-off-by: Vinod Polimera Reviewed-on: https://review.coreboot.org/c/coreboot/+/64885 Reviewed-by: Shelley Chen Tested-by: build bot (Jenkins) --- src/mainboard/google/herobrine/board.h | 4 ++++ src/mainboard/google/herobrine/mainboard.c | 37 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) (limited to 'src/mainboard') diff --git a/src/mainboard/google/herobrine/board.h b/src/mainboard/google/herobrine/board.h index 0e06cd9305..4c2aad6539 100644 --- a/src/mainboard/google/herobrine/board.h +++ b/src/mainboard/google/herobrine/board.h @@ -49,6 +49,10 @@ #define GPIO_EN_FP_RAILS dead_code_t(gpio_t) #endif +/* Display specific gpios */ +#define GPIO_PANEL_POWER_ON GPIO(80) +#define GPIO_PANEL_HPD GPIO(60) + void setup_chromeos_gpios(void); #endif /* _COREBOOT_SRC_MAINBOARD_GOOGLE_HEROBRINE_BOARD_H_ */ diff --git a/src/mainboard/google/herobrine/mainboard.c b/src/mainboard/google/herobrine/mainboard.c index 0901ff0cc3..ece6d6859a 100644 --- a/src/mainboard/google/herobrine/mainboard.c +++ b/src/mainboard/google/herobrine/mainboard.c @@ -1,10 +1,17 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include "board.h" +#include #include +#include +#include +#include #include #include +#include #include +#include +#include #include #include #include @@ -46,6 +53,35 @@ static void qi2s_configure_gpios(void) GPIO_NO_PULL, GPIO_16MA, GPIO_OUTPUT); } +static void edp_configure_gpios(void) +{ + /* Panel power on GPIO enable */ + gpio_output(GPIO_PANEL_POWER_ON, 1); + + /* Panel HPD GPIO enable */ + gpio_input_pulldown(GPIO_PANEL_HPD); +} + +static void display_startup(void) +{ + struct edid ed; + + if (!display_init_required()) { + printk(BIOS_INFO, "Skipping display init.\n"); + return; + } + + enable_mdss_clk(); + edp_configure_gpios(); + mdelay(250); /* Delay for the panel to be up */ + if (edp_ctrl_init(&ed) == CB_SUCCESS) { + mdp_dsi_video_config(&ed); + mdp_dsi_video_on(); + edid_set_framebuffer_bits_per_pixel(&ed, 32, 0); + fb_new_framebuffer_info_from_edid(&ed, (uintptr_t)0); + } +} + static void mainboard_init(struct device *dev) { /* Configure clock for eMMC */ @@ -102,6 +138,7 @@ static void mainboard_init(struct device *dev) setup_usb(); qi2s_configure_gpios(); + display_startup(); } static void mainboard_enable(struct device *dev) -- cgit v1.2.3