summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLin Huang <hl@rock-chips.com>2017-11-23 08:50:03 +0800
committerJulius Werner <jwerner@chromium.org>2017-11-28 19:17:56 +0000
commitadd7666a47c454df39e86c3782bf736372b765be (patch)
treed18b39c2e20cf91c2dcfb525c3f3d7b0bc0da0f8 /src
parent18617bf21b22126f3f6761c5e0c35010362d791e (diff)
downloadcoreboot-add7666a47c454df39e86c3782bf736372b765be.tar.xz
google/scarlet: support kd097d04 panel
Support kd097d04 dual mipi panel on Scarlet. Change-Id: Ie8bc0cbb79840f1924a8cc111f2511292203731f Signed-off-by: Lin Huang <hl@rock-chips.com> Reviewed-on: https://review.coreboot.org/22472 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/gru/mainboard.c167
-rw-r--r--src/soc/rockchip/rk3399/display.c2
-rw-r--r--src/soc/rockchip/rk3399/include/soc/display.h3
3 files changed, 168 insertions, 4 deletions
diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c
index 653e49af7c..d83c486e5a 100644
--- a/src/mainboard/google/gru/mainboard.c
+++ b/src/mainboard/google/gru/mainboard.c
@@ -26,8 +26,10 @@
#include <soc/clock.h>
#include <soc/display.h>
#include <soc/grf.h>
+#include <soc/mipi.h>
#include <soc/i2c.h>
#include <soc/usb.h>
+#include <string.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include "board.h"
@@ -379,9 +381,170 @@ void mainboard_power_on_backlight(void)
prepare_backlight_i2c();
}
-const struct mipi_panel_data *mainboard_get_mipi_mode(struct edid *edid)
+static struct panel_init_command kd097d04_init_commands[] = {
+ /* voltage setting */
+ { 0xB0, 0x00 },
+ { 0xB2, 0x02 },
+ { 0xB3, 0x11 },
+ { 0xB4, 0x00 },
+ { 0xB6, 0x80 },
+ /* VCOM disable */
+ { 0xB8, 0x80 },
+ { 0xBA, 0x43 },
+ /* VCOM setting */
+ { 0xBB, 0x53 },
+ /* VSP setting */
+ { 0xBC, 0x0A },
+ /* VSN setting */
+ { 0xBD, 0x4A },
+ /* VGH setting */
+ { 0xBE, 0x2F },
+ /* VGL setting */
+ { 0xBF, 0x1A },
+ { 0xF0, 0x39 },
+ { 0xF1, 0x21 },
+ /* Gamma setting */
+ { 0xB0, 0x02 },
+ { 0xC0, 0x00 },
+ { 0xC1, 0x01 },
+ { 0xC2, 0x0B },
+ { 0xC3, 0x15 },
+ { 0xC4, 0x22 },
+ { 0xC5, 0x11 },
+ { 0xC6, 0x15 },
+ { 0xC7, 0x19 },
+ { 0xC8, 0x1A },
+ { 0xC9, 0x16 },
+ { 0xCA, 0x18 },
+ { 0xCB, 0x13 },
+ { 0xCC, 0x18 },
+ { 0xCD, 0x13 },
+ { 0xCE, 0x1C },
+ { 0xCF, 0x19 },
+ { 0xD0, 0x21 },
+ { 0xD1, 0x2C },
+ { 0xD2, 0x2F },
+ { 0xD3, 0x30 },
+ { 0xD4, 0x19 },
+ { 0xD5, 0x1F },
+ { 0xD6, 0x00 },
+ { 0xD7, 0x01 },
+ { 0xD8, 0x0B },
+ { 0xD9, 0x15 },
+ { 0xDA, 0x22 },
+ { 0xDB, 0x11 },
+ { 0xDC, 0x15 },
+ { 0xDD, 0x19 },
+ { 0xDE, 0x1A },
+ { 0xDF, 0x16 },
+ { 0xE0, 0x18 },
+ { 0xE1, 0x13 },
+ { 0xE2, 0x18 },
+ { 0xE3, 0x13 },
+ { 0xE4, 0x1C },
+ { 0xE5, 0x19 },
+ { 0xE6, 0x21 },
+ { 0xE7, 0x2C },
+ { 0xE8, 0x2F },
+ { 0xE9, 0x30 },
+ { 0xEA, 0x19 },
+ { 0xEB, 0x1F },
+ /* GOA MUX setting */
+ { 0xB0, 0x01 },
+ { 0xC0, 0x10 },
+ { 0xC1, 0x0F },
+ { 0xC2, 0x0E },
+ { 0xC3, 0x0D },
+ { 0xC4, 0x0C },
+ { 0xC5, 0x0B },
+ { 0xC6, 0x0A },
+ { 0xC7, 0x09 },
+ { 0xC8, 0x08 },
+ { 0xC9, 0x07 },
+ { 0xCA, 0x06 },
+ { 0xCB, 0x05 },
+ { 0xCC, 0x00 },
+ { 0xCD, 0x01 },
+ { 0xCE, 0x02 },
+ { 0xCF, 0x03 },
+ { 0xD0, 0x04 },
+ { 0xD6, 0x10 },
+ { 0xD7, 0x0F },
+ { 0xD8, 0x0E },
+ { 0xD9, 0x0D },
+ { 0xDA, 0x0C },
+ { 0xDB, 0x0B },
+ { 0xDC, 0x0A },
+ { 0xDD, 0x09 },
+ { 0xDE, 0x08 },
+ { 0xDF, 0x07 },
+ { 0xE0, 0x06 },
+ { 0xE1, 0x05 },
+ { 0xE2, 0x00 },
+ { 0xE3, 0x01 },
+ { 0xE4, 0x02 },
+ { 0xE5, 0x03 },
+ { 0xE6, 0x04 },
+ { 0xE7, 0x00 },
+ { 0xEC, 0xC0 },
+ /* GOA timing setting */
+ { 0xB0, 0x03 },
+ { 0xC0, 0x01 },
+ { 0xC2, 0x6F },
+ { 0xC3, 0x6F },
+ { 0xC5, 0x36 },
+ { 0xC8, 0x08 },
+ { 0xC9, 0x04 },
+ { 0xCA, 0x41 },
+ { 0xCC, 0x43 },
+ { 0xCF, 0x60 },
+ { 0xD2, 0x04 },
+ { 0xD3, 0x04 },
+ { 0xD4, 0x03 },
+ { 0xD5, 0x02 },
+ { 0xD6, 0x01 },
+ { 0xD7, 0x00 },
+ { 0xDB, 0x01 },
+ { 0xDE, 0x36 },
+ { 0xE6, 0x6F },
+ { 0xE7, 0x6F },
+ /* GOE setting */
+ { 0xB0, 0x06 },
+ { 0xB8, 0xA5 },
+ { 0xC0, 0xA5 },
+ { 0xD5, 0x3F },
+};
+
+const struct mipi_panel_data kd097d04_panel = {
+ .mipi_num = 2,
+ .format = MIPI_DSI_FMT_RGB888,
+ .lanes = 8,
+ .display_on_udelay = 120000,
+ .video_mode_udelay = 5000,
+ .init_cmd = kd097d04_init_commands,
+ .num_init_commands = ARRAY_SIZE(kd097d04_init_commands)
+};
+
+static const struct edid_mode kd097d04_edid_mode = {
+ .name = "1536x2048@60Hz",
+ .pixel_clock = 213000,
+ .refresh = 60,
+ .ha = 1536,
+ .hbl = 164,
+ .hso = 70,
+ .hspw = 24,
+ .va = 2048,
+ .vbl = 44,
+ .vso = 17,
+ .vspw = 2,
+};
+
+const struct mipi_panel_data *mainboard_get_mipi_mode
+ (struct edid_mode *edid_mode)
{
- return NULL;
+ memcpy(edid_mode, &kd097d04_edid_mode, sizeof(struct edid_mode));
+
+ return &kd097d04_panel;
}
static void mainboard_enable(device_t dev)
diff --git a/src/soc/rockchip/rk3399/display.c b/src/soc/rockchip/rk3399/display.c
index cc265b2edb..b81e96f0fe 100644
--- a/src/soc/rockchip/rk3399/display.c
+++ b/src/soc/rockchip/rk3399/display.c
@@ -123,7 +123,7 @@ retry_edp:
write32(&rk3399_grf->soc_con20,
RK_CLRBITS((1 << 0) | (1 << 4)));
- panel_data = mainboard_get_mipi_mode(&edid);
+ panel_data = mainboard_get_mipi_mode(&edid.mode);
if (panel_data) {
if (panel_data->mipi_num > 1)
detected_mode = VOP_MODE_DUAL_MIPI;
diff --git a/src/soc/rockchip/rk3399/include/soc/display.h b/src/soc/rockchip/rk3399/include/soc/display.h
index bf90f651a6..494def61d8 100644
--- a/src/soc/rockchip/rk3399/include/soc/display.h
+++ b/src/soc/rockchip/rk3399/include/soc/display.h
@@ -23,5 +23,6 @@
void rk_display_init(device_t dev);
void mainboard_power_on_backlight(void);
-const struct mipi_panel_data *mainboard_get_mipi_mode(struct edid *edid);
+const struct mipi_panel_data *mainboard_get_mipi_mode
+ (struct edid_mode *edid_mode);
#endif