summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLin Huang <hl@rock-chips.com>2016-10-20 21:48:25 (GMT)
committerchrome-bot <chrome-bot@chromium.org>2016-10-22 01:41:36 (GMT)
commit17145da59b99f9967caebc96e4d46b556471ba5d (patch)
tree41af1d5df5170e29814a79b43a8ecb579f52fac2 /src
parent3d7fe9cf5b821947d6ab43d7f253d27c9264a0c4 (diff)
downloaddepthcharge-17145da59b99f9967caebc96e4d46b556471ba5d.tar.gz
depthcharge-17145da59b99f9967caebc96e4d46b556471ba5d.tar.xz
rockchip/rk3399: video: set the framebuffer address in depthcharge
add the display initial function, then we can set framebuffer address to vop, and use the framebuffer allocate from libpayload. CQ-DEPEND=CL:401401 BUG=chrome-os-partner:58675 BRANCH=none TEST=Boot from kevin, and display work Change-Id: Ie6fcb406d3e86137bb1ab2afe393beabdb3e06d4 Signed-off-by: Lin Huang <hl@rock-chips.com> Reviewed-on: https://chromium-review.googlesource.com/401402 Commit-Ready: Julius Werner <jwerner@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/video/rk3399.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/drivers/video/rk3399.c b/src/drivers/video/rk3399.c
index 497d360..39471f8 100644
--- a/src/drivers/video/rk3399.c
+++ b/src/drivers/video/rk3399.c
@@ -30,8 +30,9 @@
// from internal_backlight_no_als_ac_brightness
#define DEFAULT_EC_BL_PWM_DUTY 80
-static uint32_t *vop0_sys_ctrl = (uint32_t *)0xff8f0008;
-static uint32_t *vop1_sys_ctrl = (uint32_t *)0xff900008;
+static uint32_t *vop0_sys_ctrl = (uint32_t *)0xff900008;
+static uint32_t *vop0_win0_yrgb_mst = (uint32_t *)0xff900040;
+static uint32_t *vop0_reg_cfg_done = (uint32_t *)0xff900000;
/*
* callback to turn on/off the backlight
@@ -41,14 +42,23 @@ static int rk3399_backlight_update(DisplayOps *me, uint8_t enable)
return cros_ec_set_bl_pwm_duty(enable ? DEFAULT_EC_BL_PWM_DUTY : 0);
}
+static int rockchip_display_init(DisplayOps *me)
+{
+ uintptr_t phys_addr = lib_sysinfo.framebuffer->physical_address;
+
+ writel(phys_addr, vop0_win0_yrgb_mst);
+
+ /* enable reg config */
+ writel(0xffff, vop0_reg_cfg_done);
+
+ return 0;
+}
+
static int rockchip_display_stop(DisplayOps *me)
{
/* set vop0 to standby */
writel(RK_SETBITS(1 << VOP_STANDBY_EN), vop0_sys_ctrl);
- /* set vop1 to standby */
- writel(RK_SETBITS(1 << VOP_STANDBY_EN), vop1_sys_ctrl);
-
/* wait frame complete (60Hz) to enter standby */
mdelay(17);
@@ -59,6 +69,7 @@ DisplayOps *new_rk3399_display(void)
{
DisplayOps *display = xzalloc(sizeof(*display));
+ display->init = rockchip_display_init;
display->stop = rockchip_display_stop;
display->backlight_update = rk3399_backlight_update;