summaryrefslogtreecommitdiff
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-02-16 10:02:15 +0800
commit85659ea5ee975fa2d5fa7215e17a01f7006c39bf (patch)
tree75c940a85c080d1b813a8cc46f9c43bca2cef431
parent0c6d0f4202bae7f61d38ecff1c9d255261f022f2 (diff)
downloadu-boot-imx-85659ea5ee975fa2d5fa7215e17a01f7006c39bf.zip
u-boot-imx-85659ea5ee975fa2d5fa7215e17a01f7006c39bf.tar.gz
u-boot-imx-85659ea5ee975fa2d5fa7215e17a01f7006c39bf.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>
-rw-r--r--drivers/video/mxsfb.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 0ddb7b8..5e77024 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;
@@ -175,6 +180,11 @@ void lcdif_power_down(void)
if (check_module_fused(MX6_MODULE_LCDIF))
return;
#endif
+
+#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);
@@ -275,6 +285,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);