summaryrefslogtreecommitdiff
path: root/src/mainboard/google/kukui/panel.h
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2019-02-20 14:31:23 +0800
committerJulius Werner <jwerner@chromium.org>2019-08-15 00:51:31 +0000
commit2c307a0bedfeecd932531387efcc4f66381f6d56 (patch)
tree436305b17e2121e4bf64da4fa46fae4aee49f3e3 /src/mainboard/google/kukui/panel.h
parent32ddc0d9f7186471c2f1ae8dc7279639dcaadb06 (diff)
downloadcoreboot-2c307a0bedfeecd932531387efcc4f66381f6d56.tar.xz
mb/google/kukui: Initialize display
Many devices in Kukui family will be using MIPI panels, which needs hard-coded EDID and initialization commands. And because each device may have its own layout and ID, there should be very few devices sharing same panel configuration. As a result, we want to put panel data (EDID and init commands) into board-specific modules, provided by `get_panel_description` function. The panel numeric ID is identified by ADC 2, and is currently available as higher 4 bits of sku_id(). After ID is retrieved, the get_panel_description should return a reference to the EDID and table of init commands. The default implementation is to simply return NULL, and the data for real devices should be provided by panel_*.c in further commits. BUG=b:80501386,b:117254947 BRANCH=none TEST=boot correctly on Kukui Change-Id: I19213aee1ac0f69f42e73be9e5ab72394f412a01 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/32511 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/mainboard/google/kukui/panel.h')
-rw-r--r--src/mainboard/google/kukui/panel.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/mainboard/google/kukui/panel.h b/src/mainboard/google/kukui/panel.h
new file mode 100644
index 0000000000..e68567ddd4
--- /dev/null
+++ b/src/mainboard/google/kukui/panel.h
@@ -0,0 +1,59 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 Huaqin Telecom Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __MAINBOARD_GOOGLE_KUKUI_PANEL_H__
+#define __MAINBOARD_GOOGLE_KUKUI_PANEL_H__
+
+#include <edid.h>
+#include <soc/dsi.h>
+
+struct panel_description {
+ struct edid edid; /* edid info of this panel */
+ enum lb_fb_orientation orientation; /* panel orientation */
+ void (*power_on)(void); /* Callback to turn on panel */
+ struct lcm_init_command init[]; /* table of init commands */
+};
+
+/* Returns the panel description from given ID. */
+extern struct panel_description *get_panel_description(int panel_id);
+
+#define INIT_DCS_CMD(...) { \
+ .cmd = LCM_DCS_CMD, \
+ .len = sizeof((u8[]){__VA_ARGS__}), \
+ .data = {__VA_ARGS__} }
+
+#define INIT_GENERIC_CMD(...) { \
+ .cmd = LCM_GENERIC_CMD, \
+ .len = sizeof((u8[]){__VA_ARGS__}), \
+ .data = {__VA_ARGS__} }
+
+#define INIT_DELAY_CMD(delay) { \
+ .cmd = LCM_DELAY_CMD,\
+ .len = delay, }
+
+#define INIT_END_CMD { .cmd = LCM_END_CMD, }
+
+/* GPIO names */
+#define GPIO_LCM_RST_1V8 GPIO(LCM_RST) /* 45 */
+#define GPIO_MIPIBRDG_PWRDN_L_1V8 GPIO(LCM_RST) /* 45 */
+#define GPIO_MIPIBRDG_RST_L_1V8 GPIO(BPI_BUS3) /* 73 */
+#define GPIO_PP1200_MIPIBRDG_EN GPIO(BPI_OLAT1) /* 54 */
+#define GPIO_PP1800_LCM_EN GPIO(SIM2_SRST) /* 36 */
+#define GPIO_PP3300_LCM_EN GPIO(SIM2_SIO) /* 35 */
+#define GPIO_PPVARN_LCD_EN GPIO(PERIPHERAL_EN9) /* 166 */
+#define GPIO_PPVARP_LCD_EN GPIO(MISC_BSI_CK_3) /* 66 */
+#define GPIO_VDDIO_MIPIBRDG_EN GPIO(SIM2_SCLK) /* 37 */
+
+#endif /* __MAINBOARD_GOOGLE_KUKUI_PANEL_H__ */