Skip to contentSkip to conversation

Add i.MX51/53 IPU framebuffer support

PATCH New Sascha Hauer 5 participants 18 messages Feb 16, 2011 – Feb 23, 2011

Subsystems (5)
lore
Share & tools
lore

Sascha Hauer

author maintainer
#0 lore raw

PATCH v3 1/1 Add i.MX51/53 IPU framebuffer support

The following is the third version of the series adding ipu support for the i.MX51/53.

Changes since last version:

- The IPU core driver now sits in drivers/video instead of drivers/mfd. It still needs mfd support, so it has a select on MFD_SUPPORT and MFD_CORE.
- The fb driver does not reallocate memory anymore. This is broken since there is a risk that some userspace process still has the memory mapped while we reallocate it which leads to bad results.

Sascha Hauer (7):
Add a mfd IPUv3 driver
fb: export fb mode db table
Add i.MX5 framebuffer driver
ARM i.MX51: Add IPU device support
ARM i.MX5: Allow to increase max zone order ARM i.MX5: increase dma consistent size for IPU support ARM i.MX51 babbage: Add framebuffer support

 arch/arm/Kconfig                                |    4 +-
 arch/arm/mach-mx5/Kconfig                       |    1 +
 arch/arm/mach-mx5/board-mx51_babbage.c          |   74 ++
 arch/arm/mach-mx5/devices-imx51.h               |    4 +
 arch/arm/plat-mxc/devices/Kconfig               |    4 +
 arch/arm/plat-mxc/devices/Makefile              |    1 +
 arch/arm/plat-mxc/devices/platform-imx_ipuv3.c  |   47 ++
 arch/arm/plat-mxc/include/mach/devices-common.h |   10 +
 arch/arm/plat-mxc/include/mach/ipu-v3.h         |   49 ++
 arch/arm/plat-mxc/include/mach/memory.h         |    3 +-
 drivers/video/Kconfig                           |   13 +
 drivers/video/Makefile                          |    2 +
 drivers/video/imx-ipu-v3/Makefile               |    3 +
 drivers/video/imx-ipu-v3/ipu-common.c           |  708 +++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-cpmem.c            |  612 +++++++++++++++
 drivers/video/imx-ipu-v3/ipu-dc.c               |  364 +++++++++
 drivers/video/imx-ipu-v3/ipu-di.c               |  550 ++++++++++++++
 drivers/video/imx-ipu-v3/ipu-dmfc.c             |  355 +++++++++
 drivers/video/imx-ipu-v3/ipu-dp.c               |  476 ++++++++++++
 drivers/video/imx-ipu-v3/ipu-prv.h              |  216 ++++++
 drivers/video/modedb.c                          |    8 +-
 drivers/video/mx5fb.c                           |  925 +++++++++++++++++++++++
 include/linux/fb.h                              |    3 +
 include/linux/mfd/imx-ipu-v3.h                  |  219 ++++++
 24 files changed, 4646 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/plat-mxc/devices/platform-imx_ipuv3.c
 create mode 100644 arch/arm/plat-mxc/include/mach/ipu-v3.h
 create mode 100644 drivers/video/imx-ipu-v3/Makefile
 create mode 100644 drivers/video/imx-ipu-v3/ipu-common.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-cpmem.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-dc.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-di.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-dmfc.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-dp.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-prv.h
 create mode 100644 drivers/video/mx5fb.c
 create mode 100644 include/linux/mfd/imx-ipu-v3.h
author maintainer
#1 lore raw

PATCH 1/7 Add a mfd IPUv3 driver

The IPU is the Image Processing Unit found on i.MX51/53 SoCs. It features several units for image processing, this patch adds support for the units needed for Framebuffer support, namely:

- Display Controller (dc)
- Display Interface (di)
- Display Multi Fifo Controller (dmfc)
- Display Processor (dp)
- Image DMA Controller (idmac)

This patch is based on the Freescale driver, but follows a different approach. The Freescale code implements logical idmac channels and the handling of the subunits is hidden in common idmac code pathes in big switch/case statements. This patch instead just provides code and resource management for the different subunits. The user, in this case the framebuffer driver, decides how the different units play together.

The IPU has other units missing in this patch:

- CMOS Sensor Interface (csi)
- Video Deinterlacer (vdi)
- Sensor Multi FIFO Controler (smfc)
- Image Converter (ic)
- Image Rotator (irt)

So expect more files to come in this directory.

Cc linux-kernel at vger.kernel.org
Cc linux-fbdev at vger.kernel.org
Cc Paul Mundt <[email protected]>
Cc Samuel Ortiz <[email protected]>
---
 arch/arm/plat-mxc/include/mach/ipu-v3.h |   49 +++
 drivers/video/Kconfig                   |    2 +
 drivers/video/Makefile                  |    1 +
 drivers/video/imx-ipu-v3/Makefile       |    3 +
 drivers/video/imx-ipu-v3/ipu-common.c   |  708 +++++++++++++++++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-cpmem.c    |  612 ++++++++++++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-dc.c       |  364 ++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-di.c       |  550 ++++++++++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-dmfc.c     |  355 ++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-dp.c       |  476 +++++++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-prv.h      |  216 ++++++++++
 include/linux/mfd/imx-ipu-v3.h          |  219 ++++++++++
 12 files changed, 3555 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-mxc/include/mach/ipu-v3.h
 create mode 100644 drivers/video/imx-ipu-v3/Makefile
 create mode 100644 drivers/video/imx-ipu-v3/ipu-common.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-cpmem.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-dc.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-di.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-dmfc.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-dp.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-prv.h
 create mode 100644 include/linux/mfd/imx-ipu-v3.h
arch/arm/plat-mxc/include/mach/ipu-v3.h new file +49 -0
new file mode 100644
index 0000000..f8900b9
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2010 Sascha Hauer <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ */
+
+#ifndef __MACH_IPU_V3_H_
+#define __MACH_IPU_V3_H_
+
+/* IPU specific extensions to struct fb_videomode flag field */
+#define FB_SYNC_OE_LOW_ACT	(1 << 8)
+#define FB_SYNC_CLK_LAT_FALL	(1 << 9)
+#define FB_SYNC_DATA_INVERT	(1 << 10)
+#define FB_SYNC_CLK_IDLE_EN	(1 << 11)
+#define FB_SYNC_SHARP_MODE	(1 << 12)
+#define FB_SYNC_SWAP_RGB	(1 << 13)
+
+struct ipuv3_fb_platform_data {
+	const struct fb_videomode	*modes;
+	int				num_modes;
+	char				*mode_str;
+	u32				interface_pix_fmt;
+
+#define IMX_IPU_FB_USE_MODEDB	(1 << 0)
+#define IMX_IPU_FB_USE_OVERLAY	(1 << 1)
+	unsigned long			flags;
+
+	int				ipu_channel_bg;
+	int				ipu_channel_fg;
+	int				dc_channel;
+	int				dp_channel;
+	int				display;
+};
+
+struct imx_ipuv3_platform_data {
+	int rev;
+	struct ipuv3_fb_platform_data	*fb_head0_platform_data;
+	struct ipuv3_fb_platform_data	*fb_head1_platform_data;
+};
+
+#endif /* __MACH_IPU_V3_H_ */
drivers/video/Kconfig +2 -0
index 6bafb51b..ffdb37a 100644
@@ -26,6 +26,8 @@ source "drivers/gpu/drm/Kconfig"
 
 source "drivers/gpu/stub/Kconfig"
 
+source "drivers/video/imx-ipu-v3/Kconfig"
+
 config VGASTATE
        tristate
        default n
drivers/video/Makefile +1 -0
index 8c8fabd..f4921ab 100644
@@ -153,6 +153,7 @@ obj-$(CONFIG_FB_BFIN_T350MCQB)	  += bfin-t350mcqb-fb.o
 obj-$(CONFIG_FB_BFIN_7393)        += bfin_adv7393fb.o
 obj-$(CONFIG_FB_MX3)		  += mx3fb.o
 obj-$(CONFIG_FB_DA8XX)		  += da8xx-fb.o
+obj-$(CONFIG_MFD_IMX_IPU_V3)	  += imx-ipu-v3/
 
 # the test framebuffer is last
 obj-$(CONFIG_FB_VIRTUAL)          += vfb.o
drivers/video/imx-ipu-v3/Makefile new file +3 -0
new file mode 100644
index 0000000..ff70fe8
@@ -0,0 +1,3 @@
+obj-$(CONFIG_MFD_IMX_IPU_V3) += imx-ipu-v3.o
+
+imx-ipu-v3-objs := ipu-common.o ipu-dc.o ipu-di.o ipu-dp.o ipu-dmfc.o ipu-cpmem.o
drivers/video/imx-ipu-v3/ipu-common.c new file +708 -0

708 lines not on this page · raw message

drivers/video/imx-ipu-v3/ipu-cpmem.c new file +612 -0

612 lines not on this page · raw message

drivers/video/imx-ipu-v3/ipu-dc.c new file +364 -0

364 lines not on this page · raw message

drivers/video/imx-ipu-v3/ipu-di.c new file +550 -0

550 lines not on this page · raw message

drivers/video/imx-ipu-v3/ipu-dmfc.c new file +355 -0

355 lines not on this page · raw message

drivers/video/imx-ipu-v3/ipu-dp.c new file +476 -0

344 lines not on this page · raw message

drivers/video/imx-ipu-v3/ipu-prv.h new file +216 -0

216 lines not on this page · raw message

include/linux/mfd/imx-ipu-v3.h new file +219 -0

219 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.2.3

Part of the diff is not shown here. View the raw message.

#2 lore raw

Re: [PATCH 1/7] Add a mfd IPUv3 driver

Sascha Hauer <[email protected]> writes:

Hi,

Quoted 57 lines

The IPU is the Image Processing Unit found on i.MX51/53 SoCs. It features several units for image processing, this patch adds support for the units needed for Framebuffer support, namely:

- Display Controller (dc)
- Display Interface (di)
- Display Multi Fifo Controller (dmfc)
- Display Processor (dp)
- Image DMA Controller (idmac)

This patch is based on the Freescale driver, but follows a different approach. The Freescale code implements logical idmac channels and the handling of the subunits is hidden in common idmac code pathes in big switch/case statements. This patch instead just provides code and resource management for the different subunits. The user, in this case the framebuffer driver, decides how the different units play together.

The IPU has other units missing in this patch:

- CMOS Sensor Interface (csi)
- Video Deinterlacer (vdi)
- Sensor Multi FIFO Controler (smfc)
- Image Converter (ic)
- Image Rotator (irt)

So expect more files to come in this directory.

---
 arch/arm/plat-mxc/include/mach/ipu-v3.h |   49 +++
 drivers/video/Kconfig                   |    2 +
 drivers/video/Makefile                  |    1 +
 drivers/video/imx-ipu-v3/Makefile       |    3 +
 drivers/video/imx-ipu-v3/ipu-common.c   |  708 +++++++++++++++++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-cpmem.c    |  612 ++++++++++++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-dc.c       |  364 ++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-di.c       |  550 ++++++++++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-dmfc.c     |  355 ++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-dp.c       |  476 +++++++++++++++++++++
 drivers/video/imx-ipu-v3/ipu-prv.h      |  216 ++++++++++
 include/linux/mfd/imx-ipu-v3.h          |  219 ++++++++++
 12 files changed, 3555 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-mxc/include/mach/ipu-v3.h
 create mode 100644 drivers/video/imx-ipu-v3/Makefile
 create mode 100644 drivers/video/imx-ipu-v3/ipu-common.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-cpmem.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-dc.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-di.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-dmfc.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-dp.c
 create mode 100644 drivers/video/imx-ipu-v3/ipu-prv.h
 create mode 100644 include/linux/mfd/imx-ipu-v3.h

[...]

drivers/video/Kconfig source "drivers/gpu/drm/Kconfig" · line 30

Quoted 10 lines
drivers/video/Kconfig +2 -0
index 6bafb51b..ffdb37a 100644
@@ -26,6 +26,8 @@ source "drivers/gpu/drm/Kconfig"
 
 source "drivers/gpu/stub/Kconfig"
 
+source "drivers/video/imx-ipu-v3/Kconfig"
+

I don't see such a Kconfig file in this patch. Got lost while moving from mfd to video ?

drivers/video/Makefile obj-$(CONFIG_FB_BFIN_T350MCQB) += bfin-t350mcqb-fb.o · line 156

Quoted 12 lines
drivers/video/Kconfig +0 -0
 config VGASTATE
        tristate
        default n
drivers/video/Makefile +1 -0
index 8c8fabd..f4921ab 100644
@@ -153,6 +153,7 @@ obj-$(CONFIG_FB_BFIN_T350MCQB)	  += bfin-t350mcqb-fb.o
 obj-$(CONFIG_FB_BFIN_7393)        += bfin_adv7393fb.o
 obj-$(CONFIG_FB_MX3)		  += mx3fb.o
 obj-$(CONFIG_FB_DA8XX)		  += da8xx-fb.o
+obj-$(CONFIG_MFD_IMX_IPU_V3)	  += imx-ipu-v3/

Now that files are in drivers/video, do we want to keep MFD in the name ?

Arnaud

author maintainer
#3 lore raw

Re: [PATCH 1/7] Add a mfd IPUv3 driver

Quoted 6 lines · Arnaud Patard
Quoted 6 lines
drivers/video/Kconfig +0 -0
index 6bafb51b..ffdb37a 100644
@@ -26,6 +26,8 @@ source "drivers/gpu/drm/Kconfig"
 
Quoted 7 lines

drivers/video/Kconfig source "drivers/gpu/drm/Kconfig" · line 30

Quoted 4 lines
drivers/video/Kconfig +2 -0
 source "drivers/gpu/stub/Kconfig"
 
+source "drivers/video/imx-ipu-v3/Kconfig"
+

I don't see such a Kconfig file in this patch. Got lost while moving from mfd to video ?

Oops, yes still untracked in my repository. Will add in the next series.

Quoted 16 lines
Quoted 10 lines
drivers/video/Kconfig +0 -0
 config VGASTATE
        tristate
        default n
drivers/video/Makefile +0 -0
index 8c8fabd..f4921ab 100644

drivers/video/Makefile obj-$(CONFIG_FB_BFIN_T350MCQB) += bfin-t350mcqb-fb.o · line 156

Quoted 4 lines
drivers/video/Makefile +1 -0
@@ -153,6 +153,7 @@ obj-$(CONFIG_FB_BFIN_T350MCQB)	  += bfin-t350mcqb-fb.o
 obj-$(CONFIG_FB_BFIN_7393)        += bfin_adv7393fb.o
 obj-$(CONFIG_FB_MX3)		  += mx3fb.o
 obj-$(CONFIG_FB_DA8XX)		  += da8xx-fb.o
+obj-$(CONFIG_MFD_IMX_IPU_V3)	  += imx-ipu-v3/

Now that files are in drivers/video, do we want to keep MFD in the name ?

I asked myself the same question and had no clear answer. Probably better to remove the MFD.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#4 lore raw

Re: [PATCH 1/7] Add a mfd IPUv3 driver

Hi Sascha,

Quoted 34 lines · Sascha Hauer
Quoted 6 lines · Arnaud Patard
Quoted 6 lines
drivers/video/Kconfig +0 -0
index 6bafb51b..ffdb37a 100644
@@ -26,6 +26,8 @@ source "drivers/gpu/drm/Kconfig"
 
Quoted 7 lines

drivers/video/Kconfig source "drivers/gpu/drm/Kconfig" · line 30

Quoted 4 lines
drivers/video/Kconfig +2 -0
 source "drivers/gpu/stub/Kconfig"
 
+source "drivers/video/imx-ipu-v3/Kconfig"
+

I don't see such a Kconfig file in this patch. Got lost while moving from mfd to video ?

Oops, yes still untracked in my repository. Will add in the next series.

Quoted 16 lines
Quoted 10 lines
drivers/video/Kconfig +0 -0
 config VGASTATE
        tristate
        default n
drivers/video/Makefile +0 -0
index 8c8fabd..f4921ab 100644

drivers/video/Makefile obj-$(CONFIG_FB_BFIN_T350MCQB) += bfin-t350mcqb-fb.o · line 156

Quoted 4 lines
drivers/video/Makefile +1 -0
@@ -153,6 +153,7 @@ obj-$(CONFIG_FB_BFIN_T350MCQB)	  += bfin-t350mcqb-fb.o
 obj-$(CONFIG_FB_BFIN_7393)        += bfin_adv7393fb.o
 obj-$(CONFIG_FB_MX3)		  += mx3fb.o
 obj-$(CONFIG_FB_DA8XX)		  += da8xx-fb.o
+obj-$(CONFIG_MFD_IMX_IPU_V3)	  += imx-ipu-v3/

Now that files are in drivers/video, do we want to keep MFD in the name ?

Quoted 2 lines

I asked myself the same question and had no clear answer. Probably better to remove the MFD.

Definitely, yes.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/
#5 lore raw

Re: [PATCH 1/7] Add a mfd IPUv3 driver

In reply to Sascha Hauer

hi, Sascha,

I have few comments for this patch.

Quoted 6 lines
(quoted diff) +6 -0
+#define MX51_IPU_CHANNEL_CSI0 ? ? ? ? ? ? ? ? ? 0
+#define MX51_IPU_CHANNEL_CSI1 ? ? ? ? ? ? ? ? ? 1
+#define MX51_IPU_CHANNEL_CSI2 ? ? ? ? ? ? ? ? ? 2
+#define MX51_IPU_CHANNEL_CSI3 ? ? ? ? ? ? ? ? ? 3
+#define MX51_IPU_CHANNEL_MEM_BG_SYNC ? ? ? ? ? 23
+#define MX51_IPU_CHANNEL_MEM_FG_SYNC ? ? ? ? ? 27

Review

Quoted 10 lines
(quoted diff) +10 -0
+#define MX51_IPU_CHANNEL_MEM_DC_SYNC ? ? ? ? ? 28
+#define MX51_IPU_CHANNEL_MEM_FG_SYNC_ALPHA ? ? 31
+#define MX51_IPU_CHANNEL_MEM_DC_ASYNC ? ? ? ? ?41
+#define MX51_IPU_CHANNEL_ROT_ENC_MEM ? ? ? ? ? 45
+#define MX51_IPU_CHANNEL_ROT_VF_MEM ? ? ? ? ? ?46
+#define MX51_IPU_CHANNEL_ROT_PP_MEM ? ? ? ? ? ?47
+#define MX51_IPU_CHANNEL_ROT_ENC_MEM_OUT ? ? ? 48
+#define MX51_IPU_CHANNEL_ROT_VF_MEM_OUT ? ? ? ? ? ? ? ?49
+#define MX51_IPU_CHANNEL_ROT_PP_MEM_OUT ? ? ? ? ? ? ? ?50
+#define MX51_IPU_CHANNEL_MEM_BG_SYNC_ALPHA ? ? 51

Had better use MX5_IPU as prefix because it's same value in MX5X.

Review

Quoted 10 lines
(quoted diff) +10 -0
+
+ ? ? ? ipu_idmac_reg = ioremap(ipu_base + IPU_IDMAC_REG_BASE, PAGE_SIZE);
+ ? ? ? if (!ipu_idmac_reg) {
+ ? ? ? ? ? ? ? ret = -ENOMEM;
+ ? ? ? ? ? ? ? goto failed_ioremap2;
+ ? ? ? }
+
+ ? ? ? ret = ipu_mipi_setup();
+ ? ? ? if (ret)
+ ? ? ? ? ? ? ? goto failed_mipi_setup;

I dont know what's the best way to do it, but I think you had better consider mx53 platform, so maybe this mipi_setup function and also below ipu hw reset could be set in platform data.

Quoted 25 lines
(quoted diff) +25 -0
+
+ ? ? ? ipu_clk = clk_get(&pdev->dev, "ipu");
+ ? ? ? if (IS_ERR(ipu_clk)) {
+ ? ? ? ? ? ? ? ret = PTR_ERR(ipu_clk);
+ ? ? ? ? ? ? ? dev_err(&pdev->dev, "clk_get failed with %d", ret);
+ ? ? ? ? ? ? ? goto failed_clk_get;
+ ? ? ? }
+
+ ? ? ? ipu_get();
+
+ ? ? ? ret = request_irq(irq1, ipu_irq_handler, IRQF_DISABLED, pdev->name,
+ ? ? ? ? ? ? ? ? ? ? ? &pdev->dev);
+ ? ? ? if (ret) {
+ ? ? ? ? ? ? ? dev_err(&pdev->dev, "request irq %d failed with: %d\n", irq1, ret);
+ ? ? ? ? ? ? ? goto failed_request_irq1;
+ ? ? ? }
+
+ ? ? ? ret = request_irq(irq2, ipu_irq_handler, IRQF_DISABLED, pdev->name,
+ ? ? ? ? ? ? ? ? ? ? ? &pdev->dev);
+ ? ? ? if (ret) {
+ ? ? ? ? ? ? ? dev_err(&pdev->dev, "request irq %d failed with: %d\n", irq2, ret);
+ ? ? ? ? ? ? ? goto failed_request_irq2;
+ ? ? ? }
+
+ ? ? ? ipu_reset();
author maintainer
#6 lore raw

PATCH 2/7 fb: export fb mode db table

In reply to Sascha Hauer

The different modes can be useful for drivers. Currently there is no way to expose the modes to sysfs, so export them.

Cc linux-kernel at vger.kernel.org
Cc linux-fbdev at vger.kernel.org
Cc Paul Mundt <[email protected]>
---
 drivers/video/modedb.c |    8 ++++++--
 include/linux/fb.h     |    3 +++
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/video/modedb.c +6 -2
index 48c3ea8..942b44d 100644
@@ -36,8 +36,7 @@ EXPORT_SYMBOL_GPL(fb_mode_option);
  *  Standard video mode definitions (taken from XFree86)
  */
 
-static const struct fb_videomode modedb[] = {
-
+const struct fb_videomode modedb[] = {
 	/* 640x400 @ 70 Hz, 31.5 kHz hsync */
 	{ NULL, 70, 640, 400, 39721, 40, 24, 39, 9, 96, 2, 0,
 		FB_VMODE_NONINTERLACED },
@@ -291,6 +290,11 @@ static const struct fb_videomode modedb[] = {
 		0, FB_VMODE_NONINTERLACED },
 };
 
+const struct fb_videomode *fb_modes = modedb;
+EXPORT_SYMBOL(fb_modes);
+const int num_fb_modes = ARRAY_SIZE(modedb);
+EXPORT_SYMBOL(num_fb_modes);
+
 #ifdef CONFIG_FB_MODE_HELPERS
 const struct fb_videomode cea_modes[64] = {
 	/* #1: 640x480p at 59.94/60Hz */
include/linux/fb.h +3 -0
index 68ba85a..41b0ce1 100644
@@ -1154,6 +1154,9 @@ extern const char *fb_mode_option;
 extern const struct fb_videomode vesa_modes[];
 extern const struct fb_videomode cea_modes[64];
 
+extern const struct fb_videomode *fb_modes;
+extern const int num_fb_modes;
+
 struct fb_modelist {
 	struct list_head list;
 	struct fb_videomode mode;
Signature · 1 line
1.7.2.3
author maintainer
#7 lore raw

PATCH 3/7 Add i.MX5 framebuffer driver

In reply to Sascha Hauer

This patch adds framebuffer support to the Freescale i.MX SoCs equipped with an IPU v3, so far these are the i.MX51/53.

This driver has been tested on the i.MX51 babbage board with both DVI and analog VGA in different resolutions and color depths. It has also been tested on a custom i.MX51 board using a fixed resolution panel.

Cc linux-kernel at vger.kernel.org
Cc linux-fbdev at vger.kernel.org
Cc Paul Mundt <[email protected]>
Cc Samuel Ortiz <[email protected]>
---
 drivers/video/Kconfig  |   11 +
 drivers/video/Makefile |    1 +
 drivers/video/mx5fb.c  |  925 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 937 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/mx5fb.c
drivers/video/Kconfig +11 -0
index ffdb37a..70f8490 100644
@@ -2344,6 +2344,17 @@ config FB_MX3
 	  far only synchronous displays are supported. If you plan to use
 	  an LCD display with your i.MX31 system, say Y here.
 
+config FB_MX5
+	tristate "MX5 Framebuffer support"
+	depends on FB && MFD_IMX_IPU_V3
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	select FB_MODE_HELPERS
+	help
+	  This is a framebuffer device for the i.MX51 LCD Controller. If you
+	  plan to use an LCD display with your i.MX51 system, say Y here.
+
 config FB_BROADSHEET
 	tristate "E-Ink Broadsheet/Epson S1D13521 controller support"
 	depends on FB
drivers/video/Makefile +1 -0
index f4921ab..64f6913 100644
@@ -152,6 +152,7 @@ obj-$(CONFIG_FB_BFIN_LQ035Q1)     += bfin-lq035q1-fb.o
 obj-$(CONFIG_FB_BFIN_T350MCQB)	  += bfin-t350mcqb-fb.o
 obj-$(CONFIG_FB_BFIN_7393)        += bfin_adv7393fb.o
 obj-$(CONFIG_FB_MX3)		  += mx3fb.o
+obj-$(CONFIG_FB_MX5)		  += mx5fb.o
 obj-$(CONFIG_FB_DA8XX)		  += da8xx-fb.o
 obj-$(CONFIG_MFD_IMX_IPU_V3)	  += imx-ipu-v3/
 
drivers/video/mx5fb.c new file +925 -0

925 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#8 lore raw

Re: [PATCH 3/7] Add i.MX5 framebuffer driver

hi, Sasha,

drivers/video/mx5fb.c line 191

Quoted 6 lines
drivers/video/mx5fb.c new file +6 -0
+       if (var->vmode & FB_VMODE_ODD_FLD_FIRST) /* PAL */
+               sig_cfg.odd_field_first = 1;
+       if (var->sync & FB_SYNC_EXT)
+               sig_cfg.ext_clk = 1;
+       if (var->sync & FB_SYNC_HOR_HIGH_ACT)
+               sig_cfg.Hsync_pol = 1;

Please remove FB_SYNC_EXT support.

+static void imx_ipu_fb_disable_overlay(struct fb_info *ovl) +{
+ struct imx_ipu_fb_info *mxc_ovl = ovl->par;
+
+ if (!mxc_ovl->enabled)
+ return;
+

+       ipu_dp_disable_fg(mxc_ovl->dp);
+       ipu_wait_for_interrupt(451, 100);
+       ipu_idmac_disable_channel(mxc_ovl->ipu_ch);
+       ipu_dmfc_disable_channel(mxc_ovl->dmfc);
+       mxc_ovl->enabled = 0;

+}
Had better has a definition of ipu irq 451.

Jason Chen
BRs

author maintainer
#9 lore raw

Re: [PATCH 3/7] Add i.MX5 framebuffer driver

Hi Jason,

Quoted 9 lines · Jason Chen

hi, Sasha,

drivers/video/mx5fb.c line 191

Quoted 6 lines
drivers/video/mx5fb.c new file +6 -0
+       if (var->vmode & FB_VMODE_ODD_FLD_FIRST) /* PAL */
+               sig_cfg.odd_field_first = 1;
+       if (var->sync & FB_SYNC_EXT)
+               sig_cfg.ext_clk = 1;
+       if (var->sync & FB_SYNC_HOR_HIGH_ACT)
+               sig_cfg.Hsync_pol = 1;

Please remove FB_SYNC_EXT support.

No problem, can do. But why? Is it nonfunctional in the hardware or is it that the current code just misses more pieces to support this?

Quoted 14 lines
drivers/video/mx5fb.c new file +13 -0
+static void imx_ipu_fb_disable_overlay(struct fb_info *ovl)
+{
+       struct imx_ipu_fb_info *mxc_ovl = ovl->par;
+
+       if (!mxc_ovl->enabled)
+               return;
+
+       ipu_dp_disable_fg(mxc_ovl->dp);
+       ipu_wait_for_interrupt(451, 100);
+       ipu_idmac_disable_channel(mxc_ovl->ipu_ch);
+       ipu_dmfc_disable_channel(mxc_ovl->dmfc);
+       mxc_ovl->enabled = 0;
+}
Quoted 1 line

Had better has a definition of ipu irq 451.

Ok.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#10 lore raw

Re: [PATCH 3/7] Add i.MX5 framebuffer driver

hi, Sascha,

2011/2/18 Sascha Hauer <[email protected]>:

Quoted 11 lines

Hi Jason,

Quoted 8 lines · Jason Chen

hi, Sasha,

Quoted 6 lines

+ ? ? ? if (var->vmode & FB_VMODE_ODD_FLD_FIRST) /* PAL */
+ ? ? ? ? ? ? ? sig_cfg.odd_field_first = 1;
+ ? ? ? if (var->sync & FB_SYNC_EXT)
+ ? ? ? ? ? ? ? sig_cfg.ext_clk = 1;
+ ? ? ? if (var->sync & FB_SYNC_HOR_HIGH_ACT)
+ ? ? ? ? ? ? ? sig_cfg.Hsync_pol = 1;

Quoted 6 lines
Quoted 1 line

Please remove FB_SYNC_EXT support.

No problem, can do. But why? Is it nonfunctional in the hardware or is it that the current code just misses more pieces to support this?

This flag represents external sync, some application will not check this flag when they reset fb var, for example, X server fb driver will ignore it, if so, the ipu external clock can not be set correctly. I think ipu should decide external clock usage by other method. The latest method in freesacle mainline is decide it automatically -- if internal clock can not fit target clock rate well, switch it to external.

Quoted 26 lines
Quoted 14 lines
(quoted diff) +13 -0
+static void imx_ipu_fb_disable_overlay(struct fb_info *ovl)
+{
+ ? ? ? struct imx_ipu_fb_info *mxc_ovl = ovl->par;
+
+ ? ? ? if (!mxc_ovl->enabled)
+ ? ? ? ? ? ? ? return;
+
+ ? ? ? ipu_dp_disable_fg(mxc_ovl->dp);
+ ? ? ? ipu_wait_for_interrupt(451, 100);
+ ? ? ? ipu_idmac_disable_channel(mxc_ovl->ipu_ch);
+ ? ? ? ipu_dmfc_disable_channel(mxc_ovl->dmfc);
+ ? ? ? mxc_ovl->enabled = 0;
+}
Quoted 1 line

Had better has a definition of ipu irq 451.

Ok.

Sascha

--

Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 ? ?|
Amtsgericht Hildesheim, HRA 2686 ? ? ? ? ? | Fax: ? +49-5121-206917-5555 |
author maintainer
#11 lore raw

PATCH 4/7 ARM i.MX51: Add IPU device support

In reply to Sascha Hauer
---
 arch/arm/mach-mx5/devices-imx51.h               |    4 ++
 arch/arm/plat-mxc/devices/Kconfig               |    4 ++
 arch/arm/plat-mxc/devices/Makefile              |    1 +
 arch/arm/plat-mxc/devices/platform-imx_ipuv3.c  |   47 +++++++++++++++++++++++
 arch/arm/plat-mxc/include/mach/devices-common.h |   10 +++++
 5 files changed, 66 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-mxc/devices/platform-imx_ipuv3.c
arch/arm/mach-mx5/devices-imx51.h +4 -0
index 7fff485..1bd73b3 100644
@@ -55,3 +55,7 @@ extern const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst;
 extern const struct imx_imx_keypad_data imx51_imx_keypad_data __initconst;
 #define imx51_add_imx_keypad(pdata)	\
 	imx_add_imx_keypad(&imx51_imx_keypad_data, pdata)
+
+extern const struct imx_ipuv3_data imx51_ipuv3_data __initconst;
+#define imx51_add_ipuv3(pdata)	\
+	imx_add_ipuv3(&imx51_ipuv3_data, pdata)
arch/arm/plat-mxc/devices/Kconfig +4 -0
index b9ab1d5..f99317e 100644
@@ -71,3 +71,7 @@ config IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
 
 config IMX_HAVE_PLATFORM_SPI_IMX
 	bool
+
+config IMX_HAVE_PLATFORM_IMX_IPUV3
+	bool
+
arch/arm/plat-mxc/devices/Makefile +1 -0
index 75cd2ec..0a6be0a 100644
@@ -22,3 +22,4 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) +=  platform-spi_imx.o
+obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_IPUV3) +=  platform-imx_ipuv3.o
arch/arm/plat-mxc/devices/platform-imx_ipuv3.c new file +47 -0

47 lines not on this page · raw message

arch/arm/plat-mxc/include/mach/devices-common.h +10 -0
index 8658c9c..8f5197f 100644
@@ -264,3 +264,13 @@ struct imx_spi_imx_data {
 struct platform_device *__init imx_add_spi_imx(
 		const struct imx_spi_imx_data *data,
 		const struct spi_imx_master *pdata);
+
+#include <mach/ipu-v3.h>
+struct imx_ipuv3_data {
+	resource_size_t iobase;
+	resource_size_t irq_err;
+	resource_size_t irq;
+};
+struct platform_device *__init imx_add_ipuv3(
+		const struct imx_ipuv3_data *data,
+		const struct imx_ipuv3_platform_data *pdata);
Signature · 1 line
1.7.2.3
author maintainer
#12 lore raw

PATCH 5/7 ARM i.MX5: Allow to increase max zone order

In reply to Sascha Hauer

default setting of 11 allows us to allocate at maximum 2MB chunks of contiguous memory. For resolutions up to 1920x1080 32bpp we need much more memory, so make zone order configurable

---
 arch/arm/Kconfig |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/Kconfig +2 -2
index 26d45e5..e25c04e 100644
@@ -1451,8 +1451,8 @@ config HW_PERF_EVENTS
 source "mm/Kconfig"
 
 config FORCE_MAX_ZONEORDER
-	int "Maximum zone order" if ARCH_SHMOBILE
-	range 11 64 if ARCH_SHMOBILE
+	int "Maximum zone order" if ARCH_SHMOBILE || ARCH_MX5
+	range 11 64 if ARCH_SHMOBILE || ARCH_MX5
 	default "9" if SA1111
 	default "11"
 	help
Signature · 1 line
1.7.2.3
author maintainer
#13 lore raw

PATCH 6/7 ARM i.MX5: increase dma consistent size for IPU support

In reply to Sascha Hauer
---
 arch/arm/plat-mxc/include/mach/memory.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/plat-mxc/include/mach/memory.h +2 -1
index 8386140..81b4158 100644
@@ -43,7 +43,8 @@
 # endif
 #endif
 
-#if defined(CONFIG_MX3_VIDEO)
+#if defined(CONFIG_MX3_VIDEO) || defined(CONFIG_MFD_IMX_IPU_V3) || \
+	defined(CONFIG_MFD_IMX_IPU_V3_MODULE)
 /*
  * Increase size of DMA-consistent memory region.
  * This is required for mx3 camera driver to capture at least two QXGA frames.
Signature · 1 line
1.7.2.3
author maintainer
#14 lore raw

PATCH 7/7 ARM i.MX51 babbage: Add framebuffer support

In reply to Sascha Hauer
---
 arch/arm/mach-mx5/Kconfig              |    1 +
 arch/arm/mach-mx5/board-mx51_babbage.c |   74 ++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/Kconfig +1 -0
index de4fa992f..89e71da 100644
@@ -42,6 +42,7 @@ config MACH_MX51_BABBAGE
 	select IMX_HAVE_PLATFORM_IMX_UART
 	select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
 	select IMX_HAVE_PLATFORM_SPI_IMX
+	select IMX_HAVE_PLATFORM_IMX_IPUV3
 	help
 	  Include support for MX51 Babbage platform, also known as MX51EVK in
 	  u-boot. This includes specific configurations for the board and its
arch/arm/mach-mx5/board-mx51_babbage.c +74 -0

103 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#15 lore raw

PATCH 7/7 ARM i.MX51 babbage: Add framebuffer support

Sascha Hauer <[email protected]> writes:

Hi,

Quoted 103 lines
---
 arch/arm/mach-mx5/Kconfig              |    1 +
 arch/arm/mach-mx5/board-mx51_babbage.c |   74 ++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/Kconfig +1 -0
index de4fa992f..89e71da 100644
@@ -42,6 +42,7 @@ config MACH_MX51_BABBAGE
 	select IMX_HAVE_PLATFORM_IMX_UART
 	select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
 	select IMX_HAVE_PLATFORM_SPI_IMX
+	select IMX_HAVE_PLATFORM_IMX_IPUV3
 	help
 	  Include support for MX51 Babbage platform, also known as MX51EVK in
 	  u-boot. This includes specific configurations for the board and its
arch/arm/mach-mx5/board-mx51_babbage.c +54 -0
index 1d231e8..c5170e8 100644
@@ -22,11 +22,13 @@
 #include <linux/input.h>
 #include <linux/spi/flash.h>
 #include <linux/spi/spi.h>
+#include <linux/mfd/imx-ipu-v3.h>
 
 #include <mach/common.h>
 #include <mach/hardware.h>
 #include <mach/iomux-mx51.h>
 #include <mach/mxc_ehci.h>
+#include <mach/ipu-v3.h>
 
 #include <asm/irq.h>
 #include <asm/setup.h>
@@ -158,6 +160,41 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
 	MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
 	MX51_PAD_CSPI1_SS0__GPIO4_24,
 	MX51_PAD_CSPI1_SS1__GPIO4_25,
+
+	/* Display */
+	MX51_PAD_DISPB2_SER_DIN__GPIO3_5,
+	MX51_PAD_DISPB2_SER_DIO__GPIO3_6,
+	MX51_PAD_NANDF_D12__GPIO3_28,
+
+	MX51_PAD_DISP1_DAT0__DISP1_DAT0,
+	MX51_PAD_DISP1_DAT1__DISP1_DAT1,
+	MX51_PAD_DISP1_DAT2__DISP1_DAT2,
+	MX51_PAD_DISP1_DAT3__DISP1_DAT3,
+	MX51_PAD_DISP1_DAT4__DISP1_DAT4,
+	MX51_PAD_DISP1_DAT5__DISP1_DAT5,
+	MX51_PAD_DISP1_DAT6__DISP1_DAT6,
+	MX51_PAD_DISP1_DAT7__DISP1_DAT7,
+	MX51_PAD_DISP1_DAT8__DISP1_DAT8,
+	MX51_PAD_DISP1_DAT9__DISP1_DAT9,
+	MX51_PAD_DISP1_DAT10__DISP1_DAT10,
+	MX51_PAD_DISP1_DAT11__DISP1_DAT11,
+	MX51_PAD_DISP1_DAT12__DISP1_DAT12,
+	MX51_PAD_DISP1_DAT13__DISP1_DAT13,
+	MX51_PAD_DISP1_DAT14__DISP1_DAT14,
+	MX51_PAD_DISP1_DAT15__DISP1_DAT15,
+	MX51_PAD_DISP1_DAT16__DISP1_DAT16,
+	MX51_PAD_DISP1_DAT17__DISP1_DAT17,
+	MX51_PAD_DISP1_DAT18__DISP1_DAT18,
+	MX51_PAD_DISP1_DAT19__DISP1_DAT19,
+	MX51_PAD_DISP1_DAT20__DISP1_DAT20,
+	MX51_PAD_DISP1_DAT21__DISP1_DAT21,
+	MX51_PAD_DISP1_DAT22__DISP1_DAT22,
+	MX51_PAD_DISP1_DAT23__DISP1_DAT23,
+#define MX51_PAD_DI_GP4__IPU_DI2_PIN15                 IOMUX_PAD(0x758, 0x350, 4, 0x0,   0, NO_PAD_CTRL)
+	MX51_PAD_DI_GP4__IPU_DI2_PIN15,
+
+	/* I2C DVI enable */
+	MX51_PAD_CSI2_HSYNC__GPIO4_14,
 };
 
 /* Serial ports */
@@ -346,6 +383,23 @@ static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = {
 	.num_chipselect = ARRAY_SIZE(mx51_babbage_spi_cs),
 };
 
+static struct ipuv3_fb_platform_data babbage_fb0_data = {
+	.interface_pix_fmt = IPU_PIX_FMT_RGB24,
+	.flags = IMX_IPU_FB_USE_MODEDB | IMX_IPU_FB_USE_OVERLAY,
+	.display = 0,
+};
+
+static struct ipuv3_fb_platform_data babbage_fb1_data = {
+	.interface_pix_fmt = IPU_PIX_FMT_RGB565,
+	.flags = IMX_IPU_FB_USE_MODEDB,
+	.display = 1,
+};
+
+static struct imx_ipuv3_platform_data ipu_data = {
+	.fb_head0_platform_data = &babbage_fb0_data,
+	.fb_head1_platform_data = &babbage_fb1_data,
+};
+
 /*
  * Board specific initialization.
  */

arch/arm/mach-mx5/board-mx51_babbage.c static void __init mxc_board_init(void) · line 453

Quoted 8 lines
arch/arm/mach-mx5/board-mx51_babbage.c +5 -0
@@ -392,6 +446,26 @@ static void __init mxc_board_init(void)
 		ARRAY_SIZE(mx51_babbage_spi_board_info));
 	imx51_add_ecspi(0, &mx51_babbage_spi_pdata);
 	imx51_add_imx2_wdt(0, NULL);
+
+#define GPIO_DVI_DETECT	(2 * 32 + 28)
+#define GPIO_DVI_RESET	(2 * 32 + 5)
+#define GPIO_DVI_PWRDN	(2 * 32 + 6)
+#define GPIO_DVI_I2C	(3 * 32 + 14)

What about using IMX_GPIO_NR() ?

Arnaud

author maintainer
#16 lore raw

PATCH 7/7 ARM i.MX51 babbage: Add framebuffer support

Quoted 109 lines · Arnaud Patard

Sascha Hauer <[email protected]> writes:

Hi,

Quoted 105 lines
---
 arch/arm/mach-mx5/Kconfig              |    1 +
 arch/arm/mach-mx5/board-mx51_babbage.c |   74 ++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 0 deletions(-)
arch/arm/mach-mx5/Kconfig +1 -0
index de4fa992f..89e71da 100644
@@ -42,6 +42,7 @@ config MACH_MX51_BABBAGE
 	select IMX_HAVE_PLATFORM_IMX_UART
 	select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
 	select IMX_HAVE_PLATFORM_SPI_IMX
+	select IMX_HAVE_PLATFORM_IMX_IPUV3
 	help
 	  Include support for MX51 Babbage platform, also known as MX51EVK in
 	  u-boot. This includes specific configurations for the board and its
arch/arm/mach-mx5/board-mx51_babbage.c +54 -0
index 1d231e8..c5170e8 100644
@@ -22,11 +22,13 @@
 #include <linux/input.h>
 #include <linux/spi/flash.h>
 #include <linux/spi/spi.h>
+#include <linux/mfd/imx-ipu-v3.h>
 
 #include <mach/common.h>
 #include <mach/hardware.h>
 #include <mach/iomux-mx51.h>
 #include <mach/mxc_ehci.h>
+#include <mach/ipu-v3.h>
 
 #include <asm/irq.h>
 #include <asm/setup.h>
@@ -158,6 +160,41 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
 	MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
 	MX51_PAD_CSPI1_SS0__GPIO4_24,
 	MX51_PAD_CSPI1_SS1__GPIO4_25,
+
+	/* Display */
+	MX51_PAD_DISPB2_SER_DIN__GPIO3_5,
+	MX51_PAD_DISPB2_SER_DIO__GPIO3_6,
+	MX51_PAD_NANDF_D12__GPIO3_28,
+
+	MX51_PAD_DISP1_DAT0__DISP1_DAT0,
+	MX51_PAD_DISP1_DAT1__DISP1_DAT1,
+	MX51_PAD_DISP1_DAT2__DISP1_DAT2,
+	MX51_PAD_DISP1_DAT3__DISP1_DAT3,
+	MX51_PAD_DISP1_DAT4__DISP1_DAT4,
+	MX51_PAD_DISP1_DAT5__DISP1_DAT5,
+	MX51_PAD_DISP1_DAT6__DISP1_DAT6,
+	MX51_PAD_DISP1_DAT7__DISP1_DAT7,
+	MX51_PAD_DISP1_DAT8__DISP1_DAT8,
+	MX51_PAD_DISP1_DAT9__DISP1_DAT9,
+	MX51_PAD_DISP1_DAT10__DISP1_DAT10,
+	MX51_PAD_DISP1_DAT11__DISP1_DAT11,
+	MX51_PAD_DISP1_DAT12__DISP1_DAT12,
+	MX51_PAD_DISP1_DAT13__DISP1_DAT13,
+	MX51_PAD_DISP1_DAT14__DISP1_DAT14,
+	MX51_PAD_DISP1_DAT15__DISP1_DAT15,
+	MX51_PAD_DISP1_DAT16__DISP1_DAT16,
+	MX51_PAD_DISP1_DAT17__DISP1_DAT17,
+	MX51_PAD_DISP1_DAT18__DISP1_DAT18,
+	MX51_PAD_DISP1_DAT19__DISP1_DAT19,
+	MX51_PAD_DISP1_DAT20__DISP1_DAT20,
+	MX51_PAD_DISP1_DAT21__DISP1_DAT21,
+	MX51_PAD_DISP1_DAT22__DISP1_DAT22,
+	MX51_PAD_DISP1_DAT23__DISP1_DAT23,
+#define MX51_PAD_DI_GP4__IPU_DI2_PIN15                 IOMUX_PAD(0x758, 0x350, 4, 0x0,   0, NO_PAD_CTRL)
+	MX51_PAD_DI_GP4__IPU_DI2_PIN15,
+
+	/* I2C DVI enable */
+	MX51_PAD_CSI2_HSYNC__GPIO4_14,
 };
 
 /* Serial ports */
@@ -346,6 +383,23 @@ static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = {
 	.num_chipselect = ARRAY_SIZE(mx51_babbage_spi_cs),
 };
 
+static struct ipuv3_fb_platform_data babbage_fb0_data = {
+	.interface_pix_fmt = IPU_PIX_FMT_RGB24,
+	.flags = IMX_IPU_FB_USE_MODEDB | IMX_IPU_FB_USE_OVERLAY,
+	.display = 0,
+};
+
+static struct ipuv3_fb_platform_data babbage_fb1_data = {
+	.interface_pix_fmt = IPU_PIX_FMT_RGB565,
+	.flags = IMX_IPU_FB_USE_MODEDB,
+	.display = 1,
+};
+
+static struct imx_ipuv3_platform_data ipu_data = {
+	.fb_head0_platform_data = &babbage_fb0_data,
+	.fb_head1_platform_data = &babbage_fb1_data,
+};
+
 /*
  * Board specific initialization.
  */
@@ -392,6 +446,26 @@ static void __init mxc_board_init(void)
 		ARRAY_SIZE(mx51_babbage_spi_board_info));
 	imx51_add_ecspi(0, &mx51_babbage_spi_pdata);
Quoted 8 lines

arch/arm/mach-mx5/board-mx51_babbage.c static void __init mxc_board_init(void) · line 453

Quoted 6 lines
arch/arm/mach-mx5/board-mx51_babbage.c +5 -0
 	imx51_add_imx2_wdt(0, NULL);
+
+#define GPIO_DVI_DETECT	(2 * 32 + 28)
+#define GPIO_DVI_RESET	(2 * 32 + 5)
+#define GPIO_DVI_PWRDN	(2 * 32 + 6)
+#define GPIO_DVI_I2C	(3 * 32 + 14)

What about using IMX_GPIO_NR() ?

Yes, changed. Also I'll use gpio_request_array which simplfifies the code a bit and adds proper error checking.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#17 lore raw

PATCH v3 1/1 Add i.MX51/53 IPU framebuffer support

In reply to Sascha Hauer

Hi Sascha,

Quoted 12 lines · Sascha Hauer

The following is the third version of the series adding ipu support for the i.MX51/53.

Changes since last version:

- The IPU core driver now sits in drivers/video instead of drivers/mfd. It still needs mfd support, so it has a select on MFD_SUPPORT and MFD_CORE.
- The fb driver does not reallocate memory anymore. This is broken since there is a risk that some userspace process still has the memory mapped while we reallocate it which leads to bad results.

Quoted 9 lines

Sascha Hauer (7):
Add a mfd IPUv3 driver
fb: export fb mode db table
Add i.MX5 framebuffer driver
ARM i.MX51: Add IPU device support
ARM i.MX5: Allow to increase max zone order ARM i.MX5: increase dma consistent size for IPU support ARM i.MX51 babbage: Add framebuffer support

for the whole serie except the last one concerning babbage :

Eric