summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/geralt/Kconfig1
-rw-r--r--src/mainboard/google/geralt/Makefile.inc1
-rw-r--r--src/mainboard/google/geralt/panel.c23
-rw-r--r--src/mainboard/google/geralt/panel.h2
-rw-r--r--src/mainboard/google/geralt/panel_ciri.c48
-rw-r--r--src/mainboard/google/geralt/panel_geralt.c24
6 files changed, 76 insertions, 23 deletions
diff --git a/src/mainboard/google/geralt/Kconfig b/src/mainboard/google/geralt/Kconfig
index feac88a102..77822678fd 100644
--- a/src/mainboard/google/geralt/Kconfig
+++ b/src/mainboard/google/geralt/Kconfig
@@ -42,6 +42,7 @@ config BOARD_SPECIFIC_OPTIONS
select HAVE_LINEAR_FRAMEBUFFER
select RTC
select MIPI_PANEL_BOE_TV110C9M_LL0 if BOARD_GOOGLE_GERALT
+ select MIPI_PANEL_BOE_NV110WUM_L60 if BOARD_GOOGLE_CIRI
select FW_CONFIG
select FW_CONFIG_SOURCE_CHROMEEC_CBI
diff --git a/src/mainboard/google/geralt/Makefile.inc b/src/mainboard/google/geralt/Makefile.inc
index e954309e2a..b1af289d55 100644
--- a/src/mainboard/google/geralt/Makefile.inc
+++ b/src/mainboard/google/geralt/Makefile.inc
@@ -24,4 +24,5 @@ ramstage-y += mainboard.c
ramstage-y += panel.c
ramstage-y += regulator.c
ramstage-y += reset.c
+ramstage-$(CONFIG_BOARD_GOOGLE_CIRI) += panel_ciri.c
ramstage-$(CONFIG_BOARD_GOOGLE_GERALT) += panel_geralt.c
diff --git a/src/mainboard/google/geralt/panel.c b/src/mainboard/google/geralt/panel.c
index 202eda7b7d..3f55cac12d 100644
--- a/src/mainboard/google/geralt/panel.c
+++ b/src/mainboard/google/geralt/panel.c
@@ -3,10 +3,14 @@
#include <boardid.h>
#include <cbfs.h>
#include <console/console.h>
+#include <delay.h>
#include <edid.h>
#include <gpio.h>
#include <identity.h>
#include <soc/gpio_common.h>
+#include <soc/i2c.h>
+#include <soc/pmif.h>
+#include <soc/regulator.h>
#include <string.h>
#include "gpio.h"
@@ -59,3 +63,22 @@ void fill_lp_backlight_gpios(struct lb_gpios *gpios)
lb_add_gpios(gpios, backlight_gpios, ARRAY_SIZE(backlight_gpios));
}
+
+void power_on_mipi_panel(const struct tps65132s_cfg *cfg)
+{
+ mtk_i2c_bus_init(cfg->i2c_bus, I2C_SPEED_FAST);
+
+ /* Enable VM18V */
+ mainboard_enable_regulator(MTK_REGULATOR_VDD18, true);
+ mdelay(2);
+ if (tps65132s_setup(cfg) != CB_SUCCESS)
+ printk(BIOS_ERR, "Failed to set up voltage regulator tps65132s\n");
+ gpio_output(GPIO_DISP_RST_1V8_L, 0);
+ mdelay(1);
+ gpio_output(GPIO_DISP_RST_1V8_L, 1);
+ mdelay(1);
+ gpio_output(GPIO_DISP_RST_1V8_L, 0);
+ mdelay(1);
+ gpio_output(GPIO_DISP_RST_1V8_L, 1);
+ mdelay(6);
+}
diff --git a/src/mainboard/google/geralt/panel.h b/src/mainboard/google/geralt/panel.h
index 3d0fafdaed..7e07fb1684 100644
--- a/src/mainboard/google/geralt/panel.h
+++ b/src/mainboard/google/geralt/panel.h
@@ -4,9 +4,11 @@
#define __MAINBOARD_GOOGLE_GERALT_PANEL_H__
#include <soc/display.h>
+#include <soc/tps65132s.h>
void configure_mipi_pwm_backlight(void);
void fill_lp_backlight_gpios(struct lb_gpios *gpios);
+void power_on_mipi_panel(const struct tps65132s_cfg *cfg);
uint32_t panel_id(void);
struct panel_description *get_panel_description(uint32_t panel_id);
diff --git a/src/mainboard/google/geralt/panel_ciri.c b/src/mainboard/google/geralt/panel_ciri.c
new file mode 100644
index 0000000000..c50e2fa296
--- /dev/null
+++ b/src/mainboard/google/geralt/panel_ciri.c
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <console/console.h>
+#include <soc/i2c.h>
+
+#include "gpio.h"
+#include "panel.h"
+
+#define PMIC_TPS65132_I2C I2C3
+
+static void power_on_mipi_himax_83102j(void)
+{
+ const struct tps65132s_reg_setting reg_settings[] = {
+ { PMIC_TPS65132_VPOS, 0x11, 0x1f },
+ { PMIC_TPS65132_VNEG, 0x11, 0x1f },
+ { PMIC_TPS65132_DLYX, 0x55, 0xff },
+ { PMIC_TPS65132_ASSDD, 0x5b, 0xff },
+ };
+ const struct tps65132s_cfg cfg = {
+ .i2c_bus = PMIC_TPS65132_I2C,
+ .en = GPIO_EN_PPVAR_MIPI_DISP,
+ .sync = GPIO_EN_PPVAR_MIPI_DISP_150MA,
+ .settings = reg_settings,
+ .setting_counts = ARRAY_SIZE(reg_settings),
+ };
+ power_on_mipi_panel(&cfg);
+}
+
+static struct panel_description ciri_panels[] = {
+ [17] = {
+ .name = "BOE_NV110WUM_L60",
+ .power_on = power_on_mipi_himax_83102j,
+ .configure_backlight = configure_mipi_pwm_backlight,
+ .orientation = LB_FB_ORIENTATION_LEFT_UP,
+ .disp_path = DISP_PATH_MIPI,
+ .pwm_ctrl_gpio = true,
+ },
+};
+
+struct panel_description *get_panel_description(uint32_t panel_id)
+{
+ uint32_t id = panel_id & 0xFF;
+
+ if (id >= ARRAY_SIZE(ciri_panels))
+ return NULL;
+
+ return &ciri_panels[id];
+}
diff --git a/src/mainboard/google/geralt/panel_geralt.c b/src/mainboard/google/geralt/panel_geralt.c
index 6eed3fb122..0b59a4e3d5 100644
--- a/src/mainboard/google/geralt/panel_geralt.c
+++ b/src/mainboard/google/geralt/panel_geralt.c
@@ -1,15 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <boardid.h>
#include <console/console.h>
-#include <delay.h>
-#include <gpio.h>
-#include <soc/gpio_common.h>
#include <soc/i2c.h>
-#include <soc/regulator.h>
-#include <soc/tps65132s.h>
-#include <soc/pmif.h>
-#include <string.h>
#include "gpio.h"
#include "panel.h"
@@ -31,21 +23,7 @@ static void power_on_mipi_boe_tv110c9m_ll0(void)
.settings = reg_settings,
.setting_counts = ARRAY_SIZE(reg_settings),
};
-
- /* Enable VM18V */
- mainboard_enable_regulator(MTK_REGULATOR_VDD18, true);
- mtk_i2c_bus_init(PMIC_TPS65132_I2C, I2C_SPEED_FAST);
- mdelay(10);
- if (tps65132s_setup(&cfg) != CB_SUCCESS)
- printk(BIOS_ERR, "Failed to set up voltage regulator tps65132s\n");
- gpio_output(GPIO_DISP_RST_1V8_L, 0);
- mdelay(1);
- gpio_output(GPIO_DISP_RST_1V8_L, 1);
- mdelay(1);
- gpio_output(GPIO_DISP_RST_1V8_L, 0);
- mdelay(1);
- gpio_output(GPIO_DISP_RST_1V8_L, 1);
- mdelay(6);
+ power_on_mipi_panel(&cfg);
}
static struct panel_description panels[] = {