Skip to contentSkip to conversation

imx6, display: enhancements for upcoming aristainetos DM support

PATCH New Heiko Schocher 2 participants 7 messages Jul 22, 2019 – Jul 30, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover imx6, display: enhancements for upcoming aristainetos DM support

some small enhancements for display support for the DM conversion of the aristainetos port.

Travis build:
https://travis-ci.org/hsdenx/u-boot-test/builds/559790510

Heiko Schocher (5):
global_data: enable fb_base for DM_VIDEO
mxc_ipuv3_fb.c: set gd->fb_base
bdinfo: show fb base with DM_VIDEO
mxc_ipuv3_fb.c: call display_enable
mxc_ipuv3_fb.c: enable a backlight on a panel

 cmd/bdinfo.c                      |  2 +-
 drivers/video/imx/mxc_ipuv3_fb.c  | 20 ++++++++++++++++++++
 include/asm-generic/global_data.h |  2 +-
 3 files changed, 22 insertions(+), 2 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/5 global_data: enable fb_base for DM_VIDEO

with CONFIG_VIDEO we store fb base address
in global data fb_base variable. Do this
also in DM_VIDEO case.

---

 include/asm-generic/global_data.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/asm-generic/global_data.h +1 -1
index 02a3ed6838..11bbe9b134 100644
@@ -33,7 +33,7 @@ typedef struct global_data {
 	/* We cannot bracket this with CONFIG_PCI due to mpc5xxx */
 	unsigned long pci_clk;
 	unsigned long mem_clk;
-#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
+#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO)
 	unsigned long fb_base;		/* Base address of framebuffer mem */
 #endif
 #if defined(CONFIG_POST)
Signature · 1 line
2.21.0
#2 lore raw

PATCH 2/5 mxc_ipuv3_fb.c: set gd->fb_base

In reply to Heiko Schocher

set gd->fb_base so it can be shown with bdinfo command.

---

 drivers/video/imx/mxc_ipuv3_fb.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/video/imx/mxc_ipuv3_fb.c +2 -0
index 29ecac40a2..cf672156cd 100644
@@ -609,6 +609,7 @@ void *video_hw_init(void)
 
 	ret = mxcfb_probe(gpixfmt, gdisp, gmode);
 	debug("Framebuffer at 0x%x\n", (unsigned int)panel.frameAdrs);
+	gd->fb_base = panel.frameAdrs;
 
 	return (void *)&panel;
 }
@@ -665,6 +666,7 @@ static int ipuv3_video_probe(struct udevice *dev)
 	mmu_set_region_dcache_behaviour(fb_start, fb_end - fb_start,
 					DCACHE_WRITEBACK);
 	video_set_flush_dcache(dev, true);
+	gd->fb_base = fb_start;
 
 	return 0;
 }
Signature · 1 line
2.21.0
#3 lore raw

PATCH 3/5 bdinfo: show fb base with DM_VIDEO

In reply to Heiko Schocher

show Framebuffer base with CONFIG_DM_VIDEO
enabled.

---

 cmd/bdinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/bdinfo.c +1 -1
index f576e226ee..86c17dc427 100644
@@ -328,7 +328,7 @@ static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc,
 	print_num("reloc off", gd->reloc_off);
 	print_num("irq_sp", gd->irq_sp);	/* irq stack pointer */
 	print_num("sp start ", gd->start_addr_sp);
-#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
+#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO)
 	print_num("FB base  ", gd->fb_base);
 #endif
 	/*
Signature · 1 line
2.21.0
#4 lore raw

PATCH 4/5 mxc_ipuv3_fb.c: call display_enable

In reply to Heiko Schocher

call display_enable, so a display gets enabled.

---

 drivers/video/imx/mxc_ipuv3_fb.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/video/imx/mxc_ipuv3_fb.c +13 -0
index cf672156cd..aca76bd9cc 100644
@@ -24,6 +24,7 @@
 #include "ipu.h"
 #include "mxcfb.h"
 #include "ipu_regs.h"
+#include "display.h"
 
 #include <dm.h>
 #include <video.h>
@@ -637,6 +638,9 @@ static int ipuv3_video_probe(struct udevice *dev)
 {
 	struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
 	struct video_priv *uc_priv = dev_get_uclass_priv(dev);
+#if defined(CONFIG_DISPLAY)
+	struct udevice *disp_dev;
+#endif
 	u32 fb_start, fb_end;
 	int ret;
 
@@ -655,6 +659,15 @@ static int ipuv3_video_probe(struct udevice *dev)
 	if (ret < 0)
 		return ret;
 
+#if defined(CONFIG_DISPLAY)
+	ret = uclass_first_device(UCLASS_DISPLAY, &disp_dev);
+	if (disp_dev) {
+		ret = display_enable(disp_dev, 16, NULL);
+		if (ret < 0)
+			return ret;
+	}
+#endif
+
 	uc_priv->xsize = gmode->xres;
 	uc_priv->ysize = gmode->yres;
 	uc_priv->bpix = LCD_MAX_LOG2_BPP;
Signature · 1 line
2.21.0
#5 lore raw

PATCH 5/5 mxc_ipuv3_fb.c: enable a backlight on a panel

In reply to Heiko Schocher

check if we get a panel device, if so, enable
the backlight on it.

---

 drivers/video/imx/mxc_ipuv3_fb.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/video/imx/mxc_ipuv3_fb.c +5 -0
index aca76bd9cc..c64be38e49 100644
@@ -25,6 +25,7 @@
 #include "mxcfb.h"
 #include "ipu_regs.h"
 #include "display.h"
+#include <panel.h>
 
 #include <dm.h>
 #include <video.h>
@@ -641,6 +642,7 @@ static int ipuv3_video_probe(struct udevice *dev)
 #if defined(CONFIG_DISPLAY)
 	struct udevice *disp_dev;
 #endif
+	struct udevice *panel_dev;
 	u32 fb_start, fb_end;
 	int ret;
 
@@ -667,6 +669,9 @@ static int ipuv3_video_probe(struct udevice *dev)
 			return ret;
 	}
 #endif
+	ret = uclass_get_device(UCLASS_PANEL, 0, &panel_dev);
+	if (panel_dev)
+		panel_enable_backlight(panel_dev);
 
 	uc_priv->xsize = gmode->xres;
 	uc_priv->ysize = gmode->yres;
Signature · 1 line
2.21.0
#6 lore raw

cover imx6, display: enhancements for upcoming aristainetos DM support

In reply to Heiko Schocher

Hi Heiko,

On Mon, 22 Jul 2019 06:49:03 +0200
Heiko Schocher hs at denx.de wrote:
...

Quoted 11 lines

Heiko Schocher (5):
global_data: enable fb_base for DM_VIDEO
mxc_ipuv3_fb.c: set gd->fb_base
bdinfo: show fb base with DM_VIDEO
mxc_ipuv3_fb.c: call display_enable
mxc_ipuv3_fb.c: enable a backlight on a panel

 cmd/bdinfo.c                      |  2 +-
 drivers/video/imx/mxc_ipuv3_fb.c  | 20 ++++++++++++++++++++
 include/asm-generic/global_data.h |  2 +-
 3 files changed, 22 insertions(+), 2 deletions(-)

Series applied to u-boot-video/master, thanks!

--
Anatolij