mb/google/rauru: Add panel driver in mainboard

Add panel driver in mainboard for rauru project and support OLED eDP
panel.

TEST=check edp training pass and show log:
EQ training pass
BUG=b:343351631

Signed-off-by: Bincai Liu <bincai.liu@mediatek.corp-partner.google.com>
Change-Id: Iea610c97351beb94a49cc1044701a523b7c85a6e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85951
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
Bincai Liu 2024-12-06 19:40:32 +08:00 committed by Yidi Lin
commit 5a4469300e
7 changed files with 78 additions and 0 deletions

View file

@ -33,6 +33,8 @@ config BOARD_SPECIFIC_OPTIONS
select TPM_GOOGLE_TI50 if VBOOT
select COMMONLIB_STORAGE
select COMMONLIB_STORAGE_MMC
select FW_CONFIG
select FW_CONFIG_SOURCE_CHROMEEC_CBI
config MAINBOARD_DIR
string

View file

@ -10,4 +10,5 @@ romstage-y += romstage.c
ramstage-y += boardid.c
ramstage-y += mainboard.c
ramstage-y += panel.c
ramstage-y += regulator.c

View file

@ -56,6 +56,12 @@ void fill_lb_gpios(struct lb_gpios *gpios)
lb_add_gpios(gpios, alc5645_gpios, ARRAY_SIZE(alc5645_gpios));
else
lb_add_gpios(gpios, nau8318_gpios, ARRAY_SIZE(nau8318_gpios));
struct lb_gpio edp_pwm_backlight_gpios[] = {
{GPIO_BL_PWM_1V8.id, ACTIVE_HIGH, -1, "PWM control"},
{GPIO_AP_EDP_BKLTEN.id, ACTIVE_HIGH, -1, "backlight enable"},
};
lb_add_gpios(gpios, edp_pwm_backlight_gpios, ARRAY_SIZE(edp_pwm_backlight_gpios));
}
int cr50_plat_irq_status(void)

View file

@ -8,6 +8,13 @@ fw_config
end
end
fw_config
field PANEL 18 21
option DEFAULT 0
option OLED 1
end
end
chip soc/mediatek/mt8196
device cpu_cluster 0 on end

View file

@ -15,6 +15,11 @@
#define GPIO_FP_RST_1V8_S3_L GPIO(EINT26)
#define GPIO_AP_FP_FW_UP_STRAP GPIO(EINT27)
#define GPIO_EN_PWR_FP GPIO(PERIPHERAL_EN3)
#define GPIO_BL_PWM_1V8 GPIO(DISP_PWM)
#define GPIO_AP_EDP_BKLTEN GPIO(PERIPHERAL_EN4)
#define GPIO_EN_PP3300_EDP_X GPIO(PERIPHERAL_EN2)
#define GPIO_EDP_HPD_1V8 GPIO(EINT13)
#define GPIO_I2SI4_BCK GPIO(I2SIN1_BCK)
#define GPIO_I2SI4_LRCK GPIO(I2SIN1_LRCK)

View file

@ -0,0 +1,49 @@
/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
#include <fw_config.h>
#include <gpio.h>
#include <soc/ddp.h>
#include <soc/dsi.h>
#include "gpio.h"
#include "panel.h"
/* Set up backlight control pins as output pin and power-off by default */
static void configure_backlight(void)
{
gpio_output(GPIO_AP_EDP_BKLTEN, 0);
gpio_output(GPIO_BL_PWM_1V8, 0);
}
static void power_on_panel(void)
{
gpio_set_mode(GPIO_EDP_HPD_1V8, GPIO_FUNC(EINT13, EDP_TX_HPD));
}
static struct panel_description panel = {
.configure_backlight = configure_backlight,
.power_on = power_on_panel,
.disp_path = DISP_PATH_EDP,
.orientation = LB_FB_ORIENTATION_NORMAL,
};
static void power_on_oled_panel(void)
{
gpio_output(GPIO_EN_PP3300_EDP_X, 1);
gpio_set_mode(GPIO_EDP_HPD_1V8, GPIO_FUNC(EINT13, EDP_TX_HPD));
}
static struct panel_description oled_panel = {
.configure_backlight = configure_backlight,
.power_on = power_on_oled_panel,
.disp_path = DISP_PATH_EDP,
.orientation = LB_FB_ORIENTATION_NORMAL,
};
struct panel_description *get_active_panel(void)
{
if (fw_config_probe(FW_CONFIG(PANEL, OLED))) {
return &oled_panel;
}
return &panel;
}

View file

@ -0,0 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __MAINBOARD_GOOGLE_RAURU_PANEL_H__
#define __MAINBOARD_GOOGLE_RAURU_PANEL_H__
struct panel_description *get_oled_description(void);
#endif /* __MAINBOARD_GOOGLE_RAURU_PANEL_H__ */