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 <quic_vpolimer@quicinc.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64885
Reviewed-by: Shelley Chen <shchen@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Vinod Polimera 2022-05-30 18:03:41 +05:30 committed by Shelley Chen
parent 4e93e94c7c
commit 4ce67c02b2
2 changed files with 41 additions and 0 deletions

View File

@ -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_ */

View File

@ -1,10 +1,17 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include "board.h"
#include <boardid.h>
#include <bootblock_common.h>
#include <bootmode.h>
#include <console/console.h>
#include <delay.h>
#include <device/device.h>
#include <device/mmio.h>
#include <edid.h>
#include <soc/clock.h>
#include <soc/display/mdssreg.h>
#include <soc/display/edp_ctrl.h>
#include <soc/qupv3_config_common.h>
#include <soc/qup_se_handlers_common.h>
#include <soc/qcom_qup_se.h>
@ -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)