summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-02-15 17:27:31 +0800
committerYe Li <ye.li@nxp.com>2017-04-05 17:24:34 +0800
commit7ef1d78154fef4f799dbf7de0f3d9679911ffa39 (patch)
tree212b2eb3cbf9e6c2fef5e28e9144df759154a27f /drivers/video
parentd65bbb0585a906072f01a2d72169be0b13b1d9b8 (diff)
downloadu-boot-imx-7ef1d78154fef4f799dbf7de0f3d9679911ffa39.zip
u-boot-imx-7ef1d78154fef4f799dbf7de0f3d9679911ffa39.tar.gz
u-boot-imx-7ef1d78154fef4f799dbf7de0f3d9679911ffa39.tar.bz2
MLK-13929-3 video: Update LCDIF driver to support MIPI-DSI
The LCDIF provides video source for MIPI DSI host at DPI-2 interface. When the LCDIF Framebuffer driver is enabled, it uses the panel parameters setup by environments to create a panel device and register it to DSI host driver and then enable the DSI host. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 85659ea5ee975fa2d5fa7215e17a01f7006c39bf)
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/mxsfb.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index fae9d75..4390eda 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -4,6 +4,7 @@
* Copyright (C) 2011-2013 Marek Vasut <marex@denx.de>
*
* Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
*
* SPDX-License-Identifier: GPL-2.0+
*/
@@ -29,6 +30,10 @@
#include <gis.h>
#endif
+#ifdef CONFIG_MXC_MIPI_DSI_NORTHWEST
+#include <mipi_dsi_northwest.h>
+#endif
+
#define PS2KHZ(ps) (1000000000UL / (ps))
static GraphicDevice panel;
@@ -178,6 +183,10 @@ void lcdif_power_down(void)
if (!panel.frameAdrs)
return;
+#ifdef CONFIG_MXC_MIPI_DSI_NORTHWEST
+ mipi_dsi_northwest_shutdown();
+#endif
+
writel(panel.frameAdrs, &regs->hw_lcdif_cur_buf_reg);
writel(panel.frameAdrs, &regs->hw_lcdif_next_buf_reg);
writel(LCDIF_CTRL1_VSYNC_EDGE_IRQ, &regs->hw_lcdif_ctrl1_clr);
@@ -278,6 +287,40 @@ void *video_hw_init(void)
printf("%s\n", panel.modeIdent);
+#ifdef CONFIG_MXC_MIPI_DSI_NORTHWEST
+ struct mipi_dsi_northwest_panel_device *pdevice;
+
+ /* Setup DSI host driver */
+ mipi_dsi_northwest_setup(DSI_RBASE, SIM0_RBASE);
+
+#ifdef CONFIG_HX8363
+ /* Setup hx8363 panel driver */
+ hx8363_init();
+#endif
+
+ pdevice = (struct mipi_dsi_northwest_panel_device *)malloc(sizeof(struct mipi_dsi_northwest_panel_device));
+ if (!pdevice) {
+ printf("Error allocating MIPI panel device!\n");
+ free(fb);
+ return NULL;
+ }
+
+ /* Using the panel parameters to create a DSI panel device */
+ pdevice->bpp = bpp;
+ pdevice->data_lane_num = 2;
+ pdevice->mode = fbmode;
+ pdevice->name = fbmode.name;
+ pdevice->virtual_ch_id = 0;
+ pdevice->host = NULL;
+
+ /* Register a panel device */
+ mipi_dsi_northwest_register_panel_device(pdevice);
+
+ /* Enable the MIPI DSI host to work */
+ mipi_dsi_northwest_enable();
+#endif
+
+
/* Start framebuffer */
mxs_lcd_init(&panel, &mode, bpp);