rockchip/rk3288: add support for hdmi display
this is an brief hdmi driver which config with simple
display parameter, const encoder input & output color
format and 8bit color depth, and only 48KHz audio support.
what's more to prevent TV have not show an right things
before coreboot switch to kernel space, we have to add
an terrible 2s delay to driver (2s come from test many
times), cause we have to wait TV to respond (we got no
flag to check whether it is ready).
BUG=chrome-os-partner:40337
TEST=Booted Veyron Jerry and display normal
BRANCH=None
Change-Id: Icd33467e95de6219e1b614616f0112afc52097b6
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 7e5b699aff75a579116aae63d858c834b2f648e8
Original-Change-Id: Iedc87c011c5b62ce5f16a296dd9c3e0c2eaba59b
Original-Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/272565
Original-Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Original-Commit-Queue: Lin Huang <hl@rock-chips.com>
Original-Tested-by: Lin Huang <hl@rock-chips.com>
Reviewed-on: http://review.coreboot.org/10625
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
diff --git a/src/soc/rockchip/rk3288/display.c b/src/soc/rockchip/rk3288/display.c
index 2974d4e..192580b 100644
--- a/src/soc/rockchip/rk3288/display.c
+++ b/src/soc/rockchip/rk3288/display.c
@@ -31,6 +31,7 @@
#include <soc/clock.h>
#include <soc/display.h>
#include <soc/edp.h>
+#include <soc/hdmi.h>
#include <soc/gpio.h>
#include <soc/grf.h>
#include <soc/soc.h>
@@ -51,15 +52,27 @@
dcache_clean_invalidate_by_mva((void *)lower, upper - lower);
mmu_config_range(lower / MiB, (upper - lower) / MiB, DCACHE_OFF);
- rkclk_configure_edp();
+ switch (conf->vop_mode) {
+ case HDMI_MODE:
+ rkclk_configure_hdmi();
+ rkclk_configure_vop_aclk(conf->vop_id, 384 * MHz);
+ rk_hdmi_init(conf->vop_id);
+ if (rk_hdmi_get_edid(&edid)) {
+ printk(BIOS_WARNING, "can not get edid\n");
+ return;
+ }
+ break;
- rkclk_configure_vop_aclk(conf->vop_id, 192 * MHz);
-
- rk_edp_init(conf->vop_id);
-
- if (rk_edp_get_edid(&edid)) {
- printk(BIOS_WARNING, "can not get edid\n");
- return;
+ case EDP_MODE:
+ default:
+ rkclk_configure_edp();
+ rkclk_configure_vop_aclk(conf->vop_id, 192 * MHz);
+ rk_edp_init(conf->vop_id);
+ if (rk_edp_get_edid(&edid)) {
+ printk(BIOS_WARNING, "can not get edid\n");
+ return;
+ }
+ break;
}
if (rkclk_configure_vop_dclk(conf->vop_id, edid.pixel_clock * KHz)) {
@@ -71,15 +84,34 @@
edid.bytes_per_line = edid.ha * conf->framebuffer_bits_per_pixel / 8;
edid.x_resolution = edid.ha;
edid.y_resolution = edid.va;
- rkvop_mode_set(conf->vop_id, &edid);
+ rkvop_mode_set(conf->vop_id, &edid, conf->vop_mode);
rkvop_enable(conf->vop_id, lcdbase, &edid);
- if (rk_edp_enable()) {
- printk(BIOS_WARNING, "edp enable err\n");
- return;
+ switch (conf->vop_mode) {
+ case HDMI_MODE:
+ if (rk_hdmi_enable(&edid)) {
+ printk(BIOS_WARNING, "hdmi enable err\n");
+ return;
+ }
+
+ /*
+ * HACK: if we do remove this delay, HDMI TV may not show
+ * anythings. So we make an delay here, ensure TV have
+ * enough time to respond.
+ */
+ mdelay(2000);
+ break;
+
+ case EDP_MODE:
+ default:
+ if (rk_edp_enable()) {
+ printk(BIOS_WARNING, "edp enable err\n");
+ return;
+ }
+ mainboard_power_on_backlight();
+ break;
}
set_vbe_mode_info_valid(&edid, (uintptr_t)lcdbase);
- mainboard_power_on_backlight();
}