Attention is currently required from: Hung-Te Lin, Yidi Lin, Yu-Ping Wu.
Yang Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/85742?usp=email )
Change subject: mb/google/corsola: Add new board variant Wyrdeer ......................................................................
mb/google/corsola: Add new board variant Wyrdeer
Add a new Staryu follower device 'Wyrdeer'. And add MIPI panel support.
BUG=b:379810871 TEST=emerge-staryu coreboot chromeos-bootimage and check FW screen BRANCH=corsola
Change-Id: I07b73c97d8d51b32f557e31d834ffc6cfb8420ed Signed-off-by: Yang Wu wuyang5@huaqin.corp-partner.google.com --- M src/mainboard/google/corsola/Kconfig M src/mainboard/google/corsola/Kconfig.name M src/mainboard/google/corsola/Makefile.mk A src/mainboard/google/corsola/panel_wyrdeer.c 4 files changed, 78 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/85742/1
diff --git a/src/mainboard/google/corsola/Kconfig b/src/mainboard/google/corsola/Kconfig index 41f9845..f2342c2 100644 --- a/src/mainboard/google/corsola/Kconfig +++ b/src/mainboard/google/corsola/Kconfig @@ -23,7 +23,8 @@
config BOARD_GOOGLE_STARYU_COMMON def_bool BOARD_GOOGLE_STARMIE || \ - BOARD_GOOGLE_WUGTRIO + BOARD_GOOGLE_WUGTRIO || \ + BOARD_GOOGLE_WYRDEER
if BOARD_GOOGLE_CORSOLA_COMMON
@@ -31,7 +32,8 @@ def_bool BOARD_GOOGLE_KINGLER_COMMON || \ BOARD_GOOGLE_MAGIKARP || \ BOARD_GOOGLE_TENTACRUEL || \ - BOARD_GOOGLE_WUGTRIO + BOARD_GOOGLE_WUGTRIO || \ + BOARD_GOOGLE_WYRDEER
config BOARD_SPECIFIC_OPTIONS def_bool y @@ -72,6 +74,7 @@ select MIPI_PANEL_KD_KD101NE3_40TI if BOARD_GOOGLE_WUGTRIO select MIPI_PANEL_LCE_LMFBX101117480 if BOARD_GOOGLE_WUGTRIO select MIPI_PANEL_STA_ER88577 if BOARD_GOOGLE_WUGTRIO + select MIPI_PANEL_KD_KD110N11_51IE if BOARD_GOOGLE_WYRDEER select MIPI_PANEL_STA_HIMAX83102_J02 if BOARD_GOOGLE_STARMIE select MIPI_PANEL_STA_ILI9882T if BOARD_GOOGLE_STARMIE
@@ -99,6 +102,7 @@ default "Veluza" if BOARD_GOOGLE_VELUZA default "Voltorb" if BOARD_GOOGLE_VOLTORB default "Wugtrio" if BOARD_GOOGLE_WUGTRIO + default "Wyrdeer" if BOARD_GOOGLE_WYRDEER
config BOOT_DEVICE_SPI_FLASH_BUS int diff --git a/src/mainboard/google/corsola/Kconfig.name b/src/mainboard/google/corsola/Kconfig.name index ab6a1328..5de50c3 100644 --- a/src/mainboard/google/corsola/Kconfig.name +++ b/src/mainboard/google/corsola/Kconfig.name @@ -47,3 +47,6 @@
config BOARD_GOOGLE_WUGTRIO bool "-> Wugtrio" + +config BOARD_GOOGLE_WYRDEER + bool "-> Wyrdeer" diff --git a/src/mainboard/google/corsola/Makefile.mk b/src/mainboard/google/corsola/Makefile.mk index 09e9b91..b0d87e58 100644 --- a/src/mainboard/google/corsola/Makefile.mk +++ b/src/mainboard/google/corsola/Makefile.mk @@ -27,3 +27,4 @@
ramstage-$(CONFIG_BOARD_GOOGLE_STARMIE) += panel_starmie.c ramstage-$(CONFIG_BOARD_GOOGLE_WUGTRIO) += panel_wugtrio.c +ramstage-$(CONFIG_BOARD_GOOGLE_WYRDEER) += panel_wyrdeer.c diff --git a/src/mainboard/google/corsola/panel_wyrdeer.c b/src/mainboard/google/corsola/panel_wyrdeer.c new file mode 100644 index 0000000..2c984ac --- /dev/null +++ b/src/mainboard/google/corsola/panel_wyrdeer.c @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <console/console.h> +#include <delay.h> +#include <gpio.h> +#include <soc/regulator.h> +#include <soc/tps65132s.h> + +#include "gpio.h" +#include "panel.h" + +static void mipi_panel_power_on(void) +{ + const struct tps65132s_reg_setting reg_settings[] = { + { PMIC_TPS65132_VPOS, 0x14, 0x1F }, + { PMIC_TPS65132_VNEG, 0x14, 0x1F }, + { PMIC_TPS65132_DLYX, 0x95, 0xFF }, + { PMIC_TPS65132_ASSDD, 0x5b, 0xFF }, + }; + const struct tps65132s_cfg cfg = { + .i2c_bus = PMIC_I2C_BUS, + .en = GPIO_EN_PP3300_DISP_X, + .sync = GPIO_TCHPAD_INT_ODL, + .settings = reg_settings, + .setting_counts = ARRAY_SIZE(reg_settings), + }; + + mainboard_set_regulator_voltage(MTK_REGULATOR_VIO18, 1800000); + mtk_i2c_bus_init(PMIC_I2C_BUS, I2C_SPEED_FAST); + + if (is_pmic_aw37503(PMIC_I2C_BUS)) { + printk(BIOS_DEBUG, "Initialize and power on PMIC AW37503\n"); + aw37503_init(PMIC_I2C_BUS); + gpio_output(GPIO_EN_PP3300_DISP_X, 1); + mdelay(2); + gpio_output(GPIO_TCHPAD_INT_ODL, 1); + mdelay(3); + } else if (tps65132s_setup(&cfg) != CB_SUCCESS) { + printk(BIOS_ERR, "Failed to setup tps65132s\n"); + } + + /* DISP_RST_1V8_L */ + gpio_output(GPIO_EDPBRDG_RST_L, 1); + mdelay(1); + gpio_output(GPIO_EDPBRDG_RST_L, 0); + udelay(20); + gpio_output(GPIO_EDPBRDG_RST_L, 1); +} + +static struct panel_description wyrdeer_panels[] = { + /* K&D Technology panel */ + [6] = { + .configure_backlight = backlight_control, + .power_on = mipi_panel_power_on, + .name = "KD_KD110N11_51IE", + .disp_path = DISP_PATH_MIPI, + .orientation = LB_FB_ORIENTATION_LEFT_UP, + }, +}; + +struct panel_description *get_panel_description(void) +{ + uint32_t id = panel_id() & 0xF; + if (id >= ARRAY_SIZE(wyrdeer_panels)) + return NULL; + + return &wyrdeer_panels[id]; +}