[Armadeus-commitlog] armadeus branch, master, updated. release-3.3-201-gda54480
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2010-12-31 16:50:31
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via da5448085049781ba34238a9fb6ee5052909f730 (commit)
via b6806d48eb00ff4e8d3cd726463cb1fee1df9ad1 (commit)
via 54d970d8d2bf6c110b9170d9c56b43e07232f0f0 (commit)
from 243e4dad6ab78b9d390d4b4ebfac760c37888e23 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit da5448085049781ba34238a9fb6ee5052909f730
Author: Julien Boibessot <jul...@ar...>
Date: Fri Dec 31 17:49:36 2010 +0100
[LINUX] 2.6.38: improves APF51 support (OTG, LCD, SPI)
commit b6806d48eb00ff4e8d3cd726463cb1fee1df9ad1
Author: Julien Boibessot <jul...@ar...>
Date: Fri Dec 31 17:47:10 2010 +0100
[LINUX] 2.6.38-alpha: adds v2 version of pengutronix ipuv3 patches (part 2: patches renaming)
commit 54d970d8d2bf6c110b9170d9c56b43e07232f0f0
Author: Julien Boibessot <jul...@ar...>
Date: Fri Dec 31 17:41:31 2010 +0100
[LINUX] 2.6.38-alpha: adds v2 version of pengutronix ipuv3 patches
-----------------------------------------------------------------------
Summary of changes:
...engutronix-1-iMX51-add_ipu_clock_support.patch} | 6 +-
...2-20-pengutronix-2-iMX51-rename_IPU_irqs.patch} | 4 -
...-20-pengutronix-3-Add_a_mfd_IPUv3_driver.patch} | 344 +++++++++++++-------
...pengutronix-4-fb-export_fb_mode_fb_table.patch} | 1 -
...engutronix-5-Add_iMX5_framebuffer_driver.patch} | 174 ++++++++---
...ngutronix-6-iMX51-Add_IPU_device_support.patch} | 58 ++--
...7-iMX51-Allow_to_increase_max_zone_order.patch} | 0
...ease_dma_consistent_size_for_IPU_support.patch} | 11 +-
...-9-iMX51-babbage_add_framebuffer_support.patch} | 18 +-
.../2.6.38/400-armadeus-add_apf51_module.patch | 110 +++++--
.../408-armadeus-add_apf51-dev_baseboard.patch | 135 +++++---
11 files changed, 581 insertions(+), 280 deletions(-)
rename buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/{001-2010-12-10-pengutronix-1-iMX51-add_ipu_clock_support.patch => 001-2010-12-20-pengutronix-1-iMX51-add_ipu_clock_support.patch} (96%)
rename buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/{001-2010-12-10-pengutronix-2-iMX51-rename_IPU_irqs.patch => 001-2010-12-20-pengutronix-2-iMX51-rename_IPU_irqs.patch} (98%)
rename buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/{001-2010-12-10-pengutronix-3-Add_a_mfd_IPUv3_driver.patch => 001-2010-12-20-pengutronix-3-Add_a_mfd_IPUv3_driver.patch} (95%)
rename buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/{001-2010-12-10-pengutronix-4-fb-export_fb_mode_fb_table.patch => 001-2010-12-20-pengutronix-4-fb-export_fb_mode_fb_table.patch} (99%)
rename buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/{001-2010-12-10-pengutronix-5-Add_iMX5_framebuffer_driver.patch => 001-2010-12-20-pengutronix-5-Add_iMX5_framebuffer_driver.patch} (84%)
rename buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/{001-2010-12-10-pengutronix-6-iMX51-Add_IPU_device_support.patch => 001-2010-12-20-pengutronix-6-iMX51-Add_IPU_device_support.patch} (61%)
rename buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/{001-2010-12-10-pengutronix-7-iMX51-Allow_to_increase_max_zone_order.patch => 001-2010-12-20-pengutronix-7-iMX51-Allow_to_increase_max_zone_order.patch} (100%)
rename buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/{001-2010-12-10-pengutronix-8-iMX51-increase_dma_consistent_size_for_IPU_support.patch => 001-2010-12-20-pengutronix-8-iMX51-increase_dma_consistent_size_for_IPU_support.patch} (72%)
rename buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/{001-2010-12-10-pengutronix-9-iMX51-babbage_add_framebuffer_support.patch => 001-2010-12-20-pengutronix-9-iMX51-babbage_add_framebuffer_support.patch} (90%)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-1-iMX51-add_ipu_clock_support.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-1-iMX51-add_ipu_clock_support.patch
similarity index 96%
rename from buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-1-iMX51-add_ipu_clock_support.patch
rename to buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-1-iMX51-add_ipu_clock_support.patch
index 845c858..4b1856b 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-1-iMX51-add_ipu_clock_support.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-1-iMX51-add_ipu_clock_support.patch
@@ -17,7 +17,7 @@ index 9fc65bb..f550d02 100644
#define MAX_DPLL_WAIT_TRIES 1000 /* 1000 * udelay(1) = 1ms */
-@@ -679,6 +682,19 @@ static unsigned long clk_emi_slow_get_rate(struct clk *clk)
+@@ -688,6 +691,19 @@ static unsigned long clk_emi_slow_get_rate(struct clk *clk)
return clk_get_rate(clk->parent) / div;
}
@@ -37,7 +37,7 @@ index 9fc65bb..f550d02 100644
/* External high frequency clock */
static struct clk ckih_clk = {
.get_rate = get_high_reference_clock_rate,
-@@ -819,6 +835,109 @@ static struct clk emi_slow_clk = {
+@@ -846,6 +862,109 @@ static struct clk emi_slow_clk = {
.get_rate = clk_emi_slow_get_rate,
};
@@ -147,7 +147,7 @@ index 9fc65bb..f550d02 100644
#define DEFINE_CLOCK_CCGR(name, i, er, es, pfx, p, s) \
static struct clk name = { \
.id = i, \
-@@ -1046,6 +1165,23 @@ DEFINE_CLOCK_FULL(esdhc2_ipg_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG2_OFFSET,
+@@ -1077,6 +1196,23 @@ DEFINE_CLOCK_FULL(esdhc2_ipg_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG2_OFFSET,
DEFINE_CLOCK_MAX(esdhc2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG3_OFFSET,
clk_esdhc2, &pll2_sw_clk, &esdhc2_ipg_clk);
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-2-iMX51-rename_IPU_irqs.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-2-iMX51-rename_IPU_irqs.patch
similarity index 98%
rename from buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-2-iMX51-rename_IPU_irqs.patch
rename to buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-2-iMX51-rename_IPU_irqs.patch
index 23d237c..f7e6edb 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-2-iMX51-rename_IPU_irqs.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-2-iMX51-rename_IPU_irqs.patch
@@ -1,4 +1,3 @@
-
Signed-off-by: Sascha Hauer <s....@pe...>
---
arch/arm/plat-mxc/include/mach/mx51.h | 4 ++--
@@ -19,6 +18,3 @@ index fa3a2a5..873807f 100644
#define MX51_MXC_INT_GPU 12
#define MX51_MXC_INT_RESV13 13
#define MX51_MXC_INT_USB_H1 14
---
-1.7.2.3
-
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-3-Add_a_mfd_IPUv3_driver.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-3-Add_a_mfd_IPUv3_driver.patch
similarity index 95%
rename from buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-3-Add_a_mfd_IPUv3_driver.patch
rename to buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-3-Add_a_mfd_IPUv3_driver.patch
index 5aa97cc..68429d6 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-3-Add_a_mfd_IPUv3_driver.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-3-Add_a_mfd_IPUv3_driver.patch
@@ -28,19 +28,19 @@ So expect more files to come in this directory.
Signed-off-by: Sascha Hauer <s....@pe...>
---
- arch/arm/plat-mxc/include/mach/ipu-v3.h | 48 +++
+ arch/arm/plat-mxc/include/mach/ipu-v3.h | 49 +++
drivers/mfd/Kconfig | 7 +
drivers/mfd/Makefile | 1 +
drivers/mfd/imx-ipu-v3/Makefile | 3 +
- drivers/mfd/imx-ipu-v3/ipu-common.c | 661 +++++++++++++++++++++++++++++++
- drivers/mfd/imx-ipu-v3/ipu-cpmem.c | 608 ++++++++++++++++++++++++++++
- drivers/mfd/imx-ipu-v3/ipu-dc.c | 362 +++++++++++++++++
- drivers/mfd/imx-ipu-v3/ipu-di.c | 507 ++++++++++++++++++++++++
- drivers/mfd/imx-ipu-v3/ipu-dmfc.c | 343 ++++++++++++++++
- drivers/mfd/imx-ipu-v3/ipu-dp.c | 468 ++++++++++++++++++++++
- drivers/mfd/imx-ipu-v3/ipu-prv.h | 214 ++++++++++
- include/linux/mfd/imx-ipu-v3.h | 218 ++++++++++
- 12 files changed, 3440 insertions(+), 0 deletions(-)
+ drivers/mfd/imx-ipu-v3/ipu-common.c | 708 +++++++++++++++++++++++++++++++
+ drivers/mfd/imx-ipu-v3/ipu-cpmem.c | 612 ++++++++++++++++++++++++++
+ drivers/mfd/imx-ipu-v3/ipu-dc.c | 364 ++++++++++++++++
+ drivers/mfd/imx-ipu-v3/ipu-di.c | 550 ++++++++++++++++++++++++
+ drivers/mfd/imx-ipu-v3/ipu-dmfc.c | 355 ++++++++++++++++
+ drivers/mfd/imx-ipu-v3/ipu-dp.c | 476 +++++++++++++++++++++
+ drivers/mfd/imx-ipu-v3/ipu-prv.h | 216 ++++++++++
+ include/linux/mfd/imx-ipu-v3.h | 219 ++++++++++
+ 12 files changed, 3560 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/plat-mxc/include/mach/ipu-v3.h
create mode 100644 drivers/mfd/imx-ipu-v3/Makefile
create mode 100644 drivers/mfd/imx-ipu-v3/ipu-common.c
@@ -54,10 +54,10 @@ Signed-off-by: Sascha Hauer <s....@pe...>
diff --git a/arch/arm/plat-mxc/include/mach/ipu-v3.h b/arch/arm/plat-mxc/include/mach/ipu-v3.h
new file mode 100644
-index 0000000..0a6c3e8
+index 0000000..f8900b9
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/ipu-v3.h
-@@ -0,0 +1,48 @@
+@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2010 Sascha Hauer <s....@pe...>
+ *
@@ -97,12 +97,13 @@ index 0000000..0a6c3e8
+ int ipu_channel_fg;
+ int dc_channel;
+ int dp_channel;
++ int display;
+};
+
+struct imx_ipuv3_platform_data {
+ int rev;
-+ struct ipuv3_fb_platform_data *fb0_platform_data;
-+ struct ipuv3_fb_platform_data *fb1_platform_data;
++ struct ipuv3_fb_platform_data *fb_head0_platform_data;
++ struct ipuv3_fb_platform_data *fb_head1_platform_data;
+};
+
+#endif /* __MACH_IPU_V3_H_ */
@@ -128,7 +129,7 @@ diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f54b365..7873b13 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
-@@ -76,3 +76,4 @@ obj-$(CONFIG_MFD_JANZ_CMODIO) += janz-cmodio.o
+@@ -81,3 +81,4 @@ obj-$(CONFIG_MFD_JANZ_CMODIO) += janz-cmodio.o
obj-$(CONFIG_MFD_JZ4740_ADC) += jz4740-adc.o
obj-$(CONFIG_MFD_TPS6586X) += tps6586x.o
obj-$(CONFIG_MFD_VX855) += vx855.o
@@ -144,10 +145,10 @@ index 0000000..ff70fe8
+imx-ipu-v3-objs := ipu-common.o ipu-dc.o ipu-di.o ipu-dp.o ipu-dmfc.o ipu-cpmem.o
diff --git a/drivers/mfd/imx-ipu-v3/ipu-common.c b/drivers/mfd/imx-ipu-v3/ipu-common.c
new file mode 100644
-index 0000000..e6edb88
+index 0000000..d96245f
--- /dev/null
+++ b/drivers/mfd/imx-ipu-v3/ipu-common.c
-@@ -0,0 +1,661 @@
+@@ -0,0 +1,708 @@
+/*
+ * Copyright (c) 2010 Sascha Hauer <s....@pe...>
+ * Copyright (C) 2005-2009 Freescale Semiconductor, Inc.
@@ -184,9 +185,12 @@ index 0000000..e6edb88
+static struct device *ipu_dev;
+
+static DEFINE_SPINLOCK(ipu_lock);
++static DEFINE_MUTEX(ipu_channel_lock);
+void __iomem *ipu_cm_reg;
+void __iomem *ipu_idmac_reg;
+
++static int ipu_use_count;
++
+static struct ipu_channel channels[64];
+
+struct ipu_channel *ipu_idmac_get(unsigned num)
@@ -198,15 +202,20 @@ index 0000000..e6edb88
+ if (num > 63)
+ return ERR_PTR(-ENODEV);
+
++ mutex_lock(&ipu_channel_lock);
++
+ channel = &channels[num];
+
-+ if (channel->busy)
-+ return ERR_PTR(-EBUSY);
++ if (channel->busy) {
++ channel = ERR_PTR(-EBUSY);
++ goto out;
++ }
+
+ channel->busy = 1;
+ channel->num = num;
+
-+ clk_enable(ipu_clk);
++out:
++ mutex_unlock(&ipu_channel_lock);
+
+ return channel;
+}
@@ -216,8 +225,11 @@ index 0000000..e6edb88
+{
+ dev_dbg(ipu_dev, "%s %d\n", __func__, channel->num);
+
-+ clk_disable(ipu_clk);
++ mutex_lock(&ipu_channel_lock);
++
+ channel->busy = 0;
++
++ mutex_unlock(&ipu_channel_lock);
+}
+EXPORT_SYMBOL(ipu_idmac_put);
+
@@ -239,31 +251,6 @@ index 0000000..e6edb88
+}
+EXPORT_SYMBOL(ipu_idmac_set_double_buffer);
+
-+void ipu_uninit_channel(struct ipu_channel *channel)
-+{
-+ unsigned long lock_flags;
-+ u32 val;
-+
-+ /* Make sure channel is disabled */
-+
-+ if (idmac_idma_is_set(IDMAC_CHA_EN, channel->num)) {
-+ dev_err(ipu_dev,
-+ "Channel %d is not disabled, disable first\n",
-+ channel->num);
-+ return;
-+ }
-+
-+ spin_lock_irqsave(&ipu_lock, lock_flags);
-+
-+ /* Reset the double buffer */
-+ val = ipu_cm_read(IPU_CHA_DB_MODE_SEL(channel->num));
-+ val &= ~idma_mask(channel->num);
-+ ipu_cm_write(val, IPU_CHA_DB_MODE_SEL(channel->num));
-+
-+ spin_unlock_irqrestore(&ipu_lock, lock_flags);
-+}
-+EXPORT_SYMBOL(ipu_uninit_channel);
-+
+int ipu_module_enable(u32 mask)
+{
+ unsigned long lock_flags;
@@ -299,12 +286,17 @@ index 0000000..e6edb88
+void ipu_idmac_select_buffer(struct ipu_channel *channel, u32 buf_num)
+{
+ unsigned int chno = channel->num;
++ unsigned long flags;
++
++ spin_lock_irqsave(&ipu_lock, flags);
+
+ /* Mark buffer as ready. */
+ if (buf_num == 0)
+ ipu_cm_write(idma_mask(chno), IPU_CHA_BUF0_RDY(chno));
+ else
+ ipu_cm_write(idma_mask(chno), IPU_CHA_BUF1_RDY(chno));
++
++ spin_unlock_irqrestore(&ipu_lock, flags);
+}
+EXPORT_SYMBOL(ipu_idmac_select_buffer);
+
@@ -313,6 +305,8 @@ index 0000000..e6edb88
+ u32 val;
+ unsigned long flags;
+
++ ipu_get();
++
+ spin_lock_irqsave(&ipu_lock, flags);
+
+ val = ipu_idmac_read(IDMAC_CHA_EN(channel->num));
@@ -351,8 +345,15 @@ index 0000000..e6edb88
+
+ ipu_cm_write(0x0, IPU_GPR); /* write one to set */
+
++ /* Reset the double buffer */
++ val = ipu_cm_read(IPU_CHA_DB_MODE_SEL(channel->num));
++ val &= ~idma_mask(channel->num);
++ ipu_cm_write(val, IPU_CHA_DB_MODE_SEL(channel->num));
++
+ spin_unlock_irqrestore(&ipu_lock, flags);
+
++ ipu_put();
++
+ return 0;
+}
+EXPORT_SYMBOL(ipu_idmac_disable_channel);
@@ -434,6 +435,8 @@ index 0000000..e6edb88
+ bitmap_zero(handler.ipu_irqs, IPU_IRQ_COUNT);
+ bitmap_set(handler.ipu_irqs, interrupt, 1);
+
++ ipu_cm_write(1 << (interrupt % 32), IPU_INT_STAT(interrupt / 32 + 1));
++
+ handler.handler = ipu_completion_handler;
+ handler.context = &completion;
+ ipu_irq_add_handler(&handler);
@@ -445,6 +448,8 @@ index 0000000..e6edb88
+
+ if (ret > 0)
+ ret = 0;
++ else
++ ret = -ETIMEDOUT;
+
+ return ret;
+}
@@ -611,6 +616,35 @@ index 0000000..e6edb88
+ return ret;
+}
+
++void ipu_get(void)
++{
++ mutex_lock(&ipu_channel_lock);
++
++ ipu_use_count++;
++
++ if (ipu_use_count == 1)
++ clk_enable(ipu_clk);
++
++ mutex_unlock(&ipu_channel_lock);
++}
++
++void ipu_put(void)
++{
++ mutex_lock(&ipu_channel_lock);
++
++ ipu_use_count--;
++
++ if (ipu_use_count == 0)
++ clk_disable(ipu_clk);
++
++ if (ipu_use_count < 0) {
++ dev_err(ipu_dev, "ipu use count < 0\n");
++ ipu_use_count = 0;
++ }
++
++ mutex_unlock(&ipu_channel_lock);
++}
++
+static void ipu_submodules_exit(struct platform_device *pdev,
+ unsigned long ipu_base)
+{
@@ -638,30 +672,31 @@ index 0000000..e6edb88
+static int ipu_add_client_devices(struct platform_device *pdev)
+{
+ struct imx_ipuv3_platform_data *plat_data = pdev->dev.platform_data;
++ struct ipuv3_fb_platform_data *fbdata;
+
-+ if (plat_data->fb0_platform_data) {
-+ plat_data->fb0_platform_data->ipu_channel_bg =
++ fbdata = plat_data->fb_head0_platform_data;
++ if (fbdata) {
++ fbdata->ipu_channel_bg =
+ MX51_IPU_CHANNEL_MEM_BG_SYNC;
-+ plat_data->fb0_platform_data->ipu_channel_fg =
++ fbdata->ipu_channel_fg =
+ MX51_IPU_CHANNEL_MEM_FG_SYNC;
-+ plat_data->fb0_platform_data->dc_channel = 5;
-+ plat_data->fb0_platform_data->dp_channel = IPU_DP_FLOW_SYNC;
++ fbdata->dc_channel = 5;
++ fbdata->dp_channel = IPU_DP_FLOW_SYNC;
+
+ ipu_add_subdevice_pdata(pdev, "imx-ipuv3-fb", 0,
-+ plat_data->fb0_platform_data,
-+ sizeof(struct ipuv3_fb_platform_data));
++ fbdata, sizeof(*fbdata));
+ }
+
-+ if (plat_data->fb1_platform_data) {
-+ plat_data->fb1_platform_data->ipu_channel_bg =
++ fbdata = plat_data->fb_head1_platform_data;
++ if (fbdata) {
++ fbdata->ipu_channel_bg =
+ MX51_IPU_CHANNEL_MEM_DC_SYNC;
-+ plat_data->fb1_platform_data->ipu_channel_fg = -1;
-+ plat_data->fb1_platform_data->dc_channel = 1;
-+ plat_data->fb1_platform_data->dp_channel = -1;
++ fbdata->ipu_channel_fg = -1;
++ fbdata->dc_channel = 1;
++ fbdata->dp_channel = -1;
+
+ ipu_add_subdevice_pdata(pdev, "imx-ipuv3-fb", 1,
-+ plat_data->fb1_platform_data,
-+ sizeof(struct ipuv3_fb_platform_data));
++ fbdata, sizeof(*fbdata));
+ }
+
+ return 0;
@@ -673,6 +708,10 @@ index 0000000..e6edb88
+ unsigned long ipu_base;
+ int ret, irq1, irq2;
+
++ /* There can be only one */
++ if (ipu_dev)
++ return -EBUSY;
++
+ spin_lock_init(&ipu_lock);
+
+ ipu_dev = &pdev->dev;
@@ -709,7 +748,7 @@ index 0000000..e6edb88
+ goto failed_clk_get;
+ }
+
-+ clk_enable(ipu_clk);
++ ipu_get();
+
+ ret = request_irq(irq1, ipu_irq_handler, IRQF_DISABLED, pdev->name,
+ &pdev->dev);
@@ -740,6 +779,8 @@ index 0000000..e6edb88
+ goto failed_add_clients;
+ }
+
++ ipu_put();
++
+ return 0;
+
+failed_add_clients:
@@ -748,6 +789,7 @@ index 0000000..e6edb88
+ free_irq(irq2, &pdev->dev);
+failed_request_irq2:
+ free_irq(irq1, &pdev->dev);
++ ipu_put();
+failed_request_irq1:
+ clk_put(ipu_clk);
+failed_clk_get:
@@ -775,11 +817,17 @@ index 0000000..e6edb88
+ ipu_submodules_exit(pdev, ipu_base);
+ free_irq(irq2, &pdev->dev);
+ free_irq(irq1, &pdev->dev);
-+ clk_disable(ipu_clk);
-+ clk_put(ipu_clk);
+ iounmap(ipu_idmac_reg);
+ iounmap(ipu_cm_reg);
+
++ if (ipu_use_count != 0) {
++ dev_err(ipu_dev, "unbalanced use count: %d\n", ipu_use_count);
++ clk_disable(ipu_clk);
++ }
++
++ clk_put(ipu_clk);
++ ipu_dev = NULL;
++
+ return 0;
+}
+
@@ -811,10 +859,10 @@ index 0000000..e6edb88
+MODULE_LICENSE("GPL");
diff --git a/drivers/mfd/imx-ipu-v3/ipu-cpmem.c b/drivers/mfd/imx-ipu-v3/ipu-cpmem.c
new file mode 100644
-index 0000000..587b487
+index 0000000..faff5ee
--- /dev/null
+++ b/drivers/mfd/imx-ipu-v3/ipu-cpmem.c
-@@ -0,0 +1,608 @@
+@@ -0,0 +1,612 @@
+/*
+ * Copyright (c) 2010 Sascha Hauer <s....@pe...>
+ * Copyright (C) 2005-2009 Freescale Semiconductor, Inc.
@@ -1366,7 +1414,7 @@ index 0000000..587b487
+ dma_addr_t phyaddr_0, dma_addr_t phyaddr_1,
+ u32 u, u32 v, bool interlaced)
+{
-+ int ret;
++ int ret = 0;
+ u32 dma_chan = channel->num;
+
+ if (stride < width * ipu_bytes_per_pixel(pixel_fmt))
@@ -1378,11 +1426,13 @@ index 0000000..587b487
+ return -EINVAL;
+ }
+
++ ipu_get();
++
+ /* Build parameter memory data for DMA channel */
+ ret = ipu_ch_param_init(dma_chan, pixel_fmt, width, height, stride, u, v, 0,
+ phyaddr_0, phyaddr_1);
+ if (ret)
-+ return ret;
++ goto out;
+
+ if (rot_mode)
+ ipu_ch_param_set_rotation(dma_chan, rot_mode);
@@ -1394,8 +1444,10 @@ index 0000000..587b487
+ ipu_ch_param_set_high_priority(dma_chan);
+
+ ipu_ch_param_dump(dma_chan);
++out:
++ ipu_put();
+
-+ return 0;
++ return ret;
+}
+EXPORT_SYMBOL(ipu_idmac_init_channel_buffer);
+
@@ -1425,10 +1477,10 @@ index 0000000..587b487
+}
diff --git a/drivers/mfd/imx-ipu-v3/ipu-dc.c b/drivers/mfd/imx-ipu-v3/ipu-dc.c
new file mode 100644
-index 0000000..23ba5d7
+index 0000000..b8c601e
--- /dev/null
+++ b/drivers/mfd/imx-ipu-v3/ipu-dc.c
-@@ -0,0 +1,362 @@
+@@ -0,0 +1,364 @@
+/*
+ * Copyright (c) 2010 Sascha Hauer <s....@pe...>
+ * Copyright (C) 2005-2009 Freescale Semiconductor, Inc.
@@ -1447,10 +1499,8 @@ index 0000000..23ba5d7
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
-+#include <linux/spinlock.h>
+#include <linux/io.h>
+#include <linux/mfd/imx-ipu-v3.h>
-+#include <asm/atomic.h>
+
+#include "ipu-prv.h"
+
@@ -1576,6 +1626,8 @@ index 0000000..23ba5d7
+ return -EINVAL;
+ }
+
++ ipu_get();
++
+ if (interlaced) {
+ ipu_dc_link_event(dc_chan, DC_EVT_NL, 0, 3);
+ ipu_dc_link_event(dc_chan, DC_EVT_EOL, 0, 2);
@@ -1625,6 +1677,8 @@ index 0000000..23ba5d7
+
+ ipu_module_enable(IPU_CONF_DC_EN);
+
++ ipu_put();
++
+ return 0;
+}
+EXPORT_SYMBOL(ipu_dc_init_sync);
@@ -1793,10 +1847,10 @@ index 0000000..23ba5d7
+}
diff --git a/drivers/mfd/imx-ipu-v3/ipu-di.c b/drivers/mfd/imx-ipu-v3/ipu-di.c
new file mode 100644
-index 0000000..73ebd51
+index 0000000..62e3d01
--- /dev/null
+++ b/drivers/mfd/imx-ipu-v3/ipu-di.c
-@@ -0,0 +1,507 @@
+@@ -0,0 +1,550 @@
+/*
+ * Copyright (c) 2010 Sascha Hauer <s....@pe...>
+ * Copyright (C) 2005-2009 Freescale Semiconductor, Inc.
@@ -1814,11 +1868,10 @@ index 0000000..73ebd51
+
+#include <linux/types.h>
+#include <linux/errno.h>
-+#include <linux/delay.h>
+#include <linux/io.h>
++#include <linux/err.h>
+#include <linux/mfd/imx-ipu-v3.h>
+#include <linux/platform_device.h>
-+#include <asm/atomic.h>
+
+#include "ipu-prv.h"
+
@@ -1833,6 +1886,8 @@ index 0000000..73ebd51
+ struct clk *clk;
+ struct clk *ipu_clk;
+ bool external_clk;
++ bool inuse;
++ bool initialized;
+};
+
+static struct ipu_di dis[2];
@@ -2123,9 +2178,8 @@ index 0000000..73ebd51
+ ipu_di_sync_config(di, cfg, ARRAY_SIZE(cfg));
+}
+
-+int ipu_di_init_sync_panel(int disp, u32 pixel_clk, struct ipu_di_signal_cfg *sig)
++int ipu_di_init_sync_panel(struct ipu_di *di, u32 pixel_clk, struct ipu_di_signal_cfg *sig)
+{
-+ struct ipu_di *di = &dis[disp];
+ u32 reg;
+ u32 disp_gen, di_gen, vsync_cnt;
+ u32 div;
@@ -2133,10 +2187,7 @@ index 0000000..73ebd51
+ struct clk *di_clk;
+
+ dev_dbg(ipu_dev, "disp %d: panel size = %d x %d\n",
-+ disp, sig->width, sig->height);
-+
-+ if (disp > 1)
-+ return -EINVAL;
++ di->id, sig->width, sig->height);
+
+ if ((sig->v_sync_width == 0) || (sig->h_sync_width == 0))
+ return -EINVAL;
@@ -2145,6 +2196,7 @@ index 0000000..73ebd51
+ v_total = sig->height + sig->v_sync_width + sig->v_start_width + sig->v_end_width;
+
+ mutex_lock(&di_mutex);
++ ipu_get();
+
+ /* Init clocking */
+ if (sig->ext_clk) {
@@ -2165,7 +2217,7 @@ index 0000000..73ebd51
+ div = 0x10;
+
+ disp_gen = ipu_cm_read(IPU_DISP_GEN);
-+ disp_gen &= disp ? ~DI1_COUNTER_RELEASE : ~DI0_COUNTER_RELEASE;
++ disp_gen &= di->id ? ~DI1_COUNTER_RELEASE : ~DI0_COUNTER_RELEASE;
+ ipu_cm_write(disp_gen, IPU_DISP_GEN);
+
+ ipu_di_write(di, div, DI_BS_CLKGEN0);
@@ -2222,19 +2274,20 @@ index 0000000..73ebd51
+
+ ipu_di_write(di, reg, DI_POL);
+
++ ipu_put();
+ mutex_unlock(&di_mutex);
+
+ return 0;
+}
+EXPORT_SYMBOL(ipu_di_init_sync_panel);
+
-+int ipu_di_enable(int disp)
++int ipu_di_enable(struct ipu_di *di)
+{
-+ struct ipu_di *di = &dis[disp];
+ u32 reg;
+
++ ipu_get();
+ reg = ipu_cm_read(IPU_DISP_GEN);
-+ if (disp)
++ if (di->id)
+ reg |= DI1_COUNTER_RELEASE;
+ else
+ reg |= DI0_COUNTER_RELEASE;
@@ -2249,18 +2302,18 @@ index 0000000..73ebd51
+}
+EXPORT_SYMBOL(ipu_di_enable);
+
-+int ipu_di_disable(int disp)
++int ipu_di_disable(struct ipu_di *di)
+{
-+ struct ipu_di *di = &dis[disp];
+ u32 reg;
+
+ ipu_module_disable(di->module);
++ ipu_put();
+
+ if (di->external_clk)
+ clk_disable(di->clk);
+
+ reg = ipu_cm_read(IPU_DISP_GEN);
-+ if (disp)
++ if (di->id)
+ reg &= ~DI1_COUNTER_RELEASE;
+ else
+ reg &= ~DI0_COUNTER_RELEASE;
@@ -2270,6 +2323,47 @@ index 0000000..73ebd51
+}
+EXPORT_SYMBOL(ipu_di_disable);
+
++static DEFINE_MUTEX(ipu_di_lock);
++
++struct ipu_di *ipu_di_get(int disp)
++{
++ struct ipu_di *di;
++
++ if (disp > 1)
++ return ERR_PTR(-EINVAL);
++
++ di = &dis[disp];
++
++ mutex_lock(&ipu_di_lock);
++
++ if (!di->initialized) {
++ di = ERR_PTR(-ENOSYS);
++ goto out;
++ }
++
++ if (di->inuse) {
++ di = ERR_PTR(-EBUSY);
++ goto out;
++ }
++
++ di->inuse = true;
++out:
++ mutex_unlock(&ipu_di_lock);
++
++ return di;
++}
++EXPORT_SYMBOL(ipu_di_get);
++
++void ipu_di_put(struct ipu_di *di)
++{
++ mutex_lock(&ipu_di_lock);
++
++ di->inuse = false;
++
++ mutex_unlock(&ipu_di_lock);
++}
++EXPORT_SYMBOL(ipu_di_put);
++
+int ipu_di_init(struct platform_device *pdev, int id, unsigned long base,
+ u32 module, struct clk *ipu_clk)
+{
@@ -2290,6 +2384,8 @@ index 0000000..73ebd51
+ dis[id].id = id;
+ dis[id].ipu_clk = ipu_clk;
+ dis[id].base = ioremap(base, PAGE_SIZE);
++ dis[id].initialized = true;
++ dis[id].inuse = false;
+ if (!dis[id].base)
+ return -ENOMEM;
+
@@ -2303,13 +2399,14 @@ index 0000000..73ebd51
+{
+ clk_put(dis[id].clk);
+ iounmap(dis[id].base);
++ dis[id].initialized = false;
+}
diff --git a/drivers/mfd/imx-ipu-v3/ipu-dmfc.c b/drivers/mfd/imx-ipu-v3/ipu-dmfc.c
new file mode 100644
-index 0000000..25782a7
+index 0000000..3d47a76
--- /dev/null
+++ b/drivers/mfd/imx-ipu-v3/ipu-dmfc.c
-@@ -0,0 +1,343 @@
+@@ -0,0 +1,355 @@
+/*
+ * Copyright (c) 2010 Sascha Hauer <s....@pe...>
+ * Copyright (C) 2005-2009 Freescale Semiconductor, Inc.
@@ -2327,7 +2424,6 @@ index 0000000..25782a7
+
+#include <linux/types.h>
+#include <linux/errno.h>
-+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/mfd/imx-ipu-v3.h>
+
@@ -2421,6 +2517,7 @@ index 0000000..25782a7
+int ipu_dmfc_enable_channel(struct dmfc_channel *dmfc)
+{
+ mutex_lock(&dmfc_mutex);
++ ipu_get();
+
+ if (!dmfc_use_count)
+ ipu_module_enable(IPU_CONF_DMFC_EN);
@@ -2445,6 +2542,7 @@ index 0000000..25782a7
+ if (dmfc_use_count < 0)
+ dmfc_use_count = 0;
+
++ ipu_put();
+ mutex_unlock(&dmfc_mutex);
+}
+EXPORT_SYMBOL(ipu_dmfc_disable_channel);
@@ -2562,27 +2660,34 @@ index 0000000..25782a7
+ unsigned long bandwidth_pixel_per_second)
+{
+ int slots = dmfc_bandwidth_to_slots(bandwidth_pixel_per_second);
-+ int segment = 0;
++ int segment = 0, ret = 0;
+
+ dev_dbg(ipu_dev, "dmfc: trying to allocate %ldMpixel/s for IPU channel %d\n",
+ bandwidth_pixel_per_second / 1000000, dmfc->ipu_channel);
+
+ ipu_dmfc_free_bandwidth(dmfc);
+
++ ipu_get();
+ mutex_lock(&dmfc_mutex);
+
-+ if (slots > 8)
-+ return -EBUSY;
++ if (slots > 8) {
++ ret = -EBUSY;
++ goto out;
++ }
+
+ segment = dmfc_find_slots(slots);
-+ if (segment < 0)
-+ return -EBUSY;
++ if (segment < 0) {
++ ret = -EBUSY;
++ goto out;
++ }
+
+ ipu_dmfc_setup_channel(dmfc, slots, segment);
+
++out:
++ ipu_put();
+ mutex_unlock(&dmfc_mutex);
+
-+ return 0;
++ return ret;
+}
+EXPORT_SYMBOL(ipu_dmfc_alloc_bandwidth);
+
@@ -2590,6 +2695,8 @@ index 0000000..25782a7
+{
+ u32 dmfc_gen1;
+
++ ipu_get();
++
+ dmfc_gen1 = readl(dmfc_regs + DMFC_GENERAL1);
+
+ if ((dmfc->slots * 64 * 4) / width > dmfc->max_fifo_lines)
@@ -2599,6 +2706,8 @@ index 0000000..25782a7
+
+ writel(dmfc_gen1, dmfc_regs + DMFC_GENERAL1);
+
++ ipu_put();
++
+ return 0;
+}
+EXPORT_SYMBOL(ipu_dmfc_init_channel);
@@ -2655,10 +2764,10 @@ index 0000000..25782a7
+}
diff --git a/drivers/mfd/imx-ipu-v3/ipu-dp.c b/drivers/mfd/imx-ipu-v3/ipu-dp.c
new file mode 100644
-index 0000000..505107d
+index 0000000..57a7fec
--- /dev/null
+++ b/drivers/mfd/imx-ipu-v3/ipu-dp.c
-@@ -0,0 +1,468 @@
+@@ -0,0 +1,476 @@
+/*
+ * Copyright (c) 2010 Sascha Hauer <s....@pe...>
+ * Copyright (C) 2005-2009 Freescale Semiconductor, Inc.
@@ -2676,11 +2785,9 @@ index 0000000..505107d
+
+#include <linux/types.h>
+#include <linux/errno.h>
-+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/mfd/imx-ipu-v3.h>
+#include <linux/err.h>
-+#include <asm/atomic.h>
+
+#include "ipu-prv.h"
+
@@ -2970,6 +3077,8 @@ index 0000000..505107d
+ enum csc_type_t *csc_type;
+ u32 reg;
+
++ ipu_get();
++
+ if (bg)
+ csc_type = &bg_csc_type;
+ else
@@ -3021,6 +3130,8 @@ index 0000000..505107d
+
+ __ipu_dp_csc_setup(dp->flow, dp_csc_array[bg_csc_type][fg_csc_type], true);
+
++ ipu_put();
++
+ return 0;
+}
+EXPORT_SYMBOL(ipu_dp_setup_channel);
@@ -3028,6 +3139,7 @@ index 0000000..505107d
+int ipu_dp_enable_channel(struct ipu_dp *dp)
+{
+ mutex_lock(&dp_mutex);
++ ipu_get();
+
+ if (!dp_use_count)
+ ipu_module_enable(IPU_CONF_DP_EN);
@@ -3052,6 +3164,7 @@ index 0000000..505107d
+ if (dp_use_count < 0)
+ dp_use_count = 0;
+
++ ipu_put();
+ mutex_unlock(&dp_mutex);
+}
+EXPORT_SYMBOL(ipu_dp_disable_channel);
@@ -3074,6 +3187,8 @@ index 0000000..505107d
+{
+ u32 reg, csc;
+
++ ipu_get();
++
+ reg = __raw_readl(DP_COM_CONF(DP_SYNC));
+ csc = reg & DP_COM_CONF_CSC_DEF_MASK;
+ if (csc == DP_COM_CONF_CSC_DEF_FG)
@@ -3084,6 +3199,8 @@ index 0000000..505107d
+
+ reg = ipu_cm_read(IPU_SRM_PRI2) | 0x8;
+ ipu_cm_write(reg, IPU_SRM_PRI2);
++
++ ipu_put();
+}
+EXPORT_SYMBOL(ipu_dp_disable_fg);
+
@@ -3129,10 +3246,10 @@ index 0000000..505107d
+}
diff --git a/drivers/mfd/imx-ipu-v3/ipu-prv.h b/drivers/mfd/imx-ipu-v3/ipu-prv.h
new file mode 100644
-index 0000000..9d54ad0
+index 0000000..339b554
--- /dev/null
+++ b/drivers/mfd/imx-ipu-v3/ipu-prv.h
-@@ -0,0 +1,214 @@
+@@ -0,0 +1,216 @@
+/*
+ * Copyright (c) 2010 Sascha Hauer <s....@pe...>
+ * Copyright (C) 2005-2009 Freescale Semiconductor, Inc.
@@ -3153,7 +3270,6 @@ index 0000000..9d54ad0
+#include <linux/types.h>
+#include <linux/device.h>
+#include <linux/clk.h>
-+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <mach/hardware.h>
+
@@ -3346,13 +3462,16 @@ index 0000000..9d54ad0
+int ipu_cpmem_init(struct platform_device *pdev, unsigned long base);
+void ipu_cpmem_exit(struct platform_device *pdev);
+
++void ipu_get(void);
++void ipu_put(void);
++
+#endif /* __IPU_PRV_H__ */
diff --git a/include/linux/mfd/imx-ipu-v3.h b/include/linux/mfd/imx-ipu-v3.h
new file mode 100644
-index 0000000..0288c51
+index 0000000..7243360
--- /dev/null
+++ b/include/linux/mfd/imx-ipu-v3.h
-@@ -0,0 +1,218 @@
+@@ -0,0 +1,219 @@
+/*
+ * Copyright 2005-2009 Freescale Semiconductor, Inc.
+ *
@@ -3367,10 +3486,8 @@ index 0000000..0288c51
+#ifndef __ASM_ARCH_IPU_H__
+#define __ASM_ARCH_IPU_H__
+
-+#include <linux/slab.h>
+#include <linux/types.h>
+#include <linux/videodev2.h>
-+#include <linux/interrupt.h>
+#include <linux/bitmap.h>
+
+/*
@@ -3533,9 +3650,12 @@ index 0000000..0288c51
+/*
+ * IPU Display Interface (di) functions
+ */
-+int ipu_di_disable(int disp);
-+int ipu_di_enable(int disp);
-+int ipu_di_init_sync_panel(int disp, u32 pixel_clk,
++struct ipu_di;
++struct ipu_di *ipu_di_get(int disp);
++void ipu_di_put(struct ipu_di *);
++int ipu_di_disable(struct ipu_di *);
++int ipu_di_enable(struct ipu_di *);
++int ipu_di_init_sync_panel(struct ipu_di *, u32 pixel_clk,
+ struct ipu_di_signal_cfg *sig);
+
+/*
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-4-fb-export_fb_mode_fb_table.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-4-fb-export_fb_mode_fb_table.patch
similarity index 99%
rename from buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-4-fb-export_fb_mode_fb_table.patch
rename to buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-4-fb-export_fb_mode_fb_table.patch
index 429cd50..449243c 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-4-fb-export_fb_mode_fb_table.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-4-fb-export_fb_mode_fb_table.patch
@@ -48,4 +48,3 @@ index d1631d3..e006172 100644
struct fb_videomode mode;
--
1.7.2.3
-
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-5-Add_iMX5_framebuffer_driver.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-5-Add_iMX5_framebuffer_driver.patch
similarity index 84%
rename from buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-5-Add_iMX5_framebuffer_driver.patch
rename to buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-5-Add_iMX5_framebuffer_driver.patch
index cbdd73c..9fe3f46 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-5-Add_iMX5_framebuffer_driver.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-5-Add_iMX5_framebuffer_driver.patch
@@ -10,8 +10,8 @@ Signed-off-by: Sascha Hauer <s....@pe...>
---
drivers/video/Kconfig | 11 +
drivers/video/Makefile | 1 +
- drivers/video/mx5fb.c | 846 ++++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 858 insertions(+), 0 deletions(-)
+ drivers/video/mx5fb.c | 934 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 946 insertions(+), 0 deletions(-)
create mode 100644 drivers/video/mx5fb.c
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
@@ -50,10 +50,10 @@ index 485e8ed..ad408d2 100644
# the test framebuffer is last
diff --git a/drivers/video/mx5fb.c b/drivers/video/mx5fb.c
new file mode 100644
-index 0000000..fd9baf4
+index 0000000..f7824c9
--- /dev/null
+++ b/drivers/video/mx5fb.c
-@@ -0,0 +1,846 @@
+@@ -0,0 +1,934 @@
+/*
+ * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
@@ -64,7 +64,7 @@ index 0000000..fd9baf4
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ *
-+ * Framebuffer Framebuffer Driver for SDC and ADC.
++ * Framebuffer Framebuffer Driver for SDC
+ */
+
+#include <linux/module.h>
@@ -89,7 +89,7 @@ index 0000000..fd9baf4
+ int ipu_channel_num;
+ struct ipu_channel *ipu_ch;
+ int dc;
-+ int ipu_di;
++ int di_no;
+ u32 ipu_di_pix_fmt;
+ u32 ipu_in_pix_fmt;
+
@@ -97,9 +97,14 @@ index 0000000..fd9baf4
+
+ struct ipu_dp *dp;
+ struct dmfc_channel *dmfc;
++ struct ipu_di *di;
+ struct fb_info *slave;
+ struct fb_info *master;
+ bool enabled;
++
++ /* overlay specific fields */
++ bool blank_state;
++ int ovlxres, ovlyres;
+};
+
+static int imx_ipu_fb_set_fix(struct fb_info *info)
@@ -163,7 +168,7 @@ index 0000000..fd9baf4
+ if (mxc_fbi->enabled)
+ return;
+
-+ ipu_di_enable(mxc_fbi->ipu_di);
++ ipu_di_enable(mxc_fbi->di);
+ ipu_dmfc_enable_channel(mxc_fbi->dmfc);
+ ipu_idmac_enable_channel(mxc_fbi->ipu_ch);
+ ipu_dc_enable_channel(mxc_fbi->dc);
@@ -182,7 +187,7 @@ index 0000000..fd9baf4
+ ipu_dc_disable_channel(mxc_fbi->dc);
+ ipu_idmac_disable_channel(mxc_fbi->ipu_ch);
+ ipu_dmfc_disable_channel(mxc_fbi->dmfc);
-+ ipu_di_disable(mxc_fbi->ipu_di);
++ ipu_di_disable(mxc_fbi->di);
+
+ mxc_fbi->enabled = 0;
+}
@@ -223,8 +228,6 @@ index 0000000..fd9baf4
+
+ fbi->fix.line_length = var->xres_virtual * var->bits_per_pixel / 8;
+
-+ var->yres_virtual = var->yres;
-+
+ ret = imx_ipu_fb_map_video_memory(fbi);
+ if (ret)
+ return ret;
@@ -279,7 +282,7 @@ index 0000000..fd9baf4
+ }
+ }
+
-+ ret = ipu_dc_init_sync(mxc_fbi->dc, mxc_fbi->ipu_di, interlaced,
++ ret = ipu_dc_init_sync(mxc_fbi->dc, mxc_fbi->di_no, interlaced,
+ out_pixel_fmt, fbi->var.xres);
+ if (ret) {
+ dev_dbg(fbi->device, "initializing display controller failed with %d\n",
@@ -287,7 +290,7 @@ index 0000000..fd9baf4
+ return ret;
+ }
+
-+ ret = ipu_di_init_sync_panel(mxc_fbi->ipu_di,
++ ret = ipu_di_init_sync_panel(mxc_fbi->di,
+ PICOS2KHZ(var->pixclock) * 1000UL,
+ &sig_cfg);
+ if (ret) {
@@ -469,8 +472,13 @@ index 0000000..fd9baf4
+ return ret;
+}
+
++static void imx_ipu_fb_enable_overlay(struct fb_info *fbi);
++static void imx_ipu_fb_disable_overlay(struct fb_info *fbi);
++
+static int imx_ipu_fb_blank(int blank, struct fb_info *info)
+{
++ struct imx_ipu_fb_info *mxc_fbi = info->par;
++
+ dev_dbg(info->device, "blank = %d\n", blank);
+
+ switch (blank) {
@@ -478,10 +486,14 @@ index 0000000..fd9baf4
+ case FB_BLANK_VSYNC_SUSPEND:
+ case FB_BLANK_HSYNC_SUSPEND:
+ case FB_BLANK_NORMAL:
++ if (mxc_fbi->slave)
++ imx_ipu_fb_disable_overlay(mxc_fbi->slave);
+ imx_ipu_fb_disable(info);
+ break;
+ case FB_BLANK_UNBLANK:
+ imx_ipu_fb_enable(info);
++ if (mxc_fbi->slave)
++ imx_ipu_fb_enable_overlay(mxc_fbi->slave);
+ break;
+ }
+
@@ -530,24 +542,67 @@ index 0000000..fd9baf4
+/*
+ * Overlay functions
+ */
-+static int imx_ipu_fb_enable_overlay(struct fb_info *fbi)
++static void imx_ipu_fb_enable_overlay(struct fb_info *fbi)
+{
+ struct imx_ipu_fb_info *mxc_fbi = fbi->par;
+
++ /*
++ * This function is called unconditionally from imx_ipu_fb_blank to
++ * enable/disable the overlay when the background is (un)blanked. So
++ * we decide upon blank_state whether we should actually enable the
++ * overlay.
++ */
++ if (!mxc_fbi->blank_state)
++ return;
++
++ if (mxc_fbi->enabled)
++ return;
++
+ ipu_dmfc_enable_channel(mxc_fbi->dmfc);
+ ipu_idmac_enable_channel(mxc_fbi->ipu_ch);
+ ipu_dp_enable_fg(mxc_fbi->dp);
-+
-+ return 0;
++ mxc_fbi->enabled = 1;
++ ipu_dp_set_color_key(mxc_fbi->dp, 1, 0x434343);
+}
+
-+static int imx_ipu_fb_disable_overlay(struct fb_info *fbi)
++static void imx_ipu_fb_disable_overlay(struct fb_info *fbi)
+{
+ struct imx_ipu_fb_info *mxc_fbi = fbi->par;
+
++ if (!mxc_fbi->enabled)
++ return;
++
+ ipu_dp_disable_fg(mxc_fbi->dp);
++ ipu_wait_for_interrupt(451, 100);
+ ipu_idmac_disable_channel(mxc_fbi->ipu_ch);
+ ipu_dmfc_disable_channel(mxc_fbi->dmfc);
++ mxc_fbi->enabled = 0;
++}
++
++#define NONSTD_TO_XPOS(x) (((x) >> 0) & 0xfff)
++#define NONSTD_TO_YPOS(x) (((x) >> 12) & 0xfff)
++#define NONSTD_TO_ALPHA(x) (((x) >> 24) & 0xff)
++
++static int imx_ipu_fb_check_var_overlay(struct fb_var_screeninfo *var,
++ struct fb_info *info)
++{
++ struct imx_ipu_fb_info *mxc_fbi = info->par;
++ struct fb_info *fbi_master = mxc_fbi->master;
++ struct fb_var_screeninfo *var_master = &fbi_master->var;
++ int ret;
++ static int xpos, ypos;
++
++ xpos = NONSTD_TO_XPOS(var->nonstd);
++ ypos = NONSTD_TO_YPOS(var->nonstd);
++
++ ret = imx_ipu_fb_check_var(var, info);
++ if (ret)
++ return ret;
++
++ if (var->xres + xpos > var_master->xres)
++ return -EINVAL;
++ if (var->yres + ypos > var_master->yres)
++ return -EINVAL;
+
+ return 0;
+}
@@ -557,32 +612,49 @@ index 0000000..fd9baf4
+ struct imx_ipu_fb_info *mxc_fbi = fbi->par;
+ struct fb_var_screeninfo *var = &fbi->var;
+ struct fb_info *fbi_master = mxc_fbi->master;
++ struct imx_ipu_fb_info *mxc_fbi_master = fbi_master->par;
+ struct fb_var_screeninfo *var_master = &fbi_master->var;
+ int ret;
+ int interlaced = 0;
+ int enabled = mxc_fbi->enabled;
++ int xpos, ypos, alpha;
++ int resolution_change;
+
+ dev_dbg(fbi->device, "Reconfiguring framebuffer %dx%d-%d\n",
+ fbi->var.xres, fbi->var.yres, fbi->var.bits_per_pixel);
+
-+ if (enabled)
++ resolution_change = mxc_fbi->ovlxres != var->xres ||
++ mxc_fbi->ovlyres != var->yres;
++
++ if (enabled && resolution_change)
+ imx_ipu_fb_disable_overlay(fbi);
+
+ fbi->fix.line_length = var->xres_virtual *
+ var->bits_per_pixel / 8;
+
-+ ret = imx_ipu_fb_map_video_memory(fbi);
-+ if (ret)
-+ return ret;
++ xpos = NONSTD_TO_XPOS(var->nonstd);
++ ypos = NONSTD_TO_YPOS(var->nonstd);
++ alpha = NONSTD_TO_ALPHA(var->nonstd);
++
++ if (resolution_change) {
++ ret = imx_ipu_fb_map_video_memory(fbi);
++ if (ret)
++ return ret;
++ }
++
++ if (!resolution_change && enabled)
++ ipu_wait_for_interrupt(IPU_IRQ_EOF(mxc_fbi_master->ipu_channel_num), 100);
+
-+ ipu_dp_set_window_pos(mxc_fbi->dp, 64, 64);
++ ipu_dp_set_window_pos(mxc_fbi->dp, xpos, ypos);
++ ipu_dp_set_global_alpha(mxc_fbi->dp, 1, alpha, 1);
+
+ var->xoffset = var->yoffset = 0;
+
-+ if (var->vmode & FB_VMODE_INTERLACED)
-+ interlaced = 1;
++ if (resolution_change) {
++ if (var->vmode & FB_VMODE_INTERLACED)
++ interlaced = 1;
+
-+ ret = ipu_idmac_init_channel_buffer(mxc_fbi->ipu_ch,
++ ret = ipu_idmac_init_channel_buffer(mxc_fbi->ipu_ch,
+ mxc_fbi->ipu_in_pix_fmt,
+ var->xres, var->yres,
+ fbi->fix.line_length,
@@ -590,27 +662,30 @@ index 0000000..fd9baf4
+ fbi->fix.smem_start,
+ 0,
+ 0, 0, interlaced);
-+ if (ret) {
-+ dev_dbg(fbi->device, "init channel buffer failed with %d\n",
++ if (ret) {
++ dev_dbg(fbi->device, "init channel buffer failed with %d\n",
+ ret);
-+ return ret;
-+ }
++ return ret;
++ }
+
-+ ret = ipu_dmfc_init_channel(mxc_fbi->dmfc, var->xres);
-+ if (ret) {
-+ dev_dbg(fbi->device, "initializing dmfc channel failed with %d\n",
++ ret = ipu_dmfc_init_channel(mxc_fbi->dmfc, var->xres);
++ if (ret) {
++ dev_dbg(fbi->device, "initializing dmfc channel failed with %d\n",
+ ret);
-+ return ret;
-+ }
++ return ret;
++ }
+
-+ ret = ipu_dmfc_alloc_bandwidth(mxc_fbi->dmfc, calc_bandwidth(var, calc_vref(var_master)));
-+ if (ret) {
-+ dev_dbg(fbi->device, "allocating dmfc bandwidth failed with %d\n",
++ ret = ipu_dmfc_alloc_bandwidth(mxc_fbi->dmfc, calc_bandwidth(var, calc_vref(var_master)));
++ if (ret) {
++ dev_dbg(fbi->device, "allocating dmfc bandwidth failed with %d\n",
+ ret);
-+ return ret;
++ return ret;
++ }
++ mxc_fbi->ovlxres = var->xres;
++ mxc_fbi->ovlyres = var->yres;
+ }
+
-+ if (enabled)
++ if (enabled && resolution_change)
+ imx_ipu_fb_enable_overlay(fbi);
+
+ return ret;
@@ -618,6 +693,8 @@ index 0000000..fd9baf4
+
+static int imx_ipu_fb_blank_overlay(int blank, struct fb_info *fbi)
+{
++ struct imx_ipu_fb_info *mxc_fbi = fbi->par;
++
+ dev_dbg(fbi->device, "blank = %d\n", blank);
+
+ switch (blank) {
@@ -625,9 +702,11 @@ index 0000000..fd9baf4
+ case FB_BLANK_VSYNC_SUSPEND:
+ case FB_BLANK_HSYNC_SUSPEND:
+ case FB_BLANK_NORMAL:
++ mxc_fbi->blank_state = 0;
+ imx_ipu_fb_disable_overlay(fbi);
+ break;
+ case FB_BLANK_UNBLANK:
++ mxc_fbi->blank_state = 1;
+ imx_ipu_fb_enable_overlay(fbi);
+ break;
+ }
@@ -638,7 +717,7 @@ index 0000000..fd9baf4
+static struct fb_ops imx_ipu_fb_overlay_ops = {
+ .owner = THIS_MODULE,
+ .fb_set_par = imx_ipu_fb_set_par_overlay,
-+ .fb_check_var = imx_ipu_fb_check_var,
++ .fb_check_var = imx_ipu_fb_check_var_overlay,
+ .fb_setcolreg = imx_ipu_fb_setcolreg,
+ .fb_pan_display = imx_ipu_fb_pan_display,
+ .fb_fillrect = cfb_fillrect,
@@ -685,7 +764,7 @@ index 0000000..fd9baf4
+ ovl_mxc_fbi = ovlfbi->par;
+ ovl_mxc_fbi->ipu_ch = ipu_idmac_get(ipu_channel);
+ ovl_mxc_fbi->dmfc = ipu_dmfc_get(ipu_channel);
-+ ovl_mxc_fbi->ipu_di = -1;
++ ovl_mxc_fbi->di = NULL;
+ ovl_mxc_fbi->dp = mxc_fbi_master->dp;
+ ovl_mxc_fbi->master = fbi_master;
+ mxc_fbi_master->slave = ovlfbi;
@@ -703,8 +782,8 @@ index 0000000..fd9baf4
+ return ret;
+ }
+
-+ ipu_dp_set_global_alpha(ovl_mxc_fbi->dp, 1, 0x80, 1);
-+ ipu_dp_set_color_key(ovl_mxc_fbi->dp, 0, 0);
++ ipu_dp_set_global_alpha(ovl_mxc_fbi->dp, 0, 0, 1);
++ ipu_dp_set_color_key(ovl_mxc_fbi->dp, 1, 0x434343);
+
+ imx_ipu_fb_set_par_overlay(ovlfbi);
+
@@ -780,7 +859,7 @@ index 0000000..fd9baf4
+ mxc_fbi->ipu_channel_num = plat_data->ipu_channel_bg;
+ mxc_fbi->dc = plat_data->dc_channel;
+ mxc_fbi->ipu_di_pix_fmt = plat_data->interface_pix_fmt;
-+ mxc_fbi->ipu_di = pdev->id;
++ mxc_fbi->di_no = plat_data->display;
+
+ mxc_fbi->ipu_ch = ipu_idmac_get(plat_data->ipu_channel_bg);
+ if (IS_ERR(mxc_fbi->ipu_ch)) {
@@ -802,6 +881,12 @@ index 0000000..fd9baf4
+ }
+ }
+
++ mxc_fbi->di = ipu_di_get(plat_data->display);
++ if (IS_ERR(mxc_fbi->di)) {
++ ret = PTR_ERR(mxc_fbi->di);
++ goto failed_request_di;
++ }
++
+ fbi->var.yres_virtual = fbi->var.yres;
+
+ INIT_LIST_HEAD(&fbi->modelist);
@@ -832,6 +917,8 @@ index 0000000..fd9baf4
+ return 0;
+
+failed_register:
++ ipu_di_put(mxc_fbi->di);
++failed_request_di:
+ if (plat_data->dp_channel >= 0)
+ ipu_dp_put(mxc_fbi->dp);
+failed_request_dp:
@@ -868,6 +955,7 @@ index 0000000..fd9baf4
+ ipu_dp_put(mxc_fbi->dp);
+ ipu_dmfc_free_bandwidth(mxc_fbi->dmfc);
+ ipu_dmfc_put(mxc_fbi->dmfc);
++ ipu_di_put(mxc_fbi->di);
+ ipu_idmac_put(mxc_fbi->ipu_ch);
+
+ framebuffer_release(fbi);
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-6-iMX51-Add_IPU_device_support.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-6-iMX51-Add_IPU_device_support.patch
similarity index 61%
rename from buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-6-iMX51-Add_IPU_device_support.patch
rename to buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-6-iMX51-Add_IPU_device_support.patch
index 93dadee..59251fb 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-6-iMX51-Add_IPU_device_support.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-6-iMX51-Add_IPU_device_support.patch
@@ -8,11 +8,11 @@ Signed-off-by: Sascha Hauer <s....@pe...>
5 files changed, 66 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/plat-mxc/devices/platform-imx_ipuv3.c
-Index: linux-2.6.36/arch/arm/mach-mx5/devices-imx51.h
-===================================================================
---- linux-2.6.36.orig/arch/arm/mach-mx5/devices-imx51.h 2010-12-13 14:50:32.000000000 +0100
-+++ linux-2.6.36/arch/arm/mach-mx5/devices-imx51.h 2010-12-13 14:50:32.000000000 +0100
-@@ -43,3 +43,7 @@
+diff --git a/arch/arm/mach-mx5/devices-imx51.h b/arch/arm/mach-mx5/devices-imx51.h
+index 6302e46..851c114 100644
+--- a/arch/arm/mach-mx5/devices-imx51.h
++++ b/arch/arm/mach-mx5/devices-imx51.h
+@@ -47,3 +47,7 @@ extern const struct imx_spi_imx_data imx51_ecspi_data[] __initconst;
extern const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst;
#define imx51_add_imx2_wdt(id, pdata) \
imx_add_imx2_wdt(&imx51_imx2_wdt_data[id])
@@ -20,11 +20,11 @@ Index: linux-2.6.36/arch/arm/mach-mx5/devices-imx51.h
+extern const struct imx_ipuv3_data imx51_ipuv3_data __initconst;
+#define imx51_add_ipuv3(pdata) \
+ imx_add_ipuv3(&imx51_ipuv3_data, pdata)
-Index: linux-2.6.36/arch/arm/plat-mxc/devices/Kconfig
-===================================================================
---- linux-2.6.36.orig/arch/arm/plat-mxc/devices/Kconfig 2010-12-13 14:50:32.000000000 +0100
-+++ linux-2.6.36/arch/arm/plat-mxc/devices/Kconfig 2010-12-13 14:50:32.000000000 +0100
-@@ -63,3 +63,7 @@
+diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
+index 2537166..262d9c5 100644
+--- a/arch/arm/plat-mxc/devices/Kconfig
++++ b/arch/arm/plat-mxc/devices/Kconfig
+@@ -71,3 +71,7 @@ config IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
config IMX_HAVE_PLATFORM_SPI_IMX
bool
@@ -32,19 +32,20 @@ Index: linux-2.6.36/arch/arm/plat-mxc/devices/Kconfig
+config IMX_HAVE_PLATFORM_IMX_IPUV3
+ bool
+
-Index: linux-2.6.36/arch/arm/plat-mxc/devices/Makefile
-===================================================================
---- linux-2.6.36.orig/arch/arm/plat-mxc/devices/Makefile 2010-12-13 14:50:32.000000000 +0100
-+++ linux-2.6.36/arch/arm/plat-mxc/devices/Makefile 2010-12-13 14:50:32.000000000 +0100
-@@ -20,3 +20,4 @@
+diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile
+index 75cd2ec..0a6be0a 100644
+--- a/arch/arm/plat-mxc/devices/Makefile
++++ b/arch/arm/plat-mxc/devices/Makefile
+@@ -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
-Index: linux-2.6.36/arch/arm/plat-mxc/devices/platform-imx_ipuv3.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.36/arch/arm/plat-mxc/devices/platform-imx_ipuv3.c 2010-12-13 15:56:30.000000000 +0100
+diff --git a/arch/arm/plat-mxc/devices/platform-imx_ipuv3.c b/arch/arm/plat-mxc/devices/platform-imx_ipuv3.c
+new file mode 100644
+index 0000000..2c6b913
+--- /dev/null
++++ b/arch/arm/plat-mxc/devices/platform-imx_ipuv3.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2010 Pengutronix
@@ -64,10 +65,10 @@ Index: linux-2.6.36/arch/arm/plat-mxc/devices/platform-imx_ipuv3.c
+ .irq = soc ## _INT_IPU_SYN, \
+ }
+
-+//#ifdef CONFIG_SOC_IMX51
++#ifdef CONFIG_SOC_IMX51
+const struct imx_ipuv3_data imx51_ipuv3_data __initconst =
+ imx51_ipuv3_data_entry_single(MX51);
-+//#endif /* ifdef CONFIG_SOC_IMX35 */
++#endif /* ifdef CONFIG_SOC_IMX35 */
+
+struct platform_device *__init imx_add_ipuv3(
+ const struct imx_ipuv3_data *data,
@@ -76,7 +77,7 @@ Index: linux-2.6.36/arch/arm/plat-mxc/devices/platform-imx_ipuv3.c
+ struct resource res[] = {
+ {
+ .start = data->iobase,
-+ .end = data->iobase + SZ_4K - 1,
++ .end = data->iobase + SZ_512M - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = data->irq_err,
@@ -93,11 +94,11 @@ Index: linux-2.6.36/arch/arm/plat-mxc/devices/platform-imx_ipuv3.c
+ res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
+}
+
-Index: linux-2.6.36/arch/arm/plat-mxc/include/mach/devices-common.h
-===================================================================
---- linux-2.6.36.orig/arch/arm/plat-mxc/include/mach/devices-common.h 2010-12-13 14:50:32.000000000 +0100
-+++ linux-2.6.36/arch/arm/plat-mxc/include/mach/devices-common.h 2010-12-13 14:50:32.000000000 +0100
-@@ -245,3 +245,13 @@
+diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
+index 8658c9c..8f5197f 100644
+--- a/arch/arm/plat-mxc/include/mach/devices-common.h
++++ b/arch/arm/plat-mxc/include/mach/devices-common.h
+@@ -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);
@@ -111,3 +112,6 @@ Index: linux-2.6.36/arch/arm/plat-mxc/include/mach/devices-common.h
+struct platform_device *__init imx_add_ipuv3(
+ const struct imx_ipuv3_data *data,
+ const struct imx_ipuv3_platform_data *pdata);
+--
+1.7.2.3
+
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-7-iMX51-Allow_to_increase_max_zone_order.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-7-iMX51-Allow_to_increase_max_zone_order.patch
similarity index 100%
rename from buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-7-iMX51-Allow_to_increase_max_zone_order.patch
rename to buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-7-iMX51-Allow_to_increase_max_zone_order.patch
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-8-iMX51-increase_dma_consistent_size_for_IPU_support.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-8-iMX51-increase_dma_consistent_size_for_IPU_support.patch
similarity index 72%
rename from buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-8-iMX51-increase_dma_consistent_size_for_IPU_support.patch
rename to buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-8-iMX51-increase_dma_consistent_size_for_IPU_support.patch
index 6bb389a..94115e7 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-8-iMX51-increase_dma_consistent_size_for_IPU_support.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-8-iMX51-increase_dma_consistent_size_for_IPU_support.patch
@@ -1,18 +1,19 @@
Signed-off-by: Sascha Hauer <s....@pe...>
---
- arch/arm/plat-mxc/include/mach/memory.h | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ arch/arm/plat-mxc/include/mach/memory.h | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-mxc/include/mach/memory.h b/arch/arm/plat-mxc/include/mach/memory.h
-index 9a9a000..a8152db 100644
+index 9a9a000..987b42a 100644
--- a/arch/arm/plat-mxc/include/mach/memory.h
+++ b/arch/arm/plat-mxc/include/mach/memory.h
-@@ -40,7 +40,7 @@
+@@ -40,7 +40,8 @@
# endif
#endif
-#if defined(CONFIG_MX3_VIDEO)
-+#if defined(CONFIG_MX3_VIDEO) || defined(CONFIG_MFD_IMX_IPU_V3)
++#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.
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-9-iMX51-babbage_add_framebuffer_support.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-9-iMX51-babbage_add_framebuffer_support.patch
similarity index 90%
rename from buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-9-iMX51-babbage_add_framebuffer_support.patch
rename to buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-9-iMX51-babbage_add_framebuffer_support.patch
index a13bf98..93f438e 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-10-pengutronix-9-iMX51-babbage_add_framebuffer_support.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/001-2010-12-20-pengutronix-9-iMX51-babbage_add_framebuffer_support.patch
@@ -17,7 +17,7 @@ index 5011f42..2a936b7 100644
Include support for MX51 Babbage platform, also known as MX51EVK in
u-boot. This includes specific configurations for the board and its
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
-index a896f84..169c48c 100644
+index 368a315..6c1576c 100644
--- a/arch/arm/mach-mx5/board-mx51_babbage.c
+++ b/arch/arm/mach-mx5/board-mx51_babbage.c
@@ -22,11 +22,13 @@
@@ -34,7 +34,7 @@ index a896f84..169c48c 100644
#include <asm/irq.h>
#include <asm/setup.h>
-@@ -147,6 +149,41 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
+@@ -158,6 +160,41 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
MX51_PAD_CSPI1_SS0__GPIO_4_24,
MX51_PAD_CSPI1_SS1__GPIO_4_25,
@@ -76,29 +76,31 @@ index a896f84..169c48c 100644
};
/* Serial ports */
-@@ -310,6 +347,21 @@ static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = {
+@@ -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 = {
-+ .fb0_platform_data = &babbage_fb0_data,
-+ .fb1_platform_data = &babbage_fb1_data,
++ .fb_head0_platform_data = &babbage_fb0_data,
++ .fb_head1_platform_data = &babbage_fb1_data,
+};
+
/*
* Board specific initialization.
*/
-@@ -351,6 +403,28 @@ static void __init mxc_board_init(void)
+@@ -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);
@@ -113,12 +115,10 @@ index a896f84..169c48c 100644
+ gpio_direction_input(GPIO_DVI_DETECT);
+ /* DVI Reset - Assert for i2c disabled mode */
+ gpio_request(GPIO_DVI_RESET, "dvi reset");
-+ gpio_set_value(GPIO_DVI_RESET, 0);
+ gpio_direction_output(GPIO_DVI_RESET, 0);
+ /* DVI Power-down */
+ gpio_request(GPIO_DVI_PWRDN, "dvi pwdn");
-+ gpio_direction_output(GPIO_DVI_PWRDN, 0);
-+ gpio_set_value(GPIO_DVI_PWRDN, 1);
++ gpio_direction_output(GPIO_DVI_PWRDN, 1);
+
+ gpio_request(GPIO_DVI_I2C, "dvi i2c");
+ gpio_direction_output(GPIO_DVI_I2C, 0);
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
index 5568549..23ff79b 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.38/400-armadeus-add_apf51_module.patch
@@ -1,7 +1,7 @@
Index: linux-2.6.38-alpha/arch/arm/mach-mx5/Kconfig
===================================================================
---- linux-2.6.38-alpha.orig/arch/arm/mach-mx5/Kconfig 2010-12-29 10:34:58.000000000 +0100
-+++ linux-2.6.38-alpha/arch/arm/mach-mx5/Kconfig 2010-12-29 10:35:03.000000000 +0100
+--- linux-2.6.38-alpha.orig/arch/arm/mach-mx5/Kconfig 2010-12-30 21:07:06.000000000 +0100
++++ linux-2.6.38-alpha/arch/arm/mach-mx5/Kconfig 2010-12-31 17:35:40.000000000 +0100
@@ -101,4 +101,17 @@
Include support for Genesi Efika MX nettop. This includes specific
configurations for the board and its peripherals.
@@ -22,8 +22,8 @@ Index: linux-2.6.38-alpha/arch/arm/mach-mx5/Kconfig
endif
Index: linux-2.6.38-alpha/arch/arm/mach-mx5/Makefile
===================================================================
---- linux-2.6.38-alpha.orig/arch/arm/mach-mx5/Makefile 2010-12-29 10:33:53.000000000 +0100
-+++ linux-2.6.38-alpha/arch/arm/mach-mx5/Makefile 2010-12-29 10:35:03.000000000 +0100
+--- linux-2.6.38-alpha.orig/arch/arm/mach-mx5/Makefile 2010-12-30 21:06:56.000000000 +0100
++++ linux-2.6.38-alpha/arch/arm/mach-mx5/Makefile 2010-12-31 17:35:39.000000000 +0100
@@ -6,6 +6,7 @@
obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o
@@ -35,13 +35,15 @@ Index: linux-2.6.38-alpha/arch/arm/mach-mx5/Makefile
Index: linux-2.6.38-alpha/arch/arm/mach-mx5/board-apf51.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.38-alpha/arch/arm/mach-mx5/board-apf51.c 2010-12-29 10:35:03.000000000 +0100
-@@ -0,0 +1,474 @@
++++ linux-2.6.38-alpha/arch/arm/mach-mx5/board-apf51.c 2010-12-31 16:14:49.000000000 +0100
+@@ -0,0 +1,522 @@
+/*
-+ * Copyright 2010 Armadeus Systems
++ * Support for APF51 System On Module
++ * Copyright (C) 2010 Armadeus Systems
+ *
+ * Based on code which is:
-+ * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
++ * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
++ * Copyright (C) 2009-2010 Amit Kucheria <ami...@ca...>
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
@@ -150,10 +152,6 @@ Index: linux-2.6.38-alpha/arch/arm/mach-mx5/board-apf51.c
+ MX51_PAD_GPIO_1_4__GPIO_1_4,
+ /* WM8311 TOUCH_EOC */
+ MX51_PAD_GPIO_1_6__GPIO_1_6,
-+
-+ /* Debug PINS */
-+/* MX51_PAD_GPIO_1_2__GPIO_1_2,
-+ MX51_PAD_GPIO_1_3__GPIO_1_3,*/
+};
+
+/* Serial ports */
@@ -164,7 +162,6 @@ Index: linux-2.6.38-alpha/arch/arm/mach-mx5/board-apf51.c
+
+static inline void apf51_init_imx_uart(void)
+{
-+ //mxc_register_device(&mxc_uart_device1, &uart_pdata);
+ imx51_add_imx_uart(1, &uart_pdata);
+}
+#else /* !SERIAL_IMX */
@@ -367,6 +364,64 @@ Index: linux-2.6.38-alpha/arch/arm/mach-mx5/board-apf51.c
+ return 0;
+}
+
++/* OTG port with i.MX51 internal PHY */
++#define MX51_USB_PLL_DIV_19_2_MHZ 0x01
++#define MX51_USB_PLL_DIV_24_MHZ 0x02
++
++/* This function is board specific as the bit mask for the plldiv will also
++be different for other Freescale SoCs, thus a common bitmask is not
++possible and cannot get place in /plat-mxc/ehci.c.*/
++static int initialize_otg_port(struct platform_device *pdev)
++{
++ u32 v;
++ void __iomem *usb_base;
++ void __iomem *usbother_base;
++
++ usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
++ if (!usb_base)
++ return -ENOMEM;
++ usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
++
++ /* Set the PHY clock to ...
[truncated message content] |