diff --git a/patch.sh b/patch.sh
index 39beb169117e92035c2fc75fe65636638318b3bc..cb8ec9035a9b01d36f237926a844aa0adf7b8730 100644
--- a/patch.sh
+++ b/patch.sh
@@ -71,15 +71,6 @@ arm () {
 	${git} "${DIR}/patches/arm/0001-deb-pkg-Simplify-architecture-matching-for-cross-bui.patch"
 }
 
-imx () {
-	echo "dir: imx"
-	${git} "${DIR}/patches/imx/0001-ARM-imx-Enable-UART1-for-Sabrelite.patch"
-	${git} "${DIR}/patches/imx/0002-Add-IMX6Q-AHCI-support.patch"
-	${git} "${DIR}/patches/imx/0003-imx-Add-IMX53-AHCI-support.patch"
-	${git} "${DIR}/patches/imx/0005-SAUCE-imx6-enable-sata-clk-if-SATA_AHCI_PLATFORM.patch"
-#	${git} "${DIR}/patches/imx/0005-staging-imx-drm-request-irq-only-after-adding-the-cr.patch"
-}
-
 omap () {
 	echo "dir: omap"
 	#Fixes 800Mhz boot lockup: http://www.spinics.net/lists/linux-omap/msg83737.html
@@ -106,7 +97,6 @@ omap () {
 	echo "dir: omap/beagle"
 	#Status: for meego guys..
 	${git} "${DIR}/patches/omap_beagle/0001-meego-modedb-add-Toshiba-LTA070B220F-800x480-support.patch"
-
 	${git} "${DIR}/patches/omap_beagle/0002-backlight-Add-TLC59108-backlight-control-driver.patch"
 	${git} "${DIR}/patches/omap_beagle/0003-tlc59108-adjust-for-beagleboard-uLCD7.patch"
 
@@ -122,65 +112,72 @@ omap () {
 	#Status: unknown: cherry picked from linaro
 	${git} "${DIR}/patches/omap_panda/0002-ti-st-st-kim-fixing-firmware-path.patch"
 	${git} "${DIR}/patches/omap_panda/0003-Panda-expansion-add-spidev.patch"
+	${git} "${DIR}/patches/omap_panda/0004-HACK-PandaES-disable-cpufreq-so-board-will-boot.patch"
+#	${git} "${DIR}/patches/omap_panda/0005-HACK-panda-enable-OMAP4_ERRATA_I688.patch"
+	${git} "${DIR}/patches/omap_panda/0006-ARM-hw_breakpoint-Enable-debug-powerdown-only-if-sys.patch"
+
+	#Status: not for upstream: http://www.spinics.net/lists/arm-kernel/msg214633.html
+	#Fixes:
+	#WARNING: "v7_dma_flush_range" *pvrsrvkm.ko] undefined!
+	#WARNING: "v7_dma_map_area" *pvrsrvkm.ko] undefined!
+	${git} "${DIR}/patches/omap_sgx/0001-arm-Export-cache-flush-management-symbols-when-MULTI.patch"
 }
 
-omap_dt () {
-	echo "dir: omap_dt"
-	${git} "${DIR}/patches/omap_dt/0001-ARM-dts-AM33XX-Rename-I2C-and-GPIO-nodes.patch"
-	${git} "${DIR}/patches/omap_dt/0002-ARM-dts-omap3-Add-generic-DT-support-for-IGEP-device.patch"
-	${git} "${DIR}/patches/omap_dt/0003-ARM-dts-omap3-Add-support-for-IGEPv2-board.patch"
-	${git} "${DIR}/patches/omap_dt/0004-ARM-dts-omap3-Add-support-for-IGEP-COM-Module.patch"
-	${git} "${DIR}/patches/omap_dt/0005-ARM-dts-omap3-igep-Add-uart1-and-uart2-to-igep-board.patch"
-	${git} "${DIR}/patches/omap_dt/0006-ARM-dts-AM33XX-Add-d_can-instances-to-aliases.patch"
-	${git} "${DIR}/patches/omap_dt/0007-ARM-dts-AM33XX-Add-memory-resource-to-d_can-node.patch"
-	${git} "${DIR}/patches/omap_dt/0008-ARM-dts-twl4030-Add-PWM-support.patch"
-	${git} "${DIR}/patches/omap_dt/0009-ARM-dts-twl6030-Add-PWM-support.patch"
-	${git} "${DIR}/patches/omap_dt/0010-ARM-dts-omap3-beagle-xm-Use-pwm-leds-for-pmu_stat-LE.patch"
-	${git} "${DIR}/patches/omap_dt/0011-ARM-dts-omap4-sdp-Add-support-for-pwm-leds-keypad-an.patch"
-	${git} "${DIR}/patches/omap_dt/0012-ARM-dts-omap4-sdp-Add-support-for-pwm-backlight.patch"
-	${git} "${DIR}/patches/omap_dt/0013-ARM-dts-omap3-overo-Add-support-for-pwm-leds.patch"
-	${git} "${DIR}/patches/omap_dt/0014-ARM-dts-omap4-sdp-Add-I2c-pinctrl-data.patch"
-	${git} "${DIR}/patches/omap_dt/0015-ARM-dts-omap3-overo-Add-audio-support.patch"
-	${git} "${DIR}/patches/omap_dt/0016-ARM-dts-omap5-evm-Add-I2c-pinctrl-data.patch"
-	${git} "${DIR}/patches/omap_dt/0017-ARM-dts-omap4-panda-Add-I2c-pinctrl-data.patch"
-	${git} "${DIR}/patches/omap_dt/0018-ARM-dts-OMAP5-Add-SPI-nodes.patch"
-	${git} "${DIR}/patches/omap_dt/0019-ARM-dts-omap5-evm-Add-mcspi-data.patch"
-	${git} "${DIR}/patches/omap_dt/0020-ARM-dts-OMAP3-Add-GPMC-controller.patch"
-	${git} "${DIR}/patches/omap_dt/0021-ARM-dts-OMAP3-reduce-GPMC-mapped-registers-address-s.patch"
-	${git} "${DIR}/patches/omap_dt/0022-ARM-dts-OMAP4-Add-omap-control-usb-data.patch"
-	${git} "${DIR}/patches/omap_dt/0023-ARM-dts-OMAP4-Add-omap-usb2-data.patch"
-	${git} "${DIR}/patches/omap_dt/0024-ARM-dts-OMAP-Add-usb_otg-and-glue-data-to-OMAP3-boar.patch"
-	${git} "${DIR}/patches/omap_dt/0025-ARM-dts-OMAP5-Add-OMAP-control-usb-data.patch"
-	${git} "${DIR}/patches/omap_dt/0026-ARM-dts-OMAP5-Add-ocp2scp-data.patch"
-	${git} "${DIR}/patches/omap_dt/0027-ARM-dts-OMAP5-Add-omap-usb3-and-omap-usb2-data.patch"
-	${git} "${DIR}/patches/omap_dt/0028-ARM-dts-OMAP5-add-dwc3-omap-and-dwc3-core-data.patch"
-	${git} "${DIR}/patches/omap_dt/0029-ARM-OMAP2-Prepare-for-device-tree-PMU-support.patch"
-	${git} "${DIR}/patches/omap_dt/0030-ARM-dts-OMAP2-Add-PMU-nodes.patch"
-	${git} "${DIR}/patches/omap_dt/0031-ARM-dts-OMAP2-Add-SDMA-controller-bindings-and-nodes.patch"
-	${git} "${DIR}/patches/omap_dt/0032-ARM-dts-Add-GPMC-node-for-OMAP2-OMAP4-and-OMAP5.patch"
-	${git} "${DIR}/patches/omap_dt/0033-ARM-dts-Add-OMAP2-gpio-bindings.patch"
-	${git} "${DIR}/patches/omap_dt/0034-ARM-dts-OMAP3-Correct-gpio-interrupts-cells-property.patch"
-	${git} "${DIR}/patches/omap_dt/0035-ARM-dts-OMAP3-Add-reg-and-interrupt-properties-for-g.patch"
-	${git} "${DIR}/patches/omap_dt/0036-ARM-dts-OMAP3-Add-support-for-OMAP3430-SDP-board.patch"
-	${git} "${DIR}/patches/omap_dt/0037-ARM-dts-OMAP2-Add-SDMA-Audio-IPs-bindings.patch"
-	${git} "${DIR}/patches/omap_dt/0038-ARM-dts-Add-minimal-DT-support-for-DevKit8000.patch"
-	${git} "${DIR}/patches/omap_dt/0039-ARM-dts-omap3-devkit8000-Enable-audio-support.patch"
-	${git} "${DIR}/patches/omap_dt/0040-ARM-dts-omap3-devkit8000-Add-NAND-DT-node.patch"
-	${git} "${DIR}/patches/omap_dt/0041-ARM-dts-OMAP34xx-35xx-Add-CPU-OPP-table.patch"
-	${git} "${DIR}/patches/omap_dt/0042-ARM-dts-OMAP36xx-Add-CPU-OPP-table.patch"
-	${git} "${DIR}/patches/omap_dt/0043-ARM-dts-OMAP3-use-twl4030-vdd1-regulator-for-CPU.patch"
-	${git} "${DIR}/patches/omap_dt/0044-ARM-dts-OMAP443x-Add-CPU-OPP-table.patch"
-	${git} "${DIR}/patches/omap_dt/0045-ARM-dts-omap4-panda-move-generic-sections-to-panda-c.patch"
-	${git} "${DIR}/patches/omap_dt/0046-ARM-dts-OMAP4460-Add-CPU-OPP-table.patch"
-	${git} "${DIR}/patches/omap_dt/0047-ARM-OMAP3-use-cpu0-cpufreq-driver-in-device-tree-sup.patch"
-	${git} "${DIR}/patches/omap_dt/0048-cpufreq-OMAP-donot-allow-to-be-used-with-device-tree.patch"
+sprz319_erratum () {
+	echo "dir: omap_sprz319-erratum-2.1"
+	${git} "${DIR}/patches/omap_sprz319-erratum-2.1/0001-hack-omap-clockk-dpll5-apply-sprz319e-2.1-erratum.patch"
 }
 
-edma
+imx () {
+	echo "dir: imx"
+	${git} "${DIR}/patches/imx/0001-ARM-imx-Enable-UART1-for-Sabrelite.patch"
+	${git} "${DIR}/patches/imx/0002-Add-IMX6Q-AHCI-support.patch"
+	${git} "${DIR}/patches/imx/0003-imx-Add-IMX53-AHCI-support.patch"
+	${git} "${DIR}/patches/imx/0005-SAUCE-imx6-enable-sata-clk-if-SATA_AHCI_PLATFORM.patch"
+#	${git} "${DIR}/patches/imx/0005-staging-imx-drm-request-irq-only-after-adding-the-cr.patch"
+	${git} "${DIR}/patches/imx/0006-arm-fec-use-random-mac-when-everything-else-fails.patch"
+}
 
+chipidea () {
+	echo "dir: chipidea"
+	${git} "${DIR}/patches/chipidea/0001-USB-move-bulk-of-otg-otg.c-to-phy-phy.c.patch"
+	${git} "${DIR}/patches/chipidea/0002-USB-add-devicetree-helpers-for-determining-dr_mode-a.patch"
+	${git} "${DIR}/patches/chipidea/0003-USB-chipidea-ci13xxx-imx-create-dynamic-platformdata.patch"
+	${git} "${DIR}/patches/chipidea/0004-USB-chipidea-add-PTW-and-PTS-handling.patch"
+	${git} "${DIR}/patches/chipidea/0005-USB-chipidea-introduce-dual-role-mode-pdata-flags.patch"
+	${git} "${DIR}/patches/chipidea/0006-USB-chipidea-i.MX-introduce-dr_mode-property.patch"
+	${git} "${DIR}/patches/chipidea/0007-USB-mxs-phy-Register-phy-with-framework.patch"
+	${git} "${DIR}/patches/chipidea/0008-USB-chipidea-i.MX-use-devm_usb_get_phy_by_phandle-to.patch"
+	${git} "${DIR}/patches/chipidea/0009-Revert-USB-chipidea-add-vbus-detect-for-udc.patch"
+	${git} "${DIR}/patches/chipidea/0010-usb-chipidea-add-otg-file.patch"
+	${git} "${DIR}/patches/chipidea/0011-usb-chipidea-add-otg-id-switch-and-vbus-connect-disc.patch"
+	${git} "${DIR}/patches/chipidea/0012-usb-chipidea-udc-add-pullup-pulldown-dp-at-hw_device.patch"
+	${git} "${DIR}/patches/chipidea/0013-usb-chipidea-udc-retire-the-flag-CI13_PULLUP_ON_VBUS.patch"
+	${git} "${DIR}/patches/chipidea/0014-usb-chipidea-add-vbus-regulator-control.patch"
+	${git} "${DIR}/patches/chipidea/0015-usb-chipidea-delete-the-delayed-work.patch"
+	${git} "${DIR}/patches/chipidea/0016-usb-chipidea-imx-add-getting-vbus-regulator-code.patch"
+	${git} "${DIR}/patches/chipidea/0017-usb-chipidea-udc-fix-the-oops-when-plugs-in-usb-cabl.patch"
+	${git} "${DIR}/patches/chipidea/0018-usb-chipidea-imx-select-usb-id-pin-using-syscon-inte.patch"
+	${git} "${DIR}/patches/chipidea/0019-usb-chipidea-usbmisc-rename-file-struct-and-function.patch"
+	${git} "${DIR}/patches/chipidea/0020-usb-chipidea-usbmisc-unset-global-varibale-usbmisc-o.patch"
+	${git} "${DIR}/patches/chipidea/0021-usb-chipidea-usbmisc-fix-a-potential-race-condition.patch"
+	${git} "${DIR}/patches/chipidea/0022-usb-chipidea-usbmisc-prepare-driver-to-handle-more-t.patch"
+	${git} "${DIR}/patches/chipidea/0023-usb-chipidea-usbmisc-add-mx53-support.patch"
+	${git} "${DIR}/patches/chipidea/0024-usb-chipidea-usbmisc-add-post-handling-and-errata-fi.patch"
+	${git} "${DIR}/patches/chipidea/0025-usb-chipidea-imx-Add-system-suspend-resume-API.patch"
+	${git} "${DIR}/patches/chipidea/0026-ARM-dts-imx-add-imx5x-usbmisc-entries.patch"
+	${git} "${DIR}/patches/chipidea/0027-ARM-dts-imx-add-imx5x-usb-clock-DT-lookups.patch"
+	${git} "${DIR}/patches/chipidea/0028-ARM-dts-imx-use-usb-nop-xceiv-usbphy-entries-for-imx.patch"
+	${git} "${DIR}/patches/chipidea/0029-ARM-dts-imx-imx53-qsb.dts-enable-usbotg-and-usbh1.patch"
+}
+
+edma
 arm
-imx
 omap
-omap_dt
+#Disabled for testing...
+#sprz319_erratum
+
+imx
+chipidea
 
 echo "patch.sh ran successful"
diff --git a/patches/arm/0003-Without-MACH_-option-Early-printk-DEBUG_LL.patch b/patches/arm/0003-Without-MACH_-option-Early-printk-DEBUG_LL.patch
deleted file mode 100644
index b487673b1b6382af1098a80cdb73172c18d525b2..0000000000000000000000000000000000000000
--- a/patches/arm/0003-Without-MACH_-option-Early-printk-DEBUG_LL.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-From deeb801491fb40015345d956ecf7c44ec5e0dd9d Mon Sep 17 00:00:00 2001
-From: "hvaibhav@ti.com" <hvaibhav@ti.com>
-Date: Fri, 31 Aug 2012 16:47:12 +0000
-Subject: [PATCH 3/3] Without MACH_ option Early printk (DEBUG_LL)
-
-On Fri, Aug 31, 2012 at 22:07:37, Hiremath, Vaibhav wrote:
-> On Fri, Aug 31, 2012 at 21:41:22, Tony Lindgren wrote:
-> > * Hiremath, Vaibhav <hvaibhav@ti.com> [120831 09:06]:
-> > > On Fri, Aug 31, 2012 at 21:22:26, Tony Lindgren wrote:
-> > > > * Vaibhav Hiremath <hvaibhav@ti.com> [120831 07:55]:
-> > > > > Hi Russell & Tony,
-> > > > >
-> > > > > AM335X EVM (based on AM33XX device) only supports DT boot mode and
-> > > > > doesn't have CONFIG_MACH_AM335XEVM option defined. Some time back during
-> > > > > baseport submission we had aligned that, we won't create separate EVM
-> > > > > options, killing the board file all-together.
-> > > > >
-> > > > > Having said that, the early printk option (DEBUG_LL) is broken, the
-> > > > > auto-generated file "./include/generated/mach-types.h" still refers to
-> > > > > CONFIG_MACH_AM335XEVM option,
-> > > >
-> > > > The way we're heading is that the DEBUG_LL options will only work for
-> > > > one hardcoded machine where you need to select the uart type and address
-> > > > in Kconfig. Or just patch it in.
-> > > >
-> > > > > #ifdef CONFIG_MACH_AM335XEVM
-> > > > > # ifdef machine_arch_type
-> > > > > #  undef machine_arch_type
-> > > > > #  define machine_arch_type     __machine_arch_type
-> > > > > # else
-> > > > > #  define machine_arch_type     MACH_TYPE_AM335XEVM
-> > > > > # endif
-> > > > > # define machine_is_am335xevm() (machine_arch_type == MACH_TYPE_AM335XEVM)
-> > > > > #else
-> > > > > # define machine_is_am335xevm() (0)
-> > > > > #endif
-> > > > >
-> > > > >
-> > > > > So I am thinking of changing the config_xxx option to SOC_AM33XX or
-> > > > > ARCH_OMAP2PLUS, something like below,
-> > > > >
-> > > > > am335xevm        SOC_AM33XX          AM335XEVM         3589
-> > > > >
-> > > > > OR
-> > > > >
-> > > > > am335xevm        ARCH_OMAP2PLUS      AM335XEVM         3589
-> > > > >
-> > > > >
-> > > > > Can you comment on this? Based on that I will submit the patch.
-> > > >
-> > > > I think that would at minimum break things for autogenerated
-> > > > mach-types.h where if only some other non-am335xevm machine is
-> > > > selected (like omap-generic) things don't get optimized out any
-> > > > longer as they currently do.
-> > > >
-> > >
-> > > Agreed. In that case the first option should work here, right?
-> >
-> > It gets messy if we start mixing mach and soc defines there..
-> >
-> > How about just add a hidden Kconfig option to mach-omap2/Kconfig
-> > that always selects MACH_TYPE_AM335XEVM if SOC_AM33XX is set?
->
-> Great, this is what I had in my mind but since it is hidden option I thought
-> may not be right thing to do.
-> I was just thinking in the direction that, it should be logical and fine if
-> SOC_AM33XX is used for all AM33xx based machines, isn't it?
->
-> Anyway, I think we are on same page here, I will add it and submit the patch
-> ASAP.
->
-> > Or does that require that MACHINE_START is there as well?
-> >
->
-> I do not think so, they are not related to each other, this option is
-> required only during decompression.
-> I have tested it on BeagleBone and it is working.
->
-
-Can you please review below patch? If you think its ok, I will send the
-patch -
-
-Thanks,
-Vaibhav
-
-Conflicts:
-
-	arch/arm/mach-omap2/Kconfig
----
- arch/arm/mach-omap2/Kconfig |   12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
-index ce05b87..da7722a 100644
---- a/arch/arm/mach-omap2/Kconfig
-+++ b/arch/arm/mach-omap2/Kconfig
-@@ -120,6 +120,9 @@ config SOC_AM33XX
- 	select CPU_V7
- 	select MULTI_IRQ_HANDLER
- 	select COMMON_CLK
-+	select MACH_AM335XEVM
-+	select MACH_AM335XIAEVM
-+	select MACH_TAM335X
- 
- config OMAP_PACKAGE_ZAF
-        bool
-@@ -165,6 +168,15 @@ config MACH_AM335XIAEVM
- config MACH_TAM335X
-        bool
- 
-+config MACH_AM335XEVM
-+       bool
-+
-+config MACH_AM335XIAEVM
-+       bool
-+
-+config MACH_TAM335X
-+       bool
-+
- config MACH_OMAP2_TUSB6010
- 	bool
- 	depends on ARCH_OMAP2 && SOC_OMAP2420
--- 
-1.7.10.4
-
diff --git a/patches/chipidea/0001-USB-move-bulk-of-otg-otg.c-to-phy-phy.c.patch b/patches/chipidea/0001-USB-move-bulk-of-otg-otg.c-to-phy-phy.c.patch
new file mode 100644
index 0000000000000000000000000000000000000000..aebbf28de8c8f4168504704ae7aa9b14c97b323c
--- /dev/null
+++ b/patches/chipidea/0001-USB-move-bulk-of-otg-otg.c-to-phy-phy.c.patch
@@ -0,0 +1,918 @@
+From 47d2315dd5d4d80b4b73cbcf4cff9db170cf5987 Mon Sep 17 00:00:00 2001
+From: Sascha Hauer <s.hauer@pengutronix.de>
+Date: Wed, 30 Jan 2013 13:24:37 +0100
+Subject: [PATCH 01/25] USB: move bulk of otg/otg.c to phy/phy.c
+
+Most of otg/otg.c is not otg specific, but phy specific, so move it
+to the phy directory.
+
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+Reported-by: Kishon Vijay Abraham I <kishon@ti.com>
+Cc: Felipe Balbi <balbi@ti.com>
+---
+ drivers/usb/otg/otg.c    |  427 --------------------------------------------
+ drivers/usb/phy/Makefile |    1 +
+ drivers/usb/phy/phy.c    |  438 ++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 439 insertions(+), 427 deletions(-)
+ create mode 100644 drivers/usb/phy/phy.c
+
+diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c
+index 2bd03d2..358cfd9 100644
+--- a/drivers/usb/otg/otg.c
++++ b/drivers/usb/otg/otg.c
+@@ -8,436 +8,9 @@
+  * the Free Software Foundation; either version 2 of the License, or
+  * (at your option) any later version.
+  */
+-
+-#include <linux/kernel.h>
+ #include <linux/export.h>
+-#include <linux/err.h>
+-#include <linux/device.h>
+-#include <linux/module.h>
+-#include <linux/slab.h>
+-#include <linux/of.h>
+-
+ #include <linux/usb/otg.h>
+ 
+-static LIST_HEAD(phy_list);
+-static LIST_HEAD(phy_bind_list);
+-static DEFINE_SPINLOCK(phy_lock);
+-
+-static struct usb_phy *__usb_find_phy(struct list_head *list,
+-	enum usb_phy_type type)
+-{
+-	struct usb_phy  *phy = NULL;
+-
+-	list_for_each_entry(phy, list, head) {
+-		if (phy->type != type)
+-			continue;
+-
+-		return phy;
+-	}
+-
+-	return ERR_PTR(-ENODEV);
+-}
+-
+-static struct usb_phy *__usb_find_phy_dev(struct device *dev,
+-	struct list_head *list, u8 index)
+-{
+-	struct usb_phy_bind *phy_bind = NULL;
+-
+-	list_for_each_entry(phy_bind, list, list) {
+-		if (!(strcmp(phy_bind->dev_name, dev_name(dev))) &&
+-				phy_bind->index == index) {
+-			if (phy_bind->phy)
+-				return phy_bind->phy;
+-			else
+-				return ERR_PTR(-EPROBE_DEFER);
+-		}
+-	}
+-
+-	return ERR_PTR(-ENODEV);
+-}
+-
+-static struct usb_phy *__of_usb_find_phy(struct device_node *node)
+-{
+-	struct usb_phy  *phy;
+-
+-	list_for_each_entry(phy, &phy_list, head) {
+-		if (node != phy->dev->of_node)
+-			continue;
+-
+-		return phy;
+-	}
+-
+-	return ERR_PTR(-ENODEV);
+-}
+-
+-static void devm_usb_phy_release(struct device *dev, void *res)
+-{
+-	struct usb_phy *phy = *(struct usb_phy **)res;
+-
+-	usb_put_phy(phy);
+-}
+-
+-static int devm_usb_phy_match(struct device *dev, void *res, void *match_data)
+-{
+-	return res == match_data;
+-}
+-
+-/**
+- * devm_usb_get_phy - find the USB PHY
+- * @dev - device that requests this phy
+- * @type - the type of the phy the controller requires
+- *
+- * Gets the phy using usb_get_phy(), and associates a device with it using
+- * devres. On driver detach, release function is invoked on the devres data,
+- * then, devres data is freed.
+- *
+- * For use by USB host and peripheral drivers.
+- */
+-struct usb_phy *devm_usb_get_phy(struct device *dev, enum usb_phy_type type)
+-{
+-	struct usb_phy **ptr, *phy;
+-
+-	ptr = devres_alloc(devm_usb_phy_release, sizeof(*ptr), GFP_KERNEL);
+-	if (!ptr)
+-		return NULL;
+-
+-	phy = usb_get_phy(type);
+-	if (!IS_ERR(phy)) {
+-		*ptr = phy;
+-		devres_add(dev, ptr);
+-	} else
+-		devres_free(ptr);
+-
+-	return phy;
+-}
+-EXPORT_SYMBOL(devm_usb_get_phy);
+-
+-/**
+- * usb_get_phy - find the USB PHY
+- * @type - the type of the phy the controller requires
+- *
+- * Returns the phy driver, after getting a refcount to it; or
+- * -ENODEV if there is no such phy.  The caller is responsible for
+- * calling usb_put_phy() to release that count.
+- *
+- * For use by USB host and peripheral drivers.
+- */
+-struct usb_phy *usb_get_phy(enum usb_phy_type type)
+-{
+-	struct usb_phy	*phy = NULL;
+-	unsigned long	flags;
+-
+-	spin_lock_irqsave(&phy_lock, flags);
+-
+-	phy = __usb_find_phy(&phy_list, type);
+-	if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
+-		pr_err("unable to find transceiver of type %s\n",
+-			usb_phy_type_string(type));
+-		goto err0;
+-	}
+-
+-	get_device(phy->dev);
+-
+-err0:
+-	spin_unlock_irqrestore(&phy_lock, flags);
+-
+-	return phy;
+-}
+-EXPORT_SYMBOL(usb_get_phy);
+-
+- /**
+- * devm_usb_get_phy_by_phandle - find the USB PHY by phandle
+- * @dev - device that requests this phy
+- * @phandle - name of the property holding the phy phandle value
+- * @index - the index of the phy
+- *
+- * Returns the phy driver associated with the given phandle value,
+- * after getting a refcount to it, -ENODEV if there is no such phy or
+- * -EPROBE_DEFER if there is a phandle to the phy, but the device is
+- * not yet loaded. While at that, it also associates the device with
+- * the phy using devres. On driver detach, release function is invoked
+- * on the devres data, then, devres data is freed.
+- *
+- * For use by USB host and peripheral drivers.
+- */
+-struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
+-	const char *phandle, u8 index)
+-{
+-	struct usb_phy	*phy = ERR_PTR(-ENOMEM), **ptr;
+-	unsigned long	flags;
+-	struct device_node *node;
+-
+-	if (!dev->of_node) {
+-		dev_dbg(dev, "device does not have a device node entry\n");
+-		return ERR_PTR(-EINVAL);
+-	}
+-
+-	node = of_parse_phandle(dev->of_node, phandle, index);
+-	if (!node) {
+-		dev_dbg(dev, "failed to get %s phandle in %s node\n", phandle,
+-			dev->of_node->full_name);
+-		return ERR_PTR(-ENODEV);
+-	}
+-
+-	ptr = devres_alloc(devm_usb_phy_release, sizeof(*ptr), GFP_KERNEL);
+-	if (!ptr) {
+-		dev_dbg(dev, "failed to allocate memory for devres\n");
+-		goto err0;
+-	}
+-
+-	spin_lock_irqsave(&phy_lock, flags);
+-
+-	phy = __of_usb_find_phy(node);
+-	if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
+-		phy = ERR_PTR(-EPROBE_DEFER);
+-		devres_free(ptr);
+-		goto err1;
+-	}
+-
+-	*ptr = phy;
+-	devres_add(dev, ptr);
+-
+-	get_device(phy->dev);
+-
+-err1:
+-	spin_unlock_irqrestore(&phy_lock, flags);
+-
+-err0:
+-	of_node_put(node);
+-
+-	return phy;
+-}
+-EXPORT_SYMBOL(devm_usb_get_phy_by_phandle);
+-
+-/**
+- * usb_get_phy_dev - find the USB PHY
+- * @dev - device that requests this phy
+- * @index - the index of the phy
+- *
+- * Returns the phy driver, after getting a refcount to it; or
+- * -ENODEV if there is no such phy.  The caller is responsible for
+- * calling usb_put_phy() to release that count.
+- *
+- * For use by USB host and peripheral drivers.
+- */
+-struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
+-{
+-	struct usb_phy	*phy = NULL;
+-	unsigned long	flags;
+-
+-	spin_lock_irqsave(&phy_lock, flags);
+-
+-	phy = __usb_find_phy_dev(dev, &phy_bind_list, index);
+-	if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
+-		pr_err("unable to find transceiver\n");
+-		goto err0;
+-	}
+-
+-	get_device(phy->dev);
+-
+-err0:
+-	spin_unlock_irqrestore(&phy_lock, flags);
+-
+-	return phy;
+-}
+-EXPORT_SYMBOL(usb_get_phy_dev);
+-
+-/**
+- * devm_usb_get_phy_dev - find the USB PHY using device ptr and index
+- * @dev - device that requests this phy
+- * @index - the index of the phy
+- *
+- * Gets the phy using usb_get_phy_dev(), and associates a device with it using
+- * devres. On driver detach, release function is invoked on the devres data,
+- * then, devres data is freed.
+- *
+- * For use by USB host and peripheral drivers.
+- */
+-struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)
+-{
+-	struct usb_phy **ptr, *phy;
+-
+-	ptr = devres_alloc(devm_usb_phy_release, sizeof(*ptr), GFP_KERNEL);
+-	if (!ptr)
+-		return NULL;
+-
+-	phy = usb_get_phy_dev(dev, index);
+-	if (!IS_ERR(phy)) {
+-		*ptr = phy;
+-		devres_add(dev, ptr);
+-	} else
+-		devres_free(ptr);
+-
+-	return phy;
+-}
+-EXPORT_SYMBOL(devm_usb_get_phy_dev);
+-
+-/**
+- * devm_usb_put_phy - release the USB PHY
+- * @dev - device that wants to release this phy
+- * @phy - the phy returned by devm_usb_get_phy()
+- *
+- * destroys the devres associated with this phy and invokes usb_put_phy
+- * to release the phy.
+- *
+- * For use by USB host and peripheral drivers.
+- */
+-void devm_usb_put_phy(struct device *dev, struct usb_phy *phy)
+-{
+-	int r;
+-
+-	r = devres_destroy(dev, devm_usb_phy_release, devm_usb_phy_match, phy);
+-	dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n");
+-}
+-EXPORT_SYMBOL(devm_usb_put_phy);
+-
+-/**
+- * usb_put_phy - release the USB PHY
+- * @x: the phy returned by usb_get_phy()
+- *
+- * Releases a refcount the caller received from usb_get_phy().
+- *
+- * For use by USB host and peripheral drivers.
+- */
+-void usb_put_phy(struct usb_phy *x)
+-{
+-	if (x) {
+-		struct module *owner = x->dev->driver->owner;
+-
+-		put_device(x->dev);
+-		module_put(owner);
+-	}
+-}
+-EXPORT_SYMBOL(usb_put_phy);
+-
+-/**
+- * usb_add_phy - declare the USB PHY
+- * @x: the USB phy to be used; or NULL
+- * @type - the type of this PHY
+- *
+- * This call is exclusively for use by phy drivers, which
+- * coordinate the activities of drivers for host and peripheral
+- * controllers, and in some cases for VBUS current regulation.
+- */
+-int usb_add_phy(struct usb_phy *x, enum usb_phy_type type)
+-{
+-	int		ret = 0;
+-	unsigned long	flags;
+-	struct usb_phy	*phy;
+-
+-	if (x->type != USB_PHY_TYPE_UNDEFINED) {
+-		dev_err(x->dev, "not accepting initialized PHY %s\n", x->label);
+-		return -EINVAL;
+-	}
+-
+-	spin_lock_irqsave(&phy_lock, flags);
+-
+-	list_for_each_entry(phy, &phy_list, head) {
+-		if (phy->type == type) {
+-			ret = -EBUSY;
+-			dev_err(x->dev, "transceiver type %s already exists\n",
+-						usb_phy_type_string(type));
+-			goto out;
+-		}
+-	}
+-
+-	x->type = type;
+-	list_add_tail(&x->head, &phy_list);
+-
+-out:
+-	spin_unlock_irqrestore(&phy_lock, flags);
+-	return ret;
+-}
+-EXPORT_SYMBOL(usb_add_phy);
+-
+-/**
+- * usb_add_phy_dev - declare the USB PHY
+- * @x: the USB phy to be used; or NULL
+- *
+- * This call is exclusively for use by phy drivers, which
+- * coordinate the activities of drivers for host and peripheral
+- * controllers, and in some cases for VBUS current regulation.
+- */
+-int usb_add_phy_dev(struct usb_phy *x)
+-{
+-	struct usb_phy_bind *phy_bind;
+-	unsigned long flags;
+-
+-	if (!x->dev) {
+-		dev_err(x->dev, "no device provided for PHY\n");
+-		return -EINVAL;
+-	}
+-
+-	spin_lock_irqsave(&phy_lock, flags);
+-	list_for_each_entry(phy_bind, &phy_bind_list, list)
+-		if (!(strcmp(phy_bind->phy_dev_name, dev_name(x->dev))))
+-			phy_bind->phy = x;
+-
+-	list_add_tail(&x->head, &phy_list);
+-
+-	spin_unlock_irqrestore(&phy_lock, flags);
+-	return 0;
+-}
+-EXPORT_SYMBOL(usb_add_phy_dev);
+-
+-/**
+- * usb_remove_phy - remove the OTG PHY
+- * @x: the USB OTG PHY to be removed;
+- *
+- * This reverts the effects of usb_add_phy
+- */
+-void usb_remove_phy(struct usb_phy *x)
+-{
+-	unsigned long	flags;
+-	struct usb_phy_bind *phy_bind;
+-
+-	spin_lock_irqsave(&phy_lock, flags);
+-	if (x) {
+-		list_for_each_entry(phy_bind, &phy_bind_list, list)
+-			if (phy_bind->phy == x)
+-				phy_bind->phy = NULL;
+-		list_del(&x->head);
+-	}
+-	spin_unlock_irqrestore(&phy_lock, flags);
+-}
+-EXPORT_SYMBOL(usb_remove_phy);
+-
+-/**
+- * usb_bind_phy - bind the phy and the controller that uses the phy
+- * @dev_name: the device name of the device that will bind to the phy
+- * @index: index to specify the port number
+- * @phy_dev_name: the device name of the phy
+- *
+- * Fills the phy_bind structure with the dev_name and phy_dev_name. This will
+- * be used when the phy driver registers the phy and when the controller
+- * requests this phy.
+- *
+- * To be used by platform specific initialization code.
+- */
+-int __init usb_bind_phy(const char *dev_name, u8 index,
+-				const char *phy_dev_name)
+-{
+-	struct usb_phy_bind *phy_bind;
+-	unsigned long flags;
+-
+-	phy_bind = kzalloc(sizeof(*phy_bind), GFP_KERNEL);
+-	if (!phy_bind) {
+-		pr_err("phy_bind(): No memory for phy_bind");
+-		return -ENOMEM;
+-	}
+-
+-	phy_bind->dev_name = dev_name;
+-	phy_bind->phy_dev_name = phy_dev_name;
+-	phy_bind->index = index;
+-
+-	spin_lock_irqsave(&phy_lock, flags);
+-	list_add_tail(&phy_bind->list, &phy_bind_list);
+-	spin_unlock_irqrestore(&phy_lock, flags);
+-
+-	return 0;
+-}
+-EXPORT_SYMBOL_GPL(usb_bind_phy);
+-
+ const char *otg_state_string(enum usb_otg_state state)
+ {
+ 	switch (state) {
+diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
+index b13faa1..9fa6327 100644
+--- a/drivers/usb/phy/Makefile
++++ b/drivers/usb/phy/Makefile
+@@ -4,6 +4,7 @@
+ 
+ ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
+ 
++obj-$(CONFIG_USB_OTG_UTILS)		+= phy.o
+ obj-$(CONFIG_OMAP_USB2)			+= omap-usb2.o
+ obj-$(CONFIG_OMAP_USB3)			+= omap-usb3.o
+ obj-$(CONFIG_OMAP_CONTROL_USB)		+= omap-control-usb.o
+diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
+new file mode 100644
+index 0000000..bc1970c
+--- /dev/null
++++ b/drivers/usb/phy/phy.c
+@@ -0,0 +1,438 @@
++/*
++ * phy.c -- USB phy handling
++ *
++ * Copyright (C) 2004-2013 Texas Instruments
++ *
++ * 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.
++ */
++#include <linux/kernel.h>
++#include <linux/export.h>
++#include <linux/err.h>
++#include <linux/device.h>
++#include <linux/module.h>
++#include <linux/slab.h>
++#include <linux/of.h>
++
++#include <linux/usb/phy.h>
++
++static LIST_HEAD(phy_list);
++static LIST_HEAD(phy_bind_list);
++static DEFINE_SPINLOCK(phy_lock);
++
++static struct usb_phy *__usb_find_phy(struct list_head *list,
++	enum usb_phy_type type)
++{
++	struct usb_phy  *phy = NULL;
++
++	list_for_each_entry(phy, list, head) {
++		if (phy->type != type)
++			continue;
++
++		return phy;
++	}
++
++	return ERR_PTR(-ENODEV);
++}
++
++static struct usb_phy *__usb_find_phy_dev(struct device *dev,
++	struct list_head *list, u8 index)
++{
++	struct usb_phy_bind *phy_bind = NULL;
++
++	list_for_each_entry(phy_bind, list, list) {
++		if (!(strcmp(phy_bind->dev_name, dev_name(dev))) &&
++				phy_bind->index == index) {
++			if (phy_bind->phy)
++				return phy_bind->phy;
++			else
++				return ERR_PTR(-EPROBE_DEFER);
++		}
++	}
++
++	return ERR_PTR(-ENODEV);
++}
++
++static struct usb_phy *__of_usb_find_phy(struct device_node *node)
++{
++	struct usb_phy  *phy;
++
++	list_for_each_entry(phy, &phy_list, head) {
++		if (node != phy->dev->of_node)
++			continue;
++
++		return phy;
++	}
++
++	return ERR_PTR(-ENODEV);
++}
++
++static void devm_usb_phy_release(struct device *dev, void *res)
++{
++	struct usb_phy *phy = *(struct usb_phy **)res;
++
++	usb_put_phy(phy);
++}
++
++static int devm_usb_phy_match(struct device *dev, void *res, void *match_data)
++{
++	return res == match_data;
++}
++
++/**
++ * devm_usb_get_phy - find the USB PHY
++ * @dev - device that requests this phy
++ * @type - the type of the phy the controller requires
++ *
++ * Gets the phy using usb_get_phy(), and associates a device with it using
++ * devres. On driver detach, release function is invoked on the devres data,
++ * then, devres data is freed.
++ *
++ * For use by USB host and peripheral drivers.
++ */
++struct usb_phy *devm_usb_get_phy(struct device *dev, enum usb_phy_type type)
++{
++	struct usb_phy **ptr, *phy;
++
++	ptr = devres_alloc(devm_usb_phy_release, sizeof(*ptr), GFP_KERNEL);
++	if (!ptr)
++		return NULL;
++
++	phy = usb_get_phy(type);
++	if (!IS_ERR(phy)) {
++		*ptr = phy;
++		devres_add(dev, ptr);
++	} else
++		devres_free(ptr);
++
++	return phy;
++}
++EXPORT_SYMBOL(devm_usb_get_phy);
++
++/**
++ * usb_get_phy - find the USB PHY
++ * @type - the type of the phy the controller requires
++ *
++ * Returns the phy driver, after getting a refcount to it; or
++ * -ENODEV if there is no such phy.  The caller is responsible for
++ * calling usb_put_phy() to release that count.
++ *
++ * For use by USB host and peripheral drivers.
++ */
++struct usb_phy *usb_get_phy(enum usb_phy_type type)
++{
++	struct usb_phy	*phy = NULL;
++	unsigned long	flags;
++
++	spin_lock_irqsave(&phy_lock, flags);
++
++	phy = __usb_find_phy(&phy_list, type);
++	if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
++		pr_err("unable to find transceiver of type %s\n",
++			usb_phy_type_string(type));
++		goto err0;
++	}
++
++	get_device(phy->dev);
++
++err0:
++	spin_unlock_irqrestore(&phy_lock, flags);
++
++	return phy;
++}
++EXPORT_SYMBOL(usb_get_phy);
++
++ /**
++ * devm_usb_get_phy_by_phandle - find the USB PHY by phandle
++ * @dev - device that requests this phy
++ * @phandle - name of the property holding the phy phandle value
++ * @index - the index of the phy
++ *
++ * Returns the phy driver associated with the given phandle value,
++ * after getting a refcount to it, -ENODEV if there is no such phy or
++ * -EPROBE_DEFER if there is a phandle to the phy, but the device is
++ * not yet loaded. While at that, it also associates the device with
++ * the phy using devres. On driver detach, release function is invoked
++ * on the devres data, then, devres data is freed.
++ *
++ * For use by USB host and peripheral drivers.
++ */
++struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
++	const char *phandle, u8 index)
++{
++	struct usb_phy	*phy = ERR_PTR(-ENOMEM), **ptr;
++	unsigned long	flags;
++	struct device_node *node;
++
++	if (!dev->of_node) {
++		dev_dbg(dev, "device does not have a device node entry\n");
++		return ERR_PTR(-EINVAL);
++	}
++
++	node = of_parse_phandle(dev->of_node, phandle, index);
++	if (!node) {
++		dev_dbg(dev, "failed to get %s phandle in %s node\n", phandle,
++			dev->of_node->full_name);
++		return ERR_PTR(-ENODEV);
++	}
++
++	ptr = devres_alloc(devm_usb_phy_release, sizeof(*ptr), GFP_KERNEL);
++	if (!ptr) {
++		dev_dbg(dev, "failed to allocate memory for devres\n");
++		goto err0;
++	}
++
++	spin_lock_irqsave(&phy_lock, flags);
++
++	phy = __of_usb_find_phy(node);
++	if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
++		phy = ERR_PTR(-EPROBE_DEFER);
++		devres_free(ptr);
++		goto err1;
++	}
++
++	*ptr = phy;
++	devres_add(dev, ptr);
++
++	get_device(phy->dev);
++
++err1:
++	spin_unlock_irqrestore(&phy_lock, flags);
++
++err0:
++	of_node_put(node);
++
++	return phy;
++}
++EXPORT_SYMBOL(devm_usb_get_phy_by_phandle);
++
++/**
++ * usb_get_phy_dev - find the USB PHY
++ * @dev - device that requests this phy
++ * @index - the index of the phy
++ *
++ * Returns the phy driver, after getting a refcount to it; or
++ * -ENODEV if there is no such phy.  The caller is responsible for
++ * calling usb_put_phy() to release that count.
++ *
++ * For use by USB host and peripheral drivers.
++ */
++struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
++{
++	struct usb_phy	*phy = NULL;
++	unsigned long	flags;
++
++	spin_lock_irqsave(&phy_lock, flags);
++
++	phy = __usb_find_phy_dev(dev, &phy_bind_list, index);
++	if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
++		pr_err("unable to find transceiver\n");
++		goto err0;
++	}
++
++	get_device(phy->dev);
++
++err0:
++	spin_unlock_irqrestore(&phy_lock, flags);
++
++	return phy;
++}
++EXPORT_SYMBOL(usb_get_phy_dev);
++
++/**
++ * devm_usb_get_phy_dev - find the USB PHY using device ptr and index
++ * @dev - device that requests this phy
++ * @index - the index of the phy
++ *
++ * Gets the phy using usb_get_phy_dev(), and associates a device with it using
++ * devres. On driver detach, release function is invoked on the devres data,
++ * then, devres data is freed.
++ *
++ * For use by USB host and peripheral drivers.
++ */
++struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)
++{
++	struct usb_phy **ptr, *phy;
++
++	ptr = devres_alloc(devm_usb_phy_release, sizeof(*ptr), GFP_KERNEL);
++	if (!ptr)
++		return NULL;
++
++	phy = usb_get_phy_dev(dev, index);
++	if (!IS_ERR(phy)) {
++		*ptr = phy;
++		devres_add(dev, ptr);
++	} else
++		devres_free(ptr);
++
++	return phy;
++}
++EXPORT_SYMBOL(devm_usb_get_phy_dev);
++
++/**
++ * devm_usb_put_phy - release the USB PHY
++ * @dev - device that wants to release this phy
++ * @phy - the phy returned by devm_usb_get_phy()
++ *
++ * destroys the devres associated with this phy and invokes usb_put_phy
++ * to release the phy.
++ *
++ * For use by USB host and peripheral drivers.
++ */
++void devm_usb_put_phy(struct device *dev, struct usb_phy *phy)
++{
++	int r;
++
++	r = devres_destroy(dev, devm_usb_phy_release, devm_usb_phy_match, phy);
++	dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n");
++}
++EXPORT_SYMBOL(devm_usb_put_phy);
++
++/**
++ * usb_put_phy - release the USB PHY
++ * @x: the phy returned by usb_get_phy()
++ *
++ * Releases a refcount the caller received from usb_get_phy().
++ *
++ * For use by USB host and peripheral drivers.
++ */
++void usb_put_phy(struct usb_phy *x)
++{
++	if (x) {
++		struct module *owner = x->dev->driver->owner;
++
++		put_device(x->dev);
++		module_put(owner);
++	}
++}
++EXPORT_SYMBOL(usb_put_phy);
++
++/**
++ * usb_add_phy - declare the USB PHY
++ * @x: the USB phy to be used; or NULL
++ * @type - the type of this PHY
++ *
++ * This call is exclusively for use by phy drivers, which
++ * coordinate the activities of drivers for host and peripheral
++ * controllers, and in some cases for VBUS current regulation.
++ */
++int usb_add_phy(struct usb_phy *x, enum usb_phy_type type)
++{
++	int		ret = 0;
++	unsigned long	flags;
++	struct usb_phy	*phy;
++
++	if (x->type != USB_PHY_TYPE_UNDEFINED) {
++		dev_err(x->dev, "not accepting initialized PHY %s\n", x->label);
++		return -EINVAL;
++	}
++
++	spin_lock_irqsave(&phy_lock, flags);
++
++	list_for_each_entry(phy, &phy_list, head) {
++		if (phy->type == type) {
++			ret = -EBUSY;
++			dev_err(x->dev, "transceiver type %s already exists\n",
++						usb_phy_type_string(type));
++			goto out;
++		}
++	}
++
++	x->type = type;
++	list_add_tail(&x->head, &phy_list);
++
++out:
++	spin_unlock_irqrestore(&phy_lock, flags);
++	return ret;
++}
++EXPORT_SYMBOL(usb_add_phy);
++
++/**
++ * usb_add_phy_dev - declare the USB PHY
++ * @x: the USB phy to be used; or NULL
++ *
++ * This call is exclusively for use by phy drivers, which
++ * coordinate the activities of drivers for host and peripheral
++ * controllers, and in some cases for VBUS current regulation.
++ */
++int usb_add_phy_dev(struct usb_phy *x)
++{
++	struct usb_phy_bind *phy_bind;
++	unsigned long flags;
++
++	if (!x->dev) {
++		dev_err(x->dev, "no device provided for PHY\n");
++		return -EINVAL;
++	}
++
++	spin_lock_irqsave(&phy_lock, flags);
++	list_for_each_entry(phy_bind, &phy_bind_list, list)
++		if (!(strcmp(phy_bind->phy_dev_name, dev_name(x->dev))))
++			phy_bind->phy = x;
++
++	list_add_tail(&x->head, &phy_list);
++
++	spin_unlock_irqrestore(&phy_lock, flags);
++	return 0;
++}
++EXPORT_SYMBOL(usb_add_phy_dev);
++
++/**
++ * usb_remove_phy - remove the OTG PHY
++ * @x: the USB OTG PHY to be removed;
++ *
++ * This reverts the effects of usb_add_phy
++ */
++void usb_remove_phy(struct usb_phy *x)
++{
++	unsigned long	flags;
++	struct usb_phy_bind *phy_bind;
++
++	spin_lock_irqsave(&phy_lock, flags);
++	if (x) {
++		list_for_each_entry(phy_bind, &phy_bind_list, list)
++			if (phy_bind->phy == x)
++				phy_bind->phy = NULL;
++		list_del(&x->head);
++	}
++	spin_unlock_irqrestore(&phy_lock, flags);
++}
++EXPORT_SYMBOL(usb_remove_phy);
++
++/**
++ * usb_bind_phy - bind the phy and the controller that uses the phy
++ * @dev_name: the device name of the device that will bind to the phy
++ * @index: index to specify the port number
++ * @phy_dev_name: the device name of the phy
++ *
++ * Fills the phy_bind structure with the dev_name and phy_dev_name. This will
++ * be used when the phy driver registers the phy and when the controller
++ * requests this phy.
++ *
++ * To be used by platform specific initialization code.
++ */
++int __init usb_bind_phy(const char *dev_name, u8 index,
++				const char *phy_dev_name)
++{
++	struct usb_phy_bind *phy_bind;
++	unsigned long flags;
++
++	phy_bind = kzalloc(sizeof(*phy_bind), GFP_KERNEL);
++	if (!phy_bind) {
++		pr_err("phy_bind(): No memory for phy_bind");
++		return -ENOMEM;
++	}
++
++	phy_bind->dev_name = dev_name;
++	phy_bind->phy_dev_name = phy_dev_name;
++	phy_bind->index = index;
++
++	spin_lock_irqsave(&phy_lock, flags);
++	list_add_tail(&phy_bind->list, &phy_bind_list);
++	spin_unlock_irqrestore(&phy_lock, flags);
++
++	return 0;
++}
++EXPORT_SYMBOL_GPL(usb_bind_phy);
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0002-USB-add-devicetree-helpers-for-determining-dr_mode-a.patch b/patches/chipidea/0002-USB-add-devicetree-helpers-for-determining-dr_mode-a.patch
new file mode 100644
index 0000000000000000000000000000000000000000..2684d0fe96259848244f808bf0b91d5f38804f90
--- /dev/null
+++ b/patches/chipidea/0002-USB-add-devicetree-helpers-for-determining-dr_mode-a.patch
@@ -0,0 +1,213 @@
+From 5222396ebaa48e8d0c3228a44d98e960cfb6e7e4 Mon Sep 17 00:00:00 2001
+From: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Date: Tue, 6 Nov 2012 16:10:10 +0100
+Subject: [PATCH 02/25] USB: add devicetree helpers for determining dr_mode
+ and phy_type
+
+This adds two little devicetree helper functions for determining the
+dr_mode (host, peripheral, otg) and phy_type (utmi, ulpi,...) from
+the devicetree.
+
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+---
+ drivers/usb/phy/Makefile |    1 +
+ drivers/usb/phy/of.c     |   47 ++++++++++++++++++++++++++++++++++++++++++++++
+ drivers/usb/usb-common.c |   36 +++++++++++++++++++++++++++++++++++
+ include/linux/usb/of.h   |   27 ++++++++++++++++++++++++++
+ include/linux/usb/otg.h  |    7 +++++++
+ include/linux/usb/phy.h  |    9 +++++++++
+ 6 files changed, 127 insertions(+)
+ create mode 100644 drivers/usb/phy/of.c
+ create mode 100644 include/linux/usb/of.h
+
+diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
+index 9fa6327..e1be1e8 100644
+--- a/drivers/usb/phy/Makefile
++++ b/drivers/usb/phy/Makefile
+@@ -5,6 +5,7 @@
+ ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
+ 
+ obj-$(CONFIG_USB_OTG_UTILS)		+= phy.o
++obj-$(CONFIG_OF)			+= of.o
+ obj-$(CONFIG_OMAP_USB2)			+= omap-usb2.o
+ obj-$(CONFIG_OMAP_USB3)			+= omap-usb3.o
+ obj-$(CONFIG_OMAP_CONTROL_USB)		+= omap-control-usb.o
+diff --git a/drivers/usb/phy/of.c b/drivers/usb/phy/of.c
+new file mode 100644
+index 0000000..e6f3b74
+--- /dev/null
++++ b/drivers/usb/phy/of.c
+@@ -0,0 +1,47 @@
++/*
++ * USB of helper code
++ *
++ * 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.
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/usb/of.h>
++#include <linux/usb/otg.h>
++
++static const char *usbphy_modes[] = {
++	[USBPHY_INTERFACE_MODE_UNKNOWN]	= "",
++	[USBPHY_INTERFACE_MODE_UTMI]	= "utmi",
++	[USBPHY_INTERFACE_MODE_UTMIW]	= "utmi_wide",
++	[USBPHY_INTERFACE_MODE_ULPI]	= "ulpi",
++	[USBPHY_INTERFACE_MODE_SERIAL]	= "serial",
++	[USBPHY_INTERFACE_MODE_HSIC]	= "hsic",
++};
++
++/**
++ * of_usb_get_phy_mode - Get phy mode for given device_node
++ * @np:	Pointer to the given device_node
++ *
++ * The function gets phy interface string from property 'phy_type',
++ * and returns the correspondig enum usb_phy_interface
++ */
++enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np)
++{
++	const char *phy_type;
++	int err, i;
++
++	err = of_property_read_string(np, "phy_type", &phy_type);
++	if (err < 0)
++		return USBPHY_INTERFACE_MODE_UNKNOWN;
++
++	for (i = 0; i < ARRAY_SIZE(usbphy_modes); i++)
++		if (!strcmp(phy_type, usbphy_modes[i]))
++			return i;
++
++	return USBPHY_INTERFACE_MODE_UNKNOWN;
++}
++EXPORT_SYMBOL_GPL(of_usb_get_phy_mode);
+diff --git a/drivers/usb/usb-common.c b/drivers/usb/usb-common.c
+index d29503e..ad4d87d 100644
+--- a/drivers/usb/usb-common.c
++++ b/drivers/usb/usb-common.c
+@@ -14,6 +14,9 @@
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/usb/ch9.h>
++#include <linux/of.h>
++#include <linux/usb/of.h>
++#include <linux/usb/otg.h>
+ 
+ const char *usb_speed_string(enum usb_device_speed speed)
+ {
+@@ -32,4 +35,37 @@ const char *usb_speed_string(enum usb_device_speed speed)
+ }
+ EXPORT_SYMBOL_GPL(usb_speed_string);
+ 
++#ifdef CONFIG_OF
++static const char *usb_dr_modes[] = {
++	[USB_DR_MODE_UNKNOWN]		= "",
++	[USB_DR_MODE_HOST]		= "host",
++	[USB_DR_MODE_PERIPHERAL]	= "peripheral",
++	[USB_DR_MODE_OTG]		= "otg",
++};
++
++/**
++ * of_usb_get_dr_mode - Get dual role mode for given device_node
++ * @np:	Pointer to the given device_node
++ *
++ * The function gets phy interface string from property 'dr_mode',
++ * and returns the correspondig enum usb_dr_mode
++ */
++enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np)
++{
++	const char *dr_mode;
++	int err, i;
++
++	err = of_property_read_string(np, "dr_mode", &dr_mode);
++	if (err < 0)
++		return USB_DR_MODE_UNKNOWN;
++
++	for (i = 0; i < ARRAY_SIZE(usb_dr_modes); i++)
++		if (!strcmp(dr_mode, usb_dr_modes[i]))
++			return i;
++
++	return USB_DR_MODE_UNKNOWN;
++}
++EXPORT_SYMBOL_GPL(of_usb_get_dr_mode);
++#endif
++
+ MODULE_LICENSE("GPL");
+diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h
+new file mode 100644
+index 0000000..4681a20
+--- /dev/null
++++ b/include/linux/usb/of.h
+@@ -0,0 +1,27 @@
++/*
++ * OF helpers for usb devices.
++ *
++ * This file is released under the GPLv2
++ */
++
++#ifndef __LINUX_USB_OF_H
++#define __LINUX_USB_OF_H
++
++#include <linux/usb/phy.h>
++
++#ifdef CONFIG_OF
++enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np);
++enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np);
++#else
++static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np)
++{
++	return USBPHY_INTERFACE_MODE_UNKNOWN;
++}
++
++static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np)
++{
++	return USB_DR_MODE_UNKNOWN;
++}
++#endif
++
++#endif /* __LINUX_USB_OF_H */
+diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
+index e8a5fe8..4e8bfbb 100644
+--- a/include/linux/usb/otg.h
++++ b/include/linux/usb/otg.h
+@@ -99,4 +99,11 @@ otg_start_srp(struct usb_otg *otg)
+ /* for OTG controller drivers (and maybe other stuff) */
+ extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num);
+ 
++enum usb_dr_mode {
++	USB_DR_MODE_UNKNOWN,
++	USB_DR_MODE_HOST,
++	USB_DR_MODE_PERIPHERAL,
++	USB_DR_MODE_OTG,
++};
++
+ #endif /* __LINUX_USB_OTG_H */
+diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
+index 15847cb..5edddb1 100644
+--- a/include/linux/usb/phy.h
++++ b/include/linux/usb/phy.h
+@@ -12,6 +12,15 @@
+ #include <linux/notifier.h>
+ #include <linux/usb.h>
+ 
++enum usb_phy_interface {
++	USBPHY_INTERFACE_MODE_UNKNOWN,
++	USBPHY_INTERFACE_MODE_UTMI,
++	USBPHY_INTERFACE_MODE_UTMIW,
++	USBPHY_INTERFACE_MODE_ULPI,
++	USBPHY_INTERFACE_MODE_SERIAL,
++	USBPHY_INTERFACE_MODE_HSIC,
++};
++
+ enum usb_phy_events {
+ 	USB_EVENT_NONE,         /* no events or cable disconnected */
+ 	USB_EVENT_VBUS,         /* vbus valid event */
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0003-USB-chipidea-ci13xxx-imx-create-dynamic-platformdata.patch b/patches/chipidea/0003-USB-chipidea-ci13xxx-imx-create-dynamic-platformdata.patch
new file mode 100644
index 0000000000000000000000000000000000000000..35742403f78e62b6540dddbe4b23c2e7e467c943
--- /dev/null
+++ b/patches/chipidea/0003-USB-chipidea-ci13xxx-imx-create-dynamic-platformdata.patch
@@ -0,0 +1,80 @@
+From b4d60d840ea01addb9276766ba31677db26bdd17 Mon Sep 17 00:00:00 2001
+From: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Date: Tue, 17 Jul 2012 22:38:20 +0200
+Subject: [PATCH 03/25] USB: chipidea: ci13xxx-imx: create dynamic
+ platformdata
+
+This patch removes the limitation of having only one instance of the
+ci13xxx-imx platformdata and makes different configurations possible.
+
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+Reviewed-by: Peter Chen <peter.chen@freescale.com>
+---
+ drivers/usb/chipidea/ci13xxx_imx.c |   25 +++++++++++++++----------
+ 1 file changed, 15 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
+index 8c29122..69024e0 100644
+--- a/drivers/usb/chipidea/ci13xxx_imx.c
++++ b/drivers/usb/chipidea/ci13xxx_imx.c
+@@ -85,17 +85,10 @@ EXPORT_SYMBOL_GPL(usbmisc_get_init_data);
+ 
+ /* End of common functions shared by usbmisc drivers*/
+ 
+-static struct ci13xxx_platform_data ci13xxx_imx_platdata  = {
+-	.name			= "ci13xxx_imx",
+-	.flags			= CI13XXX_REQUIRE_TRANSCEIVER |
+-				  CI13XXX_PULLUP_ON_VBUS |
+-				  CI13XXX_DISABLE_STREAMING,
+-	.capoffset		= DEF_CAPOFFSET,
+-};
+-
+ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ {
+ 	struct ci13xxx_imx_data *data;
++	struct ci13xxx_platform_data *pdata;
+ 	struct platform_device *plat_ci, *phy_pdev;
+ 	struct device_node *phy_np;
+ 	struct resource *res;
+@@ -107,6 +100,18 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 		&& !usbmisc_ops)
+ 		return -EPROBE_DEFER;
+ 
++	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
++	if (!pdata) {
++		dev_err(&pdev->dev, "Failed to allocate CI13xxx-IMX pdata!\n");
++		return -ENOMEM;
++	}
++
++	pdata->name = "ci13xxx_imx";
++	pdata->capoffset = DEF_CAPOFFSET;
++	pdata->flags = CI13XXX_REQUIRE_TRANSCEIVER |
++		       CI13XXX_PULLUP_ON_VBUS |
++		       CI13XXX_DISABLE_STREAMING;
++
+ 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+ 	if (!data) {
+ 		dev_err(&pdev->dev, "Failed to allocate CI13xxx-IMX data!\n");
+@@ -168,7 +173,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 		reg_vbus = NULL;
+ 	}
+ 
+-	ci13xxx_imx_platdata.phy = data->phy;
++	pdata->phy = data->phy;
+ 
+ 	if (!pdev->dev.dma_mask) {
+ 		pdev->dev.dma_mask = devm_kzalloc(&pdev->dev,
+@@ -193,7 +198,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 
+ 	plat_ci = ci13xxx_add_device(&pdev->dev,
+ 				pdev->resource, pdev->num_resources,
+-				&ci13xxx_imx_platdata);
++				pdata);
+ 	if (IS_ERR(plat_ci)) {
+ 		ret = PTR_ERR(plat_ci);
+ 		dev_err(&pdev->dev,
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0004-USB-chipidea-add-PTW-and-PTS-handling.patch b/patches/chipidea/0004-USB-chipidea-add-PTW-and-PTS-handling.patch
new file mode 100644
index 0000000000000000000000000000000000000000..cc180d263556d09fb62a15ee7a8c34cfd298073b
--- /dev/null
+++ b/patches/chipidea/0004-USB-chipidea-add-PTW-and-PTS-handling.patch
@@ -0,0 +1,164 @@
+From 7bcc3c0b2d66d15438be645f54d294d85de4e56a Mon Sep 17 00:00:00 2001
+From: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Date: Tue, 10 Jul 2012 16:42:10 +0200
+Subject: [PATCH 04/25] USB: chipidea: add PTW and PTS handling
+
+This patch makes it possible to configure the PTW and PTS bits inside
+the portsc register for host and device mode before the driver starts
+and the phy can be addressed as hardware implementation is designed.
+
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+---
+ .../devicetree/bindings/usb/ci13xxx-imx.txt        |    5 +++
+ drivers/usb/chipidea/bits.h                        |   14 ++++++-
+ drivers/usb/chipidea/ci13xxx_imx.c                 |    3 ++
+ drivers/usb/chipidea/core.c                        |   39 ++++++++++++++++++++
+ include/linux/usb/chipidea.h                       |    1 +
+ 5 files changed, 61 insertions(+), 1 deletion(-)
+
+diff --git a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
+index 5778b9c..dd42ccd 100644
+--- a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
++++ b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
+@@ -5,6 +5,11 @@ Required properties:
+ - reg: Should contain registers location and length
+ - interrupts: Should contain controller interrupt
+ 
++Recommended properies:
++- phy_type: the type of the phy connected to the core. Should be one
++  of "utmi", "utmi_wide", "ulpi", "serial" or "hsic". Without this
++  property the PORTSC register won't be touched
++
+ Optional properties:
+ - fsl,usbphy: phandler of usb phy that connects to the only one port
+ - fsl,usbmisc: phandler of non-core register device, with one argument
+diff --git a/drivers/usb/chipidea/bits.h b/drivers/usb/chipidea/bits.h
+index 050de85..d8ffc2f 100644
+--- a/drivers/usb/chipidea/bits.h
++++ b/drivers/usb/chipidea/bits.h
+@@ -48,10 +48,22 @@
+ #define PORTSC_SUSP           BIT(7)
+ #define PORTSC_HSP            BIT(9)
+ #define PORTSC_PTC            (0x0FUL << 16)
++/* PTS and PTW for non lpm version only */
++#define PORTSC_PTS(d)         ((((d) & 0x3) << 30) | (((d) & 0x4) ? BIT(25) : 0))
++#define PORTSC_PTW            BIT(28)
+ 
+ /* DEVLC */
+ #define DEVLC_PSPD            (0x03UL << 25)
+-#define    DEVLC_PSPD_HS      (0x02UL << 25)
++#define DEVLC_PSPD_HS         (0x02UL << 25)
++#define DEVLC_PTW             BIT(27)
++#define DEVLC_STS             BIT(28)
++#define DEVLC_PTS(d)          (((d) & 0x7) << 29)
++
++/* Encoding for DEVLC_PTS and PORTSC_PTS */
++#define PTS_UTMI              0
++#define PTS_ULPI              2
++#define PTS_SERIAL            3
++#define PTS_HSIC              4
+ 
+ /* OTGSC */
+ #define OTGSC_IDPU	      BIT(5)
+diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
+index 69024e0..ebc1148 100644
+--- a/drivers/usb/chipidea/ci13xxx_imx.c
++++ b/drivers/usb/chipidea/ci13xxx_imx.c
+@@ -21,6 +21,7 @@
+ #include <linux/clk.h>
+ #include <linux/regulator/consumer.h>
+ #include <linux/pinctrl/consumer.h>
++#include <linux/usb/of.h>
+ 
+ #include "ci.h"
+ #include "ci13xxx_imx.h"
+@@ -112,6 +113,8 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 		       CI13XXX_PULLUP_ON_VBUS |
+ 		       CI13XXX_DISABLE_STREAMING;
+ 
++	pdata->phy_mode = of_usb_get_phy_mode(pdev->dev.of_node);
++
+ 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+ 	if (!data) {
+ 		dev_err(&pdev->dev, "Failed to allocate CI13xxx-IMX data!\n");
+diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
+index 57cae1f..04d68cb 100644
+--- a/drivers/usb/chipidea/core.c
++++ b/drivers/usb/chipidea/core.c
+@@ -67,6 +67,8 @@
+ #include <linux/usb/gadget.h>
+ #include <linux/usb/otg.h>
+ #include <linux/usb/chipidea.h>
++#include <linux/usb/of.h>
++#include <linux/phy.h>
+ 
+ #include "ci.h"
+ #include "udc.h"
+@@ -211,6 +213,41 @@ static int hw_device_init(struct ci13xxx *ci, void __iomem *base)
+ 	return 0;
+ }
+ 
++static void hw_phymode_configure(struct ci13xxx *ci)
++{
++	u32 portsc, lpm;
++
++	switch (ci->platdata->phy_mode) {
++	case USBPHY_INTERFACE_MODE_UTMI:
++		portsc = PORTSC_PTS(PTS_UTMI);
++		lpm = DEVLC_PTS(PTS_UTMI);
++		break;
++	case USBPHY_INTERFACE_MODE_UTMIW:
++		portsc = PORTSC_PTS(PTS_UTMI) | PORTSC_PTW;
++		lpm = DEVLC_PTS(PTS_UTMI) | DEVLC_PTW;
++		break;
++	case USBPHY_INTERFACE_MODE_ULPI:
++		portsc = PORTSC_PTS(PTS_ULPI);
++		lpm = DEVLC_PTS(PTS_ULPI);
++		break;
++	case USBPHY_INTERFACE_MODE_SERIAL:
++		portsc = PORTSC_PTS(PTS_SERIAL);
++		lpm = DEVLC_PTS(PTS_SERIAL);
++		break;
++	case USBPHY_INTERFACE_MODE_HSIC:
++		portsc = PORTSC_PTS(PTS_HSIC);
++		lpm = DEVLC_PTS(PTS_HSIC);
++		break;
++	default:
++		return;
++	}
++
++	if (ci->hw_bank.lpm)
++		hw_write(ci, OP_DEVLC, DEVLC_PTS(7) | DEVLC_PTW, lpm);
++	else
++		hw_write(ci, OP_PORTSC, PORTSC_PTS(7) | PORTSC_PTW, portsc);
++}
++
+ /**
+  * hw_device_reset: resets chip (execute without interruption)
+  * @ci: the controller
+@@ -476,6 +513,8 @@ static int ci_hdrc_probe(struct platform_device *pdev)
+ 			: CI_ROLE_GADGET;
+ 	}
+ 
++	hw_phymode_configure(ci);
++
+ 	ret = ci_role_start(ci, ci->role);
+ 	if (ret) {
+ 		dev_err(dev, "can't start %s role\n", ci_role(ci)->name);
+diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
+index 544825d..1a2aa18 100644
+--- a/include/linux/usb/chipidea.h
++++ b/include/linux/usb/chipidea.h
+@@ -14,6 +14,7 @@ struct ci13xxx_platform_data {
+ 	uintptr_t	 capoffset;
+ 	unsigned	 power_budget;
+ 	struct usb_phy	*phy;
++	enum usb_phy_interface phy_mode;
+ 	unsigned long	 flags;
+ #define CI13XXX_REGS_SHARED		BIT(0)
+ #define CI13XXX_REQUIRE_TRANSCEIVER	BIT(1)
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0005-USB-chipidea-introduce-dual-role-mode-pdata-flags.patch b/patches/chipidea/0005-USB-chipidea-introduce-dual-role-mode-pdata-flags.patch
new file mode 100644
index 0000000000000000000000000000000000000000..f926ca8179827b42387e96cb4844636f07be1b62
--- /dev/null
+++ b/patches/chipidea/0005-USB-chipidea-introduce-dual-role-mode-pdata-flags.patch
@@ -0,0 +1,72 @@
+From 5eb25eb2f89bcf88a8583c18e378358d5389180d Mon Sep 17 00:00:00 2001
+From: Sascha Hauer <s.hauer@pengutronix.de>
+Date: Tue, 29 Jan 2013 12:02:18 +0100
+Subject: [PATCH 05/25] USB chipidea: introduce dual role mode pdata flags
+
+Even if a chipidea core is otg capable the board may not. This allows
+to explicitly set the core to host/peripheral mode. Without these
+flags the driver falls back to the old behaviour.
+
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+---
+ drivers/usb/chipidea/core.c  |   21 +++++++++++++++------
+ include/linux/usb/chipidea.h |    2 +-
+ 2 files changed, 16 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
+index 04d68cb..c89f2aa 100644
+--- a/drivers/usb/chipidea/core.c
++++ b/drivers/usb/chipidea/core.c
+@@ -435,6 +435,7 @@ static int ci_hdrc_probe(struct platform_device *pdev)
+ 	struct resource	*res;
+ 	void __iomem	*base;
+ 	int		ret;
++	enum usb_dr_mode dr_mode;
+ 
+ 	if (!dev->platform_data) {
+ 		dev_err(dev, "platform data missing\n");
+@@ -487,14 +488,22 @@ static int ci_hdrc_probe(struct platform_device *pdev)
+ 		return -ENODEV;
+ 	}
+ 
++	dr_mode = ci->platdata->dr_mode;
++	if (dr_mode == USB_DR_MODE_UNKNOWN)
++		dr_mode = USB_DR_MODE_OTG;
++
+ 	/* initialize role(s) before the interrupt is requested */
+-	ret = ci_hdrc_host_init(ci);
+-	if (ret)
+-		dev_info(dev, "doesn't support host\n");
++	if (dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_HOST) {
++		ret = ci_hdrc_host_init(ci);
++		if (ret)
++			dev_info(dev, "doesn't support host\n");
++	}
+ 
+-	ret = ci_hdrc_gadget_init(ci);
+-	if (ret)
+-		dev_info(dev, "doesn't support gadget\n");
++	if (dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_PERIPHERAL) {
++		ret = ci_hdrc_gadget_init(ci);
++		if (ret)
++			dev_info(dev, "doesn't support gadget\n");
++	}
+ 
+ 	if (!ci->roles[CI_ROLE_HOST] && !ci->roles[CI_ROLE_GADGET]) {
+ 		dev_err(dev, "no supported roles\n");
+diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
+index 1a2aa18..b314647 100644
+--- a/include/linux/usb/chipidea.h
++++ b/include/linux/usb/chipidea.h
+@@ -20,7 +20,7 @@ struct ci13xxx_platform_data {
+ #define CI13XXX_REQUIRE_TRANSCEIVER	BIT(1)
+ #define CI13XXX_PULLUP_ON_VBUS		BIT(2)
+ #define CI13XXX_DISABLE_STREAMING	BIT(3)
+-
++	enum usb_dr_mode	dr_mode;
+ #define CI13XXX_CONTROLLER_RESET_EVENT		0
+ #define CI13XXX_CONTROLLER_STOPPED_EVENT	1
+ 	void	(*notify_event) (struct ci13xxx *ci, unsigned event);
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0006-USB-chipidea-i.MX-introduce-dr_mode-property.patch b/patches/chipidea/0006-USB-chipidea-i.MX-introduce-dr_mode-property.patch
new file mode 100644
index 0000000000000000000000000000000000000000..8cbae0893ada451e8a4f1dd627b182420e6547b2
--- /dev/null
+++ b/patches/chipidea/0006-USB-chipidea-i.MX-introduce-dr_mode-property.patch
@@ -0,0 +1,43 @@
+From 9a4ae8ad475ca5b7904e98c3e420ac883febe278 Mon Sep 17 00:00:00 2001
+From: Sascha Hauer <s.hauer@pengutronix.de>
+Date: Tue, 29 Jan 2013 12:02:30 +0100
+Subject: [PATCH 06/25] USB chipidea i.MX: introduce dr_mode property
+
+The dr_mode devicetree property allows to explicitly specify the
+host/peripheral/otg mode. This is necessary for boards without proper
+ID pin handling.
+
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+Reviewed-by: Peter Chen <peter.chen@freescale.com>
+---
+ Documentation/devicetree/bindings/usb/ci13xxx-imx.txt |    1 +
+ drivers/usb/chipidea/ci13xxx_imx.c                    |    1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
+index dd42ccd..493a414 100644
+--- a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
++++ b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
+@@ -9,6 +9,7 @@ Recommended properies:
+ - phy_type: the type of the phy connected to the core. Should be one
+   of "utmi", "utmi_wide", "ulpi", "serial" or "hsic". Without this
+   property the PORTSC register won't be touched
++- dr_mode: One of "host", "peripheral" or "otg". Defaults to "otg"
+ 
+ Optional properties:
+ - fsl,usbphy: phandler of usb phy that connects to the only one port
+diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
+index ebc1148..b598bb8 100644
+--- a/drivers/usb/chipidea/ci13xxx_imx.c
++++ b/drivers/usb/chipidea/ci13xxx_imx.c
+@@ -114,6 +114,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 		       CI13XXX_DISABLE_STREAMING;
+ 
+ 	pdata->phy_mode = of_usb_get_phy_mode(pdev->dev.of_node);
++	pdata->dr_mode = of_usb_get_dr_mode(pdev->dev.of_node);
+ 
+ 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+ 	if (!data) {
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0007-USB-mxs-phy-Register-phy-with-framework.patch b/patches/chipidea/0007-USB-mxs-phy-Register-phy-with-framework.patch
new file mode 100644
index 0000000000000000000000000000000000000000..790e12251bfec2225ba7edc759e03c03b848da4d
--- /dev/null
+++ b/patches/chipidea/0007-USB-mxs-phy-Register-phy-with-framework.patch
@@ -0,0 +1,48 @@
+From e76ba618ff1ed0ade556ceec31ebd7010856732c Mon Sep 17 00:00:00 2001
+From: Sascha Hauer <s.hauer@pengutronix.de>
+Date: Thu, 31 Jan 2013 12:19:29 +0100
+Subject: [PATCH 07/25] USB mxs-phy: Register phy with framework
+
+We now have usb_add_phy_dev(), so use it to register with the framework
+to be able to find the phy from the USB driver.
+
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+---
+ drivers/usb/otg/mxs-phy.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c
+index b0d9f11..aa40325 100644
+--- a/drivers/usb/otg/mxs-phy.c
++++ b/drivers/usb/otg/mxs-phy.c
+@@ -127,6 +127,7 @@ static int mxs_phy_probe(struct platform_device *pdev)
+ 	void __iomem *base;
+ 	struct clk *clk;
+ 	struct mxs_phy *mxs_phy;
++	int ret;
+ 
+ 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ 	if (!res) {
+@@ -166,11 +167,19 @@ static int mxs_phy_probe(struct platform_device *pdev)
+ 
+ 	platform_set_drvdata(pdev, &mxs_phy->phy);
+ 
++	ret = usb_add_phy_dev(&mxs_phy->phy);
++	if (ret)
++		return ret;
++
+ 	return 0;
+ }
+ 
+ static int mxs_phy_remove(struct platform_device *pdev)
+ {
++	struct mxs_phy *mxs_phy = platform_get_drvdata(pdev);
++
++	usb_remove_phy(&mxs_phy->phy);
++
+ 	platform_set_drvdata(pdev, NULL);
+ 
+ 	return 0;
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0008-USB-chipidea-i.MX-use-devm_usb_get_phy_by_phandle-to.patch b/patches/chipidea/0008-USB-chipidea-i.MX-use-devm_usb_get_phy_by_phandle-to.patch
new file mode 100644
index 0000000000000000000000000000000000000000..f5bef44ca3c94d93c9cbc0f837dda07d8ace4c77
--- /dev/null
+++ b/patches/chipidea/0008-USB-chipidea-i.MX-use-devm_usb_get_phy_by_phandle-to.patch
@@ -0,0 +1,104 @@
+From f97b9bb5a2a07a8917360f24dd7b6d0831df28f1 Mon Sep 17 00:00:00 2001
+From: Sascha Hauer <s.hauer@pengutronix.de>
+Date: Thu, 31 Jan 2013 12:20:47 +0100
+Subject: [PATCH 08/25] USB chipidea i.MX: use devm_usb_get_phy_by_phandle to
+ get phy
+
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+---
+ drivers/usb/chipidea/ci13xxx_imx.c |   39 +++++++++++++++++-------------------
+ 1 file changed, 18 insertions(+), 21 deletions(-)
+
+diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
+index b598bb8..136869b 100644
+--- a/drivers/usb/chipidea/ci13xxx_imx.c
++++ b/drivers/usb/chipidea/ci13xxx_imx.c
+@@ -30,7 +30,6 @@
+ 	((struct usb_phy *)platform_get_drvdata(pdev))
+ 
+ struct ci13xxx_imx_data {
+-	struct device_node *phy_np;
+ 	struct usb_phy *phy;
+ 	struct platform_device *ci_pdev;
+ 	struct clk *clk;
+@@ -90,12 +89,12 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ {
+ 	struct ci13xxx_imx_data *data;
+ 	struct ci13xxx_platform_data *pdata;
+-	struct platform_device *plat_ci, *phy_pdev;
+-	struct device_node *phy_np;
++	struct platform_device *plat_ci;
+ 	struct resource *res;
+ 	struct regulator *reg_vbus;
+ 	struct pinctrl *pinctrl;
+ 	int ret;
++	struct usb_phy *phy;
+ 
+ 	if (of_find_property(pdev->dev.of_node, "fsl,usbmisc", NULL)
+ 		&& !usbmisc_ops)
+@@ -147,19 +146,21 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 		return ret;
+ 	}
+ 
+-	phy_np = of_parse_phandle(pdev->dev.of_node, "fsl,usbphy", 0);
+-	if (phy_np) {
+-		data->phy_np = phy_np;
+-		phy_pdev = of_find_device_by_node(phy_np);
+-		if (phy_pdev) {
+-			struct usb_phy *phy;
+-			phy = pdev_to_phy(phy_pdev);
+-			if (phy &&
+-			    try_module_get(phy_pdev->dev.driver->owner)) {
+-				usb_phy_init(phy);
+-				data->phy = phy;
+-			}
++	phy = devm_usb_get_phy_by_phandle(&pdev->dev, "fsl,usbphy", 0);
++
++	if (PTR_ERR(phy) == -EPROBE_DEFER) {
++		ret = -EPROBE_DEFER;
++		goto err_clk;
++	}
++
++	if (!IS_ERR(phy)) {
++		ret = usb_phy_init(phy);
++		if (ret) {
++			dev_err(&pdev->dev, "unable to init phy: %d\n", ret);
++			goto err_clk;
+ 		}
++
++		data->phy = phy;
+ 	}
+ 
+ 	/* we only support host now, so enable vbus here */
+@@ -170,7 +171,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 			dev_err(&pdev->dev,
+ 				"Failed to enable vbus regulator, err=%d\n",
+ 				ret);
+-			goto put_np;
++			goto err_clk;
+ 		}
+ 		data->reg_vbus = reg_vbus;
+ 	} else {
+@@ -222,9 +223,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ err:
+ 	if (reg_vbus)
+ 		regulator_disable(reg_vbus);
+-put_np:
+-	if (phy_np)
+-		of_node_put(phy_np);
++err_clk:
+ 	clk_disable_unprepare(data->clk);
+ 	return ret;
+ }
+@@ -244,8 +243,6 @@ static int ci13xxx_imx_remove(struct platform_device *pdev)
+ 		module_put(data->phy->dev->driver->owner);
+ 	}
+ 
+-	of_node_put(data->phy_np);
+-
+ 	clk_disable_unprepare(data->clk);
+ 
+ 	platform_set_drvdata(pdev, NULL);
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0009-Revert-USB-chipidea-add-vbus-detect-for-udc.patch b/patches/chipidea/0009-Revert-USB-chipidea-add-vbus-detect-for-udc.patch
new file mode 100644
index 0000000000000000000000000000000000000000..52ce16fe11dc8d936e8e8d151db22049af31547c
--- /dev/null
+++ b/patches/chipidea/0009-Revert-USB-chipidea-add-vbus-detect-for-udc.patch
@@ -0,0 +1,132 @@
+From 44fb148b65dc8e06a948c517f008b5ee8fccbb1d Mon Sep 17 00:00:00 2001
+From: Peter Chen <peter.chen@freescale.com>
+Date: Mon, 4 Feb 2013 16:59:43 +0800
+Subject: [PATCH 09/25] Revert "USB: chipidea: add vbus detect for udc"
+
+vbus register is at otgsc, and vbus detect does not belong
+to device function. Revert this patch, and will move
+vbus detect function to drivers/usb/chipidea/udc.c
+
+This reverts commit 8c4fc031954b4eb72daf13d3c907a985a3eee208.
+
+Signed-off-by: Peter Chen <peter.chen@freescale.com>
+---
+ drivers/usb/chipidea/ci.h  |    1 -
+ drivers/usb/chipidea/udc.c |   39 +--------------------------------------
+ 2 files changed, 1 insertion(+), 39 deletions(-)
+
+diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
+index e25d126..d738603 100644
+--- a/drivers/usb/chipidea/ci.h
++++ b/drivers/usb/chipidea/ci.h
+@@ -139,7 +139,6 @@ struct ci13xxx {
+ 	enum ci_role			role;
+ 	bool				is_otg;
+ 	struct work_struct		work;
+-	struct work_struct		vbus_work;
+ 	struct workqueue_struct		*wq;
+ 
+ 	struct dma_pool			*qh_pool;
+diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
+index f64fbea..2b4ff14 100644
+--- a/drivers/usb/chipidea/udc.c
++++ b/drivers/usb/chipidea/udc.c
+@@ -305,18 +305,6 @@ static u32 hw_test_and_clear_intr_active(struct ci13xxx *ci)
+ 	return reg;
+ }
+ 
+-static void hw_enable_vbus_intr(struct ci13xxx *ci)
+-{
+-	hw_write(ci, OP_OTGSC, OTGSC_AVVIS, OTGSC_AVVIS);
+-	hw_write(ci, OP_OTGSC, OTGSC_AVVIE, OTGSC_AVVIE);
+-	queue_work(ci->wq, &ci->vbus_work);
+-}
+-
+-static void hw_disable_vbus_intr(struct ci13xxx *ci)
+-{
+-	hw_write(ci, OP_OTGSC, OTGSC_AVVIE, 0);
+-}
+-
+ /**
+  * hw_test_and_clear_setup_guard: test & clear setup guard (execute without
+  *                                interruption)
+@@ -383,16 +371,6 @@ static int hw_usb_reset(struct ci13xxx *ci)
+ 	return 0;
+ }
+ 
+-static void vbus_work(struct work_struct *work)
+-{
+-	struct ci13xxx *ci = container_of(work, struct ci13xxx, vbus_work);
+-
+-	if (hw_read(ci, OP_OTGSC, OTGSC_AVV))
+-		usb_gadget_vbus_connect(&ci->gadget);
+-	else
+-		usb_gadget_vbus_disconnect(&ci->gadget);
+-}
+-
+ /******************************************************************************
+  * UTIL block
+  *****************************************************************************/
+@@ -1392,7 +1370,6 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
+ 		if (is_active) {
+ 			pm_runtime_get_sync(&_gadget->dev);
+ 			hw_device_reset(ci, USBMODE_CM_DC);
+-			hw_enable_vbus_intr(ci);
+ 			hw_device_state(ci, ci->ep0out->qh.dma);
+ 		} else {
+ 			hw_device_state(ci, 0);
+@@ -1567,10 +1544,8 @@ static int ci13xxx_start(struct usb_gadget *gadget,
+ 	pm_runtime_get_sync(&ci->gadget.dev);
+ 	if (ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) {
+ 		if (ci->vbus_active) {
+-			if (ci->platdata->flags & CI13XXX_REGS_SHARED) {
++			if (ci->platdata->flags & CI13XXX_REGS_SHARED)
+ 				hw_device_reset(ci, USBMODE_CM_DC);
+-				hw_enable_vbus_intr(ci);
+-			}
+ 		} else {
+ 			pm_runtime_put_sync(&ci->gadget.dev);
+ 			goto done;
+@@ -1676,13 +1651,6 @@ static irqreturn_t udc_irq(struct ci13xxx *ci)
+ 	} else {
+ 		retval = IRQ_NONE;
+ 	}
+-
+-	intr = hw_read(ci, OP_OTGSC, ~0);
+-	hw_write(ci, OP_OTGSC, ~0, intr);
+-
+-	if (intr & (OTGSC_AVVIE & OTGSC_AVVIS))
+-		queue_work(ci->wq, &ci->vbus_work);
+-
+ 	spin_unlock(&ci->lock);
+ 
+ 	return retval;
+@@ -1758,7 +1726,6 @@ static int udc_start(struct ci13xxx *ci)
+ 		retval = hw_device_reset(ci, USBMODE_CM_DC);
+ 		if (retval)
+ 			goto put_transceiver;
+-		hw_enable_vbus_intr(ci);
+ 	}
+ 
+ 	retval = device_register(&ci->gadget.dev);
+@@ -1821,9 +1788,6 @@ static void udc_stop(struct ci13xxx *ci)
+ 	if (ci == NULL)
+ 		return;
+ 
+-	hw_disable_vbus_intr(ci);
+-	cancel_work_sync(&ci->vbus_work);
+-
+ 	usb_del_gadget_udc(&ci->gadget);
+ 
+ 	destroy_eps(ci);
+@@ -1864,7 +1828,6 @@ int ci_hdrc_gadget_init(struct ci13xxx *ci)
+ 	rdrv->irq	= udc_irq;
+ 	rdrv->name	= "gadget";
+ 	ci->roles[CI_ROLE_GADGET] = rdrv;
+-	INIT_WORK(&ci->vbus_work, vbus_work);
+ 
+ 	return 0;
+ }
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0010-usb-chipidea-add-otg-file.patch b/patches/chipidea/0010-usb-chipidea-add-otg-file.patch
new file mode 100644
index 0000000000000000000000000000000000000000..df12878d690f6daccbe60a1a9c9dc2abeee20203
--- /dev/null
+++ b/patches/chipidea/0010-usb-chipidea-add-otg-file.patch
@@ -0,0 +1,132 @@
+From c6f1c58ad2bfd3de57926df30e574a9ea1d2ee30 Mon Sep 17 00:00:00 2001
+From: Peter Chen <peter.chen@freescale.com>
+Date: Mon, 4 Feb 2013 16:59:44 +0800
+Subject: [PATCH 10/25] usb: chipidea: add otg file
+
+Implement struct usb_otg, In that way, calling otg_set_peripheral
+will not be failed at udc.c.
+
+Signed-off-by: Peter Chen <peter.chen@freescale.com>
+---
+ drivers/usb/chipidea/Makefile |    2 +-
+ drivers/usb/chipidea/ci.h     |    2 ++
+ drivers/usb/chipidea/otg.c    |   60 +++++++++++++++++++++++++++++++++++++++++
+ drivers/usb/chipidea/otg.h    |    6 +++++
+ 4 files changed, 69 insertions(+), 1 deletion(-)
+ create mode 100644 drivers/usb/chipidea/otg.c
+ create mode 100644 drivers/usb/chipidea/otg.h
+
+diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile
+index d92ca32..11f513c 100644
+--- a/drivers/usb/chipidea/Makefile
++++ b/drivers/usb/chipidea/Makefile
+@@ -2,7 +2,7 @@ ccflags-$(CONFIG_USB_CHIPIDEA_DEBUG) := -DDEBUG
+ 
+ obj-$(CONFIG_USB_CHIPIDEA)		+= ci_hdrc.o
+ 
+-ci_hdrc-y				:= core.o
++ci_hdrc-y				:= core.o otg.o
+ ci_hdrc-$(CONFIG_USB_CHIPIDEA_UDC)	+= udc.o
+ ci_hdrc-$(CONFIG_USB_CHIPIDEA_HOST)	+= host.o
+ ci_hdrc-$(CONFIG_USB_CHIPIDEA_DEBUG)	+= debug.o
+diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
+index d738603..697e369 100644
+--- a/drivers/usb/chipidea/ci.h
++++ b/drivers/usb/chipidea/ci.h
+@@ -129,6 +129,7 @@ struct hw_bank {
+  * @vbus_active: is VBUS active
+  * @transceiver: pointer to USB PHY, if any
+  * @hcd: pointer to usb_hcd for ehci host driver
++ * @otg: for otg support
+  */
+ struct ci13xxx {
+ 	struct device			*dev;
+@@ -164,6 +165,7 @@ struct ci13xxx {
+ 	bool				global_phy;
+ 	struct usb_phy			*transceiver;
+ 	struct usb_hcd			*hcd;
++	struct usb_otg      		otg;
+ };
+ 
+ static inline struct ci_role_driver *ci_role(struct ci13xxx *ci)
+diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c
+new file mode 100644
+index 0000000..7dea3b3
+--- /dev/null
++++ b/drivers/usb/chipidea/otg.c
+@@ -0,0 +1,60 @@
++/*
++ * otg.c - ChipIdea USB IP core OTG driver
++ *
++ * Copyright (C) 2012 Freescale Semiconductor, Inc.
++ *
++ * Author: Peter Chen
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/module.h>
++#include <linux/io.h>
++#include <linux/irq.h>
++#include <linux/kernel.h>
++#include <linux/slab.h>
++#include <linux/usb/gadget.h>
++#include <linux/usb/otg.h>
++#include <linux/usb/chipidea.h>
++
++#include "ci.h"
++#include "udc.h"
++#include "bits.h"
++#include "host.h"
++#include "debug.h"
++
++static int ci_otg_set_peripheral(struct usb_otg *otg,
++		struct usb_gadget *periph)
++{
++	otg->gadget = periph;
++
++	return 0;
++}
++
++static int ci_otg_set_host(struct usb_otg *otg, struct usb_bus *host)
++{
++	otg->host = host;
++
++	return 0;
++}
++
++/**
++ * ci_hdrc_otg_init - initialize device related bits
++ * ci: the controller
++ *
++ * This function create otg struct, if the device can switch between
++ * device and host.
++ */
++int ci_hdrc_otg_init(struct ci13xxx *ci)
++{
++	/* Useless at current */
++	ci->otg.set_peripheral = ci_otg_set_peripheral;
++	ci->otg.set_host = ci_otg_set_host;
++	if (!IS_ERR_OR_NULL(ci->transceiver))
++		ci->transceiver->otg = &ci->otg;
++
++	return 0;
++}
+diff --git a/drivers/usb/chipidea/otg.h b/drivers/usb/chipidea/otg.h
+new file mode 100644
+index 0000000..b4c6b3e
+--- /dev/null
++++ b/drivers/usb/chipidea/otg.h
+@@ -0,0 +1,6 @@
++#ifndef __DRIVERS_USB_CHIPIDEA_OTG_H
++#define __DRIVERS_USB_CHIPIDEA_OTG_H
++
++int ci_hdrc_otg_init(struct ci13xxx *ci);
++
++#endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0011-usb-chipidea-add-otg-id-switch-and-vbus-connect-disc.patch b/patches/chipidea/0011-usb-chipidea-add-otg-id-switch-and-vbus-connect-disc.patch
new file mode 100644
index 0000000000000000000000000000000000000000..6e057e5c9de51464797855bdc933a5bedc221400
--- /dev/null
+++ b/patches/chipidea/0011-usb-chipidea-add-otg-id-switch-and-vbus-connect-disc.patch
@@ -0,0 +1,642 @@
+From 2f4cf94f3753797ba2f8643a07c975f30c3760ea Mon Sep 17 00:00:00 2001
+From: Peter Chen <peter.chen@freescale.com>
+Date: Mon, 4 Feb 2013 16:59:45 +0800
+Subject: [PATCH 11/25] usb: chipidea: add otg id switch and vbus
+ connect/disconnect detect
+
+The main design flow is the same with msm otg driver, that is the id and
+vbus interrupt are handled at core driver, others are handled by
+individual drivers.
+
+- At former design, when switch usb role from device->host, it will call
+udc_stop, it will remove the gadget driver, so when switch role
+from host->device, it can't add gadget driver any more.
+At new design, when role switch occurs, the gadget just calls
+usb_gadget_vbus_disconnect/usb_gadget_vbus_connect as well as
+reset controller, it will not free any device/gadget structure
+
+- Add vbus connect and disconnect to core interrupt handler, it can
+notify udc driver by calling usb_gadget_vbus_disconnect
+/usb_gadget_vbus_connect.
+
+- vbus interrupt needs to be handled when gadget function is enabled
+
+- Create/destroy the gadget at udc's init and destory function
+
+- start/stop API are used at otg id switch and probe routine
+
+- Defer some gadget operations at ci's delayed work queue
+
+Signed-off-by: Peter Chen <peter.chen@freescale.com>
+---
+ drivers/usb/chipidea/bits.h        |   10 ++
+ drivers/usb/chipidea/ci.h          |    7 +-
+ drivers/usb/chipidea/ci13xxx_imx.c |    3 +-
+ drivers/usb/chipidea/core.c        |  190 ++++++++++++++++++++++++++++++++----
+ drivers/usb/chipidea/host.c        |    6 ++
+ drivers/usb/chipidea/host.h        |    6 +-
+ drivers/usb/chipidea/otg.c         |   28 ++++--
+ drivers/usb/chipidea/otg.h         |    3 +
+ drivers/usb/chipidea/udc.c         |   39 ++++++--
+ drivers/usb/chipidea/udc.h         |    4 +
+ 10 files changed, 254 insertions(+), 42 deletions(-)
+
+diff --git a/drivers/usb/chipidea/bits.h b/drivers/usb/chipidea/bits.h
+index d8ffc2f..58ef56c 100644
+--- a/drivers/usb/chipidea/bits.h
++++ b/drivers/usb/chipidea/bits.h
+@@ -77,11 +77,21 @@
+ #define OTGSC_ASVIS	      BIT(18)
+ #define OTGSC_BSVIS	      BIT(19)
+ #define OTGSC_BSEIS	      BIT(20)
++#define OTGSC_1MSIS	      BIT(21)
++#define OTGSC_DPIS	      BIT(22)
+ #define OTGSC_IDIE	      BIT(24)
+ #define OTGSC_AVVIE	      BIT(25)
+ #define OTGSC_ASVIE	      BIT(26)
+ #define OTGSC_BSVIE	      BIT(27)
+ #define OTGSC_BSEIE	      BIT(28)
++#define OTGSC_1MSIE	      BIT(29)
++#define OTGSC_DPIE	      BIT(30)
++#define OTGSC_INT_EN_BITS	(OTGSC_IDIE | OTGSC_AVVIE | OTGSC_ASVIE \
++				| OTGSC_BSVIE | OTGSC_BSEIE | OTGSC_1MSIE \
++				| OTGSC_DPIE)
++#define OTGSC_INT_STATUS_BITS	(OTGSC_IDIS | OTGSC_AVVIS | OTGSC_ASVIS	\
++				| OTGSC_BSVIS | OTGSC_BSEIS | OTGSC_1MSIS \
++				| OTGSC_DPIS)
+ 
+ /* USBMODE */
+ #define USBMODE_CM            (0x03UL <<  0)
+diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
+index 697e369..a3777a1 100644
+--- a/drivers/usb/chipidea/ci.h
++++ b/drivers/usb/chipidea/ci.h
+@@ -130,6 +130,9 @@ struct hw_bank {
+  * @transceiver: pointer to USB PHY, if any
+  * @hcd: pointer to usb_hcd for ehci host driver
+  * @otg: for otg support
++ * @id_event: indicates there is a id event, and handled at ci_otg_work
++ * @b_sess_valid_event: indicates there is a vbus event, and handled
++ * at ci_otg_work
+  */
+ struct ci13xxx {
+ 	struct device			*dev;
+@@ -140,6 +143,7 @@ struct ci13xxx {
+ 	enum ci_role			role;
+ 	bool				is_otg;
+ 	struct work_struct		work;
++	struct delayed_work		dwork;
+ 	struct workqueue_struct		*wq;
+ 
+ 	struct dma_pool			*qh_pool;
+@@ -166,6 +170,8 @@ struct ci13xxx {
+ 	struct usb_phy			*transceiver;
+ 	struct usb_hcd			*hcd;
+ 	struct usb_otg      		otg;
++	bool				id_event;
++	bool				b_sess_valid_event;
+ };
+ 
+ static inline struct ci_role_driver *ci_role(struct ci13xxx *ci)
+@@ -201,7 +207,6 @@ static inline void ci_role_stop(struct ci13xxx *ci)
+ 
+ 	ci->roles[role]->stop(ci);
+ }
+-
+ /******************************************************************************
+  * REGISTERS
+  *****************************************************************************/
+diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
+index 136869b..ffcb56c 100644
+--- a/drivers/usb/chipidea/ci13xxx_imx.c
++++ b/drivers/usb/chipidea/ci13xxx_imx.c
+@@ -110,7 +110,8 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 	pdata->capoffset = DEF_CAPOFFSET;
+ 	pdata->flags = CI13XXX_REQUIRE_TRANSCEIVER |
+ 		       CI13XXX_PULLUP_ON_VBUS |
+-		       CI13XXX_DISABLE_STREAMING;
++		       CI13XXX_DISABLE_STREAMING |
++		       CI13XXX_REGS_SHARED;
+ 
+ 	pdata->phy_mode = of_usb_get_phy_mode(pdev->dev.of_node);
+ 	pdata->dr_mode = of_usb_get_dr_mode(pdev->dev.of_node);
+diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
+index c89f2aa..a3beafb 100644
+--- a/drivers/usb/chipidea/core.c
++++ b/drivers/usb/chipidea/core.c
+@@ -75,6 +75,7 @@
+ #include "bits.h"
+ #include "host.h"
+ #include "debug.h"
++#include "otg.h"
+ 
+ /* Controller register map */
+ static uintptr_t ci_regs_nolpm[] = {
+@@ -201,6 +202,14 @@ static int hw_device_init(struct ci13xxx *ci, void __iomem *base)
+ 	if (ci->hw_ep_max > ENDPT_MAX)
+ 		return -ENODEV;
+ 
++	/* Disable all interrupts bits */
++	hw_write(ci, OP_USBINTR, 0xffffffff, 0);
++	ci_disable_otg_interrupt(ci, OTGSC_INT_EN_BITS);
++
++	/* Clear all interrupts status bits*/
++	hw_write(ci, OP_USBSTS, 0xffffffff, 0xffffffff);
++	ci_clear_otg_interrupt(ci, OTGSC_INT_STATUS_BITS);
++
+ 	dev_dbg(ci->dev, "ChipIdea HDRC found, lpm: %d; cap: %p op: %p\n",
+ 		ci->hw_bank.lpm, ci->hw_bank.cap, ci->hw_bank.op);
+ 
+@@ -302,24 +311,131 @@ static enum ci_role ci_otg_role(struct ci13xxx *ci)
+ }
+ 
+ /**
+- * ci_role_work - perform role changing based on ID pin
+- * @work: work struct
++ * hw_wait_reg: wait the register value
++ *
++ * Sometimes, it needs to wait register value before going on.
++ * Eg, when switch to device mode, the vbus value should be lower
++ * than OTGSC_BSV before connects to host.
++ *
++ * @ci: the controller
++ * @reg: register index
++ * @mask: mast bit
++ * @value: the bit value to wait
++ * @timeout: timeout to indicate an error
++ *
++ * This function returns an error code if timeout
+  */
+-static void ci_role_work(struct work_struct *work)
++static int hw_wait_reg(struct ci13xxx *ci, enum ci13xxx_regs reg, u32 mask,
++				u32 value, unsigned long timeout)
++{
++	unsigned long elapse = jiffies + timeout;
++
++	while (hw_read(ci, reg, mask) != value) {
++		if (time_after(jiffies, elapse)) {
++			dev_err(ci->dev, "timeout waiting for %08x in %d\n",
++					mask, reg);
++			return -ETIMEDOUT;
++		}
++		msleep(20);
++	}
++
++	return 0;
++}
++
++/*
++ * Since there are some capacitances at vbus, the vbus may not
++ * change very quickly when we stop/start internal 5v.
++ * Below is a vbus stable timeout value, the routine will quit
++ * if the vbus gets the required value, we can think there are some
++ * problems for hardware if the vbus can't get the required value
++ * within 5 seconds.
++ */
++#define CI_VBUS_STABLE_TIMEOUT 500
++static void ci_handle_id_switch(struct ci13xxx *ci)
+ {
+-	struct ci13xxx *ci = container_of(work, struct ci13xxx, work);
+ 	enum ci_role role = ci_otg_role(ci);
+ 
+ 	if (role != ci->role) {
+ 		dev_dbg(ci->dev, "switching from %s to %s\n",
+ 			ci_role(ci)->name, ci->roles[role]->name);
+ 
++		/* 1. Finish the current role */
+ 		ci_role_stop(ci);
++		hw_device_reset(ci, USBMODE_CM_IDLE);
++
++		/* 2. Turn on/off vbus according to coming role */
++		if (role == CI_ROLE_GADGET) {
++			otg_set_vbus(&ci->otg, false);
++			/* wait vbus lower than OTGSC_BSV */
++			hw_wait_reg(ci, OP_OTGSC, OTGSC_BSV, 0,
++					CI_VBUS_STABLE_TIMEOUT);
++		} else if (role == CI_ROLE_HOST) {
++			otg_set_vbus(&ci->otg, true);
++			/* wait vbus higher than OTGSC_AVV */
++			hw_wait_reg(ci, OP_OTGSC, OTGSC_AVV, OTGSC_AVV,
++					CI_VBUS_STABLE_TIMEOUT);
++		}
++
++		/* 3. Begin the new role */
+ 		ci_role_start(ci, role);
+-		enable_irq(ci->irq);
+ 	}
+ }
+ 
++static void ci_handle_vbus_change(struct ci13xxx *ci)
++{
++	u32 otgsc = hw_read(ci, OP_OTGSC, ~0);
++
++	if (otgsc & OTGSC_BSV)
++		usb_gadget_vbus_connect(&ci->gadget);
++	else
++		usb_gadget_vbus_disconnect(&ci->gadget);
++}
++
++/**
++ * ci_otg_work - perform otg (vbus/id) event handle
++ * @work: work struct
++ */
++static void ci_otg_work(struct work_struct *work)
++{
++	struct ci13xxx *ci = container_of(work, struct ci13xxx, work);
++
++	if (ci->id_event) {
++		ci->id_event = false;
++		ci_handle_id_switch(ci);
++	} else if (ci->b_sess_valid_event) {
++		ci->b_sess_valid_event = false;
++		ci_handle_vbus_change(ci);
++	} else
++		dev_err(ci->dev, "unexpected event occurs at %s\n", __func__);
++
++	enable_irq(ci->irq);
++}
++
++static void ci_delayed_work(struct work_struct *work)
++{
++	struct delayed_work *dwork = to_delayed_work(work);
++	struct ci13xxx *ci = container_of(dwork, struct ci13xxx, dwork);
++
++	if (ci->role == CI_ROLE_GADGET) {
++		/*
++		 * if it is device mode:
++		 * - Enable vbus detect
++		 * - If it has already connected to host, notify udc
++		 */
++		ci_enable_otg_interrupt(ci, OTGSC_BSVIE);
++		ci_handle_vbus_change(ci);
++	} else if (ci->is_otg && (ci->role == CI_ROLE_HOST)) {
++		/* USB Device at the MicroB to A cable */
++		otg_set_vbus(&ci->otg, true);
++	}
++}
++
++static inline void ci_role_destroy(struct ci13xxx *ci)
++{
++	ci_hdrc_gadget_destroy(ci);
++	ci_hdrc_host_destroy(ci);
++}
++
+ static ssize_t show_role(struct device *dev, struct device_attribute *attr,
+ 			 char *buf)
+ {
+@@ -352,25 +468,50 @@ static ssize_t store_role(struct device *dev, struct device_attribute *attr,
+ 
+ static DEVICE_ATTR(role, S_IRUSR | S_IWUSR, show_role, store_role);
+ 
++static bool ci_is_otg_capable(struct ci13xxx *ci)
++{
++	return hw_read(ci, CAP_DCCPARAMS, DCCPARAMS_DC | DCCPARAMS_HC)
++		== (DCCPARAMS_DC | DCCPARAMS_HC);
++}
++
+ static irqreturn_t ci_irq(int irq, void *data)
+ {
+ 	struct ci13xxx *ci = data;
+ 	irqreturn_t ret = IRQ_NONE;
+ 	u32 otgsc = 0;
+ 
+-	if (ci->is_otg)
++	if (ci_is_otg_capable(ci))
+ 		otgsc = hw_read(ci, OP_OTGSC, ~0);
+ 
+-	if (ci->role != CI_ROLE_END)
+-		ret = ci_role(ci)->irq(ci);
++	/*
++	 * Handle id change interrupt, it indicates device/host function
++	 * switch.
++	 */
++	if (ci->is_otg && (otgsc & OTGSC_IDIE) && (otgsc & OTGSC_IDIS)) {
++		ci->id_event = true;
++		ci_clear_otg_interrupt(ci, OTGSC_IDIS);
++		disable_irq_nosync(ci->irq);
++		queue_work(ci->wq, &ci->work);
++		return IRQ_HANDLED;
++	}
+ 
+-	if (ci->is_otg && (otgsc & OTGSC_IDIS)) {
+-		hw_write(ci, OP_OTGSC, OTGSC_IDIS, OTGSC_IDIS);
++	/*
++	 * Handle vbus change interrupt, it indicates device connection
++	 * and disconnection events.
++	 */
++	if (ci_is_otg_capable(ci) && (otgsc & OTGSC_BSVIE)
++			&& (otgsc & OTGSC_BSVIS)) {
++		ci->b_sess_valid_event = true;
++		ci_clear_otg_interrupt(ci, OTGSC_BSVIS);
+ 		disable_irq_nosync(ci->irq);
+ 		queue_work(ci->wq, &ci->work);
+-		ret = IRQ_HANDLED;
++		return IRQ_HANDLED;
+ 	}
+ 
++	/* Handle device/host interrupt */
++	if (ci->role != CI_ROLE_END)
++		ret = ci_role(ci)->irq(ci);
++
+ 	return ret;
+ }
+ 
+@@ -481,7 +622,8 @@ static int ci_hdrc_probe(struct platform_device *pdev)
+ 		return -ENODEV;
+ 	}
+ 
+-	INIT_WORK(&ci->work, ci_role_work);
++	INIT_WORK(&ci->work, ci_otg_work);
++	INIT_DELAYED_WORK(&ci->dwork, ci_delayed_work);
+ 	ci->wq = create_singlethread_workqueue("ci_otg");
+ 	if (!ci->wq) {
+ 		dev_err(dev, "can't create workqueue\n");
+@@ -512,7 +654,10 @@ static int ci_hdrc_probe(struct platform_device *pdev)
+ 	}
+ 
+ 	if (ci->roles[CI_ROLE_HOST] && ci->roles[CI_ROLE_GADGET]) {
++		dev_dbg(dev, "support otg\n");
+ 		ci->is_otg = true;
++		/* if otg is supported, create struct usb_otg */
++		ci_hdrc_otg_init(ci);
+ 		/* ID pin needs 1ms debouce time, we delay 2ms for safe */
+ 		mdelay(2);
+ 		ci->role = ci_otg_role(ci);
+@@ -528,7 +673,7 @@ static int ci_hdrc_probe(struct platform_device *pdev)
+ 	if (ret) {
+ 		dev_err(dev, "can't start %s role\n", ci_role(ci)->name);
+ 		ret = -ENODEV;
+-		goto rm_wq;
++		goto free_memory;
+ 	}
+ 
+ 	platform_set_drvdata(pdev, ci);
+@@ -539,17 +684,22 @@ static int ci_hdrc_probe(struct platform_device *pdev)
+ 
+ 	ret = device_create_file(dev, &dev_attr_role);
+ 	if (ret)
+-		goto rm_attr;
++		goto free_irq;
+ 
+-	if (ci->is_otg)
+-		hw_write(ci, OP_OTGSC, OTGSC_IDIE, OTGSC_IDIE);
++	/* Defer some operations */
++	queue_delayed_work(ci->wq, &ci->dwork, msecs_to_jiffies(200));
+ 
+ 	return ret;
+ 
+-rm_attr:
+-	device_remove_file(dev, &dev_attr_role);
++free_irq:
++	free_irq(ci->irq, ci);
+ stop:
+-	ci_role_stop(ci);
++	ci_role_destroy(ci);
++free_memory:
++	if (ci->roles[CI_ROLE_HOST])
++		devm_kfree(dev, ci->roles[CI_ROLE_HOST]);
++	if (ci->roles[CI_ROLE_GADGET])
++		devm_kfree(dev, ci->roles[CI_ROLE_GADGET]);
+ rm_wq:
+ 	flush_workqueue(ci->wq);
+ 	destroy_workqueue(ci->wq);
+@@ -565,7 +715,7 @@ static int ci_hdrc_remove(struct platform_device *pdev)
+ 	destroy_workqueue(ci->wq);
+ 	device_remove_file(ci->dev, &dev_attr_role);
+ 	free_irq(ci->irq, ci);
+-	ci_role_stop(ci);
++	ci_role_destroy(ci);
+ 
+ 	return 0;
+ }
+diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
+index 8e9d312..ead3158 100644
+--- a/drivers/usb/chipidea/host.c
++++ b/drivers/usb/chipidea/host.c
+@@ -105,3 +105,9 @@ int ci_hdrc_host_init(struct ci13xxx *ci)
+ 
+ 	return 0;
+ }
++
++void ci_hdrc_host_destroy(struct ci13xxx *ci)
++{
++	if (ci->role == CI_ROLE_HOST)
++		host_stop(ci);
++}
+diff --git a/drivers/usb/chipidea/host.h b/drivers/usb/chipidea/host.h
+index 761fb1f..19cc72d 100644
+--- a/drivers/usb/chipidea/host.h
++++ b/drivers/usb/chipidea/host.h
+@@ -4,13 +4,17 @@
+ #ifdef CONFIG_USB_CHIPIDEA_HOST
+ 
+ int ci_hdrc_host_init(struct ci13xxx *ci);
+-
++void ci_hdrc_host_destroy(struct ci13xxx *ci);
+ #else
+ 
+ static inline int ci_hdrc_host_init(struct ci13xxx *ci)
+ {
+ 	return -ENXIO;
+ }
++static inline void ci_hdrc_host_destroy(struct ci13xxx *ci)
++{
++
++}
+ 
+ #endif
+ 
+diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c
+index 7dea3b3..2986d91 100644
+--- a/drivers/usb/chipidea/otg.c
++++ b/drivers/usb/chipidea/otg.c
+@@ -10,21 +10,28 @@
+  * published by the Free Software Foundation.
+  */
+ 
+-#include <linux/platform_device.h>
+-#include <linux/module.h>
+-#include <linux/io.h>
+-#include <linux/irq.h>
+-#include <linux/kernel.h>
+-#include <linux/slab.h>
+-#include <linux/usb/gadget.h>
+ #include <linux/usb/otg.h>
++#include <linux/usb/gadget.h>
+ #include <linux/usb/chipidea.h>
+ 
+ #include "ci.h"
+-#include "udc.h"
+ #include "bits.h"
+-#include "host.h"
+-#include "debug.h"
++
++void ci_clear_otg_interrupt(struct ci13xxx *ci, u32 bits)
++{
++	/* Only clear request bits */
++	hw_write(ci, OP_OTGSC, OTGSC_INT_STATUS_BITS, bits);
++}
++
++void ci_enable_otg_interrupt(struct ci13xxx *ci, u32 bits)
++{
++	hw_write(ci, OP_OTGSC, bits, bits);
++}
++
++void ci_disable_otg_interrupt(struct ci13xxx *ci, u32 bits)
++{
++	hw_write(ci, OP_OTGSC, bits, 0);
++}
+ 
+ static int ci_otg_set_peripheral(struct usb_otg *otg,
+ 		struct usb_gadget *periph)
+@@ -55,6 +62,7 @@ int ci_hdrc_otg_init(struct ci13xxx *ci)
+ 	ci->otg.set_host = ci_otg_set_host;
+ 	if (!IS_ERR_OR_NULL(ci->transceiver))
+ 		ci->transceiver->otg = &ci->otg;
++	ci_enable_otg_interrupt(ci, OTGSC_IDIE);
+ 
+ 	return 0;
+ }
+diff --git a/drivers/usb/chipidea/otg.h b/drivers/usb/chipidea/otg.h
+index b4c6b3e..fa30428 100644
+--- a/drivers/usb/chipidea/otg.h
++++ b/drivers/usb/chipidea/otg.h
+@@ -2,5 +2,8 @@
+ #define __DRIVERS_USB_CHIPIDEA_OTG_H
+ 
+ int ci_hdrc_otg_init(struct ci13xxx *ci);
++void ci_clear_otg_interrupt(struct ci13xxx *ci, u32 bits);
++void ci_enable_otg_interrupt(struct ci13xxx *ci, u32 bits);
++void ci_disable_otg_interrupt(struct ci13xxx *ci, u32 bits);
+ 
+ #endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */
+diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
+index 2b4ff14..b58788a 100644
+--- a/drivers/usb/chipidea/udc.c
++++ b/drivers/usb/chipidea/udc.c
+@@ -31,6 +31,7 @@
+ 
+ #include "ci.h"
+ #include "udc.h"
++#include "otg.h"
+ #include "bits.h"
+ #include "debug.h"
+ 
+@@ -1371,6 +1372,7 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
+ 			pm_runtime_get_sync(&_gadget->dev);
+ 			hw_device_reset(ci, USBMODE_CM_DC);
+ 			hw_device_state(ci, ci->ep0out->qh.dma);
++			dev_dbg(ci->dev, "Connected to host\n");
+ 		} else {
+ 			hw_device_state(ci, 0);
+ 			if (ci->platdata->notify_event)
+@@ -1378,6 +1380,7 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
+ 				CI13XXX_CONTROLLER_STOPPED_EVENT);
+ 			_gadget_stop_activity(&ci->gadget);
+ 			pm_runtime_put_sync(&_gadget->dev);
++			dev_dbg(ci->dev, "Disconnected from host\n");
+ 		}
+ 	}
+ 
+@@ -1741,7 +1744,12 @@ static int udc_start(struct ci13xxx *ci)
+ 	if (!IS_ERR_OR_NULL(ci->transceiver)) {
+ 		retval = otg_set_peripheral(ci->transceiver->otg,
+ 						&ci->gadget);
+-		if (retval)
++		/*
++		 * If we implement all USB functions using chipidea drivers,
++		 * it doesn't need to call above API, meanwhile, if we only
++		 * use gadget function, calling above API is useless.
++		 */
++		if (retval && retval != -ENOTSUPP)
+ 			goto remove_dbg;
+ 	}
+ 
+@@ -1778,12 +1786,27 @@ free_qh_pool:
+ 	return retval;
+ }
+ 
++static int udc_id_switch_for_device(struct ci13xxx *ci)
++{
++	ci_clear_otg_interrupt(ci, OTGSC_BSVIS);
++	ci_enable_otg_interrupt(ci, OTGSC_BSVIE);
++
++	return 0;
++}
++
++static void udc_id_switch_for_host(struct ci13xxx *ci)
++{
++	/* host doesn't care B_SESSION_VALID event */
++	ci_clear_otg_interrupt(ci, OTGSC_BSVIS);
++	ci_disable_otg_interrupt(ci, OTGSC_BSVIE);
++}
++
+ /**
+- * udc_remove: parent remove must call this to remove UDC
++ * ci_hdrc_gadget_destroy: parent remove must call this to remove UDC
+  *
+  * No interrupts active, the IRQ has been released
+  */
+-static void udc_stop(struct ci13xxx *ci)
++void ci_hdrc_gadget_destroy(struct ci13xxx *ci)
+ {
+ 	if (ci == NULL)
+ 		return;
+@@ -1802,15 +1825,13 @@ static void udc_stop(struct ci13xxx *ci)
+ 	}
+ 	dbg_remove_files(ci->dev);
+ 	device_unregister(&ci->gadget.dev);
+-	/* my kobject is dynamic, I swear! */
+-	memset(&ci->gadget, 0, sizeof(ci->gadget));
+ }
+ 
+ /**
+  * ci_hdrc_gadget_init - initialize device related bits
+  * ci: the controller
+  *
+- * This function enables the gadget role, if the device is "device capable".
++ * This function initializes gadget, if the device is "device capable".
+  */
+ int ci_hdrc_gadget_init(struct ci13xxx *ci)
+ {
+@@ -1823,11 +1844,11 @@ int ci_hdrc_gadget_init(struct ci13xxx *ci)
+ 	if (!rdrv)
+ 		return -ENOMEM;
+ 
+-	rdrv->start	= udc_start;
+-	rdrv->stop	= udc_stop;
++	rdrv->start	= udc_id_switch_for_device;
++	rdrv->stop	= udc_id_switch_for_host;
+ 	rdrv->irq	= udc_irq;
+ 	rdrv->name	= "gadget";
+ 	ci->roles[CI_ROLE_GADGET] = rdrv;
+ 
+-	return 0;
++	return udc_start(ci);
+ }
+diff --git a/drivers/usb/chipidea/udc.h b/drivers/usb/chipidea/udc.h
+index 4ff2384d..6553e4d 100644
+--- a/drivers/usb/chipidea/udc.h
++++ b/drivers/usb/chipidea/udc.h
+@@ -80,6 +80,7 @@ struct ci13xxx_req {
+ #ifdef CONFIG_USB_CHIPIDEA_UDC
+ 
+ int ci_hdrc_gadget_init(struct ci13xxx *ci);
++void ci_hdrc_gadget_destroy(struct ci13xxx *ci);
+ 
+ #else
+ 
+@@ -87,7 +88,10 @@ static inline int ci_hdrc_gadget_init(struct ci13xxx *ci)
+ {
+ 	return -ENXIO;
+ }
++static inline void ci_hdrc_gadget_destroy(struct ci13xxx *ci)
++{
+ 
++}
+ #endif
+ 
+ #endif /* __DRIVERS_USB_CHIPIDEA_UDC_H */
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0012-usb-chipidea-udc-add-pullup-pulldown-dp-at-hw_device.patch b/patches/chipidea/0012-usb-chipidea-udc-add-pullup-pulldown-dp-at-hw_device.patch
new file mode 100644
index 0000000000000000000000000000000000000000..5140f560a9e40c45af86ab0edbc6cd18e448e0bb
--- /dev/null
+++ b/patches/chipidea/0012-usb-chipidea-udc-add-pullup-pulldown-dp-at-hw_device.patch
@@ -0,0 +1,52 @@
+From fecb68c5e1754c4e6c34f1087c478e88d315accb Mon Sep 17 00:00:00 2001
+From: Peter Chen <peter.chen@freescale.com>
+Date: Mon, 4 Feb 2013 16:59:47 +0800
+Subject: [PATCH 12/25] usb: chipidea: udc: add pullup/pulldown dp at
+ hw_device_state
+
+- During the connect/disconnect host, we need to pullup
+and pulldown dp
+- Make sure the dp is not pullup until the vbus is on when
+flag CI13XXX_PULLUP_ON_VBUS is set
+- Using hw_device_state when set run/stop bit
+
+Signed-off-by: Peter Chen <peter.chen@freescale.com>
+---
+ drivers/usb/chipidea/udc.c |   10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
+index b58788a..45c0d70 100644
+--- a/drivers/usb/chipidea/udc.c
++++ b/drivers/usb/chipidea/udc.c
+@@ -91,8 +91,10 @@ static int hw_device_state(struct ci13xxx *ci, u32 dma)
+ 		/* interrupt, error, port change, reset, sleep/suspend */
+ 		hw_write(ci, OP_USBINTR, ~0,
+ 			     USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI);
++		hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
+ 	} else {
+ 		hw_write(ci, OP_USBINTR, ~0, 0);
++		hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
+ 	}
+ 	return 0;
+ }
+@@ -1424,10 +1426,14 @@ static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_on)
+ {
+ 	struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget);
+ 
++	if ((ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) &&
++			!ci->vbus_active)
++		return -EPERM;
++
+ 	if (is_on)
+-		hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
++		hw_device_state(ci, ci->ep0out->qh.dma);
+ 	else
+-		hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
++		hw_device_state(ci, 0);
+ 
+ 	return 0;
+ }
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0013-usb-chipidea-udc-retire-the-flag-CI13_PULLUP_ON_VBUS.patch b/patches/chipidea/0013-usb-chipidea-udc-retire-the-flag-CI13_PULLUP_ON_VBUS.patch
new file mode 100644
index 0000000000000000000000000000000000000000..7e4883e23135a3dbc0726b952d2e675d14038b37
--- /dev/null
+++ b/patches/chipidea/0013-usb-chipidea-udc-retire-the-flag-CI13_PULLUP_ON_VBUS.patch
@@ -0,0 +1,115 @@
+From c3b21e9d264c1b7012ee99fefec3fe415135203e Mon Sep 17 00:00:00 2001
+From: Peter Chen <peter.chen@freescale.com>
+Date: Mon, 4 Feb 2013 16:59:48 +0800
+Subject: [PATCH 13/25] usb: chipidea: udc: retire the flag
+ CI13_PULLUP_ON_VBUS
+
+(change CI13XXX to CI13 to avoid junk email check)
+Now, we have handled vbus session in core driver when the
+vbus interrupt occurs, so our pullup operations are all
+according to vbus.
+Of cource, the software can still call .pullup when device connects
+to host if it wants to connect/disconnect with host.
+
+Signed-off-by: Peter Chen <peter.chen@freescale.com>
+---
+ drivers/usb/chipidea/ci13xxx_imx.c |    1 -
+ drivers/usb/chipidea/ci13xxx_msm.c |    1 -
+ drivers/usb/chipidea/udc.c         |   23 ++++++++---------------
+ include/linux/usb/chipidea.h       |    1 -
+ 4 files changed, 8 insertions(+), 18 deletions(-)
+
+diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
+index ffcb56c..dc2453c 100644
+--- a/drivers/usb/chipidea/ci13xxx_imx.c
++++ b/drivers/usb/chipidea/ci13xxx_imx.c
+@@ -109,7 +109,6 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 	pdata->name = "ci13xxx_imx";
+ 	pdata->capoffset = DEF_CAPOFFSET;
+ 	pdata->flags = CI13XXX_REQUIRE_TRANSCEIVER |
+-		       CI13XXX_PULLUP_ON_VBUS |
+ 		       CI13XXX_DISABLE_STREAMING |
+ 		       CI13XXX_REGS_SHARED;
+ 
+diff --git a/drivers/usb/chipidea/ci13xxx_msm.c b/drivers/usb/chipidea/ci13xxx_msm.c
+index 7d16681..5755ee8 100644
+--- a/drivers/usb/chipidea/ci13xxx_msm.c
++++ b/drivers/usb/chipidea/ci13xxx_msm.c
+@@ -49,7 +49,6 @@ static struct ci13xxx_platform_data ci13xxx_msm_platdata = {
+ 	.name			= "ci13xxx_msm",
+ 	.flags			= CI13XXX_REGS_SHARED |
+ 				  CI13XXX_REQUIRE_TRANSCEIVER |
+-				  CI13XXX_PULLUP_ON_VBUS |
+ 				  CI13XXX_DISABLE_STREAMING,
+ 
+ 	.notify_event		= ci13xxx_msm_notify_event,
+diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
+index 45c0d70..1d041f9 100644
+--- a/drivers/usb/chipidea/udc.c
++++ b/drivers/usb/chipidea/udc.c
+@@ -1360,9 +1360,6 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
+ 	unsigned long flags;
+ 	int gadget_ready = 0;
+ 
+-	if (!(ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS))
+-		return -EOPNOTSUPP;
+-
+ 	spin_lock_irqsave(&ci->lock, flags);
+ 	ci->vbus_active = is_active;
+ 	if (ci->driver)
+@@ -1426,8 +1423,7 @@ static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_on)
+ {
+ 	struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget);
+ 
+-	if ((ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) &&
+-			!ci->vbus_active)
++	if (!ci->vbus_active)
+ 		return -EPERM;
+ 
+ 	if (is_on)
+@@ -1551,14 +1547,12 @@ static int ci13xxx_start(struct usb_gadget *gadget,
+ 
+ 	ci->driver = driver;
+ 	pm_runtime_get_sync(&ci->gadget.dev);
+-	if (ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) {
+-		if (ci->vbus_active) {
+-			if (ci->platdata->flags & CI13XXX_REGS_SHARED)
+-				hw_device_reset(ci, USBMODE_CM_DC);
+-		} else {
+-			pm_runtime_put_sync(&ci->gadget.dev);
+-			goto done;
+-		}
++	if (ci->vbus_active) {
++		if (ci->platdata->flags & CI13XXX_REGS_SHARED)
++			hw_device_reset(ci, USBMODE_CM_DC);
++	} else {
++		pm_runtime_put_sync(&ci->gadget.dev);
++		goto done;
+ 	}
+ 
+ 	retval = hw_device_state(ci, ci->ep0out->qh.dma);
+@@ -1581,8 +1575,7 @@ static int ci13xxx_stop(struct usb_gadget *gadget,
+ 
+ 	spin_lock_irqsave(&ci->lock, flags);
+ 
+-	if (!(ci->platdata->flags & CI13XXX_PULLUP_ON_VBUS) ||
+-			ci->vbus_active) {
++	if (ci->vbus_active) {
+ 		hw_device_state(ci, 0);
+ 		if (ci->platdata->notify_event)
+ 			ci->platdata->notify_event(ci,
+diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
+index b314647..d543e4a 100644
+--- a/include/linux/usb/chipidea.h
++++ b/include/linux/usb/chipidea.h
+@@ -18,7 +18,6 @@ struct ci13xxx_platform_data {
+ 	unsigned long	 flags;
+ #define CI13XXX_REGS_SHARED		BIT(0)
+ #define CI13XXX_REQUIRE_TRANSCEIVER	BIT(1)
+-#define CI13XXX_PULLUP_ON_VBUS		BIT(2)
+ #define CI13XXX_DISABLE_STREAMING	BIT(3)
+ 	enum usb_dr_mode	dr_mode;
+ #define CI13XXX_CONTROLLER_RESET_EVENT		0
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0014-usb-chipidea-add-vbus-regulator-control.patch b/patches/chipidea/0014-usb-chipidea-add-vbus-regulator-control.patch
new file mode 100644
index 0000000000000000000000000000000000000000..1792bdb9eb60e8bdb8300c4072bb24c3556bd6d4
--- /dev/null
+++ b/patches/chipidea/0014-usb-chipidea-add-vbus-regulator-control.patch
@@ -0,0 +1,176 @@
+From 89078c306945790f62371fbce4ad5196cd9082a4 Mon Sep 17 00:00:00 2001
+From: Peter Chen <peter.chen@freescale.com>
+Date: Mon, 4 Feb 2013 16:59:49 +0800
+Subject: [PATCH 14/25] usb: chipidea: add vbus regulator control
+
+For boards which have board level vbus control (eg, gpio), we
+need to operation vbus according to below rules:
+- For host, the vbus should always be on.
+- For otg, the vbus needs to be turned on/off when usb role switches.
+
+We put vbus operation to host as host is the only vbus user,
+When we are at host mode, the vbus is on, when we are not at
+host mode, vbus should be off.
+
+Signed-off-by: Peter Chen <peter.chen@freescale.com>
+---
+ drivers/usb/chipidea/ci.h    |    2 ++
+ drivers/usb/chipidea/core.c  |   24 ++++++++----------------
+ drivers/usb/chipidea/host.c  |   23 ++++++++++++++++++++++-
+ include/linux/usb/chipidea.h |    1 +
+ 4 files changed, 33 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
+index a3777a1..8826cdb 100644
+--- a/drivers/usb/chipidea/ci.h
++++ b/drivers/usb/chipidea/ci.h
+@@ -133,6 +133,7 @@ struct hw_bank {
+  * @id_event: indicates there is a id event, and handled at ci_otg_work
+  * @b_sess_valid_event: indicates there is a vbus event, and handled
+  * at ci_otg_work
++ * @reg_vbus: used to control internal vbus regulator
+  */
+ struct ci13xxx {
+ 	struct device			*dev;
+@@ -172,6 +173,7 @@ struct ci13xxx {
+ 	struct usb_otg      		otg;
+ 	bool				id_event;
+ 	bool				b_sess_valid_event;
++	struct regulator		*reg_vbus;
+ };
+ 
+ static inline struct ci_role_driver *ci_role(struct ci13xxx *ci)
+diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
+index a3beafb..55ad379 100644
+--- a/drivers/usb/chipidea/core.c
++++ b/drivers/usb/chipidea/core.c
+@@ -63,6 +63,7 @@
+ #include <linux/kernel.h>
+ #include <linux/slab.h>
+ #include <linux/pm_runtime.h>
++#include <linux/regulator/consumer.h>
+ #include <linux/usb/ch9.h>
+ #include <linux/usb/gadget.h>
+ #include <linux/usb/otg.h>
+@@ -364,17 +365,10 @@ static void ci_handle_id_switch(struct ci13xxx *ci)
+ 		hw_device_reset(ci, USBMODE_CM_IDLE);
+ 
+ 		/* 2. Turn on/off vbus according to coming role */
+-		if (role == CI_ROLE_GADGET) {
+-			otg_set_vbus(&ci->otg, false);
++		if (role == CI_ROLE_GADGET)
+ 			/* wait vbus lower than OTGSC_BSV */
+ 			hw_wait_reg(ci, OP_OTGSC, OTGSC_BSV, 0,
+ 					CI_VBUS_STABLE_TIMEOUT);
+-		} else if (role == CI_ROLE_HOST) {
+-			otg_set_vbus(&ci->otg, true);
+-			/* wait vbus higher than OTGSC_AVV */
+-			hw_wait_reg(ci, OP_OTGSC, OTGSC_AVV, OTGSC_AVV,
+-					CI_VBUS_STABLE_TIMEOUT);
+-		}
+ 
+ 		/* 3. Begin the new role */
+ 		ci_role_start(ci, role);
+@@ -416,17 +410,14 @@ static void ci_delayed_work(struct work_struct *work)
+ 	struct delayed_work *dwork = to_delayed_work(work);
+ 	struct ci13xxx *ci = container_of(dwork, struct ci13xxx, dwork);
+ 
++	/*
++	 * If it is gadget mode, the vbus operation should be done like below:
++	 * 1. Enable vbus detect
++	 * 2. If it has already connected to host, notify udc
++	 */
+ 	if (ci->role == CI_ROLE_GADGET) {
+-		/*
+-		 * if it is device mode:
+-		 * - Enable vbus detect
+-		 * - If it has already connected to host, notify udc
+-		 */
+ 		ci_enable_otg_interrupt(ci, OTGSC_BSVIE);
+ 		ci_handle_vbus_change(ci);
+-	} else if (ci->is_otg && (ci->role == CI_ROLE_HOST)) {
+-		/* USB Device at the MicroB to A cable */
+-		otg_set_vbus(&ci->otg, true);
+ 	}
+ }
+ 
+@@ -603,6 +594,7 @@ static int ci_hdrc_probe(struct platform_device *pdev)
+ 
+ 	ci->dev = dev;
+ 	ci->platdata = dev->platform_data;
++	ci->reg_vbus = ci->platdata->reg_vbus;
+ 	if (ci->platdata->phy)
+ 		ci->transceiver = ci->platdata->phy;
+ 	else
+diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
+index ead3158..8efbd44 100644
+--- a/drivers/usb/chipidea/host.c
++++ b/drivers/usb/chipidea/host.c
+@@ -21,6 +21,7 @@
+ 
+ #include <linux/kernel.h>
+ #include <linux/io.h>
++#include <linux/regulator/consumer.h>
+ #include <linux/usb.h>
+ #include <linux/usb/hcd.h>
+ #include <linux/usb/chipidea.h>
+@@ -64,9 +65,19 @@ static int host_start(struct ci13xxx *ci)
+ 	ehci->caps = ci->hw_bank.cap;
+ 	ehci->has_hostpc = ci->hw_bank.lpm;
+ 
++	if (ci->reg_vbus) {
++		ret = regulator_enable(ci->reg_vbus);
++		if (ret) {
++			dev_err(ci->dev,
++				"Failed to enable vbus regulator, ret=%d\n",
++				ret);
++			goto put_hcd;
++		}
++	}
++
+ 	ret = usb_add_hcd(hcd, 0, 0);
+ 	if (ret)
+-		usb_put_hcd(hcd);
++		goto disable_reg;
+ 	else
+ 		ci->hcd = hcd;
+ 
+@@ -74,6 +85,14 @@ static int host_start(struct ci13xxx *ci)
+ 		hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS);
+ 
+ 	return ret;
++
++disable_reg:
++	if (ci->reg_vbus)
++		regulator_disable(ci->reg_vbus);
++put_hcd:
++	usb_put_hcd(hcd);
++
++	return ret;
+ }
+ 
+ static void host_stop(struct ci13xxx *ci)
+@@ -82,6 +101,8 @@ static void host_stop(struct ci13xxx *ci)
+ 
+ 	usb_remove_hcd(hcd);
+ 	usb_put_hcd(hcd);
++	if (ci->reg_vbus)
++		regulator_disable(ci->reg_vbus);
+ }
+ 
+ int ci_hdrc_host_init(struct ci13xxx *ci)
+diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
+index d543e4a..1430403 100644
+--- a/include/linux/usb/chipidea.h
++++ b/include/linux/usb/chipidea.h
+@@ -23,6 +23,7 @@ struct ci13xxx_platform_data {
+ #define CI13XXX_CONTROLLER_RESET_EVENT		0
+ #define CI13XXX_CONTROLLER_STOPPED_EVENT	1
+ 	void	(*notify_event) (struct ci13xxx *ci, unsigned event);
++	struct regulator *reg_vbus;
+ };
+ 
+ /* Default offset of capability registers */
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0015-usb-chipidea-delete-the-delayed-work.patch b/patches/chipidea/0015-usb-chipidea-delete-the-delayed-work.patch
new file mode 100644
index 0000000000000000000000000000000000000000..a86623c6771cceec561c5651aff1f7805d3bd13d
--- /dev/null
+++ b/patches/chipidea/0015-usb-chipidea-delete-the-delayed-work.patch
@@ -0,0 +1,77 @@
+From a213e3077237f7f2a1a910aead1f6d4ee447b3d7 Mon Sep 17 00:00:00 2001
+From: Peter Chen <peter.chen@freescale.com>
+Date: Wed, 6 Mar 2013 17:24:32 +0800
+Subject: [PATCH 15/25] usb: chipidea: delete the delayed work
+
+After moving vbus operation to host, we no matter need to delayed operation.
+But, the connection notification to gadget is needed as gadget's start
+is only enable vbus operation, but it doesn't need to delayed.
+
+Signed-off-by: Peter Chen <peter.chen@freescale.com>
+---
+ drivers/usb/chipidea/ci.h   |    1 -
+ drivers/usb/chipidea/core.c |   22 +++-------------------
+ 2 files changed, 3 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
+index 8826cdb..35ca5ee 100644
+--- a/drivers/usb/chipidea/ci.h
++++ b/drivers/usb/chipidea/ci.h
+@@ -144,7 +144,6 @@ struct ci13xxx {
+ 	enum ci_role			role;
+ 	bool				is_otg;
+ 	struct work_struct		work;
+-	struct delayed_work		dwork;
+ 	struct workqueue_struct		*wq;
+ 
+ 	struct dma_pool			*qh_pool;
+diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
+index 55ad379..0eae14f 100644
+--- a/drivers/usb/chipidea/core.c
++++ b/drivers/usb/chipidea/core.c
+@@ -405,22 +405,6 @@ static void ci_otg_work(struct work_struct *work)
+ 	enable_irq(ci->irq);
+ }
+ 
+-static void ci_delayed_work(struct work_struct *work)
+-{
+-	struct delayed_work *dwork = to_delayed_work(work);
+-	struct ci13xxx *ci = container_of(dwork, struct ci13xxx, dwork);
+-
+-	/*
+-	 * If it is gadget mode, the vbus operation should be done like below:
+-	 * 1. Enable vbus detect
+-	 * 2. If it has already connected to host, notify udc
+-	 */
+-	if (ci->role == CI_ROLE_GADGET) {
+-		ci_enable_otg_interrupt(ci, OTGSC_BSVIE);
+-		ci_handle_vbus_change(ci);
+-	}
+-}
+-
+ static inline void ci_role_destroy(struct ci13xxx *ci)
+ {
+ 	ci_hdrc_gadget_destroy(ci);
+@@ -615,7 +599,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
+ 	}
+ 
+ 	INIT_WORK(&ci->work, ci_otg_work);
+-	INIT_DELAYED_WORK(&ci->dwork, ci_delayed_work);
+ 	ci->wq = create_singlethread_workqueue("ci_otg");
+ 	if (!ci->wq) {
+ 		dev_err(dev, "can't create workqueue\n");
+@@ -678,8 +661,9 @@ static int ci_hdrc_probe(struct platform_device *pdev)
+ 	if (ret)
+ 		goto free_irq;
+ 
+-	/* Defer some operations */
+-	queue_delayed_work(ci->wq, &ci->dwork, msecs_to_jiffies(200));
++	/* If it is connected to host, tell gadget the connection */
++	if (ci->role == CI_ROLE_GADGET)
++		ci_handle_vbus_change(ci);
+ 
+ 	return ret;
+ 
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0016-usb-chipidea-imx-add-getting-vbus-regulator-code.patch b/patches/chipidea/0016-usb-chipidea-imx-add-getting-vbus-regulator-code.patch
new file mode 100644
index 0000000000000000000000000000000000000000..38564d495ea5783d22b608b458bb671f51759543
--- /dev/null
+++ b/patches/chipidea/0016-usb-chipidea-imx-add-getting-vbus-regulator-code.patch
@@ -0,0 +1,95 @@
+From f8487e8ce26cc1b4a83848fc0d881aebff587385 Mon Sep 17 00:00:00 2001
+From: Peter Chen <peter.chen@freescale.com>
+Date: Fri, 1 Mar 2013 17:48:30 +0800
+Subject: [PATCH 16/25] usb: chipidea: imx: add getting vbus regulator code
+
+Signed-off-by: Peter Chen <peter.chen@freescale.com>
+---
+ drivers/usb/chipidea/ci13xxx_imx.c |   28 +++++-----------------------
+ 1 file changed, 5 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
+index dc2453c..ebed129 100644
+--- a/drivers/usb/chipidea/ci13xxx_imx.c
++++ b/drivers/usb/chipidea/ci13xxx_imx.c
+@@ -33,7 +33,6 @@ struct ci13xxx_imx_data {
+ 	struct usb_phy *phy;
+ 	struct platform_device *ci_pdev;
+ 	struct clk *clk;
+-	struct regulator *reg_vbus;
+ };
+ 
+ static const struct usbmisc_ops *usbmisc_ops;
+@@ -163,20 +162,9 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 		data->phy = phy;
+ 	}
+ 
+-	/* we only support host now, so enable vbus here */
+ 	reg_vbus = devm_regulator_get(&pdev->dev, "vbus");
+-	if (!IS_ERR(reg_vbus)) {
+-		ret = regulator_enable(reg_vbus);
+-		if (ret) {
+-			dev_err(&pdev->dev,
+-				"Failed to enable vbus regulator, err=%d\n",
+-				ret);
+-			goto err_clk;
+-		}
+-		data->reg_vbus = reg_vbus;
+-	} else {
+-		reg_vbus = NULL;
+-	}
++	if (!IS_ERR(reg_vbus))
++		pdata->reg_vbus = reg_vbus;
+ 
+ 	pdata->phy = data->phy;
+ 
+@@ -186,7 +174,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 		if (!pdev->dev.dma_mask) {
+ 			ret = -ENOMEM;
+ 			dev_err(&pdev->dev, "Failed to alloc dma_mask!\n");
+-			goto err;
++			goto err_clk;
+ 		}
+ 		*pdev->dev.dma_mask = DMA_BIT_MASK(32);
+ 		dma_set_coherent_mask(&pdev->dev, *pdev->dev.dma_mask);
+@@ -197,7 +185,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 		if (ret) {
+ 			dev_err(&pdev->dev,
+ 				"usbmisc init failed, ret=%d\n", ret);
+-			goto err;
++			goto err_clk;
+ 		}
+ 	}
+ 
+@@ -209,7 +197,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 		dev_err(&pdev->dev,
+ 			"Can't register ci_hdrc platform device, err=%d\n",
+ 			ret);
+-		goto err;
++		goto err_clk;
+ 	}
+ 
+ 	data->ci_pdev = plat_ci;
+@@ -220,9 +208,6 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 
+ 	return 0;
+ 
+-err:
+-	if (reg_vbus)
+-		regulator_disable(reg_vbus);
+ err_clk:
+ 	clk_disable_unprepare(data->clk);
+ 	return ret;
+@@ -235,9 +220,6 @@ static int ci13xxx_imx_remove(struct platform_device *pdev)
+ 	pm_runtime_disable(&pdev->dev);
+ 	ci13xxx_remove_device(data->ci_pdev);
+ 
+-	if (data->reg_vbus)
+-		regulator_disable(data->reg_vbus);
+-
+ 	if (data->phy) {
+ 		usb_phy_shutdown(data->phy);
+ 		module_put(data->phy->dev->driver->owner);
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0017-usb-chipidea-udc-fix-the-oops-when-plugs-in-usb-cabl.patch b/patches/chipidea/0017-usb-chipidea-udc-fix-the-oops-when-plugs-in-usb-cabl.patch
new file mode 100644
index 0000000000000000000000000000000000000000..97848c3b62a9e830701e11cacca1a8ed9387801a
--- /dev/null
+++ b/patches/chipidea/0017-usb-chipidea-udc-fix-the-oops-when-plugs-in-usb-cabl.patch
@@ -0,0 +1,191 @@
+From 906b5601215147eed7cc685bab4e4824e682d3bc Mon Sep 17 00:00:00 2001
+From: Peter Chen <peter.chen@freescale.com>
+Date: Mon, 4 Feb 2013 16:59:50 +0800
+Subject: [PATCH 17/25] usb: chipidea: udc: fix the oops when plugs in usb
+ cable after rmmod gadget
+
+When we rmmod gadget, the ci->driver needs to be cleared.
+Otherwise, we plug in usb cable again, the driver will
+consider gadget is there, in fact, it is removed.
+
+Besides, consolidate the calling of ci->driver->disconnect, when
+we do rmmod gadget, the gadget's disconnect should be called from
+udc core.
+
+Below is the oops this patch fixes.
+
+root@freescale ~$ ci_hdrc ci_hdrc.0: Connected to host
+Unable to handle kernel paging request at virtual address 7f01171c
+pgd = 80004000
+[7f01171c] *pgd=4fa1e811, *pte=00000000, *ppte=00000000
+Internal error: Oops: 7 [#1] SMP ARM
+Modules linked in: f_acm libcomposite u_serial [last unloaded: g_serial]
+CPU: 0    Not tainted  (3.8.0-rc5+ #221)
+	PC is at _gadget_stop_activity+0xbc/0x128
+	LR is at ep_fifo_flush+0x68/0xa0
+	pc : [<803634cc>]    lr : [<80363938>]    psr: 20000193
+	sp : 806c7dc8  ip : 00000000  fp : 806c7de4
+	r10: 00000000  r9 : 80710ea4  r8 : 00000000
+	r7 : bf834094  r6 : bf834098  r5 : bf834010  r4 : bf8340a0
+	r3 : 7f011708  r2 : 01940194  r1 : a0000193  r0 : bf834014
+	Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
+	Control: 10c53c7d  Table: 4f06404a  DAC: 00000017
+	Process swapper/0 (pid: 0, stack limit = 0x806c6238)
+	Stack: (0x806c7dc8 to 0x806c8000)
+	7dc0:                   bf834010 bf809950 bf834010 0000004b 806c7e44 806c7de8
+	7de0: 80365400 8036341c 0000ec1c 00000000 0000ec1c 00000040 fff5ede0 bf834014
+	7e00: 000a1220 00000000 0000002e ffffd958 806c7e3c 806c7e20 8004e870 bf834010
+	7e20: bf809950 0000004b 0000004b 00000000 80710ea4 00000000 806c7e5c 806c7e48
+	7e40: 80362888 80365154 bfb35180 bf809950 806c7e9c 806c7e60 8008111c 803627f4
+	7e60: 00989680 00000000 bf809900 bf809964 812df8c0 bf809900 bf809950 806c3f2c
+	7e80: 0000004b 00000000 412fc09a 00000000 806c7eb4 806c7ea0 80081368 800810b8
+	7ea0: bf809900 bf809950 806c7ecc 806c7eb8 800843c8 8008130c 0000004b 806cf748
+	7ec0: 806c7ee4 806c7ed0 80081088 8008432c 806c6000 806cf748 806c7f0c 806c7ee8
+	7ee0: 8000fa44 8008105c f400010c 806ce974 806c7f30 f4000110 806d29e8 412fc09a
+	7f00: 806c7f2c 806c7f10 80008584 8000f9f4 8000fbd0 60000013 ffffffff 806c7f64
+	7f20: 806c7f84 806c7f30 8000eac0 80008554 00000000 00000000 0000000f 8001aea0
+	7f40: 806c6000 80712a48 804f0040 00000000 806d29e8 412fc09a 00000000 806c7f84
+	7f60: 806c7f88 806c7f78 8000fbcc 8000fbd0 60000013 ffffffff 806c7fac 806c7f88
+	7f80: 8001015c 8000fb9c 806cf5b0 80712980 806a4528 8fffffff 1000406a 412fc09a
+	7fa0: 806c7fbc 806c7fb0 804e5334 800100ac 806c7ff4 806c7fc0 80668940 804e52d4
+	7fc0: ffffffff ffffffff 806684bc 00000000 00000000 806a4528 10c53c7d 806ce94c
+	7fe0: 806a4524 806d29dc 00000000 806c7ff8 10008078 806686b0 00000000 00000000
+	Backtrace:
+	[<80363410>] (_gadget_stop_activity+0x0/0x128) from [<80365400>] (udc_irq+0x2b8/0xf38)
+	 r7:0000004b r6:bf834010 r5:bf809950 r4:bf834010
+	 [<80365148>] (udc_irq+0x0/0xf38) from [<80362888>] (ci_irq+0xa0/0xf4)
+	[<803627e8>] (ci_irq+0x0/0xf4) from [<8008111c>] (handle_irq_event_percpu+0x70/0x254)
+	 r5:bf809950 r4:bfb35180
+	 [<800810ac>] (handle_irq_event_percpu+0x0/0x254) from [<80081368>] (handle_irq_event+0x68/0x88)
+	[<80081300>] (handle_irq_event+0x0/0x88) from [<800843c8>] (handle_fasteoi_irq+0xa8/0x178)
+	 r5:bf809950 r4:bf809900
+	 [<80084320>] (handle_fasteoi_irq+0x0/0x178) from [<80081088>] (generic_handle_irq+0x38/0x40)
+	 r5:806cf748 r4:0000004b
+	 [<80081050>] (generic_handle_irq+0x0/0x40) from [<8000fa44>] (handle_IRQ+0x5c/0xbc)
+	 r5:806cf748 r4:806c6000
+	 [<8000f9e8>] (handle_IRQ+0x0/0xbc) from [<80008584>] (gic_handle_irq+0x3c/0x70)
+	 r9:412fc09a r8:806d29e8 r7:f4000110 r6:806c7f30 r5:806ce974
+	 r4:f400010c
+	 [<80008548>] (gic_handle_irq+0x0/0x70) from [<8000eac0>] (__irq_svc+0x40/0x54)
+	Exception stack(0x806c7f30 to 0x806c7f78)
+	7f20:                                     00000000 00000000 0000000f 8001aea0
+	7f40: 806c6000 80712a48 804f0040 00000000 806d29e8 412fc09a 00000000 806c7f84
+	7f60: 806c7f88 806c7f78 8000fbcc 8000fbd0 60000013 ffffffff
+	 r7:806c7f64 r6:ffffffff r5:60000013 r4:8000fbd0
+	 [<8000fb90>] (default_idle+0x0/0x4c) from [<8001015c>] (cpu_idle+0xbc/0xf8)
+	[<800100a0>] (cpu_idle+0x0/0xf8) from [<804e5334>] (rest_init+0x6c/0x84)
+	 r9:412fc09a r8:1000406a r7:8fffffff r6:806a4528 r5:80712980
+	 r4:806cf5b0
+	 [<804e52c8>] (rest_init+0x0/0x84) from [<80668940>] (start_kernel+0x29c/0x2ec)
+	[<806686a4>] (start_kernel+0x0/0x2ec) from [<10008078>] (0x10008078)
+	Code: e12fff33 e5953200 e3530000 0a000002 (e5933014)
+	---[ end trace aade28ad434062bd ]---
+	Kernel panic - not syncing: 0xbf8bdfa8)
+	df60: 00000000 00000000 0000000f 8001aea0 bf8bc000 80712a48 804f0040 00000000
+	df80: 806d29e8 412fc09a 00000000 bf8bdfb4 bf8bdfb8 bf8bdfa8 8000fbcc 8000fbd0
+	dfa0: 60000013 ffffffff
+	 r7:bf8bdf94 r6:ffffffff r5:60000013 r4:8000fbd0
+	 [<8000fb90>] (default_idle+0x0/0x4c) from [<8001015c>] (cpu_idle+0xbc/0xf8)
+	[<800100a0>] (cpu_idle+0x0/0xf8) from [<804e7930>] (secondary_start_kernel+0x120/0x148)
+	 r9:412fc09a r8:1000406a r7:80712d20 r6:10c03c7d r5:00000002
+	 r4:806e2008
+	 [<804e7810>] (secondary_start_kernel+0x0/0x148) from [<104e7148>] (0x104e7148)
+	 r5:0000001f r4:4f8a806a
+	 CPU3: stopping
+	 Backtrace:
+	 [<800132e8>] (dump_backtrace+0x0/0x114) from [<804ea684>] (dump_stack+0x20/0x24)
+	 r7:00000000 r6:806c3f2c r5:806cf748 r4:80712d18
+	 [<804ea664>] (dump_stack+0x0/0x24) from [<80014adc>] (handle_IPI+0x140/0x18c)
+	[<8001499c>] (handle_IPI+0x0/0x18c) from [<800085b0>] (gic_handle_irq+0x68/0x70)
+	 r9:412fc09a r8:806d29e8 r7:f4000110 r6:bf8bff60 r5:806ce974
+	 r4:f400010c
+	 [<80008548>] (gic_handle_irq+0x0/0x70) from [<8000eac0>] (__irq_svc+0x40/0x54)
+	Exception stack(0xbf8bff60 to 0xbf8bffa8)
+	ff60: 00000000 00000000 0000000f 8001aea0 bf8be000 80712a48 804f0040 00000000
+	ff80: 806d29e8 412fc09a 00000000 bf8bffb4 bf8bffb8 bf8bffa8 8000fbcc 8000fbd0
+	ffa0: 60000013 ffffffff
+	 r7:bf8bff94 r6:ffffffff r5:60000013 r4:8000fbd0
+	 [<8000fb90>] (default_idle+0x0/0x4c) from [<8001015c>] (cpu_idle+0xbc/0xf8)
+	[<800100a0>] (cpu_idle+0x0/0xf8) from [<804e7930>] (secondary_start_kernel+0x120/0x148)
+	 r9:412fc09a r8:1000406a r7:80712d20 r6:10c03c7d r5:00000003
+	 r4:806e2008
+	 [<804e7810>] (secondary_start_kernel+0x0/0x148) from [<104e7148>] (0x104e7148)
+	 r5:0000001f r4:4f8a806a
+	 CPU1: stopping
+	 Backtrace:
+	 [<800132e8>] (dump_backtrace+0x0/0x114) from [<804ea684>] (dump_stack+0x20/0x24)
+	 r7:00000000 r6:806c3f2c r5:806cf748 r4:80712d18
+	 [<804ea664>] (dump_stack+0x0/0x24) from [<80014adc>] (handle_IPI+0x140/0x18c)
+	[<8001499c>] (handle_IPI+0x0/0x18c) from [<800085b0>] (gic_handle_irq+0x68/0x70)
+	 r9:412fc09a r8:806d29e8 r7:f4000110 r6:bf8bbf60 r5:806ce974
+	 r4:f400010c
+	 [<80008548>] (gic_handle_irq+0x0/0x70) from [<8000eac0>] (__irq_svc+0x40/0x54)
+	Exception stack(0xbf8bbf60 to 0xbf8bbfa8)
+	bf60: 00000000 00000000 0000000f 8001aea0 bf8ba000 80712a48 804f0040 00000000
+	bf80: 806d29e8 412fc09a 00000000 bf8bbfb4 bf8bbfb8 bf8bbfa8 8000fbcc 8000fbd0
+	bfa0: 60000013 ffffffff
+	 r7:bf8bbf94 r6:ffffffff r5:60000013 r4:8000fbd0
+	 [<8000fb90>] (default_idle+0x0/0x4c) from [<8001015c>] (cpu_idle+0xbc/0xf8)
+	[<800100a0>] (cpu_idle+0x0/0xf8) from [<804e7930>] (secondary_start_kernel+0x120/0x148)
+	 r9:412fc09a r8:1000406a r7:80712d20 r6:10c03c7d r5:00000001
+	 r4:806e2008
+
+Signed-off-by: Peter Chen <peter.chen@freescale.com>
+---
+ drivers/usb/chipidea/udc.c |   13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
+index 1d041f9..98179ae 100644
+--- a/drivers/usb/chipidea/udc.c
++++ b/drivers/usb/chipidea/udc.c
+@@ -579,9 +579,6 @@ static int _gadget_stop_activity(struct usb_gadget *gadget)
+ 	usb_ep_fifo_flush(&ci->ep0out->ep);
+ 	usb_ep_fifo_flush(&ci->ep0in->ep);
+ 
+-	if (ci->driver)
+-		ci->driver->disconnect(gadget);
+-
+ 	/* make sure to disable all endpoints */
+ 	gadget_for_each_ep(ep, gadget) {
+ 		usb_ep_disable(ep);
+@@ -612,6 +609,11 @@ __acquires(ci->lock)
+ 
+ 	dbg_event(0xFF, "BUS RST", 0);
+ 
++	if (ci->gadget.speed != USB_SPEED_UNKNOWN) {
++		if (ci->driver)
++			ci->driver->disconnect(&ci->gadget);
++	}
++
+ 	spin_unlock(&ci->lock);
+ 	retval = _gadget_stop_activity(&ci->gadget);
+ 	if (retval)
+@@ -1373,6 +1375,8 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active)
+ 			hw_device_state(ci, ci->ep0out->qh.dma);
+ 			dev_dbg(ci->dev, "Connected to host\n");
+ 		} else {
++			if (ci->driver)
++				ci->driver->disconnect(&ci->gadget);
+ 			hw_device_state(ci, 0);
+ 			if (ci->platdata->notify_event)
+ 				ci->platdata->notify_event(ci,
+@@ -1580,13 +1584,14 @@ static int ci13xxx_stop(struct usb_gadget *gadget,
+ 		if (ci->platdata->notify_event)
+ 			ci->platdata->notify_event(ci,
+ 			CI13XXX_CONTROLLER_STOPPED_EVENT);
+-		ci->driver = NULL;
+ 		spin_unlock_irqrestore(&ci->lock, flags);
+ 		_gadget_stop_activity(&ci->gadget);
+ 		spin_lock_irqsave(&ci->lock, flags);
+ 		pm_runtime_put(&ci->gadget.dev);
+ 	}
+ 
++	ci->driver = NULL;
++
+ 	spin_unlock_irqrestore(&ci->lock, flags);
+ 
+ 	return 0;
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0018-usb-chipidea-imx-select-usb-id-pin-using-syscon-inte.patch b/patches/chipidea/0018-usb-chipidea-imx-select-usb-id-pin-using-syscon-inte.patch
new file mode 100644
index 0000000000000000000000000000000000000000..e01ff143ccc3fe4c06c450056dde07e00134ec49
--- /dev/null
+++ b/patches/chipidea/0018-usb-chipidea-imx-select-usb-id-pin-using-syscon-inte.patch
@@ -0,0 +1,104 @@
+From d1d2e97c645805d303fd4bcac3898b80000337da Mon Sep 17 00:00:00 2001
+From: Peter Chen <peter.chen@freescale.com>
+Date: Fri, 2 Nov 2012 13:51:24 +0800
+Subject: [PATCH 18/25] usb: chipidea: imx: select usb id pin using syscon
+ interface
+
+otg_id_pin_select_change is set, we need to select usb id pin.
+
+Signed-off-by: Peter Chen <peter.chen@freescale.com>
+---
+ .../devicetree/bindings/usb/ci13xxx-imx.txt        |    6 +++++
+ arch/arm/boot/dts/imx6q-sabrelite.dts              |    1 +
+ drivers/usb/chipidea/ci13xxx_imx.c                 |   28 ++++++++++++++++++++
+ 3 files changed, 35 insertions(+)
+
+diff --git a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
+index 493a414..22b4805 100644
+--- a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
++++ b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
+@@ -17,6 +17,11 @@ Optional properties:
+   that indicate usb controller index
+ - vbus-supply: regulator for vbus
+ - disable-over-current: disable over current detect
++- otg_id_pin_select_change: for platforms who have otg_id_pin selection
++(Currently, only imx6 has this selection), and need to change
++default value, please add this flag. Below is the pin selection for imx6q:
++	- ENET_RX_ER: 0  (defalt)
++	- GPIO_1: 1
+ 
+ Examples:
+ usb@02184000 { /* USB OTG */
+@@ -26,4 +31,5 @@ usb@02184000 { /* USB OTG */
+ 	fsl,usbphy = <&usbphy1>;
+ 	fsl,usbmisc = <&usbmisc 0>;
+ 	disable-over-current;
++	otg_id_pin_select_change;
+ };
+diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
+index 816428b..7da2a13 100644
+--- a/arch/arm/boot/dts/imx6q-sabrelite.dts
++++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
+@@ -113,6 +113,7 @@
+ 	pinctrl-names = "default";
+ 	pinctrl-0 = <&pinctrl_usbotg_1>;
+ 	disable-over-current;
++	otg_id_pin_select_change;
+ 	status = "okay";
+ };
+ 
+diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
+index ebed129..5a2b196 100644
+--- a/drivers/usb/chipidea/ci13xxx_imx.c
++++ b/drivers/usb/chipidea/ci13xxx_imx.c
+@@ -22,12 +22,16 @@
+ #include <linux/regulator/consumer.h>
+ #include <linux/pinctrl/consumer.h>
+ #include <linux/usb/of.h>
++#include <linux/regmap.h>
++#include <linux/mfd/syscon.h>
+ 
+ #include "ci.h"
+ #include "ci13xxx_imx.h"
+ 
+ #define pdev_to_phy(pdev) \
+ 	((struct usb_phy *)platform_get_drvdata(pdev))
++#define IOMUXC_IOMUXC_GPR1			0x00000004
++#define USB_OTG_ID_SEL_BIT			(1<<13)
+ 
+ struct ci13xxx_imx_data {
+ 	struct usb_phy *phy;
+@@ -189,6 +193,30 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 		}
+ 	}
+ 
++#if IS_ENABLED(CONFIG_MFD_SYSCON)
++	/* Any imx6 user who needs to change id select pin, do below */
++	if (of_find_property(pdev->dev.of_node,
++				"otg_id_pin_select_change", NULL)) {
++		struct regmap *iomuxc_gpr;
++		u32 gpr1 = 0;
++
++		iomuxc_gpr = syscon_regmap_lookup_by_compatible
++			("fsl,imx6q-iomuxc-gpr");
++		if (!IS_ERR(iomuxc_gpr)) {
++			/* Select USB ID pin at iomuxc grp1 */
++			regmap_read(iomuxc_gpr, IOMUXC_IOMUXC_GPR1, &gpr1);
++			regmap_write(iomuxc_gpr, IOMUXC_IOMUXC_GPR1,
++					gpr1 | USB_OTG_ID_SEL_BIT);
++		} else {
++			ret = PTR_ERR(iomuxc_gpr);
++			dev_err(&pdev->dev,
++				"failed to find imx6q-iomuxc-gpr regmap:%d\n",
++				ret);
++			goto err_clk;
++		}
++	}
++#endif
++
+ 	plat_ci = ci13xxx_add_device(&pdev->dev,
+ 				pdev->resource, pdev->num_resources,
+ 				pdata);
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0019-usb-chipidea-usbmisc-rename-file-struct-and-function.patch b/patches/chipidea/0019-usb-chipidea-usbmisc-rename-file-struct-and-function.patch
new file mode 100644
index 0000000000000000000000000000000000000000..08490d0828cee6daf76c9627e5c60add3e6c9da3
--- /dev/null
+++ b/patches/chipidea/0019-usb-chipidea-usbmisc-rename-file-struct-and-function.patch
@@ -0,0 +1,371 @@
+From 6e71148bef5e5aed2adb0ecc46dc6ccece99768d Mon Sep 17 00:00:00 2001
+From: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Date: Tue, 27 Nov 2012 17:16:56 +0100
+Subject: [PATCH 19/25] usb: chipidea: usbmisc: rename file, struct and
+ functions to usbmisc_imx
+
+This driver will be used for every Freescale SoC which has this misc
+memory layout to control the basic usb handling. So better name this
+driver, function and struct names in a more generic way.
+
+Reported-by: Fabio Estevam <festevam@gmail.com>
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ drivers/usb/chipidea/Makefile        |    2 +-
+ drivers/usb/chipidea/usbmisc_imx.c   |  162 ++++++++++++++++++++++++++++++++++
+ drivers/usb/chipidea/usbmisc_imx6q.c |  162 ----------------------------------
+ 3 files changed, 163 insertions(+), 163 deletions(-)
+ create mode 100644 drivers/usb/chipidea/usbmisc_imx.c
+ delete mode 100644 drivers/usb/chipidea/usbmisc_imx6q.c
+
+diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile
+index 11f513c..146ecd7 100644
+--- a/drivers/usb/chipidea/Makefile
++++ b/drivers/usb/chipidea/Makefile
+@@ -17,5 +17,5 @@ ifneq ($(CONFIG_PCI),)
+ endif
+ 
+ ifneq ($(CONFIG_OF_DEVICE),)
+-	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_imx.o usbmisc_imx6q.o
++	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_imx.o usbmisc_imx.o
+ endif
+diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
+new file mode 100644
+index 0000000..efeb983
+--- /dev/null
++++ b/drivers/usb/chipidea/usbmisc_imx.c
+@@ -0,0 +1,162 @@
++/*
++ * Copyright 2012 Freescale Semiconductor, Inc.
++ *
++ * The code contained herein is licensed under the GNU General Public
++ * License. You may obtain a copy of the GNU General Public License
++ * Version 2 or later at the following locations:
++ *
++ * http://www.opensource.org/licenses/gpl-license.html
++ * http://www.gnu.org/copyleft/gpl.html
++ */
++
++#include <linux/module.h>
++#include <linux/of_platform.h>
++#include <linux/clk.h>
++#include <linux/err.h>
++#include <linux/io.h>
++
++#include "ci13xxx_imx.h"
++
++#define USB_DEV_MAX 4
++
++#define BM_OVER_CUR_DIS		BIT(7)
++
++struct imx_usbmisc {
++	void __iomem *base;
++	spinlock_t lock;
++	struct clk *clk;
++	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
++};
++
++static struct imx_usbmisc *usbmisc;
++
++static struct usbmisc_usb_device *get_usbdev(struct device *dev)
++{
++	int i, ret;
++
++	for (i = 0; i < USB_DEV_MAX; i++) {
++		if (usbmisc->usbdev[i].dev == dev)
++			return &usbmisc->usbdev[i];
++		else if (!usbmisc->usbdev[i].dev)
++			break;
++	}
++
++	if (i >= USB_DEV_MAX)
++		return ERR_PTR(-EBUSY);
++
++	ret = usbmisc_get_init_data(dev, &usbmisc->usbdev[i]);
++	if (ret)
++		return ERR_PTR(ret);
++
++	return &usbmisc->usbdev[i];
++}
++
++static int usbmisc_imx6q_init(struct device *dev)
++{
++
++	struct usbmisc_usb_device *usbdev;
++	unsigned long flags;
++	u32 reg;
++
++	usbdev = get_usbdev(dev);
++	if (IS_ERR(usbdev))
++		return PTR_ERR(usbdev);
++
++	if (usbdev->disable_oc) {
++		spin_lock_irqsave(&usbmisc->lock, flags);
++		reg = readl(usbmisc->base + usbdev->index * 4);
++		writel(reg | BM_OVER_CUR_DIS,
++			usbmisc->base + usbdev->index * 4);
++		spin_unlock_irqrestore(&usbmisc->lock, flags);
++	}
++
++	return 0;
++}
++
++static const struct usbmisc_ops imx6q_usbmisc_ops = {
++	.init = usbmisc_imx6q_init,
++};
++
++static const struct of_device_id usbmisc_imx_dt_ids[] = {
++	{ .compatible = "fsl,imx6q-usbmisc"},
++	{ /* sentinel */ }
++};
++
++static int usbmisc_imx_probe(struct platform_device *pdev)
++{
++	struct resource	*res;
++	struct imx_usbmisc *data;
++	int ret;
++
++	if (usbmisc)
++		return -EBUSY;
++
++	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
++	if (!data)
++		return -ENOMEM;
++
++	spin_lock_init(&data->lock);
++
++	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++	data->base = devm_ioremap_resource(&pdev->dev, res);
++	if (IS_ERR(data->base))
++		return PTR_ERR(data->base);
++
++	data->clk = devm_clk_get(&pdev->dev, NULL);
++	if (IS_ERR(data->clk)) {
++		dev_err(&pdev->dev,
++			"failed to get clock, err=%ld\n", PTR_ERR(data->clk));
++		return PTR_ERR(data->clk);
++	}
++
++	ret = clk_prepare_enable(data->clk);
++	if (ret) {
++		dev_err(&pdev->dev,
++			"clk_prepare_enable failed, err=%d\n", ret);
++		return ret;
++	}
++
++	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
++	if (ret) {
++		clk_disable_unprepare(data->clk);
++		return ret;
++	}
++
++	usbmisc = data;
++
++	return 0;
++}
++
++static int usbmisc_imx_remove(struct platform_device *pdev)
++{
++	usbmisc_unset_ops(&imx6q_usbmisc_ops);
++	clk_disable_unprepare(usbmisc->clk);
++	return 0;
++}
++
++static struct platform_driver usbmisc_imx_driver = {
++	.probe = usbmisc_imx_probe,
++	.remove = usbmisc_imx_remove,
++	.driver = {
++		.name = "usbmisc_imx",
++		.owner = THIS_MODULE,
++		.of_match_table = usbmisc_imx_dt_ids,
++	 },
++};
++
++int __init usbmisc_imx_drv_init(void)
++{
++	return platform_driver_register(&usbmisc_imx_driver);
++}
++subsys_initcall(usbmisc_imx_drv_init);
++
++void __exit usbmisc_imx_drv_exit(void)
++{
++	platform_driver_unregister(&usbmisc_imx_driver);
++}
++module_exit(usbmisc_imx_drv_exit);
++
++MODULE_ALIAS("platform:usbmisc-imx");
++MODULE_LICENSE("GPL v2");
++MODULE_DESCRIPTION("driver for imx usb non-core registers");
++MODULE_AUTHOR("Richard Zhao <richard.zhao@freescale.com>");
+diff --git a/drivers/usb/chipidea/usbmisc_imx6q.c b/drivers/usb/chipidea/usbmisc_imx6q.c
+deleted file mode 100644
+index a1bce39..0000000
+--- a/drivers/usb/chipidea/usbmisc_imx6q.c
++++ /dev/null
+@@ -1,162 +0,0 @@
+-/*
+- * Copyright 2012 Freescale Semiconductor, Inc.
+- *
+- * The code contained herein is licensed under the GNU General Public
+- * License. You may obtain a copy of the GNU General Public License
+- * Version 2 or later at the following locations:
+- *
+- * http://www.opensource.org/licenses/gpl-license.html
+- * http://www.gnu.org/copyleft/gpl.html
+- */
+-
+-#include <linux/module.h>
+-#include <linux/of_platform.h>
+-#include <linux/clk.h>
+-#include <linux/err.h>
+-#include <linux/io.h>
+-
+-#include "ci13xxx_imx.h"
+-
+-#define USB_DEV_MAX 4
+-
+-#define BM_OVER_CUR_DIS		BIT(7)
+-
+-struct imx6q_usbmisc {
+-	void __iomem *base;
+-	spinlock_t lock;
+-	struct clk *clk;
+-	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
+-};
+-
+-static struct imx6q_usbmisc *usbmisc;
+-
+-static struct usbmisc_usb_device *get_usbdev(struct device *dev)
+-{
+-	int i, ret;
+-
+-	for (i = 0; i < USB_DEV_MAX; i++) {
+-		if (usbmisc->usbdev[i].dev == dev)
+-			return &usbmisc->usbdev[i];
+-		else if (!usbmisc->usbdev[i].dev)
+-			break;
+-	}
+-
+-	if (i >= USB_DEV_MAX)
+-		return ERR_PTR(-EBUSY);
+-
+-	ret = usbmisc_get_init_data(dev, &usbmisc->usbdev[i]);
+-	if (ret)
+-		return ERR_PTR(ret);
+-
+-	return &usbmisc->usbdev[i];
+-}
+-
+-static int usbmisc_imx6q_init(struct device *dev)
+-{
+-
+-	struct usbmisc_usb_device *usbdev;
+-	unsigned long flags;
+-	u32 reg;
+-
+-	usbdev = get_usbdev(dev);
+-	if (IS_ERR(usbdev))
+-		return PTR_ERR(usbdev);
+-
+-	if (usbdev->disable_oc) {
+-		spin_lock_irqsave(&usbmisc->lock, flags);
+-		reg = readl(usbmisc->base + usbdev->index * 4);
+-		writel(reg | BM_OVER_CUR_DIS,
+-			usbmisc->base + usbdev->index * 4);
+-		spin_unlock_irqrestore(&usbmisc->lock, flags);
+-	}
+-
+-	return 0;
+-}
+-
+-static const struct usbmisc_ops imx6q_usbmisc_ops = {
+-	.init = usbmisc_imx6q_init,
+-};
+-
+-static const struct of_device_id usbmisc_imx6q_dt_ids[] = {
+-	{ .compatible = "fsl,imx6q-usbmisc"},
+-	{ /* sentinel */ }
+-};
+-
+-static int usbmisc_imx6q_probe(struct platform_device *pdev)
+-{
+-	struct resource	*res;
+-	struct imx6q_usbmisc *data;
+-	int ret;
+-
+-	if (usbmisc)
+-		return -EBUSY;
+-
+-	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+-	if (!data)
+-		return -ENOMEM;
+-
+-	spin_lock_init(&data->lock);
+-
+-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+-	data->base = devm_ioremap_resource(&pdev->dev, res);
+-	if (IS_ERR(data->base))
+-		return PTR_ERR(data->base);
+-
+-	data->clk = devm_clk_get(&pdev->dev, NULL);
+-	if (IS_ERR(data->clk)) {
+-		dev_err(&pdev->dev,
+-			"failed to get clock, err=%ld\n", PTR_ERR(data->clk));
+-		return PTR_ERR(data->clk);
+-	}
+-
+-	ret = clk_prepare_enable(data->clk);
+-	if (ret) {
+-		dev_err(&pdev->dev,
+-			"clk_prepare_enable failed, err=%d\n", ret);
+-		return ret;
+-	}
+-
+-	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
+-	if (ret) {
+-		clk_disable_unprepare(data->clk);
+-		return ret;
+-	}
+-
+-	usbmisc = data;
+-
+-	return 0;
+-}
+-
+-static int usbmisc_imx6q_remove(struct platform_device *pdev)
+-{
+-	usbmisc_unset_ops(&imx6q_usbmisc_ops);
+-	clk_disable_unprepare(usbmisc->clk);
+-	return 0;
+-}
+-
+-static struct platform_driver usbmisc_imx6q_driver = {
+-	.probe = usbmisc_imx6q_probe,
+-	.remove = usbmisc_imx6q_remove,
+-	.driver = {
+-		.name = "usbmisc_imx6q",
+-		.owner = THIS_MODULE,
+-		.of_match_table = usbmisc_imx6q_dt_ids,
+-	 },
+-};
+-
+-int __init usbmisc_imx6q_drv_init(void)
+-{
+-	return platform_driver_register(&usbmisc_imx6q_driver);
+-}
+-subsys_initcall(usbmisc_imx6q_drv_init);
+-
+-void __exit usbmisc_imx6q_drv_exit(void)
+-{
+-	platform_driver_unregister(&usbmisc_imx6q_driver);
+-}
+-module_exit(usbmisc_imx6q_drv_exit);
+-
+-MODULE_ALIAS("platform:usbmisc-imx6q");
+-MODULE_LICENSE("GPL v2");
+-MODULE_DESCRIPTION("driver for imx6q usb non-core registers");
+-MODULE_AUTHOR("Richard Zhao <richard.zhao@freescale.com>");
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0020-usb-chipidea-usbmisc-unset-global-varibale-usbmisc-o.patch b/patches/chipidea/0020-usb-chipidea-usbmisc-unset-global-varibale-usbmisc-o.patch
new file mode 100644
index 0000000000000000000000000000000000000000..b55447f0cc3c23c9ade046faf18ee298ad365358
--- /dev/null
+++ b/patches/chipidea/0020-usb-chipidea-usbmisc-unset-global-varibale-usbmisc-o.patch
@@ -0,0 +1,30 @@
+From f2a3a37a5acf1a19342eac8246b637e00337b802 Mon Sep 17 00:00:00 2001
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Date: Tue, 27 Nov 2012 17:16:57 +0100
+Subject: [PATCH 20/25] usb: chipidea: usbmisc: unset global varibale usbmisc
+ on driver remove
+
+The probe function checks usbmisc to be NULL in the beginning. Without
+this patch the can only be loaded once.
+
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+---
+ drivers/usb/chipidea/usbmisc_imx.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
+index efeb983..293e778 100644
+--- a/drivers/usb/chipidea/usbmisc_imx.c
++++ b/drivers/usb/chipidea/usbmisc_imx.c
+@@ -131,6 +131,7 @@ static int usbmisc_imx_remove(struct platform_device *pdev)
+ {
+ 	usbmisc_unset_ops(&imx6q_usbmisc_ops);
+ 	clk_disable_unprepare(usbmisc->clk);
++	usbmisc = NULL;
+ 	return 0;
+ }
+ 
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0021-usb-chipidea-usbmisc-fix-a-potential-race-condition.patch b/patches/chipidea/0021-usb-chipidea-usbmisc-fix-a-potential-race-condition.patch
new file mode 100644
index 0000000000000000000000000000000000000000..58fbfa58383e2d5e916a09c9924fc7f074149d56
--- /dev/null
+++ b/patches/chipidea/0021-usb-chipidea-usbmisc-fix-a-potential-race-condition.patch
@@ -0,0 +1,40 @@
+From c3c76e65d826ac7da645483983809caaaa3b3a96 Mon Sep 17 00:00:00 2001
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Date: Tue, 27 Nov 2012 17:16:58 +0100
+Subject: [PATCH 21/25] usb: chipidea: usbmisc: fix a potential race condition
+
+This fixes a potential race condition where the ci13xxx_imx glue code
+could be fast enough to call one of the usbmisc_ops before he got a
+valid value on the static usbmisc pointer. To fix that we first set
+usbmisc, then call usbmisc_set_ops().
+
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+---
+ drivers/usb/chipidea/usbmisc_imx.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
+index 293e778..96a6fd4 100644
+--- a/drivers/usb/chipidea/usbmisc_imx.c
++++ b/drivers/usb/chipidea/usbmisc_imx.c
+@@ -116,14 +116,14 @@ static int usbmisc_imx_probe(struct platform_device *pdev)
+ 		return ret;
+ 	}
+ 
++	usbmisc = data;
+ 	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
+ 	if (ret) {
++		usbmisc = NULL;
+ 		clk_disable_unprepare(data->clk);
+ 		return ret;
+ 	}
+ 
+-	usbmisc = data;
+-
+ 	return 0;
+ }
+ 
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0022-usb-chipidea-usbmisc-prepare-driver-to-handle-more-t.patch b/patches/chipidea/0022-usb-chipidea-usbmisc-prepare-driver-to-handle-more-t.patch
new file mode 100644
index 0000000000000000000000000000000000000000..dcfbf581937c163cfd4b7ee34031aa702749493f
--- /dev/null
+++ b/patches/chipidea/0022-usb-chipidea-usbmisc-prepare-driver-to-handle-more-t.patch
@@ -0,0 +1,86 @@
+From a8494f3923d6de32fda296708f433b5e0741422a Mon Sep 17 00:00:00 2001
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Date: Tue, 27 Nov 2012 17:16:59 +0100
+Subject: [PATCH 22/25] usb: chipidea: usbmisc: prepare driver to handle more
+ than one soc
+
+This attaches the usbmisc_ops to the of_device_id data and
+makes it possible to define special functions per soc.
+
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+---
+ drivers/usb/chipidea/usbmisc_imx.c |   15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
+index 96a6fd4..1d7befe 100644
+--- a/drivers/usb/chipidea/usbmisc_imx.c
++++ b/drivers/usb/chipidea/usbmisc_imx.c
+@@ -19,13 +19,14 @@
+ 
+ #define USB_DEV_MAX 4
+ 
+-#define BM_OVER_CUR_DIS		BIT(7)
++#define MX6_BM_OVER_CUR_DIS		BIT(7)
+ 
+ struct imx_usbmisc {
+ 	void __iomem *base;
+ 	spinlock_t lock;
+ 	struct clk *clk;
+ 	struct usbmisc_usb_device usbdev[USB_DEV_MAX];
++	const struct usbmisc_ops *ops;
+ };
+ 
+ static struct imx_usbmisc *usbmisc;
+@@ -65,7 +66,7 @@ static int usbmisc_imx6q_init(struct device *dev)
+ 	if (usbdev->disable_oc) {
+ 		spin_lock_irqsave(&usbmisc->lock, flags);
+ 		reg = readl(usbmisc->base + usbdev->index * 4);
+-		writel(reg | BM_OVER_CUR_DIS,
++		writel(reg | MX6_BM_OVER_CUR_DIS,
+ 			usbmisc->base + usbdev->index * 4);
+ 		spin_unlock_irqrestore(&usbmisc->lock, flags);
+ 	}
+@@ -78,7 +79,7 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
+ };
+ 
+ static const struct of_device_id usbmisc_imx_dt_ids[] = {
+-	{ .compatible = "fsl,imx6q-usbmisc"},
++	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
+ 	{ /* sentinel */ }
+ };
+ 
+@@ -87,6 +88,7 @@ static int usbmisc_imx_probe(struct platform_device *pdev)
+ 	struct resource	*res;
+ 	struct imx_usbmisc *data;
+ 	int ret;
++	struct of_device_id *tmp_dev;
+ 
+ 	if (usbmisc)
+ 		return -EBUSY;
+@@ -116,8 +118,11 @@ static int usbmisc_imx_probe(struct platform_device *pdev)
+ 		return ret;
+ 	}
+ 
++	tmp_dev = (struct of_device_id *)
++		of_match_device(usbmisc_imx_dt_ids, &pdev->dev);
++	data->ops = (const struct usbmisc_ops *)tmp_dev->data;
+ 	usbmisc = data;
+-	ret = usbmisc_set_ops(&imx6q_usbmisc_ops);
++	ret = usbmisc_set_ops(data->ops);
+ 	if (ret) {
+ 		usbmisc = NULL;
+ 		clk_disable_unprepare(data->clk);
+@@ -129,7 +134,7 @@ static int usbmisc_imx_probe(struct platform_device *pdev)
+ 
+ static int usbmisc_imx_remove(struct platform_device *pdev)
+ {
+-	usbmisc_unset_ops(&imx6q_usbmisc_ops);
++	usbmisc_unset_ops(usbmisc->ops);
+ 	clk_disable_unprepare(usbmisc->clk);
+ 	usbmisc = NULL;
+ 	return 0;
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0023-usb-chipidea-usbmisc-add-mx53-support.patch b/patches/chipidea/0023-usb-chipidea-usbmisc-add-mx53-support.patch
new file mode 100644
index 0000000000000000000000000000000000000000..a03d26c10884b51711ea82a1393858fdf10e8732
--- /dev/null
+++ b/patches/chipidea/0023-usb-chipidea-usbmisc-add-mx53-support.patch
@@ -0,0 +1,98 @@
+From d6f099b76308d5b21eafd13540cf59fe9bddc689 Mon Sep 17 00:00:00 2001
+From: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Date: Tue, 27 Nov 2012 17:17:00 +0100
+Subject: [PATCH 23/25] usb: chipidea: usbmisc: add mx53 support
+
+This adds mx53 as the next user of the usbmisc driver and makes it
+possible to disable the overcurrent-detection of the internal phy.
+
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ drivers/usb/chipidea/usbmisc_imx.c |   51 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 51 insertions(+)
+
+diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
+index 1d7befe..5f385b0 100644
+--- a/drivers/usb/chipidea/usbmisc_imx.c
++++ b/drivers/usb/chipidea/usbmisc_imx.c
+@@ -19,6 +19,13 @@
+ 
+ #define USB_DEV_MAX 4
+ 
++#define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08
++#define MX53_USB_UH2_CTRL_OFFSET	0x14
++#define MX53_USB_UH3_CTRL_OFFSET	0x18
++#define MX53_BM_OVER_CUR_DIS_H1		BIT(5)
++#define MX53_BM_OVER_CUR_DIS_OTG	BIT(8)
++#define MX53_BM_OVER_CUR_DIS_UHx	BIT(30)
++
+ #define MX6_BM_OVER_CUR_DIS		BIT(7)
+ 
+ struct imx_usbmisc {
+@@ -52,6 +59,45 @@ static struct usbmisc_usb_device *get_usbdev(struct device *dev)
+ 	return &usbmisc->usbdev[i];
+ }
+ 
++static int usbmisc_imx53_init(struct device *dev)
++{
++	struct usbmisc_usb_device *usbdev;
++	void __iomem *reg = NULL;
++	unsigned long flags;
++	u32 val = 0;
++
++	usbdev = get_usbdev(dev);
++	if (IS_ERR(usbdev))
++		return PTR_ERR(usbdev);
++
++	if (usbdev->disable_oc) {
++		spin_lock_irqsave(&usbmisc->lock, flags);
++		switch (usbdev->index) {
++		case 0:
++			reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_0_OFFSET;
++			val = readl(reg) | MX53_BM_OVER_CUR_DIS_OTG;
++			break;
++		case 1:
++			reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_0_OFFSET;
++			val = readl(reg) | MX53_BM_OVER_CUR_DIS_H1;
++			break;
++		case 2:
++			reg = usbmisc->base + MX53_USB_UH2_CTRL_OFFSET;
++			val = readl(reg) | MX53_BM_OVER_CUR_DIS_UHx;
++			break;
++		case 3:
++			reg = usbmisc->base + MX53_USB_UH3_CTRL_OFFSET;
++			val = readl(reg) | MX53_BM_OVER_CUR_DIS_UHx;
++			break;
++		}
++		if (reg && val)
++			writel(val, reg);
++		spin_unlock_irqrestore(&usbmisc->lock, flags);
++	}
++
++	return 0;
++}
++
+ static int usbmisc_imx6q_init(struct device *dev)
+ {
+ 
+@@ -74,11 +120,16 @@ static int usbmisc_imx6q_init(struct device *dev)
+ 	return 0;
+ }
+ 
++static const struct usbmisc_ops imx53_usbmisc_ops = {
++	.init = usbmisc_imx53_init,
++};
++
+ static const struct usbmisc_ops imx6q_usbmisc_ops = {
+ 	.init = usbmisc_imx6q_init,
+ };
+ 
+ static const struct of_device_id usbmisc_imx_dt_ids[] = {
++	{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
+ 	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
+ 	{ /* sentinel */ }
+ };
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0024-usb-chipidea-usbmisc-add-post-handling-and-errata-fi.patch b/patches/chipidea/0024-usb-chipidea-usbmisc-add-post-handling-and-errata-fi.patch
new file mode 100644
index 0000000000000000000000000000000000000000..a42d634326b8e543ea22ffacb6a9757c87818d7d
--- /dev/null
+++ b/patches/chipidea/0024-usb-chipidea-usbmisc-add-post-handling-and-errata-fi.patch
@@ -0,0 +1,161 @@
+From 3087a866b903441ebc699a09747387c067843b92 Mon Sep 17 00:00:00 2001
+From: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Date: Tue, 27 Nov 2012 17:17:01 +0100
+Subject: [PATCH 24/25] usb: chipidea: usbmisc: add post handling and errata
+ fix for mx25
+
+This adds a post handling routine which is called after
+ci13xxx_add_device was called. The first user is the mx25, which has to
+disable the external-vbus-divider after the udc has started.
+
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ .../devicetree/bindings/usb/ci13xxx-imx.txt        |    2 ++
+ drivers/usb/chipidea/ci13xxx_imx.c                 |   12 +++++++
+ drivers/usb/chipidea/ci13xxx_imx.h                 |    3 ++
+ drivers/usb/chipidea/usbmisc_imx.c                 |   33 ++++++++++++++++++++
+ 4 files changed, 50 insertions(+)
+
+diff --git a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
+index 22b4805..2bb6c22 100644
+--- a/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
++++ b/Documentation/devicetree/bindings/usb/ci13xxx-imx.txt
+@@ -22,6 +22,7 @@ Optional properties:
+ default value, please add this flag. Below is the pin selection for imx6q:
+ 	- ENET_RX_ER: 0  (defalt)
+ 	- GPIO_1: 1
++- external-vbus-divider: enables off-chip resistor divider for Vbus
+ 
+ Examples:
+ usb@02184000 { /* USB OTG */
+@@ -32,4 +33,5 @@ usb@02184000 { /* USB OTG */
+ 	fsl,usbmisc = <&usbmisc 0>;
+ 	disable-over-current;
+ 	otg_id_pin_select_change;
++	external-vbus-divider;
+ };
+diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
+index 5a2b196..039b7fb 100644
+--- a/drivers/usb/chipidea/ci13xxx_imx.c
++++ b/drivers/usb/chipidea/ci13xxx_imx.c
+@@ -82,6 +82,9 @@ int usbmisc_get_init_data(struct device *dev, struct usbmisc_usb_device *usbdev)
+ 	if (of_find_property(np, "disable-over-current", NULL))
+ 		usbdev->disable_oc = 1;
+ 
++	if (of_find_property(np, "external-vbus-divider", NULL))
++		usbdev->evdo = 1;
++
+ 	return 0;
+ }
+ EXPORT_SYMBOL_GPL(usbmisc_get_init_data);
+@@ -228,6 +231,15 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
+ 		goto err_clk;
+ 	}
+ 
++	if (usbmisc_ops && usbmisc_ops->post) {
++		ret = usbmisc_ops->post(&pdev->dev);
++		if (ret) {
++			dev_err(&pdev->dev,
++				"usbmisc post failed, ret=%d\n", ret);
++			goto err_clk;
++		}
++	}
++
+ 	data->ci_pdev = plat_ci;
+ 	platform_set_drvdata(pdev, data);
+ 
+diff --git a/drivers/usb/chipidea/ci13xxx_imx.h b/drivers/usb/chipidea/ci13xxx_imx.h
+index 9cd2e91..550bfa4 100644
+--- a/drivers/usb/chipidea/ci13xxx_imx.h
++++ b/drivers/usb/chipidea/ci13xxx_imx.h
+@@ -13,6 +13,8 @@
+ struct usbmisc_ops {
+ 	/* It's called once when probe a usb device */
+ 	int (*init)(struct device *dev);
++	/* It's called once after adding a usb device */
++	int (*post)(struct device *dev);
+ };
+ 
+ struct usbmisc_usb_device {
+@@ -20,6 +22,7 @@ struct usbmisc_usb_device {
+ 	int index;
+ 
+ 	unsigned int disable_oc:1; /* over current detect disabled */
++	unsigned int evdo:1; /* set external vbus divider option */
+ };
+ 
+ int usbmisc_set_ops(const struct usbmisc_ops *ops);
+diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
+index 5f385b0..d559873 100644
+--- a/drivers/usb/chipidea/usbmisc_imx.c
++++ b/drivers/usb/chipidea/usbmisc_imx.c
+@@ -14,11 +14,15 @@
+ #include <linux/clk.h>
+ #include <linux/err.h>
+ #include <linux/io.h>
++#include <linux/delay.h>
+ 
+ #include "ci13xxx_imx.h"
+ 
+ #define USB_DEV_MAX 4
+ 
++#define MX25_USB_PHY_CTRL_OFFSET	0x08
++#define MX25_BM_EXTERNAL_VBUS_DIVIDER	BIT(23)
++
+ #define MX53_USB_OTG_PHY_CTRL_0_OFFSET	0x08
+ #define MX53_USB_UH2_CTRL_OFFSET	0x14
+ #define MX53_USB_UH3_CTRL_OFFSET	0x18
+@@ -59,6 +63,30 @@ static struct usbmisc_usb_device *get_usbdev(struct device *dev)
+ 	return &usbmisc->usbdev[i];
+ }
+ 
++static int usbmisc_imx25_post(struct device *dev)
++{
++	struct usbmisc_usb_device *usbdev;
++	void __iomem *reg;
++	unsigned long flags;
++	u32 val;
++
++	usbdev = get_usbdev(dev);
++	if (IS_ERR(usbdev))
++		return PTR_ERR(usbdev);
++
++	reg = usbmisc->base + MX25_USB_PHY_CTRL_OFFSET;
++
++	if (usbdev->evdo) {
++		spin_lock_irqsave(&usbmisc->lock, flags);
++		val = readl(reg);
++		writel(val | MX25_BM_EXTERNAL_VBUS_DIVIDER, reg);
++		spin_unlock_irqrestore(&usbmisc->lock, flags);
++		usleep_range(5000, 10000); /* needed to stabilize voltage */
++	}
++
++	return 0;
++}
++
+ static int usbmisc_imx53_init(struct device *dev)
+ {
+ 	struct usbmisc_usb_device *usbdev;
+@@ -120,6 +148,10 @@ static int usbmisc_imx6q_init(struct device *dev)
+ 	return 0;
+ }
+ 
++static const struct usbmisc_ops imx25_usbmisc_ops = {
++	.post = usbmisc_imx25_post,
++};
++
+ static const struct usbmisc_ops imx53_usbmisc_ops = {
+ 	.init = usbmisc_imx53_init,
+ };
+@@ -129,6 +161,7 @@ static const struct usbmisc_ops imx6q_usbmisc_ops = {
+ };
+ 
+ static const struct of_device_id usbmisc_imx_dt_ids[] = {
++	{ .compatible = "fsl,imx25-usbmisc", .data = (void *)&imx25_usbmisc_ops },
+ 	{ .compatible = "fsl,imx53-usbmisc", .data = (void *)&imx53_usbmisc_ops },
+ 	{ .compatible = "fsl,imx6q-usbmisc", .data = (void *)&imx6q_usbmisc_ops },
+ 	{ /* sentinel */ }
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0025-usb-chipidea-imx-Add-system-suspend-resume-API.patch b/patches/chipidea/0025-usb-chipidea-imx-Add-system-suspend-resume-API.patch
new file mode 100644
index 0000000000000000000000000000000000000000..c3a5a8919ea9a35ba5e50f2260ae25531ea9d4b3
--- /dev/null
+++ b/patches/chipidea/0025-usb-chipidea-imx-Add-system-suspend-resume-API.patch
@@ -0,0 +1,116 @@
+From 7680db26de8261d17cafed3efbddffa4aa0816ed Mon Sep 17 00:00:00 2001
+From: Peter Chen <peter.chen@freescale.com>
+Date: Thu, 10 Jan 2013 16:35:54 +0800
+Subject: [PATCH 25/25] usb: chipidea: imx: Add system suspend/resume API
+
+During the system suspend/resume procedure, the USB also
+needs to go suspend/resume procedure, this patch adds
+related APIs. It is tested at i.mx6q sabrelite. Meanwhile,
+it fixes the bug that the USB will out of work after
+system suspend/resume.
+
+Signed-off-by: Peter Chen <peter.chen@freescale.com>
+---
+ drivers/usb/chipidea/bits.h        |    1 +
+ drivers/usb/chipidea/ci13xxx_imx.c |   59 ++++++++++++++++++++++++++++++++++++
+ 2 files changed, 60 insertions(+)
+
+diff --git a/drivers/usb/chipidea/bits.h b/drivers/usb/chipidea/bits.h
+index 58ef56c..4be0e61 100644
+--- a/drivers/usb/chipidea/bits.h
++++ b/drivers/usb/chipidea/bits.h
+@@ -47,6 +47,7 @@
+ #define PORTSC_FPR            BIT(6)
+ #define PORTSC_SUSP           BIT(7)
+ #define PORTSC_HSP            BIT(9)
++#define PORTSC_PHCD           BIT(23) /* phy suspend mode */
+ #define PORTSC_PTC            (0x0FUL << 16)
+ /* PTS and PTW for non lpm version only */
+ #define PORTSC_PTS(d)         ((((d) & 0x3) << 30) | (((d) & 0x4) ? BIT(25) : 0))
+diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
+index 039b7fb..d46c755 100644
+--- a/drivers/usb/chipidea/ci13xxx_imx.c
++++ b/drivers/usb/chipidea/ci13xxx_imx.c
+@@ -26,6 +26,7 @@
+ #include <linux/mfd/syscon.h>
+ 
+ #include "ci.h"
++#include "bits.h"
+ #include "ci13xxx_imx.h"
+ 
+ #define pdev_to_phy(pdev) \
+@@ -272,6 +273,61 @@ static int ci13xxx_imx_remove(struct platform_device *pdev)
+ 	return 0;
+ }
+ 
++#ifdef CONFIG_PM
++static int ci13xxx_imx_suspend(struct device *dev)
++{
++	struct ci13xxx_imx_data *data = dev_get_drvdata(dev);
++	struct platform_device *plat_ci;
++	struct ci13xxx	*ci;
++
++	plat_ci = data->ci_pdev;
++	ci = platform_get_drvdata(plat_ci);
++
++	hw_write(ci, OP_PORTSC, PORTSC_PHCD, PORTSC_PHCD);
++
++	if (data->phy)
++		usb_phy_set_suspend(data->phy, 1);
++
++	clk_disable_unprepare(data->clk);
++
++	return 0;
++}
++
++static int ci13xxx_imx_resume(struct device *dev)
++{
++	int ret;
++	struct ci13xxx_imx_data *data = dev_get_drvdata(dev);
++	struct platform_device *plat_ci;
++	struct ci13xxx	*ci;
++
++	plat_ci = data->ci_pdev;
++	ci = platform_get_drvdata(plat_ci);
++
++	ret = clk_prepare_enable(data->clk);
++	if (ret) {
++		dev_err(dev,
++			"Failed to prepare or enable clock, err=%d\n", ret);
++		return ret;
++	}
++
++	if (hw_read(ci, OP_PORTSC, PORTSC_PHCD)) {
++		hw_write(ci, OP_PORTSC, PORTSC_PHCD, 0);
++		/* Some clks sync between Controller and USB PHY */
++		mdelay(1);
++	}
++
++	if (data->phy)
++		usb_phy_set_suspend(data->phy, 0);
++
++	return ret;
++}
++
++static const struct dev_pm_ops ci13xxx_imx_pm_ops = {
++	.suspend	= ci13xxx_imx_suspend,
++	.resume		= ci13xxx_imx_resume,
++};
++#endif
++
+ static const struct of_device_id ci13xxx_imx_dt_ids[] = {
+ 	{ .compatible = "fsl,imx27-usb", },
+ 	{ /* sentinel */ }
+@@ -285,6 +341,9 @@ static struct platform_driver ci13xxx_imx_driver = {
+ 		.name = "imx_usb",
+ 		.owner = THIS_MODULE,
+ 		.of_match_table = ci13xxx_imx_dt_ids,
++#ifdef CONFIG_PM
++		.pm	= &ci13xxx_imx_pm_ops,
++#endif
+ 	 },
+ };
+ 
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0026-ARM-dts-imx-add-imx5x-usbmisc-entries.patch b/patches/chipidea/0026-ARM-dts-imx-add-imx5x-usbmisc-entries.patch
new file mode 100644
index 0000000000000000000000000000000000000000..06e78246ae4ae6ffa391ea5dca1e820826716c20
--- /dev/null
+++ b/patches/chipidea/0026-ARM-dts-imx-add-imx5x-usbmisc-entries.patch
@@ -0,0 +1,104 @@
+From 78ce8aa6e97a6ce8caa06d489359d62ba606f1f0 Mon Sep 17 00:00:00 2001
+From: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Date: Thu, 11 Apr 2013 12:13:14 +0200
+Subject: [PATCH 26/29] ARM: dts: imx: add imx5x usbmisc entries
+
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+---
+ arch/arm/boot/dts/imx51.dtsi |   10 ++++++++++
+ arch/arm/boot/dts/imx53.dtsi |   10 ++++++++++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
+index fcf035b..2316472 100644
+--- a/arch/arm/boot/dts/imx51.dtsi
++++ b/arch/arm/boot/dts/imx51.dtsi
+@@ -157,6 +157,7 @@
+ 				compatible = "fsl,imx51-usb", "fsl,imx27-usb";
+ 				reg = <0x73f80000 0x0200>;
+ 				interrupts = <18>;
++				fsl,usbmisc = <&usbmisc 0>;
+ 				status = "disabled";
+ 			};
+ 
+@@ -164,6 +165,7 @@
+ 				compatible = "fsl,imx51-usb", "fsl,imx27-usb";
+ 				reg = <0x73f80200 0x0200>;
+ 				interrupts = <14>;
++				fsl,usbmisc = <&usbmisc 1>;
+ 				status = "disabled";
+ 			};
+ 
+@@ -171,6 +173,7 @@
+ 				compatible = "fsl,imx51-usb", "fsl,imx27-usb";
+ 				reg = <0x73f80400 0x0200>;
+ 				interrupts = <16>;
++				fsl,usbmisc = <&usbmisc 2>;
+ 				status = "disabled";
+ 			};
+ 
+@@ -178,9 +181,16 @@
+ 				compatible = "fsl,imx51-usb", "fsl,imx27-usb";
+ 				reg = <0x73f80600 0x0200>;
+ 				interrupts = <17>;
++				fsl,usbmisc = <&usbmisc 3>;
+ 				status = "disabled";
+ 			};
+ 
++			usbmisc: usbmisc@73f80800 {
++				#index-cells = <1>;
++				compatible = "fsl,imx51-usbmisc";
++				reg = <0x73f80800 0x200>;
++			};
++
+ 			gpio1: gpio@73f84000 {
+ 				compatible = "fsl,imx51-gpio", "fsl,imx35-gpio";
+ 				reg = <0x73f84000 0x4000>;
+diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
+index 9197a74..1c1f239 100644
+--- a/arch/arm/boot/dts/imx53.dtsi
++++ b/arch/arm/boot/dts/imx53.dtsi
+@@ -163,6 +163,7 @@
+ 				compatible = "fsl,imx53-usb", "fsl,imx27-usb";
+ 				reg = <0x53f80000 0x0200>;
+ 				interrupts = <18>;
++				fsl,usbmisc = <&usbmisc 0>;
+ 				status = "disabled";
+ 			};
+ 
+@@ -170,6 +171,7 @@
+ 				compatible = "fsl,imx53-usb", "fsl,imx27-usb";
+ 				reg = <0x53f80200 0x0200>;
+ 				interrupts = <14>;
++				fsl,usbmisc = <&usbmisc 1>;
+ 				status = "disabled";
+ 			};
+ 
+@@ -177,6 +179,7 @@
+ 				compatible = "fsl,imx53-usb", "fsl,imx27-usb";
+ 				reg = <0x53f80400 0x0200>;
+ 				interrupts = <16>;
++				fsl,usbmisc = <&usbmisc 2>;
+ 				status = "disabled";
+ 			};
+ 
+@@ -184,9 +187,16 @@
+ 				compatible = "fsl,imx53-usb", "fsl,imx27-usb";
+ 				reg = <0x53f80600 0x0200>;
+ 				interrupts = <17>;
++				fsl,usbmisc = <&usbmisc 3>;
+ 				status = "disabled";
+ 			};
+ 
++			usbmisc: usbmisc@53f80800 {
++				#index-cells = <1>;
++				compatible = "fsl,imx53-usbmisc";
++				reg = <0x53f80800 0x200>;
++			};
++
+ 			gpio1: gpio@53f84000 {
+ 				compatible = "fsl,imx53-gpio", "fsl,imx35-gpio";
+ 				reg = <0x53f84000 0x4000>;
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0027-ARM-dts-imx-add-imx5x-usb-clock-DT-lookups.patch b/patches/chipidea/0027-ARM-dts-imx-add-imx5x-usb-clock-DT-lookups.patch
new file mode 100644
index 0000000000000000000000000000000000000000..8964aacac093a2e9ebd925e73dc14e166feb8c30
--- /dev/null
+++ b/patches/chipidea/0027-ARM-dts-imx-add-imx5x-usb-clock-DT-lookups.patch
@@ -0,0 +1,102 @@
+From 4f58c58b1f61ec6898d6b9d2a427d2b6f624aaa1 Mon Sep 17 00:00:00 2001
+From: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Date: Thu, 11 Apr 2013 12:13:15 +0200
+Subject: [PATCH 27/29] ARM: dts: imx: add imx5x usb clock DT lookups
+
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+---
+ arch/arm/boot/dts/imx51.dtsi |    5 +++++
+ arch/arm/boot/dts/imx53.dtsi |    5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
+index 2316472..01fe241 100644
+--- a/arch/arm/boot/dts/imx51.dtsi
++++ b/arch/arm/boot/dts/imx51.dtsi
+@@ -157,6 +157,7 @@
+ 				compatible = "fsl,imx51-usb", "fsl,imx27-usb";
+ 				reg = <0x73f80000 0x0200>;
+ 				interrupts = <18>;
++				clocks = <&clks 108>;
+ 				fsl,usbmisc = <&usbmisc 0>;
+ 				status = "disabled";
+ 			};
+@@ -165,6 +166,7 @@
+ 				compatible = "fsl,imx51-usb", "fsl,imx27-usb";
+ 				reg = <0x73f80200 0x0200>;
+ 				interrupts = <14>;
++				clocks = <&clks 108>;
+ 				fsl,usbmisc = <&usbmisc 1>;
+ 				status = "disabled";
+ 			};
+@@ -173,6 +175,7 @@
+ 				compatible = "fsl,imx51-usb", "fsl,imx27-usb";
+ 				reg = <0x73f80400 0x0200>;
+ 				interrupts = <16>;
++				clocks = <&clks 108>;
+ 				fsl,usbmisc = <&usbmisc 2>;
+ 				status = "disabled";
+ 			};
+@@ -181,6 +184,7 @@
+ 				compatible = "fsl,imx51-usb", "fsl,imx27-usb";
+ 				reg = <0x73f80600 0x0200>;
+ 				interrupts = <17>;
++				clocks = <&clks 108>;
+ 				fsl,usbmisc = <&usbmisc 3>;
+ 				status = "disabled";
+ 			};
+@@ -189,6 +193,7 @@
+ 				#index-cells = <1>;
+ 				compatible = "fsl,imx51-usbmisc";
+ 				reg = <0x73f80800 0x200>;
++				clocks = <&clks 108>;
+ 			};
+ 
+ 			gpio1: gpio@73f84000 {
+diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
+index 1c1f239..11b721e 100644
+--- a/arch/arm/boot/dts/imx53.dtsi
++++ b/arch/arm/boot/dts/imx53.dtsi
+@@ -163,6 +163,7 @@
+ 				compatible = "fsl,imx53-usb", "fsl,imx27-usb";
+ 				reg = <0x53f80000 0x0200>;
+ 				interrupts = <18>;
++				clocks = <&clks 108>;
+ 				fsl,usbmisc = <&usbmisc 0>;
+ 				status = "disabled";
+ 			};
+@@ -171,6 +172,7 @@
+ 				compatible = "fsl,imx53-usb", "fsl,imx27-usb";
+ 				reg = <0x53f80200 0x0200>;
+ 				interrupts = <14>;
++				clocks = <&clks 108>;
+ 				fsl,usbmisc = <&usbmisc 1>;
+ 				status = "disabled";
+ 			};
+@@ -179,6 +181,7 @@
+ 				compatible = "fsl,imx53-usb", "fsl,imx27-usb";
+ 				reg = <0x53f80400 0x0200>;
+ 				interrupts = <16>;
++				clocks = <&clks 108>;
+ 				fsl,usbmisc = <&usbmisc 2>;
+ 				status = "disabled";
+ 			};
+@@ -187,6 +190,7 @@
+ 				compatible = "fsl,imx53-usb", "fsl,imx27-usb";
+ 				reg = <0x53f80600 0x0200>;
+ 				interrupts = <17>;
++				clocks = <&clks 108>;
+ 				fsl,usbmisc = <&usbmisc 3>;
+ 				status = "disabled";
+ 			};
+@@ -195,6 +199,7 @@
+ 				#index-cells = <1>;
+ 				compatible = "fsl,imx53-usbmisc";
+ 				reg = <0x53f80800 0x200>;
++				clocks = <&clks 108>;
+ 			};
+ 
+ 			gpio1: gpio@53f84000 {
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0028-ARM-dts-imx-use-usb-nop-xceiv-usbphy-entries-for-imx.patch b/patches/chipidea/0028-ARM-dts-imx-use-usb-nop-xceiv-usbphy-entries-for-imx.patch
new file mode 100644
index 0000000000000000000000000000000000000000..970f82658f200493b5fc4d2390ef31d1101ae8de
--- /dev/null
+++ b/patches/chipidea/0028-ARM-dts-imx-use-usb-nop-xceiv-usbphy-entries-for-imx.patch
@@ -0,0 +1,80 @@
+From cd8891aa0095ce5f019e468b2a580ff28f9ca111 Mon Sep 17 00:00:00 2001
+From: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Date: Thu, 11 Apr 2013 12:13:16 +0200
+Subject: [PATCH 28/29] ARM: dts: imx: use usb-nop-xceiv usbphy entries for
+ imx5x
+
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+---
+ arch/arm/boot/dts/imx51.dtsi |    8 ++++++++
+ arch/arm/boot/dts/imx53.dtsi |   16 ++++++++++++++++
+ 2 files changed, 24 insertions(+)
+
+diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
+index 01fe241..53fe73c 100644
+--- a/arch/arm/boot/dts/imx51.dtsi
++++ b/arch/arm/boot/dts/imx51.dtsi
+@@ -153,12 +153,20 @@
+ 				};
+ 			};
+ 
++			usbphy0: usbphy@0 {
++				compatible = "usb-nop-xceiv";
++				clocks = <&clks 124>;
++				clock-names = "main_clk";
++				status = "okay";
++			};
++
+ 			usbotg: usb@73f80000 {
+ 				compatible = "fsl,imx51-usb", "fsl,imx27-usb";
+ 				reg = <0x73f80000 0x0200>;
+ 				interrupts = <18>;
+ 				clocks = <&clks 108>;
+ 				fsl,usbmisc = <&usbmisc 0>;
++				fsl,usbphy = <&usbphy0>;
+ 				status = "disabled";
+ 			};
+ 
+diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
+index 11b721e..b0d979e 100644
+--- a/arch/arm/boot/dts/imx53.dtsi
++++ b/arch/arm/boot/dts/imx53.dtsi
+@@ -159,12 +159,27 @@
+ 				};
+ 			};
+ 
++			usbphy0: usbphy@0 {
++				compatible = "usb-nop-xceiv";
++				clocks = <&clks 124>;
++				clock-names = "main_clk";
++				status = "okay";
++			};
++
++			usbphy1: usbphy@1 {
++				compatible = "usb-nop-xceiv";
++				clocks = <&clks 125>;
++				clock-names = "main_clk";
++				status = "okay";
++			};
++
+ 			usbotg: usb@53f80000 {
+ 				compatible = "fsl,imx53-usb", "fsl,imx27-usb";
+ 				reg = <0x53f80000 0x0200>;
+ 				interrupts = <18>;
+ 				clocks = <&clks 108>;
+ 				fsl,usbmisc = <&usbmisc 0>;
++				fsl,usbphy = <&usbphy0>;
+ 				status = "disabled";
+ 			};
+ 
+@@ -174,6 +189,7 @@
+ 				interrupts = <14>;
+ 				clocks = <&clks 108>;
+ 				fsl,usbmisc = <&usbmisc 1>;
++				fsl,usbphy = <&usbphy1>;
+ 				status = "disabled";
+ 			};
+ 
+-- 
+1.7.10.4
+
diff --git a/patches/chipidea/0029-ARM-dts-imx-imx53-qsb.dts-enable-usbotg-and-usbh1.patch b/patches/chipidea/0029-ARM-dts-imx-imx53-qsb.dts-enable-usbotg-and-usbh1.patch
new file mode 100644
index 0000000000000000000000000000000000000000..00ffc9b8bc558c448d7dbedb00416b205868add5
--- /dev/null
+++ b/patches/chipidea/0029-ARM-dts-imx-imx53-qsb.dts-enable-usbotg-and-usbh1.patch
@@ -0,0 +1,32 @@
+From 2eee24416f51dd4244aec1588e7b407b8677f67c Mon Sep 17 00:00:00 2001
+From: Michael Grzeschik <m.grzeschik@pengutronix.de>
+Date: Thu, 11 Apr 2013 12:13:17 +0200
+Subject: [PATCH 29/29] ARM: dts: imx: imx53-qsb.dts: enable usbotg and usbh1
+
+Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
+---
+ arch/arm/boot/dts/imx53-qsb.dts |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/arch/arm/boot/dts/imx53-qsb.dts b/arch/arm/boot/dts/imx53-qsb.dts
+index eb03dae..9d059ed 100644
+--- a/arch/arm/boot/dts/imx53-qsb.dts
++++ b/arch/arm/boot/dts/imx53-qsb.dts
+@@ -83,6 +83,14 @@
+ 	};
+ };
+ 
++&usbotg {
++       status = "okay";
++};
++
++&usbh1 {
++       status = "okay";
++};
++
+ &esdhc1 {
+ 	pinctrl-names = "default";
+ 	pinctrl-0 = <&pinctrl_esdhc1_1>;
+-- 
+1.7.10.4
+
diff --git a/patches/defconfig b/patches/defconfig
index dc944e2b502d0f53d8a9432b65c073e85d318032..572245a14bbc395705b09817a67c5b9adfb38fa1 100644
--- a/patches/defconfig
+++ b/patches/defconfig
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/arm 3.9.0-rc5 Kernel Configuration
+# Linux/arm 3.9.0 Kernel Configuration
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -15,7 +15,6 @@ CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_NEED_DMA_MAP_STATE=y
-CONFIG_FIQ=y
 CONFIG_VECTORS_BASE=0xffff0000
 CONFIG_ARM_PATCH_PHYS_VIRT=y
 CONFIG_GENERIC_BUG=y
@@ -229,16 +228,10 @@ CONFIG_BLK_DEV_INTEGRITY=y
 # Partition Types
 #
 CONFIG_PARTITION_ADVANCED=y
-CONFIG_ACORN_PARTITION=y
-# CONFIG_ACORN_PARTITION_CUMANA is not set
-# CONFIG_ACORN_PARTITION_EESOX is not set
-CONFIG_ACORN_PARTITION_ICS=y
-# CONFIG_ACORN_PARTITION_ADFS is not set
-# CONFIG_ACORN_PARTITION_POWERTEC is not set
-CONFIG_ACORN_PARTITION_RISCIX=y
-CONFIG_OSF_PARTITION=y
-CONFIG_AMIGA_PARTITION=y
-CONFIG_ATARI_PARTITION=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
 CONFIG_MAC_PARTITION=y
 CONFIG_MSDOS_PARTITION=y
 CONFIG_BSD_DISKLABEL=y
@@ -247,10 +240,10 @@ CONFIG_SOLARIS_X86_PARTITION=y
 CONFIG_UNIXWARE_DISKLABEL=y
 CONFIG_LDM_PARTITION=y
 # CONFIG_LDM_DEBUG is not set
-CONFIG_SGI_PARTITION=y
-CONFIG_ULTRIX_PARTITION=y
-CONFIG_SUN_PARTITION=y
-CONFIG_KARMA_PARTITION=y
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
 CONFIG_EFI_PARTITION=y
 # CONFIG_SYSV68_PARTITION is not set
 
@@ -260,12 +253,17 @@ CONFIG_EFI_PARTITION=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_DEADLINE=y
 CONFIG_IOSCHED_CFQ=y
-# CONFIG_CFQ_GROUP_IOSCHED is not set
+CONFIG_CFQ_GROUP_IOSCHED=y
 # CONFIG_DEFAULT_DEADLINE is not set
 CONFIG_DEFAULT_CFQ=y
 # CONFIG_DEFAULT_NOOP is not set
 CONFIG_DEFAULT_IOSCHED="cfq"
-CONFIG_UNINLINE_SPIN_UNLOCK=y
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+CONFIG_INLINE_READ_UNLOCK=y
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+CONFIG_INLINE_WRITE_UNLOCK=y
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_FREEZER=y
 
 #
@@ -343,7 +341,7 @@ CONFIG_ARCH_MXC=y
 #
 # CONFIG_MXC_IRQ_PRIOR is not set
 CONFIG_MXC_TZIC=y
-CONFIG_MXC_DEBUG_BOARD=y
+# CONFIG_MXC_DEBUG_BOARD is not set
 CONFIG_HAVE_IMX_GPC=y
 CONFIG_HAVE_IMX_MMDC=y
 CONFIG_HAVE_IMX_SRC=y
@@ -358,9 +356,8 @@ CONFIG_SOC_IMX51=y
 # i.MX51 machines:
 #
 CONFIG_MACH_IMX51_DT=y
-CONFIG_MACH_MX51_BABBAGE=y
-CONFIG_MACH_EUKREA_CPUIMX51SD=y
-CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD=y
+# CONFIG_MACH_MX51_BABBAGE is not set
+# CONFIG_MACH_EUKREA_CPUIMX51SD is not set
 
 #
 # Device tree only
@@ -368,16 +365,8 @@ CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD=y
 CONFIG_SOC_IMX53=y
 CONFIG_SOC_IMX6Q=y
 CONFIG_IMX_HAVE_PLATFORM_FEC=y
-CONFIG_IMX_HAVE_PLATFORM_FSL_USB2_UDC=y
 CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS=y
 CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT=y
-CONFIG_IMX_HAVE_PLATFORM_IMX_I2C=y
-CONFIG_IMX_HAVE_PLATFORM_IMX_SSI=y
-CONFIG_IMX_HAVE_PLATFORM_IMX_UART=y
-CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI=y
-CONFIG_IMX_HAVE_PLATFORM_MXC_NAND=y
-CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX=y
-CONFIG_IMX_HAVE_PLATFORM_SPI_IMX=y
 CONFIG_IMX_HAVE_PLATFORM_AHCI=y
 
 #
@@ -453,7 +442,7 @@ CONFIG_MACH_OMAP4_PANDA=y
 # CONFIG_OMAP3_EMU is not set
 # CONFIG_OMAP3_SDRC_AC_TIMING is not set
 # CONFIG_ARCH_SOCFPGA is not set
-CONFIG_ARCH_SUNXI=y
+# CONFIG_ARCH_SUNXI is not set
 CONFIG_ARCH_VEXPRESS=y
 
 #
@@ -465,7 +454,7 @@ CONFIG_PLAT_VERSATILE_CLCD=y
 CONFIG_PLAT_VERSATILE_SCHED_CLOCK=y
 # CONFIG_ARCH_VIRT is not set
 # CONFIG_ARCH_WM8850 is not set
-CONFIG_ARCH_ZYNQ=y
+# CONFIG_ARCH_ZYNQ is not set
 CONFIG_PLAT_VERSATILE=y
 CONFIG_ARM_TIMER_SP804=y
 
@@ -517,6 +506,7 @@ CONFIG_ARM_ERRATA_754322=y
 CONFIG_ARM_ERRATA_764369=y
 CONFIG_PL310_ERRATA_769419=y
 CONFIG_ARM_ERRATA_775420=y
+# CONFIG_ARM_ERRATA_798181 is not set
 CONFIG_ICST=y
 CONFIG_TI_PRIV_EDMA=y
 
@@ -543,7 +533,7 @@ CONFIG_VMSPLIT_3G=y
 # CONFIG_VMSPLIT_2G is not set
 # CONFIG_VMSPLIT_1G is not set
 CONFIG_PAGE_OFFSET=0xC0000000
-CONFIG_NR_CPUS=4
+CONFIG_NR_CPUS=2
 CONFIG_HOTPLUG_CPU=y
 # CONFIG_ARM_PSCI is not set
 CONFIG_LOCAL_TIMERS=y
@@ -569,7 +559,7 @@ CONFIG_HAVE_MEMBLOCK=y
 CONFIG_MEMORY_ISOLATION=y
 # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
 CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_SPLIT_PTLOCK_CPUS=999999
+CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_COMPACTION=y
 CONFIG_MIGRATION=y
 # CONFIG_PHYS_ADDR_T_64BIT is not set
@@ -624,10 +614,10 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
 # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
-CONFIG_CPU_FREQ_GOV_POWERSAVE=y
-CONFIG_CPU_FREQ_GOV_USERSPACE=y
-CONFIG_CPU_FREQ_GOV_ONDEMAND=y
-CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=m
+CONFIG_CPU_FREQ_GOV_ONDEMAND=m
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
 CONFIG_GENERIC_CPUFREQ_CPU0=y
 
 #
@@ -723,7 +713,9 @@ CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_IP_PNP_RARP=y
 CONFIG_NET_IPIP=m
-# CONFIG_NET_IPGRE_DEMUX is not set
+CONFIG_NET_IPGRE_DEMUX=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
 CONFIG_IP_MROUTE=y
 CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
 CONFIG_IP_PIMSM_V1=y
@@ -1445,6 +1437,7 @@ CONFIG_MTD_OF_PARTS=y
 # User Modules And Translation Layers
 #
 CONFIG_MTD_CHAR=y
+CONFIG_HAVE_MTD_OTP=y
 CONFIG_MTD_BLKDEVS=y
 CONFIG_MTD_BLOCK=y
 CONFIG_FTL=m
@@ -1485,11 +1478,14 @@ CONFIG_MTD_ABSENT=m
 #
 # Mapping drivers for chip access
 #
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=m
+# CONFIG_MTD_PHYSMAP_COMPAT is not set
 # CONFIG_MTD_PHYSMAP_OF is not set
 # CONFIG_MTD_IMPA7 is not set
-# CONFIG_MTD_PLATRAM is not set
+# CONFIG_MTD_GPIO_ADDR is not set
+CONFIG_MTD_PLATRAM=m
+# CONFIG_MTD_LATCH_ADDR is not set
 
 #
 # Self-contained MTD device drivers
@@ -1514,6 +1510,8 @@ CONFIG_MTD_DOC2000=m
 CONFIG_MTD_DOC2001=m
 CONFIG_MTD_DOC2001PLUS=m
 # CONFIG_MTD_DOCG3 is not set
+CONFIG_BCH_CONST_M=13
+CONFIG_BCH_CONST_T=8
 CONFIG_MTD_DOCPROBE=m
 CONFIG_MTD_DOCECC=m
 # CONFIG_MTD_DOCPROBE_ADVANCED is not set
@@ -1527,7 +1525,9 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_DENALI is not set
 # CONFIG_MTD_NAND_GPIO is not set
 CONFIG_MTD_NAND_OMAP2=y
-# CONFIG_MTD_NAND_OMAP_BCH is not set
+CONFIG_MTD_NAND_OMAP_BCH=y
+CONFIG_MTD_NAND_OMAP_BCH8=y
+# CONFIG_MTD_NAND_OMAP_BCH4 is not set
 CONFIG_MTD_NAND_IDS=y
 CONFIG_MTD_NAND_DISKONCHIP=m
 # CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
@@ -1535,17 +1535,16 @@ CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
 # CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
 # CONFIG_MTD_NAND_DOCG4 is not set
 # CONFIG_MTD_NAND_NANDSIM is not set
-CONFIG_MTD_NAND_GPMI_NAND=y
 CONFIG_MTD_NAND_PLATFORM=y
 # CONFIG_MTD_ALAUDA is not set
 CONFIG_MTD_NAND_MXC=y
 CONFIG_MTD_ONENAND=y
 CONFIG_MTD_ONENAND_VERIFY_WRITE=y
-# CONFIG_MTD_ONENAND_GENERIC is not set
+CONFIG_MTD_ONENAND_GENERIC=y
 CONFIG_MTD_ONENAND_OMAP2=y
-# CONFIG_MTD_ONENAND_OTP is not set
+CONFIG_MTD_ONENAND_OTP=y
 CONFIG_MTD_ONENAND_2X_PROGRAM=y
-CONFIG_MTD_ONENAND_SIM=m
+# CONFIG_MTD_ONENAND_SIM is not set
 
 #
 # LPDDR flash memory drivers
@@ -1584,7 +1583,7 @@ CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=16384
+CONFIG_BLK_DEV_RAM_SIZE=65536
 # CONFIG_BLK_DEV_XIP is not set
 CONFIG_CDROM_PKTCDVD=m
 CONFIG_CDROM_PKTCDVD_BUFFERS=8
@@ -1592,7 +1591,6 @@ CONFIG_CDROM_PKTCDVD_BUFFERS=8
 CONFIG_ATA_OVER_ETH=m
 CONFIG_MG_DISK=m
 CONFIG_MG_DISK_RES=0
-# CONFIG_VIRTIO_BLK is not set
 # CONFIG_BLK_DEV_RBD is not set
 
 #
@@ -1616,11 +1614,11 @@ CONFIG_SENSORS_APDS990X=m
 CONFIG_HMC6352=m
 CONFIG_DS1682=m
 CONFIG_TI_DAC7512=m
-# CONFIG_ARM_CHARLCD is not set
+CONFIG_ARM_CHARLCD=y
 CONFIG_BMP085=y
 CONFIG_BMP085_I2C=m
 CONFIG_BMP085_SPI=m
-# CONFIG_USB_SWITCH_FSA9480 is not set
+CONFIG_USB_SWITCH_FSA9480=m
 CONFIG_LATTICE_ECP3_CONFIG=m
 # CONFIG_C2PORT is not set
 
@@ -1644,7 +1642,7 @@ CONFIG_SENSORS_LIS3_I2C=m
 #
 # Altera FPGA firmware download module
 #
-# CONFIG_ALTERA_STAPL is not set
+CONFIG_ALTERA_STAPL=m
 
 #
 # SCSI device support
@@ -1663,8 +1661,8 @@ CONFIG_SCSI_PROC_FS=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_ST=m
 CONFIG_CHR_DEV_OSST=m
-CONFIG_BLK_DEV_SR=m
-CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_BLK_DEV_SR=y
+# CONFIG_BLK_DEV_SR_VENDOR is not set
 CONFIG_CHR_DEV_SG=y
 CONFIG_CHR_DEV_SCH=m
 CONFIG_SCSI_ENCLOSURE=m
@@ -1688,12 +1686,11 @@ CONFIG_SCSI_SRP_ATTRS=m
 CONFIG_SCSI_SRP_TGT_ATTRS=y
 CONFIG_SCSI_LOWLEVEL=y
 CONFIG_ISCSI_TCP=m
-CONFIG_ISCSI_BOOT_SYSFS=m
-CONFIG_SCSI_UFSHCD=m
+# CONFIG_ISCSI_BOOT_SYSFS is not set
+# CONFIG_SCSI_UFSHCD is not set
 CONFIG_LIBFC=m
 CONFIG_LIBFCOE=m
 CONFIG_SCSI_DEBUG=m
-CONFIG_SCSI_VIRTIO=m
 CONFIG_SCSI_DH=y
 CONFIG_SCSI_DH_RDAC=m
 CONFIG_SCSI_DH_HP_SW=m
@@ -1779,7 +1776,6 @@ CONFIG_IFB=m
 # CONFIG_NET_POLL_CONTROLLER is not set
 CONFIG_TUN=m
 # CONFIG_VETH is not set
-# CONFIG_VIRTIO_NET is not set
 CONFIG_ATM_DRIVERS=y
 # CONFIG_ATM_DUMMY is not set
 # CONFIG_ATM_TCP is not set
@@ -1797,19 +1793,14 @@ CONFIG_NET_DSA_MV88E6XXX_NEED_PPU=y
 CONFIG_NET_DSA_MV88E6131=y
 CONFIG_NET_DSA_MV88E6123_61_65=y
 CONFIG_ETHERNET=y
-CONFIG_NET_CADENCE=y
-# CONFIG_ARM_AT91_ETHER is not set
-# CONFIG_MACB is not set
+# CONFIG_NET_CADENCE is not set
 # CONFIG_NET_VENDOR_BROADCOM is not set
 # CONFIG_NET_CALXEDA_XGMAC is not set
-CONFIG_NET_VENDOR_CIRRUS=y
-# CONFIG_CS89x0 is not set
+# CONFIG_NET_VENDOR_CIRRUS is not set
 CONFIG_DM9000=m
 CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL=y
 # CONFIG_DNET is not set
-CONFIG_NET_VENDOR_FARADAY=y
-# CONFIG_FTMAC100 is not set
-# CONFIG_FTGMAC100 is not set
+# CONFIG_NET_VENDOR_FARADAY is not set
 CONFIG_NET_VENDOR_FREESCALE=y
 CONFIG_FEC=y
 CONFIG_NET_VENDOR_INTEL=y
@@ -1825,22 +1816,22 @@ CONFIG_ENC28J60=m
 # CONFIG_ENC28J60_WRITEVERIFY is not set
 CONFIG_NET_VENDOR_NATSEMI=y
 CONFIG_NET_VENDOR_8390=y
-# CONFIG_AX88796 is not set
-# CONFIG_ETHOC is not set
+CONFIG_AX88796=m
+CONFIG_AX88796_93CX6=y
+CONFIG_ETHOC=m
 CONFIG_NET_VENDOR_SEEQ=y
 CONFIG_NET_VENDOR_SMSC=y
-CONFIG_SMC91X=y
-CONFIG_SMC911X=y
-CONFIG_SMSC911X=y
+CONFIG_SMC91X=m
+CONFIG_SMC911X=m
+CONFIG_SMSC911X=m
 # CONFIG_SMSC911X_ARCH_HOOKS is not set
-CONFIG_NET_VENDOR_STMICRO=y
-# CONFIG_STMMAC_ETH is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
 CONFIG_NET_VENDOR_TI=y
 CONFIG_TI_DAVINCI_EMAC=y
 CONFIG_TI_DAVINCI_MDIO=y
 CONFIG_TI_DAVINCI_CPDMA=y
 CONFIG_TI_CPSW=y
-# CONFIG_TI_CPTS is not set
+CONFIG_TI_CPTS=y
 CONFIG_NET_VENDOR_WIZNET=y
 CONFIG_WIZNET_W5100=m
 CONFIG_WIZNET_W5300=m
@@ -1860,7 +1851,7 @@ CONFIG_PHYLIB=y
 # CONFIG_LXT_PHY is not set
 # CONFIG_CICADA_PHY is not set
 # CONFIG_VITESSE_PHY is not set
-# CONFIG_SMSC_PHY is not set
+CONFIG_SMSC_PHY=y
 # CONFIG_BROADCOM_PHY is not set
 # CONFIG_BCM87XX_PHY is not set
 # CONFIG_ICPLUS_PHY is not set
@@ -1870,10 +1861,11 @@ CONFIG_PHYLIB=y
 # CONFIG_LSI_ET1011C_PHY is not set
 # CONFIG_MICREL_PHY is not set
 # CONFIG_FIXED_PHY is not set
-# CONFIG_MDIO_BITBANG is not set
+CONFIG_MDIO_BITBANG=m
+# CONFIG_MDIO_GPIO is not set
 # CONFIG_MDIO_BUS_MUX_GPIO is not set
 # CONFIG_MDIO_BUS_MUX_MMIOREG is not set
-# CONFIG_MICREL_KS8995MA is not set
+CONFIG_MICREL_KS8995MA=m
 CONFIG_PPP=m
 CONFIG_PPP_BSDCOMP=m
 CONFIG_PPP_DEFLATE=m
@@ -1882,6 +1874,7 @@ CONFIG_PPP_MPPE=m
 CONFIG_PPP_MULTILINK=y
 CONFIG_PPPOATM=m
 CONFIG_PPPOE=m
+CONFIG_PPTP=m
 CONFIG_PPPOL2TP=m
 CONFIG_PPP_ASYNC=m
 CONFIG_PPP_SYNC_TTY=m
@@ -2068,7 +2061,7 @@ CONFIG_INPUT_EVDEV=y
 CONFIG_INPUT_KEYBOARD=y
 CONFIG_KEYBOARD_ADP5588=m
 CONFIG_KEYBOARD_ADP5589=m
-CONFIG_KEYBOARD_ATKBD=m
+CONFIG_KEYBOARD_ATKBD=y
 CONFIG_KEYBOARD_QT1070=m
 CONFIG_KEYBOARD_QT2160=m
 CONFIG_KEYBOARD_LKKBD=m
@@ -2222,7 +2215,7 @@ CONFIG_INPUT_GPIO_TILT_POLLED=m
 CONFIG_INPUT_ATI_REMOTE2=m
 CONFIG_INPUT_KEYSPAN_REMOTE=m
 CONFIG_INPUT_KXTJ9=m
-# CONFIG_INPUT_KXTJ9_POLLED_MODE is not set
+CONFIG_INPUT_KXTJ9_POLLED_MODE=y
 CONFIG_INPUT_POWERMATE=m
 CONFIG_INPUT_YEALINK=m
 CONFIG_INPUT_CM109=m
@@ -2245,7 +2238,7 @@ CONFIG_INPUT_CMA3000_I2C=m
 # Hardware I/O ports
 #
 CONFIG_SERIO=y
-CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_SERPORT=y
 # CONFIG_SERIO_AMBAKMI is not set
 CONFIG_SERIO_LIBPS2=y
 # CONFIG_SERIO_RAW is not set
@@ -2281,9 +2274,13 @@ CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_DMA=y
-CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_NR_UARTS=32
 CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-# CONFIG_SERIAL_8250_EXTENDED is not set
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
 # CONFIG_SERIAL_8250_DW is not set
 # CONFIG_SERIAL_8250_EM is not set
 
@@ -2312,12 +2309,10 @@ CONFIG_SERIAL_OMAP_CONSOLE=y
 # CONFIG_SERIAL_ARC is not set
 # CONFIG_TTY_PRINTK is not set
 # CONFIG_HVC_DCC is not set
-# CONFIG_VIRTIO_CONSOLE is not set
 # CONFIG_IPMI_HANDLER is not set
 CONFIG_HW_RANDOM=y
 # CONFIG_HW_RANDOM_TIMERIOMEM is not set
 # CONFIG_HW_RANDOM_ATMEL is not set
-# CONFIG_HW_RANDOM_VIRTIO is not set
 # CONFIG_HW_RANDOM_EXYNOS is not set
 # CONFIG_NVRAM is not set
 # CONFIG_R3964 is not set
@@ -2424,14 +2419,12 @@ CONFIG_PINCTRL=y
 #
 CONFIG_PINMUX=y
 CONFIG_PINCONF=y
-CONFIG_GENERIC_PINCONF=y
-# CONFIG_DEBUG_PINCTRL is not set
+CONFIG_DEBUG_PINCTRL=y
 CONFIG_PINCTRL_IMX=y
 CONFIG_PINCTRL_IMX51=y
 CONFIG_PINCTRL_IMX53=y
 CONFIG_PINCTRL_IMX6Q=y
 CONFIG_PINCTRL_SINGLE=y
-CONFIG_PINCTRL_SUNXI=y
 # CONFIG_PINCTRL_EXYNOS is not set
 # CONFIG_PINCTRL_EXYNOS5440 is not set
 CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
@@ -2855,7 +2848,7 @@ CONFIG_VIDEOBUF2_VMALLOC=m
 # CONFIG_VIDEO_V4L2_INT_DEVICE is not set
 CONFIG_DVB_CORE=y
 CONFIG_DVB_NET=y
-# CONFIG_TTPCI_EEPROM is not set
+CONFIG_TTPCI_EEPROM=m
 CONFIG_DVB_MAX_ADAPTERS=8
 CONFIG_DVB_DYNAMIC_MINORS=y
 
@@ -2997,7 +2990,7 @@ CONFIG_DVB_USB_DTT200U=m
 CONFIG_DVB_USB_OPERA1=m
 CONFIG_DVB_USB_AF9005=m
 CONFIG_DVB_USB_AF9005_REMOTE=m
-# CONFIG_DVB_USB_PCTV452E is not set
+CONFIG_DVB_USB_PCTV452E=m
 CONFIG_DVB_USB_DW2102=m
 CONFIG_DVB_USB_CINERGY_T2=m
 CONFIG_DVB_USB_DTV5100=m
@@ -3039,6 +3032,7 @@ CONFIG_VIDEO_OMAP3=y
 CONFIG_VIDEO_OMAP3_DEBUG=y
 CONFIG_SOC_CAMERA=m
 CONFIG_SOC_CAMERA_PLATFORM=m
+# CONFIG_VIDEO_MX3 is not set
 CONFIG_VIDEO_SH_MOBILE_CSI2=m
 CONFIG_VIDEO_SH_MOBILE_CEU=m
 CONFIG_V4L_MEM2MEM_DRIVERS=y
@@ -3059,7 +3053,7 @@ CONFIG_USB_SI470X=m
 CONFIG_I2C_SI470X=m
 CONFIG_USB_MR800=m
 CONFIG_USB_DSBR=m
-# CONFIG_RADIO_SHARK is not set
+CONFIG_RADIO_SHARK=m
 CONFIG_RADIO_SHARK2=m
 CONFIG_I2C_SI4713=m
 CONFIG_RADIO_SI4713=m
@@ -3388,7 +3382,7 @@ CONFIG_DVB_AF9033=m
 # Graphics support
 #
 CONFIG_DRM=y
-CONFIG_DRM_USB=y
+CONFIG_DRM_USB=m
 CONFIG_DRM_KMS_HELPER=y
 # CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
 CONFIG_DRM_GEM_CMA_HELPER=y
@@ -3397,12 +3391,13 @@ CONFIG_DRM_KMS_CMA_HELPER=y
 #
 # I2C encoder or helper chips
 #
-CONFIG_DRM_I2C_CH7006=y
-CONFIG_DRM_I2C_SIL164=y
-CONFIG_DRM_I2C_NXP_TDA998X=y
+CONFIG_DRM_I2C_CH7006=m
+CONFIG_DRM_I2C_SIL164=m
+CONFIG_DRM_I2C_NXP_TDA998X=m
 # CONFIG_DRM_EXYNOS is not set
-CONFIG_DRM_UDL=y
-# CONFIG_DRM_OMAP is not set
+CONFIG_DRM_UDL=m
+CONFIG_DRM_OMAP=y
+CONFIG_DRM_OMAP_NUM_CRTCS=1
 CONFIG_DRM_TILCDC=y
 # CONFIG_VGASTATE is not set
 # CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -3412,7 +3407,7 @@ CONFIG_OF_DISPLAY_TIMING=y
 CONFIG_OF_VIDEOMODE=y
 CONFIG_HDMI=y
 CONFIG_FB=y
-CONFIG_FIRMWARE_EDID=y
+# CONFIG_FIRMWARE_EDID is not set
 # CONFIG_FB_DDC is not set
 # CONFIG_FB_BOOT_VESA_SUPPORT is not set
 CONFIG_FB_CFB_FILLRECT=y
@@ -3439,18 +3434,18 @@ CONFIG_FB_TILEBLITTING=y
 # CONFIG_FB_UVESA is not set
 # CONFIG_FB_S1D13XXX is not set
 # CONFIG_FB_TMIO is not set
-# CONFIG_FB_SMSCUFX is not set
+CONFIG_FB_SMSCUFX=m
 CONFIG_FB_UDL=m
 # CONFIG_FB_GOLDFISH is not set
 # CONFIG_FB_VIRTUAL is not set
 # CONFIG_FB_METRONOME is not set
+CONFIG_FB_MX3=y
 # CONFIG_FB_BROADSHEET is not set
 # CONFIG_FB_AUO_K190X is not set
 CONFIG_OMAP2_VRFB=y
 CONFIG_OMAP2_DSS=y
-CONFIG_OMAP2_DSS_DEBUG=y
-CONFIG_OMAP2_DSS_DEBUGFS=y
-# CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set
+# CONFIG_OMAP2_DSS_DEBUG is not set
+# CONFIG_OMAP2_DSS_DEBUGFS is not set
 CONFIG_OMAP2_DSS_DPI=y
 # CONFIG_OMAP2_DSS_RFBI is not set
 CONFIG_OMAP2_DSS_VENC=y
@@ -3460,9 +3455,6 @@ CONFIG_OMAP4_DSS_HDMI_AUDIO=y
 CONFIG_OMAP2_DSS_DSI=y
 CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
 CONFIG_OMAP2_DSS_SLEEP_AFTER_VENC_RESET=y
-CONFIG_FB_OMAP2=y
-CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
-CONFIG_FB_OMAP2_NUM_FBS=3
 
 #
 # OMAP2/3 Display Device Drivers
@@ -3567,6 +3559,7 @@ CONFIG_SND_DRIVERS=y
 # CONFIG_SND_SERIAL_U16550 is not set
 # CONFIG_SND_MPU401 is not set
 # CONFIG_SND_AC97_POWER_SAVE is not set
+CONFIG_SND_TEA575X=m
 CONFIG_SND_ARM=y
 # CONFIG_SND_ARMAACI is not set
 CONFIG_SND_SPI=y
@@ -3578,133 +3571,123 @@ CONFIG_SND_USB_CAIAQ_INPUT=y
 CONFIG_SND_USB_6FIRE=m
 CONFIG_SND_SOC=y
 CONFIG_SND_SOC_DMAENGINE_PCM=y
-CONFIG_SND_ATMEL_SOC=m
+# CONFIG_SND_ATMEL_SOC is not set
 CONFIG_SND_DESIGNWARE_I2S=m
-CONFIG_SND_SOC_FSL_SSI=m
-CONFIG_SND_SOC_FSL_UTILS=m
-CONFIG_SND_IMX_SOC=m
-CONFIG_SND_SOC_IMX_SSI=m
-CONFIG_SND_SOC_IMX_PCM=m
-CONFIG_SND_SOC_IMX_PCM_FIQ=y
-CONFIG_SND_SOC_IMX_PCM_DMA=y
-CONFIG_SND_SOC_IMX_AUDMUX=m
-CONFIG_SND_SOC_EUKREA_TLV320=m
-CONFIG_SND_SOC_IMX_SGTL5000=m
-CONFIG_SND_SOC_IMX_MC13783=m
-CONFIG_SND_OMAP_SOC=m
-CONFIG_SND_OMAP_SOC_DMIC=m
-CONFIG_SND_OMAP_SOC_MCBSP=m
-CONFIG_SND_OMAP_SOC_MCPDM=m
-CONFIG_SND_OMAP_SOC_HDMI=m
-CONFIG_SND_OMAP_SOC_RX51=m
-CONFIG_SND_OMAP_SOC_AM3517EVM=m
-CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m
-CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m
-CONFIG_SND_OMAP_SOC_OMAP_HDMI=m
-CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m
+# CONFIG_SND_IMX_SOC is not set
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_OMAP_SOC_DMIC=y
+CONFIG_SND_OMAP_SOC_MCBSP=y
+CONFIG_SND_OMAP_SOC_MCPDM=y
+CONFIG_SND_OMAP_SOC_HDMI=y
+CONFIG_SND_OMAP_SOC_RX51=y
+CONFIG_SND_OMAP_SOC_AM3517EVM=y
+CONFIG_SND_OMAP_SOC_OMAP_TWL4030=y
+CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=y
+CONFIG_SND_OMAP_SOC_OMAP_HDMI=y
+CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=y
 CONFIG_SND_SOC_I2C_AND_SPI=y
-CONFIG_SND_SOC_ALL_CODECS=m
-CONFIG_SND_SOC_WM_HUBS=m
-CONFIG_SND_SOC_WM_ADSP=m
-CONFIG_SND_SOC_AD1836=m
-CONFIG_SND_SOC_AD193X=m
-CONFIG_SND_SOC_AD73311=m
-CONFIG_SND_SOC_ADAU1373=m
-CONFIG_SND_SOC_ADAV80X=m
-CONFIG_SND_SOC_ADS117X=m
-CONFIG_SND_SOC_AK4104=m
-CONFIG_SND_SOC_AK4535=m
-CONFIG_SND_SOC_AK4641=m
-CONFIG_SND_SOC_AK4642=m
-CONFIG_SND_SOC_AK4671=m
-CONFIG_SND_SOC_ALC5623=m
-CONFIG_SND_SOC_ALC5632=m
-CONFIG_SND_SOC_CS42L51=m
-CONFIG_SND_SOC_CS42L52=m
-CONFIG_SND_SOC_CS42L73=m
-CONFIG_SND_SOC_CS4270=m
-CONFIG_SND_SOC_CS4271=m
-CONFIG_SND_SOC_CX20442=m
-CONFIG_SND_SOC_JZ4740_CODEC=m
-CONFIG_SND_SOC_L3=m
-CONFIG_SND_SOC_DA7210=m
-CONFIG_SND_SOC_DA7213=m
-CONFIG_SND_SOC_DA732X=m
-CONFIG_SND_SOC_DA9055=m
-CONFIG_SND_SOC_DFBMCS320=m
-CONFIG_SND_SOC_DMIC=m
-CONFIG_SND_SOC_ISABELLE=m
-CONFIG_SND_SOC_LM49453=m
-CONFIG_SND_SOC_MAX98088=m
-CONFIG_SND_SOC_MAX98090=m
-CONFIG_SND_SOC_MAX98095=m
-CONFIG_SND_SOC_MAX9850=m
-CONFIG_SND_SOC_OMAP_HDMI_CODEC=m
-CONFIG_SND_SOC_PCM3008=m
-CONFIG_SND_SOC_RT5631=m
-CONFIG_SND_SOC_SGTL5000=m
-CONFIG_SND_SOC_SPDIF=m
-CONFIG_SND_SOC_SSM2602=m
-CONFIG_SND_SOC_STA32X=m
-CONFIG_SND_SOC_STA529=m
-CONFIG_SND_SOC_TLV320AIC23=m
-CONFIG_SND_SOC_TLV320AIC26=m
-CONFIG_SND_SOC_TLV320AIC32X4=m
-CONFIG_SND_SOC_TLV320AIC3X=m
-CONFIG_SND_SOC_TLV320DAC33=m
-CONFIG_SND_SOC_TWL4030=m
-CONFIG_SND_SOC_TWL6040=m
-CONFIG_SND_SOC_UDA134X=m
-CONFIG_SND_SOC_UDA1380=m
+CONFIG_SND_SOC_ALL_CODECS=y
+CONFIG_SND_SOC_WM_HUBS=y
+CONFIG_SND_SOC_WM_ADSP=y
+CONFIG_SND_SOC_AD1836=y
+CONFIG_SND_SOC_AD193X=y
+CONFIG_SND_SOC_AD73311=y
+CONFIG_SND_SOC_ADAU1373=y
+CONFIG_SND_SOC_ADAV80X=y
+CONFIG_SND_SOC_ADS117X=y
+CONFIG_SND_SOC_AK4104=y
+CONFIG_SND_SOC_AK4535=y
+CONFIG_SND_SOC_AK4641=y
+CONFIG_SND_SOC_AK4642=y
+CONFIG_SND_SOC_AK4671=y
+CONFIG_SND_SOC_ALC5623=y
+CONFIG_SND_SOC_ALC5632=y
+CONFIG_SND_SOC_CS42L51=y
+CONFIG_SND_SOC_CS42L52=y
+CONFIG_SND_SOC_CS42L73=y
+CONFIG_SND_SOC_CS4270=y
+CONFIG_SND_SOC_CS4271=y
+CONFIG_SND_SOC_CX20442=y
+CONFIG_SND_SOC_JZ4740_CODEC=y
+CONFIG_SND_SOC_L3=y
+CONFIG_SND_SOC_DA7210=y
+CONFIG_SND_SOC_DA7213=y
+CONFIG_SND_SOC_DA732X=y
+CONFIG_SND_SOC_DA9055=y
+CONFIG_SND_SOC_DFBMCS320=y
+CONFIG_SND_SOC_DMIC=y
+CONFIG_SND_SOC_ISABELLE=y
+CONFIG_SND_SOC_LM49453=y
+CONFIG_SND_SOC_MAX98088=y
+CONFIG_SND_SOC_MAX98090=y
+CONFIG_SND_SOC_MAX98095=y
+CONFIG_SND_SOC_MAX9850=y
+CONFIG_SND_SOC_OMAP_HDMI_CODEC=y
+CONFIG_SND_SOC_PCM3008=y
+CONFIG_SND_SOC_RT5631=y
+CONFIG_SND_SOC_SGTL5000=y
+CONFIG_SND_SOC_SPDIF=y
+CONFIG_SND_SOC_SSM2602=y
+CONFIG_SND_SOC_STA32X=y
+CONFIG_SND_SOC_STA529=y
+CONFIG_SND_SOC_TLV320AIC23=y
+CONFIG_SND_SOC_TLV320AIC26=y
+CONFIG_SND_SOC_TLV320AIC32X4=y
+CONFIG_SND_SOC_TLV320AIC3X=y
+CONFIG_SND_SOC_TLV320DAC33=y
+CONFIG_SND_SOC_TWL4030=y
+CONFIG_SND_SOC_TWL6040=y
+CONFIG_SND_SOC_UDA134X=y
+CONFIG_SND_SOC_UDA1380=y
 CONFIG_SND_SOC_WL1273=m
-CONFIG_SND_SOC_WM0010=m
-CONFIG_SND_SOC_WM1250_EV1=m
-CONFIG_SND_SOC_WM2000=m
-CONFIG_SND_SOC_WM2200=m
-CONFIG_SND_SOC_WM5100=m
-CONFIG_SND_SOC_WM8510=m
-CONFIG_SND_SOC_WM8523=m
-CONFIG_SND_SOC_WM8580=m
-CONFIG_SND_SOC_WM8711=m
-CONFIG_SND_SOC_WM8727=m
-CONFIG_SND_SOC_WM8728=m
-CONFIG_SND_SOC_WM8731=m
-CONFIG_SND_SOC_WM8737=m
-CONFIG_SND_SOC_WM8741=m
-CONFIG_SND_SOC_WM8750=m
-CONFIG_SND_SOC_WM8753=m
-CONFIG_SND_SOC_WM8770=m
-CONFIG_SND_SOC_WM8776=m
-CONFIG_SND_SOC_WM8782=m
-CONFIG_SND_SOC_WM8804=m
-CONFIG_SND_SOC_WM8900=m
-CONFIG_SND_SOC_WM8903=m
-CONFIG_SND_SOC_WM8904=m
-CONFIG_SND_SOC_WM8940=m
-CONFIG_SND_SOC_WM8955=m
-CONFIG_SND_SOC_WM8960=m
-CONFIG_SND_SOC_WM8961=m
-CONFIG_SND_SOC_WM8962=m
-CONFIG_SND_SOC_WM8971=m
-CONFIG_SND_SOC_WM8974=m
-CONFIG_SND_SOC_WM8978=m
-CONFIG_SND_SOC_WM8983=m
-CONFIG_SND_SOC_WM8985=m
-CONFIG_SND_SOC_WM8988=m
-CONFIG_SND_SOC_WM8990=m
-CONFIG_SND_SOC_WM8991=m
-CONFIG_SND_SOC_WM8993=m
-CONFIG_SND_SOC_WM8995=m
-CONFIG_SND_SOC_WM8996=m
-CONFIG_SND_SOC_WM9081=m
-CONFIG_SND_SOC_WM9090=m
-CONFIG_SND_SOC_LM4857=m
-CONFIG_SND_SOC_MAX9768=m
-CONFIG_SND_SOC_MAX9877=m
-CONFIG_SND_SOC_MC13783=m
-CONFIG_SND_SOC_ML26124=m
-CONFIG_SND_SOC_TPA6130A2=m
-CONFIG_SND_SIMPLE_CARD=m
+CONFIG_SND_SOC_WM0010=y
+CONFIG_SND_SOC_WM1250_EV1=y
+CONFIG_SND_SOC_WM2000=y
+CONFIG_SND_SOC_WM2200=y
+CONFIG_SND_SOC_WM5100=y
+CONFIG_SND_SOC_WM8510=y
+CONFIG_SND_SOC_WM8523=y
+CONFIG_SND_SOC_WM8580=y
+CONFIG_SND_SOC_WM8711=y
+CONFIG_SND_SOC_WM8727=y
+CONFIG_SND_SOC_WM8728=y
+CONFIG_SND_SOC_WM8731=y
+CONFIG_SND_SOC_WM8737=y
+CONFIG_SND_SOC_WM8741=y
+CONFIG_SND_SOC_WM8750=y
+CONFIG_SND_SOC_WM8753=y
+CONFIG_SND_SOC_WM8770=y
+CONFIG_SND_SOC_WM8776=y
+CONFIG_SND_SOC_WM8782=y
+CONFIG_SND_SOC_WM8804=y
+CONFIG_SND_SOC_WM8900=y
+CONFIG_SND_SOC_WM8903=y
+CONFIG_SND_SOC_WM8904=y
+CONFIG_SND_SOC_WM8940=y
+CONFIG_SND_SOC_WM8955=y
+CONFIG_SND_SOC_WM8960=y
+CONFIG_SND_SOC_WM8961=y
+CONFIG_SND_SOC_WM8962=y
+CONFIG_SND_SOC_WM8971=y
+CONFIG_SND_SOC_WM8974=y
+CONFIG_SND_SOC_WM8978=y
+CONFIG_SND_SOC_WM8983=y
+CONFIG_SND_SOC_WM8985=y
+CONFIG_SND_SOC_WM8988=y
+CONFIG_SND_SOC_WM8990=y
+CONFIG_SND_SOC_WM8991=y
+CONFIG_SND_SOC_WM8993=y
+CONFIG_SND_SOC_WM8995=y
+CONFIG_SND_SOC_WM8996=y
+CONFIG_SND_SOC_WM9081=y
+CONFIG_SND_SOC_WM9090=y
+CONFIG_SND_SOC_LM4857=y
+CONFIG_SND_SOC_MAX9768=y
+CONFIG_SND_SOC_MAX9877=y
+CONFIG_SND_SOC_MC13783=y
+CONFIG_SND_SOC_ML26124=y
+CONFIG_SND_SOC_TPA6130A2=y
+# CONFIG_SND_SIMPLE_CARD is not set
 # CONFIG_SOUND_PRIME is not set
 CONFIG_AC97_BUS=m
 
@@ -3712,7 +3695,7 @@ CONFIG_AC97_BUS=m
 # HID support
 #
 CONFIG_HID=y
-# CONFIG_HID_BATTERY_STRENGTH is not set
+CONFIG_HID_BATTERY_STRENGTH=y
 CONFIG_HIDRAW=y
 CONFIG_UHID=y
 CONFIG_HID_GENERIC=y
@@ -3804,7 +3787,7 @@ CONFIG_USB_HIDDEV=y
 #
 # I2C HID support
 #
-# CONFIG_I2C_HID is not set
+CONFIG_I2C_HID=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
 # CONFIG_USB_ARCH_HAS_XHCI is not set
@@ -4003,9 +3986,13 @@ CONFIG_USB_HSIC_USB3503=m
 CONFIG_OMAP_USB2=y
 # CONFIG_OMAP_USB3 is not set
 CONFIG_OMAP_CONTROL_USB=y
-# CONFIG_USB_ISP1301 is not set
+CONFIG_USB_ISP1301=m
 # CONFIG_USB_RCAR_PHY is not set
-# CONFIG_USB_ATM is not set
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_CXACRU=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_USB_XUSBATM=m
 CONFIG_USB_GADGET=y
 # CONFIG_USB_GADGET_DEBUG is not set
 # CONFIG_USB_GADGET_DEBUG_FILES is not set
@@ -4052,7 +4039,7 @@ CONFIG_USB_OTG_UTILS=y
 CONFIG_USB_GPIO_VBUS=y
 # CONFIG_USB_ULPI is not set
 CONFIG_TWL4030_USB=y
-CONFIG_TWL6030_USB=y
+# CONFIG_TWL6030_USB is not set
 CONFIG_NOP_USB_XCEIV=y
 # CONFIG_USB_MXS_PHY is not set
 CONFIG_MMC=y
@@ -4066,17 +4053,16 @@ CONFIG_MMC_UNSAFE_RESUME=y
 CONFIG_MMC_BLOCK=y
 CONFIG_MMC_BLOCK_MINORS=8
 CONFIG_MMC_BLOCK_BOUNCE=y
-CONFIG_SDIO_UART=y
+CONFIG_SDIO_UART=m
 # CONFIG_MMC_TEST is not set
 
 #
 # MMC/SD/SDIO Host Controller Drivers
 #
-CONFIG_MMC_ARMMMCI=y
+# CONFIG_MMC_ARMMMCI is not set
 CONFIG_MMC_SDHCI=y
-CONFIG_MMC_SDHCI_IO_ACCESSORS=y
-CONFIG_MMC_SDHCI_PLTFM=y
-CONFIG_MMC_SDHCI_ESDHC_IMX=y
+CONFIG_MMC_SDHCI_PLTFM=m
+# CONFIG_MMC_SDHCI_ESDHC_IMX is not set
 # CONFIG_MMC_SDHCI_PXAV3 is not set
 # CONFIG_MMC_SDHCI_PXAV2 is not set
 CONFIG_MMC_OMAP=y
@@ -4086,7 +4072,6 @@ CONFIG_MMC_OMAP_HS=y
 # CONFIG_MMC_VUB300 is not set
 # CONFIG_MMC_USHC is not set
 # CONFIG_MEMSTICK is not set
-CONFIG_LEDS_GPIO_REGISTER=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 
@@ -4215,12 +4200,12 @@ CONFIG_RTC_DRV_DS2404=m
 #
 # on-CPU RTC drivers
 #
-CONFIG_RTC_DRV_IMXDI=y
+# CONFIG_RTC_DRV_IMXDI is not set
 CONFIG_RTC_DRV_OMAP=y
-CONFIG_RTC_DRV_PL030=y
-CONFIG_RTC_DRV_PL031=y
-CONFIG_RTC_DRV_MC13XXX=y
-CONFIG_RTC_DRV_MXC=y
+# CONFIG_RTC_DRV_PL030 is not set
+# CONFIG_RTC_DRV_PL031 is not set
+# CONFIG_RTC_DRV_MC13XXX is not set
+# CONFIG_RTC_DRV_MXC is not set
 CONFIG_RTC_DRV_SNVS=y
 
 #
@@ -4235,13 +4220,14 @@ CONFIG_DMADEVICES=y
 #
 # CONFIG_AMBA_PL08X is not set
 # CONFIG_DW_DMAC is not set
-# CONFIG_MX3_IPU is not set
+CONFIG_MX3_IPU=y
+CONFIG_MX3_IPU_IRQS=4
 CONFIG_TIMB_DMA=m
 CONFIG_TI_EDMA=y
-CONFIG_PL330_DMA=y
-CONFIG_IMX_SDMA=y
+# CONFIG_PL330_DMA is not set
+# CONFIG_IMX_SDMA is not set
 # CONFIG_IMX_DMA is not set
-CONFIG_MXS_DMA=y
+# CONFIG_MXS_DMA is not set
 CONFIG_DMA_OMAP=y
 CONFIG_DMA_ENGINE=y
 CONFIG_DMA_VIRTUAL_CHANNELS=y
@@ -4259,12 +4245,10 @@ CONFIG_UIO_PDRV=y
 CONFIG_UIO_PDRV_GENIRQ=y
 CONFIG_UIO_DMEM_GENIRQ=y
 # CONFIG_VFIO is not set
-CONFIG_VIRTIO=m
 
 #
 # Virtio drivers
 #
-# CONFIG_VIRTIO_BALLOON is not set
 # CONFIG_VIRTIO_MMIO is not set
 
 #
@@ -4276,7 +4260,7 @@ CONFIG_USBIP_VHCI_HCD=m
 CONFIG_USBIP_HOST=m
 # CONFIG_USBIP_DEBUG is not set
 # CONFIG_W35UND is not set
-CONFIG_PRISM2_USB=m
+# CONFIG_PRISM2_USB is not set
 # CONFIG_ECHO is not set
 # CONFIG_COMEDI is not set
 # CONFIG_ASUS_OLED is not set
@@ -4437,11 +4421,11 @@ CONFIG_OMAP_THERMAL=y
 CONFIG_OMAP4_THERMAL=y
 CONFIG_OMAP5_THERMAL=y
 CONFIG_CED1401=m
-CONFIG_DRM_IMX=m
-CONFIG_DRM_IMX_FB_HELPER=m
-CONFIG_DRM_IMX_PARALLEL_DISPLAY=m
-CONFIG_DRM_IMX_IPUV3_CORE=m
-CONFIG_DRM_IMX_IPUV3=m
+CONFIG_DRM_IMX=y
+CONFIG_DRM_IMX_FB_HELPER=y
+CONFIG_DRM_IMX_PARALLEL_DISPLAY=y
+CONFIG_DRM_IMX_IPUV3_CORE=y
+CONFIG_DRM_IMX_IPUV3=y
 # CONFIG_DGRP is not set
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_HAVE_CLK_PREPARE=y
@@ -4460,10 +4444,9 @@ CONFIG_HWSPINLOCK=y
 #
 CONFIG_HWSPINLOCK_OMAP=y
 CONFIG_CLKSRC_MMIO=y
-CONFIG_SUNXI_TIMER=y
 CONFIG_ARM_ARCH_TIMER=y
 CONFIG_MAILBOX=y
-CONFIG_PL320_MBOX=y
+# CONFIG_PL320_MBOX is not set
 CONFIG_IOMMU_API=y
 CONFIG_IOMMU_SUPPORT=y
 CONFIG_OF_IOMMU=y
@@ -4474,8 +4457,7 @@ CONFIG_OMAP_IOMMU_DEBUG=y
 #
 # Remoteproc drivers
 #
-CONFIG_REMOTEPROC=m
-CONFIG_STE_MODEM_RPROC=m
+# CONFIG_STE_MODEM_RPROC is not set
 
 #
 # Rpmsg drivers
@@ -4495,8 +4477,7 @@ CONFIG_DEVFREQ_GOV_USERSPACE=y
 # DEVFREQ Drivers
 #
 # CONFIG_EXTCON is not set
-CONFIG_MEMORY=y
-CONFIG_TI_EMIF=y
+# CONFIG_MEMORY is not set
 CONFIG_IIO=y
 CONFIG_IIO_BUFFER=y
 CONFIG_IIO_BUFFER_CB=y
@@ -4612,7 +4593,7 @@ CONFIG_IIO_ST_MAGN_3AXIS=m
 CONFIG_IIO_ST_MAGN_I2C_3AXIS=m
 CONFIG_IIO_ST_MAGN_SPI_3AXIS=m
 CONFIG_PWM=y
-CONFIG_PWM_IMX=y
+# CONFIG_PWM_IMX is not set
 CONFIG_PWM_TIECAP=y
 CONFIG_PWM_TIEHRPWM=y
 CONFIG_PWM_TIPWMSS=y
@@ -4920,7 +4901,10 @@ CONFIG_DEBUG_KERNEL=y
 # CONFIG_LOCKUP_DETECTOR is not set
 # CONFIG_PANIC_ON_OOPS is not set
 CONFIG_PANIC_ON_OOPS_VALUE=0
-# CONFIG_DETECT_HUNG_TASK is not set
+CONFIG_DETECT_HUNG_TASK=y
+CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
+# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
 CONFIG_SCHED_DEBUG=y
 CONFIG_SCHEDSTATS=y
 CONFIG_TIMER_STATS=y
@@ -4930,14 +4914,11 @@ CONFIG_HAVE_DEBUG_KMEMLEAK=y
 # CONFIG_DEBUG_KMEMLEAK is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
 # CONFIG_RT_MUTEX_TESTER is not set
-CONFIG_DEBUG_SPINLOCK=y
-CONFIG_DEBUG_MUTEXES=y
-CONFIG_DEBUG_LOCK_ALLOC=y
-CONFIG_PROVE_LOCKING=y
-CONFIG_LOCKDEP=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
 # CONFIG_LOCK_STAT is not set
-# CONFIG_DEBUG_LOCKDEP is not set
-CONFIG_TRACE_IRQFLAGS=y
 # CONFIG_DEBUG_ATOMIC_SLEEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 CONFIG_STACKTRACE=y
@@ -4959,10 +4940,9 @@ CONFIG_DEBUG_BUGVERBOSE=y
 #
 # RCU Debugging
 #
-# CONFIG_PROVE_RCU is not set
 # CONFIG_SPARSE_RCU_POINTER is not set
 # CONFIG_RCU_TORTURE_TEST is not set
-CONFIG_RCU_CPU_STALL_TIMEOUT=21
+CONFIG_RCU_CPU_STALL_TIMEOUT=60
 # CONFIG_RCU_CPU_STALL_INFO is not set
 # CONFIG_RCU_TRACE is not set
 # CONFIG_KPROBES_SANITY_TEST is not set
@@ -5020,10 +5000,32 @@ CONFIG_KDB_CONTINUE_CATASTROPHIC=0
 # CONFIG_TEST_KSTRTOX is not set
 CONFIG_STRICT_DEVMEM=y
 CONFIG_ARM_UNWIND=y
-# CONFIG_DEBUG_USER is not set
-# CONFIG_DEBUG_LL is not set
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_IMX51_UART is not set
+# CONFIG_DEBUG_IMX53_UART is not set
+# CONFIG_DEBUG_IMX6Q_UART is not set
+CONFIG_DEBUG_OMAP2PLUS_UART=y
+# CONFIG_DEBUG_VEXPRESS_UART0_DETECT is not set
+# CONFIG_DEBUG_VEXPRESS_UART0_CA9 is not set
+# CONFIG_DEBUG_VEXPRESS_UART0_RS1 is not set
+# CONFIG_DEBUG_ICEDCC is not set
+# CONFIG_DEBUG_SEMIHOSTING is not set
 CONFIG_DEBUG_IMX_UART_PORT=1
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+CONFIG_DEBUG_OMAP2UART1=y
+# CONFIG_DEBUG_OMAP2UART2 is not set
+# CONFIG_DEBUG_OMAP2UART3 is not set
+# CONFIG_DEBUG_OMAP3UART3 is not set
+# CONFIG_DEBUG_OMAP4UART3 is not set
+# CONFIG_DEBUG_OMAP3UART4 is not set
+# CONFIG_DEBUG_OMAP4UART4 is not set
+# CONFIG_DEBUG_TI81XXUART1 is not set
+# CONFIG_DEBUG_TI81XXUART2 is not set
+# CONFIG_DEBUG_TI81XXUART3 is not set
+# CONFIG_DEBUG_AM33XXUART1 is not set
+# CONFIG_DEBUG_ZOOM_UART is not set
+CONFIG_DEBUG_LL_INCLUDE="debug/omap2plus.S"
+CONFIG_EARLY_PRINTK=y
 # CONFIG_OC_ETM is not set
 # CONFIG_ARM_KPROBES_TEST is not set
 # CONFIG_PID_IN_CONTEXTIDR is not set
@@ -5174,9 +5176,9 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
 #
 # Compression
 #
-CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_ZLIB=m
-CONFIG_CRYPTO_LZO=y
+CONFIG_CRYPTO_LZO=m
 
 #
 # Random Number Generation
@@ -5186,8 +5188,8 @@ CONFIG_CRYPTO_USER_API=m
 CONFIG_CRYPTO_USER_API_HASH=m
 CONFIG_CRYPTO_USER_API_SKCIPHER=m
 CONFIG_CRYPTO_HW=y
-# CONFIG_CRYPTO_DEV_OMAP_SHAM is not set
-# CONFIG_CRYPTO_DEV_OMAP_AES is not set
+CONFIG_CRYPTO_DEV_OMAP_SHAM=m
+CONFIG_CRYPTO_DEV_OMAP_AES=m
 CONFIG_ASYMMETRIC_KEY_TYPE=m
 # CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE is not set
 CONFIG_BINARY_PRINTF=y
@@ -5202,18 +5204,17 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y
 CONFIG_GENERIC_STRNLEN_USER=y
 CONFIG_GENERIC_PCI_IOMAP=y
 CONFIG_GENERIC_IO=y
-CONFIG_STMP_DEVICE=y
-CONFIG_CRC_CCITT=y
+CONFIG_CRC_CCITT=m
 CONFIG_CRC16=y
 CONFIG_CRC_T10DIF=y
-CONFIG_CRC_ITU_T=y
+CONFIG_CRC_ITU_T=m
 CONFIG_CRC32=y
 # CONFIG_CRC32_SELFTEST is not set
 CONFIG_CRC32_SLICEBY8=y
 # CONFIG_CRC32_SLICEBY4 is not set
 # CONFIG_CRC32_SARWATE is not set
 # CONFIG_CRC32_BIT is not set
-CONFIG_CRC7=y
+CONFIG_CRC7=m
 CONFIG_LIBCRC32C=y
 CONFIG_CRC8=y
 CONFIG_AUDIT_GENERIC=y
@@ -5237,6 +5238,8 @@ CONFIG_DECOMPRESS_XZ=y
 CONFIG_DECOMPRESS_LZO=y
 CONFIG_REED_SOLOMON=m
 CONFIG_REED_SOLOMON_DEC16=y
+CONFIG_BCH=y
+CONFIG_BCH_CONST_PARAMS=y
 CONFIG_TEXTSEARCH=y
 CONFIG_TEXTSEARCH_KMP=m
 CONFIG_TEXTSEARCH_BM=m
diff --git a/patches/gpu/0001-ARM-i.MX5-Move-IPU-clock-lookups-into-device-tree.patch b/patches/gpu/0001-ARM-i.MX5-Move-IPU-clock-lookups-into-device-tree.patch
new file mode 100644
index 0000000000000000000000000000000000000000..a2d3922b2203e396c9599b264ae94c741a98f97c
--- /dev/null
+++ b/patches/gpu/0001-ARM-i.MX5-Move-IPU-clock-lookups-into-device-tree.patch
@@ -0,0 +1,66 @@
+From 6f848fb147a350b6684af324f616cca5b76ce340 Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Sun, 6 Jan 2013 15:27:08 +0100
+Subject: [PATCH 01/16] ARM i.MX5: Move IPU clock lookups into device tree
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ arch/arm/boot/dts/imx51.dtsi        |    2 ++
+ arch/arm/boot/dts/imx53.dtsi        |    2 ++
+ arch/arm/mach-imx/clk-imx51-imx53.c |    7 -------
+ 3 files changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
+index fcf035b..e9480b8 100644
+--- a/arch/arm/boot/dts/imx51.dtsi
++++ b/arch/arm/boot/dts/imx51.dtsi
+@@ -67,6 +67,8 @@
+ 			compatible = "fsl,imx51-ipu";
+ 			reg = <0x40000000 0x20000000>;
+ 			interrupts = <11 10>;
++			clocks = <&clks 59>, <&clks 110>, <&clks 61>;
++			clock-names = "bus", "di0", "di1";
+ 		};
+ 
+ 		aips@70000000 { /* AIPS1 */
+diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
+index d05aa21..7a6f5a8 100644
+--- a/arch/arm/boot/dts/imx53.dtsi
++++ b/arch/arm/boot/dts/imx53.dtsi
+@@ -72,6 +72,8 @@
+ 			compatible = "fsl,imx53-ipu";
+ 			reg = <0x18000000 0x080000000>;
+ 			interrupts = <11 10>;
++			clocks = <&clks 59>, <&clks 110>, <&clks 61>;
++			clock-names = "bus", "di0", "di1";
+ 		};
+ 
+ 		aips@50000000 { /* AIPS1 */
+diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
+index 0f39f8c..d22ee6a 100644
+--- a/arch/arm/mach-imx/clk-imx51-imx53.c
++++ b/arch/arm/mach-imx/clk-imx51-imx53.c
+@@ -362,9 +362,6 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
+ 	clk_register_clkdev(clk[mx51_mipi], "mipi_hsp", NULL);
+ 	clk_register_clkdev(clk[vpu_gate], NULL, "imx51-vpu.0");
+ 	clk_register_clkdev(clk[fec_gate], NULL, "imx27-fec.0");
+-	clk_register_clkdev(clk[ipu_gate], "bus", "40000000.ipu");
+-	clk_register_clkdev(clk[ipu_di0_gate], "di0", "40000000.ipu");
+-	clk_register_clkdev(clk[ipu_di1_gate], "di1", "40000000.ipu");
+ 	clk_register_clkdev(clk[usb_phy_gate], "phy", "mxc-ehci.0");
+ 	clk_register_clkdev(clk[esdhc1_ipg_gate], "ipg", "sdhci-esdhc-imx51.0");
+ 	clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx51.0");
+@@ -471,10 +468,6 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
+ 	clk_register_clkdev(clk[vpu_gate], NULL, "imx53-vpu.0");
+ 	clk_register_clkdev(clk[i2c3_gate], NULL, "imx21-i2c.2");
+ 	clk_register_clkdev(clk[fec_gate], NULL, "imx25-fec.0");
+-	clk_register_clkdev(clk[ipu_gate], "bus", "18000000.ipu");
+-	clk_register_clkdev(clk[ipu_di0_gate], "di0", "18000000.ipu");
+-	clk_register_clkdev(clk[ipu_di1_gate], "di1", "18000000.ipu");
+-	clk_register_clkdev(clk[ipu_gate], "hsp", "18000000.ipu");
+ 	clk_register_clkdev(clk[usb_phy1_gate], "usb_phy1", "mxc-ehci.0");
+ 	clk_register_clkdev(clk[esdhc1_ipg_gate], "ipg", "sdhci-esdhc-imx53.0");
+ 	clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx53.0");
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0002-ARM-i.MX-Add-imx_clk_divider_flags-and-imx_clk_mux_f.patch b/patches/gpu/0002-ARM-i.MX-Add-imx_clk_divider_flags-and-imx_clk_mux_f.patch
new file mode 100644
index 0000000000000000000000000000000000000000..17d997019adcfa2436e3f8f76821da4ab8edbe78
--- /dev/null
+++ b/patches/gpu/0002-ARM-i.MX-Add-imx_clk_divider_flags-and-imx_clk_mux_f.patch
@@ -0,0 +1,53 @@
+From 111fc7419c06176b5ed12a9cb42ec0ba02be0201 Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Mon, 25 Mar 2013 14:34:22 +0100
+Subject: [PATCH 02/16] ARM i.MX: Add imx_clk_divider_flags and
+ imx_clk_mux_flags
+
+The default is for dividers to set CLK_SET_PARENT_RATE and for muxes to
+not set that flag. In the LDB clock tree, we need the opposite, so add
+functions to create divider and mux clocks with configurable flags.
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ arch/arm/mach-imx/clk.h |   17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/arch/arm/mach-imx/clk.h b/arch/arm/mach-imx/clk.h
+index 9d1f3b9..d9d9d9c 100644
+--- a/arch/arm/mach-imx/clk.h
++++ b/arch/arm/mach-imx/clk.h
+@@ -59,6 +59,14 @@ static inline struct clk *imx_clk_divider(const char *name, const char *parent,
+ 			reg, shift, width, 0, &imx_ccm_lock);
+ }
+ 
++static inline struct clk *imx_clk_divider_flags(const char *name,
++		const char *parent, void __iomem *reg, u8 shift, u8 width,
++		unsigned long flags)
++{
++	return clk_register_divider(NULL, name, parent, flags,
++			reg, shift, width, 0, &imx_ccm_lock);
++}
++
+ static inline struct clk *imx_clk_gate(const char *name, const char *parent,
+ 		void __iomem *reg, u8 shift)
+ {
+@@ -73,6 +81,15 @@ static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg,
+ 			width, 0, &imx_ccm_lock);
+ }
+ 
++static inline struct clk *imx_clk_mux_flags(const char *name,
++		void __iomem *reg, u8 shift, u8 width, const char **parents,
++		int num_parents, unsigned long flags)
++{
++	return clk_register_mux(NULL, name, parents, num_parents,
++			flags, reg, shift, width, 0,
++			&imx_ccm_lock);
++}
++
+ static inline struct clk *imx_clk_fixed_factor(const char *name,
+ 		const char *parent, unsigned int mult, unsigned int div)
+ {
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0003-ARM-i.MX5-Remove-tve_sel-clock-from-i.MX53-clock-tre.patch b/patches/gpu/0003-ARM-i.MX5-Remove-tve_sel-clock-from-i.MX53-clock-tre.patch
new file mode 100644
index 0000000000000000000000000000000000000000..598bd028d5353155b61277d2d65d9f356ae1209f
--- /dev/null
+++ b/patches/gpu/0003-ARM-i.MX5-Remove-tve_sel-clock-from-i.MX53-clock-tre.patch
@@ -0,0 +1,45 @@
+From be5452e5a76d8806f82404e41787627cc5844ef9 Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Wed, 3 Apr 2013 17:05:50 +0200
+Subject: [PATCH 03/16] ARM i.MX5: Remove tve_sel clock from i.MX53 clock tree
+
+On i.MX53, there is only tve_ext_sel.
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ arch/arm/mach-imx/clk-imx51-imx53.c |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
+index d22ee6a..e219d68 100644
+--- a/arch/arm/mach-imx/clk-imx51-imx53.c
++++ b/arch/arm/mach-imx/clk-imx51-imx53.c
+@@ -45,7 +45,7 @@ static const char *mx53_ipu_di1_sel[] = { "di_pred", "osc", "ckih1", "tve_di", "
+ static const char *mx53_ldb_di1_sel[] = { "pll3_sw", "pll4_sw", };
+ static const char *mx51_tve_ext_sel[] = { "osc", "ckih1", };
+ static const char *mx53_tve_ext_sel[] = { "pll4_sw", "ckih1", };
+-static const char *tve_sel[] = { "tve_pred", "tve_ext_sel", };
++static const char *mx51_tve_sel[] = { "tve_pred", "tve_ext_sel", };
+ static const char *ipu_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb", };
+ static const char *vpu_sel[] = { "axi_a", "axi_b", "emi_slow_gate", "ahb", };
+ static const char *mx53_can_sel[] = { "ipg", "ckih1", "ckih2", "lp_apm", };
+@@ -161,7 +161,6 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
+ 	clk[cpu_podf] = imx_clk_divider("cpu_podf", "pll1_sw", MXC_CCM_CACRR, 0, 3);
+ 	clk[di_pred] = imx_clk_divider("di_pred", "pll3_sw", MXC_CCM_CDCDR, 6, 3);
+ 	clk[tve_di] = imx_clk_fixed("tve_di", 65000000); /* FIXME */
+-	clk[tve_s] = imx_clk_mux("tve_sel", MXC_CCM_CSCMR1, 7, 1, tve_sel, ARRAY_SIZE(tve_sel));
+ 	clk[iim_gate] = imx_clk_gate2("iim_gate", "ipg", MXC_CCM_CCGR0, 30);
+ 	clk[uart1_ipg_gate] = imx_clk_gate2("uart1_ipg_gate", "ipg", MXC_CCM_CCGR1, 6);
+ 	clk[uart1_per_gate] = imx_clk_gate2("uart1_per_gate", "uart_root", MXC_CCM_CCGR1, 8);
+@@ -333,6 +332,8 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
+ 				mx51_ipu_di1_sel, ARRAY_SIZE(mx51_ipu_di1_sel));
+ 	clk[tve_ext_sel] = imx_clk_mux("tve_ext_sel", MXC_CCM_CSCMR1, 6, 1,
+ 				mx51_tve_ext_sel, ARRAY_SIZE(mx51_tve_ext_sel));
++	clk[tve_s] = imx_clk_mux("tve_sel", MXC_CCM_CSCMR1, 7, 1,
++				mx51_tve_sel, ARRAY_SIZE(mx51_tve_sel));
+ 	clk[tve_gate] = imx_clk_gate2("tve_gate", "tve_sel", MXC_CCM_CCGR2, 30);
+ 	clk[tve_pred] = imx_clk_divider("tve_pred", "pll3_sw", MXC_CCM_CDCDR, 28, 3);
+ 	clk[esdhc1_per_gate] = imx_clk_gate2("esdhc1_per_gate", "esdhc_a_podf", MXC_CCM_CCGR3, 2);
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0004-ARM-i.MX53-Remove-unused-tve_gate-clkdev-entry.patch b/patches/gpu/0004-ARM-i.MX53-Remove-unused-tve_gate-clkdev-entry.patch
new file mode 100644
index 0000000000000000000000000000000000000000..66cb83b7425ebc65f45b248076b4558ac7d91bb7
--- /dev/null
+++ b/patches/gpu/0004-ARM-i.MX53-Remove-unused-tve_gate-clkdev-entry.patch
@@ -0,0 +1,25 @@
+From 37293a677545f3b99380a18e61bbfeeaf6e69ffd Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Mon, 8 Apr 2013 14:07:00 +0200
+Subject: [PATCH 04/16] ARM i.MX53: Remove unused tve_gate clkdev entry
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ arch/arm/mach-imx/clk-imx51-imx53.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
+index e219d68..41f8bbe 100644
+--- a/arch/arm/mach-imx/clk-imx51-imx53.c
++++ b/arch/arm/mach-imx/clk-imx51-imx53.c
+@@ -285,7 +285,6 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
+ 	clk_register_clkdev(clk[dummy], NULL, "imx2-wdt.0");
+ 	clk_register_clkdev(clk[dummy], NULL, "imx2-wdt.1");
+ 	clk_register_clkdev(clk[dummy], NULL, "imx-keypad");
+-	clk_register_clkdev(clk[tve_gate], NULL, "imx-tve.0");
+ 	clk_register_clkdev(clk[ipu_di1_gate], "di1", "imx-tve.0");
+ 	clk_register_clkdev(clk[gpc_dvfs], "gpc_dvfs", NULL);
+ 	clk_register_clkdev(clk[epit1_ipg_gate], "ipg", "imx-epit.0");
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0005-ARM-i.MX53-make-tve_ext_sel-propagate-rate-change-to.patch b/patches/gpu/0005-ARM-i.MX53-make-tve_ext_sel-propagate-rate-change-to.patch
new file mode 100644
index 0000000000000000000000000000000000000000..22ec07af6e573b7cc22c5a3bd22846c466a67d91
--- /dev/null
+++ b/patches/gpu/0005-ARM-i.MX53-make-tve_ext_sel-propagate-rate-change-to.patch
@@ -0,0 +1,32 @@
+From f39e1d22298455377bb8a6ea4772f18fca272fda Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Fri, 5 Apr 2013 16:09:21 +0200
+Subject: [PATCH 05/16] ARM i.MX53: make tve_ext_sel propagate rate change to
+ PLL
+
+This is needed so the Television Encoder driver can set the rate
+on tve_clk and have it propagated up to pll4_sw.
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ arch/arm/mach-imx/clk-imx51-imx53.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
+index 41f8bbe..067ef1f 100644
+--- a/arch/arm/mach-imx/clk-imx51-imx53.c
++++ b/arch/arm/mach-imx/clk-imx51-imx53.c
+@@ -435,8 +435,8 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
+ 				mx53_ipu_di0_sel, ARRAY_SIZE(mx53_ipu_di0_sel));
+ 	clk[ipu_di1_sel] = imx_clk_mux("ipu_di1_sel", MXC_CCM_CSCMR2, 29, 3,
+ 				mx53_ipu_di1_sel, ARRAY_SIZE(mx53_ipu_di1_sel));
+-	clk[tve_ext_sel] = imx_clk_mux("tve_ext_sel", MXC_CCM_CSCMR1, 6, 1,
+-				mx53_tve_ext_sel, ARRAY_SIZE(mx53_tve_ext_sel));
++	clk[tve_ext_sel] = imx_clk_mux_flags("tve_ext_sel", MXC_CCM_CSCMR1, 6, 1,
++				mx53_tve_ext_sel, ARRAY_SIZE(mx53_tve_ext_sel), CLK_SET_RATE_PARENT);
+ 	clk[tve_gate] = imx_clk_gate2("tve_gate", "tve_pred", MXC_CCM_CCGR2, 30);
+ 	clk[tve_pred] = imx_clk_divider("tve_pred", "tve_ext_sel", MXC_CCM_CDCDR, 28, 3);
+ 	clk[esdhc1_per_gate] = imx_clk_gate2("esdhc1_per_gate", "esdhc_a_podf", MXC_CCM_CCGR3, 2);
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0006-ARM-i.MX53-tve_di-clock-is-not-part-of-the-CCM-but-o.patch b/patches/gpu/0006-ARM-i.MX53-tve_di-clock-is-not-part-of-the-CCM-but-o.patch
new file mode 100644
index 0000000000000000000000000000000000000000..d0730d0c9eb9616b90d70d67843f10b9f7f8408b
--- /dev/null
+++ b/patches/gpu/0006-ARM-i.MX53-tve_di-clock-is-not-part-of-the-CCM-but-o.patch
@@ -0,0 +1,52 @@
+From f6e408326a42357f840953741744b7cc5bd6b8ed Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Mon, 8 Apr 2013 14:07:00 +0200
+Subject: [PATCH 06/16] ARM i.MX53: tve_di clock is not part of the CCM, but
+ of TVE
+
+Remove the tve_di clock from the CCM clock tree. It will be provided
+by the Television Encoder driver, as this clock is an output signal
+of the TVE module.
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ Documentation/devicetree/bindings/clock/imx5-clock.txt |    1 -
+ arch/arm/mach-imx/clk-imx51-imx53.c                    |    3 +--
+ 2 files changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/clock/imx5-clock.txt b/Documentation/devicetree/bindings/clock/imx5-clock.txt
+index 2a0c904..a67ff3b 100644
+--- a/Documentation/devicetree/bindings/clock/imx5-clock.txt
++++ b/Documentation/devicetree/bindings/clock/imx5-clock.txt
+@@ -38,7 +38,6 @@ clocks and IDs.
+ 	usb_phy_podf		23
+ 	cpu_podf		24
+ 	di_pred			25
+-	tve_di			26
+ 	tve_s			27
+ 	uart1_ipg_gate		28
+ 	uart1_per_gate		29
+diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
+index 067ef1f..c439a8a 100644
+--- a/arch/arm/mach-imx/clk-imx51-imx53.c
++++ b/arch/arm/mach-imx/clk-imx51-imx53.c
+@@ -54,7 +54,7 @@ enum imx5_clks {
+ 	dummy, ckil, osc, ckih1, ckih2, ahb, ipg, axi_a, axi_b, uart_pred,
+ 	uart_root, esdhc_a_pred, esdhc_b_pred, esdhc_c_s, esdhc_d_s,
+ 	emi_sel, emi_slow_podf, nfc_podf, ecspi_pred, ecspi_podf, usboh3_pred,
+-	usboh3_podf, usb_phy_pred, usb_phy_podf, cpu_podf, di_pred, tve_di,
++	usboh3_podf, usb_phy_pred, usb_phy_podf, cpu_podf, di_pred, tve_di_unused,
+ 	tve_s, uart1_ipg_gate, uart1_per_gate, uart2_ipg_gate,
+ 	uart2_per_gate, uart3_ipg_gate, uart3_per_gate, i2c1_gate, i2c2_gate,
+ 	gpt_ipg_gate, pwm1_ipg_gate, pwm1_hf_gate, pwm2_ipg_gate, pwm2_hf_gate,
+@@ -160,7 +160,6 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
+ 				usb_phy_sel_str, ARRAY_SIZE(usb_phy_sel_str));
+ 	clk[cpu_podf] = imx_clk_divider("cpu_podf", "pll1_sw", MXC_CCM_CACRR, 0, 3);
+ 	clk[di_pred] = imx_clk_divider("di_pred", "pll3_sw", MXC_CCM_CDCDR, 6, 3);
+-	clk[tve_di] = imx_clk_fixed("tve_di", 65000000); /* FIXME */
+ 	clk[iim_gate] = imx_clk_gate2("iim_gate", "ipg", MXC_CCM_CCGR0, 30);
+ 	clk[uart1_ipg_gate] = imx_clk_gate2("uart1_ipg_gate", "ipg", MXC_CCM_CCGR1, 6);
+ 	clk[uart1_per_gate] = imx_clk_gate2("uart1_per_gate", "uart_root", MXC_CCM_CCGR1, 8);
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0007-ARM-i.MX53-set-CLK_SET_RATE_PARENT-flag-on-the-tve_e.patch b/patches/gpu/0007-ARM-i.MX53-set-CLK_SET_RATE_PARENT-flag-on-the-tve_e.patch
new file mode 100644
index 0000000000000000000000000000000000000000..8575aae7809e3d0ad935bd8246b9c06d07a2fef5
--- /dev/null
+++ b/patches/gpu/0007-ARM-i.MX53-set-CLK_SET_RATE_PARENT-flag-on-the-tve_e.patch
@@ -0,0 +1,33 @@
+From 94362f3cea06dc01a593b66127dff8c85dd0d8bb Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Mon, 8 Apr 2013 14:09:44 +0200
+Subject: [PATCH 07/16] ARM i.MX53: set CLK_SET_RATE_PARENT flag on the
+ tve_ext_sel clock
+
+Use imx_clk_mux_flags to set the appropriate flags for the TVE
+selector clock. This is needed so tve_clk rate changes can propagate
+up to pll4_sw.
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ arch/arm/mach-imx/clk-imx51-imx53.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
+index c439a8a..517cdfd 100644
+--- a/arch/arm/mach-imx/clk-imx51-imx53.c
++++ b/arch/arm/mach-imx/clk-imx51-imx53.c
+@@ -328,8 +328,8 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc,
+ 				mx51_ipu_di0_sel, ARRAY_SIZE(mx51_ipu_di0_sel));
+ 	clk[ipu_di1_sel] = imx_clk_mux("ipu_di1_sel", MXC_CCM_CSCMR2, 29, 3,
+ 				mx51_ipu_di1_sel, ARRAY_SIZE(mx51_ipu_di1_sel));
+-	clk[tve_ext_sel] = imx_clk_mux("tve_ext_sel", MXC_CCM_CSCMR1, 6, 1,
+-				mx51_tve_ext_sel, ARRAY_SIZE(mx51_tve_ext_sel));
++	clk[tve_ext_sel] = imx_clk_mux_flags("tve_ext_sel", MXC_CCM_CSCMR1, 6, 1,
++				mx51_tve_ext_sel, ARRAY_SIZE(mx51_tve_ext_sel), CLK_SET_RATE_PARENT);
+ 	clk[tve_s] = imx_clk_mux("tve_sel", MXC_CCM_CSCMR1, 7, 1,
+ 				mx51_tve_sel, ARRAY_SIZE(mx51_tve_sel));
+ 	clk[tve_gate] = imx_clk_gate2("tve_gate", "tve_sel", MXC_CCM_CCGR2, 30);
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0008-ARM-i.MX53-Add-TVE-entry-to-i.MX53-dtsi.patch b/patches/gpu/0008-ARM-i.MX53-Add-TVE-entry-to-i.MX53-dtsi.patch
new file mode 100644
index 0000000000000000000000000000000000000000..4ffd146dad27d8d2b02c2dccfcd08ec4716bb43e
--- /dev/null
+++ b/patches/gpu/0008-ARM-i.MX53-Add-TVE-entry-to-i.MX53-dtsi.patch
@@ -0,0 +1,37 @@
+From d1e77720ab0770bb3ab07cdda29027ce26108db0 Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Wed, 27 Mar 2013 17:04:47 +0100
+Subject: [PATCH 08/16] ARM i.MX53: Add TVE entry to i.MX53 dtsi
+
+This adds the Television Encoder (TVEv2) device tree node
+to the i.MX53 dtsi.
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ arch/arm/boot/dts/imx53.dtsi |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
+index 7a6f5a8..5baaf85 100644
+--- a/arch/arm/boot/dts/imx53.dtsi
++++ b/arch/arm/boot/dts/imx53.dtsi
+@@ -733,6 +733,16 @@
+ 				clock-names = "ipg", "ahb", "ptp";
+ 				status = "disabled";
+ 			};
++
++			tve: tve@63ff0000 {
++				compatible = "fsl,imx53-tve";
++				reg = <0x63ff0000 0x1000>;
++				interrupts = <92>;
++				clocks = <&clks 69>, <&clks 116>;
++				clock-names = "tve", "di_sel";
++				crtcs = <&ipu 1>;
++				status = "disabled";
++			};
+ 		};
+ 	};
+ };
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0009-ARM-i.MX53-dts-Add-TVE-to-i.MX53-QSB-device-tree.patch b/patches/gpu/0009-ARM-i.MX53-dts-Add-TVE-to-i.MX53-QSB-device-tree.patch
new file mode 100644
index 0000000000000000000000000000000000000000..6766c6185acdeca0adf7c82161e25dd36305cda1
--- /dev/null
+++ b/patches/gpu/0009-ARM-i.MX53-dts-Add-TVE-to-i.MX53-QSB-device-tree.patch
@@ -0,0 +1,60 @@
+From c422c5843d63b16ff45424e9c9f679c91e7a4ba2 Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Fri, 5 Apr 2013 12:54:08 +0200
+Subject: [PATCH 09/16] ARM i.MX53: dts: Add TVE to i.MX53-QSB device tree
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ arch/arm/boot/dts/imx53-qsb.dts |   25 +++++++++++++++++++++++--
+ 1 file changed, 23 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/boot/dts/imx53-qsb.dts b/arch/arm/boot/dts/imx53-qsb.dts
+index 05cc562..f07466e 100644
+--- a/arch/arm/boot/dts/imx53-qsb.dts
++++ b/arch/arm/boot/dts/imx53-qsb.dts
+@@ -129,6 +129,15 @@
+ 		};
+ 	};
+ 
++	tve {
++		pinctrl_vga_sync_1: vgasync-grp1 {
++			fsl,pins = <
++				/* VGA_HSYNC, VSYNC with max drive strength */
++				614 0xe6	/* MX53_PAD_EIM_OE__IPU_DI1_PIN7 */
++				619 0xe6	/* MX53_PAD_EIM_RW__IPU_DI1_PIN8 */
++			>;
++		};
++	};
+ };
+ 
+ &uart1 {
+@@ -235,8 +244,8 @@
+ 			};
+ 
+ 			ldo8_reg: ldo8 {
+-				regulator-min-microvolt = <1200000>;
+-				regulator-max-microvolt = <3600000>;
++				regulator-min-microvolt = <2750000>;
++				regulator-max-microvolt = <2750000>;
+ 				regulator-always-on;
+ 			};
+ 
+@@ -268,3 +277,15 @@
+ 	phy-reset-gpios = <&gpio7 6 0>;
+ 	status = "okay";
+ };
++
++&tve {
++	pinctrl-names = "default";
++	pinctrl-0 = <&pinctrl_vga_sync_1>;
++	ddc = <&i2c2>;
++	fsl,tve-mode = "vga";
++	status = "okay";
++	dac-supply = <&ldo7_reg>;
++
++	fsl,hsync-pin = <7>; /* IPU DI1 PIN7 via EIM_OE */
++	fsl,vsync-pin = <8>; /* IPU DI1 PIN8 via EIM_RW */
++};
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0010-staging-drm-imx-ipu-dc-add-24-bit-GBR-support-to-DC.patch b/patches/gpu/0010-staging-drm-imx-ipu-dc-add-24-bit-GBR-support-to-DC.patch
new file mode 100644
index 0000000000000000000000000000000000000000..7e71c30eba667ed0be7eccb3288e9df5524f6f58
--- /dev/null
+++ b/patches/gpu/0010-staging-drm-imx-ipu-dc-add-24-bit-GBR-support-to-DC.patch
@@ -0,0 +1,82 @@
+From c6a6302181881b5159c4477aab3bbbdfbac1c32d Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Fri, 5 Apr 2013 12:59:11 +0200
+Subject: [PATCH 10/16] staging: drm/imx: ipu-dc: add 24-bit GBR support to DC
+
+24-bit GBR order is needed on the display interface connected
+to the Television Encoder (TVEv2) on i.MX53.
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ drivers/staging/imx-drm/imx-drm.h       |   10 ++++++++++
+ drivers/staging/imx-drm/ipu-v3/ipu-dc.c |   10 ++++++++++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/drivers/staging/imx-drm/imx-drm.h b/drivers/staging/imx-drm/imx-drm.h
+index ae28a49..a24508f 100644
+--- a/drivers/staging/imx-drm/imx-drm.h
++++ b/drivers/staging/imx-drm/imx-drm.h
+@@ -1,8 +1,18 @@
+ #ifndef _IMX_DRM_H_
+ #define _IMX_DRM_H_
+ 
++#include <linux/videodev2.h>
++
++#define IPU_PIX_FMT_GBR24	v4l2_fourcc('G', 'B', 'R', '3')
++
++struct drm_crtc;
++struct drm_connector;
++struct drm_device;
++struct drm_encoder;
+ struct imx_drm_crtc;
+ struct drm_fbdev_cma;
++struct drm_framebuffer;
++struct platform_device;
+ 
+ struct imx_drm_crtc_helper_funcs {
+ 	int (*enable_vblank)(struct drm_crtc *crtc);
+diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
+index 93c7579..fad5057 100644
+--- a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
++++ b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
+@@ -20,6 +20,7 @@
+ #include <linux/delay.h>
+ #include <linux/io.h>
+ 
++#include "../imx-drm.h"
+ #include "imx-ipu-v3.h"
+ #include "ipu-prv.h"
+ 
+@@ -86,6 +87,7 @@ struct ipu_dc_priv;
+ enum ipu_dc_map {
+ 	IPU_DC_MAP_RGB24,
+ 	IPU_DC_MAP_RGB565,
++	IPU_DC_MAP_GBR24, /* TVEv2 */
+ };
+ 
+ struct ipu_dc {
+@@ -136,6 +138,8 @@ static int ipu_pixfmt_to_map(u32 fmt)
+ 		return IPU_DC_MAP_RGB24;
+ 	case V4L2_PIX_FMT_RGB565:
+ 		return IPU_DC_MAP_RGB565;
++	case IPU_PIX_FMT_GBR24:
++		return IPU_DC_MAP_GBR24;
+ 	default:
+ 		return -EINVAL;
+ 	}
+@@ -364,6 +368,12 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device *dev,
+ 	ipu_dc_map_config(priv, IPU_DC_MAP_RGB565, 1, 10, 0xfc); /* green */
+ 	ipu_dc_map_config(priv, IPU_DC_MAP_RGB565, 2, 15, 0xf8); /* red */
+ 
++	/* gbr24 */
++	ipu_dc_map_clear(priv, IPU_DC_MAP_GBR24);
++	ipu_dc_map_config(priv, IPU_DC_MAP_GBR24, 2, 15, 0xff); /* green */
++	ipu_dc_map_config(priv, IPU_DC_MAP_GBR24, 1, 7, 0xff); /* blue */
++	ipu_dc_map_config(priv, IPU_DC_MAP_GBR24, 0, 23, 0xff); /* red */
++
+ 	return 0;
+ }
+ 
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0011-staging-drm-imx-ipuv3-crtc-use-external-clock-for-TV.patch b/patches/gpu/0011-staging-drm-imx-ipuv3-crtc-use-external-clock-for-TV.patch
new file mode 100644
index 0000000000000000000000000000000000000000..982f9194ffe7b1bcde2f9cd622530b69c99971ca
--- /dev/null
+++ b/patches/gpu/0011-staging-drm-imx-ipuv3-crtc-use-external-clock-for-TV.patch
@@ -0,0 +1,27 @@
+From 460635c28d5577ad7df3013cc8af4ed81a1d5f3f Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Thu, 4 Apr 2013 15:58:35 +0200
+Subject: [PATCH 11/16] staging: drm/imx: ipuv3-crtc: use external clock for
+ TV Encoder
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ drivers/staging/imx-drm/ipuv3-crtc.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c b/drivers/staging/imx-drm/ipuv3-crtc.c
+index b028b0d..620e571 100644
+--- a/drivers/staging/imx-drm/ipuv3-crtc.c
++++ b/drivers/staging/imx-drm/ipuv3-crtc.c
+@@ -413,6 +413,8 @@ static int ipu_set_interface_pix_fmt(struct drm_crtc *crtc, u32 encoder_type,
+ 	ipu_crtc->interface_pix_fmt = pixfmt;
+ 
+ 	switch (encoder_type) {
++	case DRM_MODE_ENCODER_DAC:
++	case DRM_MODE_ENCODER_TVDAC:
+ 	case DRM_MODE_ENCODER_LVDS:
+ 		ipu_crtc->di_clkflags = IPU_DI_CLKMODE_SYNC |
+ 			IPU_DI_CLKMODE_EXT;
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0012-staging-drm-imx-ipu-di-add-comments-explaining-signa.patch b/patches/gpu/0012-staging-drm-imx-ipu-di-add-comments-explaining-signa.patch
new file mode 100644
index 0000000000000000000000000000000000000000..616418ef9b88ad588ad9d0369f01ef171128fc63
--- /dev/null
+++ b/patches/gpu/0012-staging-drm-imx-ipu-di-add-comments-explaining-signa.patch
@@ -0,0 +1,60 @@
+From b22c5630177f369a20f0f7eaa2a95ff1ac2cca80 Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Fri, 5 Apr 2013 13:38:31 +0200
+Subject: [PATCH 12/16] staging: drm/imx: ipu-di: add comments explaining
+ signal generator configuration
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ drivers/staging/imx-drm/ipu-v3/ipu-di.c |    9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-di.c b/drivers/staging/imx-drm/ipu-v3/ipu-di.c
+index ec340da..26534b7 100644
+--- a/drivers/staging/imx-drm/ipu-v3/ipu-di.c
++++ b/drivers/staging/imx-drm/ipu-v3/ipu-di.c
+@@ -413,9 +413,11 @@ static void ipu_di_sync_config_noninterlaced(struct ipu_di *di,
+ 		sig->v_end_width;
+ 	struct di_sync_config cfg[] = {
+ 		{
++			/* 1: INT_HSYNC */
+ 			.run_count = h_total - 1,
+ 			.run_src = DI_SYNC_CLK,
+ 		} , {
++			/* PIN2: HSYNC */
+ 			.run_count = h_total - 1,
+ 			.run_src = DI_SYNC_CLK,
+ 			.offset_count = div * sig->v_to_h_sync,
+@@ -424,23 +426,28 @@ static void ipu_di_sync_config_noninterlaced(struct ipu_di *di,
+ 			.cnt_polarity_trigger_src = DI_SYNC_CLK,
+ 			.cnt_down = sig->h_sync_width * 2,
+ 		} , {
++			/* PIN3: VSYNC */
+ 			.run_count = v_total - 1,
+ 			.run_src = DI_SYNC_INT_HSYNC,
+ 			.cnt_polarity_gen_en = 1,
+ 			.cnt_polarity_trigger_src = DI_SYNC_INT_HSYNC,
+ 			.cnt_down = sig->v_sync_width * 2,
+ 		} , {
++			/* 4: Line Active */
+ 			.run_src = DI_SYNC_HSYNC,
+ 			.offset_count = sig->v_sync_width + sig->v_start_width,
+ 			.offset_src = DI_SYNC_HSYNC,
+ 			.repeat_count = sig->height,
+ 			.cnt_clr_src = DI_SYNC_VSYNC,
+ 		} , {
++			/* 5: DE, referenced by DC */
+ 			.run_src = DI_SYNC_CLK,
+ 			.offset_count = sig->h_sync_width + sig->h_start_width,
+ 			.offset_src = DI_SYNC_CLK,
+ 			.repeat_count = sig->width,
+-			.cnt_clr_src = 5,
++			.cnt_clr_src = 5, /* Line Active */
++		} , {
++			/* unused */
+ 		} , {
+ 			/* unused */
+ 		} , {
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0013-staging-drm-imx-Add-support-for-VGA-via-TVE-on-i.MX5.patch b/patches/gpu/0013-staging-drm-imx-Add-support-for-VGA-via-TVE-on-i.MX5.patch
new file mode 100644
index 0000000000000000000000000000000000000000..af66c89ea44f605bdeba5abe086416c6ca1ff450
--- /dev/null
+++ b/patches/gpu/0013-staging-drm-imx-Add-support-for-VGA-via-TVE-on-i.MX5.patch
@@ -0,0 +1,260 @@
+From c4770c6bb1691a59e93e4c06664799766d051e9e Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Fri, 5 Apr 2013 13:37:48 +0200
+Subject: [PATCH 13/16] staging: drm/imx: Add support for VGA via TVE on
+ i.MX53
+
+This adds display interface timings for the Television Encoder
+connected to IPU DI1 on i.MX53 and adds some configuration
+glue code to select which IPU signal generators / pins are to
+be used for HSYNC/VSYNC signals.
+
+The default configuration is pin2/pin3 for hsync/vsync. The
+VGA connector on i.MX53-QSB uses pin7/pin8, and the analog
+part of the DVI-I connector on MBa53 connects to pin4/pin6.
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ drivers/staging/imx-drm/imx-drm-core.c      |   15 ++++-
+ drivers/staging/imx-drm/imx-drm.h           |    4 +-
+ drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h |    3 +
+ drivers/staging/imx-drm/ipu-v3/ipu-di.c     |   93 +++++++++++++++++++++++++--
+ drivers/staging/imx-drm/ipuv3-crtc.c        |    9 ++-
+ 5 files changed, 112 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c
+index cec19f1..6455305 100644
+--- a/drivers/staging/imx-drm/imx-drm-core.c
++++ b/drivers/staging/imx-drm/imx-drm-core.c
+@@ -112,8 +112,8 @@ static struct imx_drm_crtc *imx_drm_crtc_by_num(struct imx_drm_device *imxdrm,
+ 	return NULL;
+ }
+ 
+-int imx_drm_crtc_panel_format(struct drm_crtc *crtc, u32 encoder_type,
+-		u32 interface_pix_fmt)
++int imx_drm_crtc_panel_format_pins(struct drm_crtc *crtc, u32 encoder_type,
++		u32 interface_pix_fmt, int hsync_pin, int vsync_pin)
+ {
+ 	struct imx_drm_device *imxdrm = crtc->dev->dev_private;
+ 	struct imx_drm_crtc *imx_crtc;
+@@ -134,9 +134,18 @@ found:
+ 	helper = &imx_crtc->imx_drm_helper_funcs;
+ 	if (helper->set_interface_pix_fmt)
+ 		return helper->set_interface_pix_fmt(crtc,
+-				encoder_type, interface_pix_fmt);
++				encoder_type, interface_pix_fmt,
++				hsync_pin, vsync_pin);
+ 	return 0;
+ }
++EXPORT_SYMBOL_GPL(imx_drm_crtc_panel_format_pins);
++
++int imx_drm_crtc_panel_format(struct drm_crtc *crtc, u32 encoder_type,
++		u32 interface_pix_fmt)
++{
++	return imx_drm_crtc_panel_format_pins(crtc, encoder_type,
++					      interface_pix_fmt, 0, 0);
++}
+ EXPORT_SYMBOL_GPL(imx_drm_crtc_panel_format);
+ 
+ int imx_drm_crtc_vblank_get(struct imx_drm_crtc *imx_drm_crtc)
+diff --git a/drivers/staging/imx-drm/imx-drm.h b/drivers/staging/imx-drm/imx-drm.h
+index a24508f..f2aac91 100644
+--- a/drivers/staging/imx-drm/imx-drm.h
++++ b/drivers/staging/imx-drm/imx-drm.h
+@@ -18,7 +18,7 @@ struct imx_drm_crtc_helper_funcs {
+ 	int (*enable_vblank)(struct drm_crtc *crtc);
+ 	void (*disable_vblank)(struct drm_crtc *crtc);
+ 	int (*set_interface_pix_fmt)(struct drm_crtc *crtc, u32 encoder_type,
+-			u32 pix_fmt);
++			u32 pix_fmt, int hsync_pin, int vsync_pin);
+ 	const struct drm_crtc_helper_funcs *crtc_helper_funcs;
+ 	const struct drm_crtc_funcs *crtc_funcs;
+ };
+@@ -54,6 +54,8 @@ struct drm_gem_cma_object *imx_drm_fb_get_obj(struct drm_framebuffer *fb);
+ 
+ struct drm_device *imx_drm_device_get(void);
+ void imx_drm_device_put(void);
++int imx_drm_crtc_panel_format_pins(struct drm_crtc *crtc, u32 encoder_type,
++		u32 interface_pix_fmt, int hsync_pin, int vsync_pin);
+ int imx_drm_crtc_panel_format(struct drm_crtc *crtc, u32 encoder_type,
+ 		u32 interface_pix_fmt);
+ void imx_drm_fb_helper_set(struct drm_fbdev_cma *fbdev_helper);
+diff --git a/drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h b/drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h
+index 99d1cce..f9f1cc9 100644
+--- a/drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h
++++ b/drivers/staging/imx-drm/ipu-v3/imx-ipu-v3.h
+@@ -54,6 +54,9 @@ struct ipu_di_signal_cfg {
+ #define IPU_DI_CLKMODE_SYNC	(1 << 0)
+ #define IPU_DI_CLKMODE_EXT	(1 << 1)
+ 	unsigned long clkflags;
++
++	u8 hsync_pin;
++	u8 vsync_pin;
+ };
+ 
+ enum ipu_color_space {
+diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-di.c b/drivers/staging/imx-drm/ipu-v3/ipu-di.c
+index 26534b7..19d777e 100644
+--- a/drivers/staging/imx-drm/ipu-v3/ipu-di.c
++++ b/drivers/staging/imx-drm/ipu-v3/ipu-di.c
+@@ -440,7 +440,7 @@ static void ipu_di_sync_config_noninterlaced(struct ipu_di *di,
+ 			.repeat_count = sig->height,
+ 			.cnt_clr_src = DI_SYNC_VSYNC,
+ 		} , {
+-			/* 5: DE, referenced by DC */
++			/* 5: Pixel Active, referenced by DC */
+ 			.run_src = DI_SYNC_CLK,
+ 			.offset_count = sig->h_sync_width + sig->h_start_width,
+ 			.offset_src = DI_SYNC_CLK,
+@@ -454,13 +454,78 @@ static void ipu_di_sync_config_noninterlaced(struct ipu_di *di,
+ 			/* unused */
+ 		} , {
+ 			/* unused */
++		},
++	};
++	/* can't use #7 and #8 for line active and pixel active counters */
++	struct di_sync_config cfg_vga[] = {
++		{
++			/* 1: INT_HSYNC */
++			.run_count = h_total - 1,
++			.run_src = DI_SYNC_CLK,
++		} , {
++			/* 2: VSYNC */
++			.run_count = v_total - 1,
++			.run_src = DI_SYNC_INT_HSYNC,
++		} , {
++			/* 3: Line Active */
++			.run_src = DI_SYNC_INT_HSYNC,
++			.offset_count = sig->v_sync_width + sig->v_start_width,
++			.offset_src = DI_SYNC_INT_HSYNC,
++			.repeat_count = sig->height,
++			.cnt_clr_src = 3 /* VSYNC */,
++		} , {
++			/* PIN4: HSYNC for VGA via TVEv2 on TQ MBa53 */
++			.run_count = h_total - 1,
++			.run_src = DI_SYNC_CLK,
++			.offset_count = div * sig->v_to_h_sync + 18, /* magic value from Freescale TVE driver */
++			.offset_src = DI_SYNC_CLK,
++			.cnt_polarity_gen_en = 1,
++			.cnt_polarity_trigger_src = DI_SYNC_CLK,
++			.cnt_down = sig->h_sync_width * 2,
++		} , {
++			/* 5: Pixel Active signal to DC */
++			.run_src = DI_SYNC_CLK,
++			.offset_count = sig->h_sync_width + sig->h_start_width,
++			.offset_src = DI_SYNC_CLK,
++			.repeat_count = sig->width,
++			.cnt_clr_src = 4, /* Line Active */
++		} , {
++			/* PIN6: VSYNC for VGA via TVEv2 on TQ MBa53 */
++			.run_count = v_total - 1,
++			.run_src = DI_SYNC_INT_HSYNC,
++			.offset_count = 1, /* magic value from Freescale TVE driver */
++			.offset_src = DI_SYNC_INT_HSYNC,
++			.cnt_polarity_gen_en = 1,
++			.cnt_polarity_trigger_src = DI_SYNC_INT_HSYNC,
++			.cnt_down = sig->v_sync_width * 2,
++		} , {
++			/* PIN4: HSYNC for VGA via TVEv2 on i.MX53-QSB */
++			.run_count = h_total - 1,
++			.run_src = DI_SYNC_CLK,
++			.offset_count = div * sig->v_to_h_sync + 18, /* magic value from Freescale TVE driver */
++			.offset_src = DI_SYNC_CLK,
++			.cnt_polarity_gen_en = 1,
++			.cnt_polarity_trigger_src = DI_SYNC_CLK,
++			.cnt_down = sig->h_sync_width * 2,
++		} , {
++			/* PIN6: VSYNC for VGA via TVEv2 on i.MX53-QSB */
++			.run_count = v_total - 1,
++			.run_src = DI_SYNC_INT_HSYNC,
++			.offset_count = 1, /* magic value from Freescale TVE driver */
++			.offset_src = DI_SYNC_INT_HSYNC,
++			.cnt_polarity_gen_en = 1,
++			.cnt_polarity_trigger_src = DI_SYNC_INT_HSYNC,
++			.cnt_down = sig->v_sync_width * 2,
+ 		} , {
+ 			/* unused */
+ 		},
+ 	};
+ 
+ 	ipu_di_write(di, v_total - 1, DI_SCR_CONF);
+-	ipu_di_sync_config(di, cfg, 0, ARRAY_SIZE(cfg));
++	if (sig->hsync_pin == 2 && sig->vsync_pin == 3)
++		ipu_di_sync_config(di, cfg, 0, ARRAY_SIZE(cfg));
++	else
++		ipu_di_sync_config(di, cfg_vga, 0, ARRAY_SIZE(cfg_vga));
+ }
+ 
+ int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig)
+@@ -537,11 +602,25 @@ int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig)
+ 		ipu_di_sync_config_noninterlaced(di, sig, div);
+ 
+ 		vsync_cnt = 3;
+-
+-		if (sig->Hsync_pol)
+-			di_gen |= DI_GEN_POLARITY_2;
+-		if (sig->Vsync_pol)
+-			di_gen |= DI_GEN_POLARITY_3;
++		if (di->id == 1)
++			vsync_cnt = 6;
++
++		if (sig->Hsync_pol) {
++			if (sig->hsync_pin == 2)
++				di_gen |= DI_GEN_POLARITY_2;
++			else if (sig->hsync_pin == 4)
++				di_gen |= DI_GEN_POLARITY_4;
++			else if (sig->hsync_pin == 7)
++				di_gen |= DI_GEN_POLARITY_7;
++		}
++		if (sig->Vsync_pol) {
++			if (sig->hsync_pin == 3)
++				di_gen |= DI_GEN_POLARITY_3;
++			else if (sig->hsync_pin == 6)
++				di_gen |= DI_GEN_POLARITY_6;
++			else if (sig->hsync_pin == 8)
++				di_gen |= DI_GEN_POLARITY_8;
++		}
+ 	}
+ 
+ 	if (!sig->clk_pol)
+diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c b/drivers/staging/imx-drm/ipuv3-crtc.c
+index 620e571..ea61c86 100644
+--- a/drivers/staging/imx-drm/ipuv3-crtc.c
++++ b/drivers/staging/imx-drm/ipuv3-crtc.c
+@@ -60,6 +60,8 @@ struct ipu_crtc {
+ 	int			irq;
+ 	u32			interface_pix_fmt;
+ 	unsigned long		di_clkflags;
++	int			di_hsync_pin;
++	int			di_vsync_pin;
+ };
+ 
+ #define to_ipu_crtc(x) container_of(x, struct ipu_crtc, base)
+@@ -255,6 +257,9 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
+ 
+ 	sig_cfg.v_to_h_sync = 0;
+ 
++	sig_cfg.hsync_pin = ipu_crtc->di_hsync_pin;
++	sig_cfg.vsync_pin = ipu_crtc->di_vsync_pin;
++
+ 	if (ipu_crtc->dp) {
+ 		ret = ipu_dp_setup_channel(ipu_crtc->dp, IPUV3_COLORSPACE_RGB,
+ 				IPUV3_COLORSPACE_RGB);
+@@ -406,11 +411,13 @@ static void ipu_disable_vblank(struct drm_crtc *crtc)
+ }
+ 
+ static int ipu_set_interface_pix_fmt(struct drm_crtc *crtc, u32 encoder_type,
+-		u32 pixfmt)
++		u32 pixfmt, int hsync_pin, int vsync_pin)
+ {
+ 	struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc);
+ 
+ 	ipu_crtc->interface_pix_fmt = pixfmt;
++	ipu_crtc->di_hsync_pin = hsync_pin;
++	ipu_crtc->di_vsync_pin = vsync_pin;
+ 
+ 	switch (encoder_type) {
+ 	case DRM_MODE_ENCODER_DAC:
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0014-staging-drm-imx-ipu-dc-add-WCLK-WRG-opcodes.patch b/patches/gpu/0014-staging-drm-imx-ipu-dc-add-WCLK-WRG-opcodes.patch
new file mode 100644
index 0000000000000000000000000000000000000000..e562b9b96ee7d072b81457c2239c6cb2520e6d48
--- /dev/null
+++ b/patches/gpu/0014-staging-drm-imx-ipu-dc-add-WCLK-WRG-opcodes.patch
@@ -0,0 +1,95 @@
+From 1cbd8e9d0c3b4312cde543a30af84adab68e7a9a Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Fri, 5 Apr 2013 16:49:35 +0200
+Subject: [PATCH 14/16] staging: drm/imx: ipu-dc: add WCLK/WRG opcodes
+
+Add WRG and WCLK opcodes to the display controller microcode,
+and allow multi instruction codes.
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ drivers/staging/imx-drm/ipu-v3/ipu-dc.c |   39 +++++++++++++++++++------------
+ 1 file changed, 24 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
+index fad5057..355b8a2 100644
+--- a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
++++ b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
+@@ -61,8 +61,10 @@
+ 
+ #define WROD(lf)		(0x18 | ((lf) << 1))
+ #define WRG			0x01
++#define WCLK			0xc9
+ 
+ #define SYNC_WAVE 0
++#define NULL_WAVE (-1)
+ 
+ #define DC_GEN_SYNC_1_6_SYNC	(2 << 1)
+ #define DC_GEN_SYNC_PRIORITY_1	(1 << 7)
+@@ -119,16 +121,23 @@ static void dc_link_event(struct ipu_dc *dc, int event, int addr, int priority)
+ }
+ 
+ static void dc_write_tmpl(struct ipu_dc *dc, int word, u32 opcode, u32 operand,
+-		int map, int wave, int glue, int sync)
++		int map, int wave, int glue, int sync, int stop)
+ {
+ 	struct ipu_dc_priv *priv = dc->priv;
+-	u32 reg;
+-	int stop = 1;
+-
+-	reg = sync | glue << 4 | ++wave << 11 | ++map << 15 | ((operand << 20) & 0xfff00000);
+-	writel(reg, priv->dc_tmpl_reg + word * 8);
+-	reg = operand >> 12 | opcode << 4 | stop << 9;
+-	writel(reg, priv->dc_tmpl_reg + word * 8 + 4);
++	u32 reg1, reg2;
++
++	if (opcode == WCLK) {
++		reg1 = (operand << 20) & 0xfff00000;
++		reg2 = operand >> 12 | opcode << 1 | stop << 9;
++	} else if (opcode == WRG) {
++		reg1 = sync | glue << 4 | ++wave << 11 | ((operand << 15) & 0xffff8000);
++		reg2 = operand >> 17 | opcode << 7 | stop << 9;
++	} else {
++		reg1 = sync | glue << 4 | ++wave << 11 | ++map << 15 | ((operand << 20) & 0xfff00000);
++		reg2 = operand >> 12 | opcode << 4 | stop << 9;
++	}
++	writel(reg1, priv->dc_tmpl_reg + word * 8);
++	writel(reg2, priv->dc_tmpl_reg + word * 8 + 4);
+ }
+ 
+ static int ipu_pixfmt_to_map(u32 fmt)
+@@ -165,24 +174,24 @@ int ipu_dc_init_sync(struct ipu_dc *dc, struct ipu_di *di, bool interlaced,
+ 		dc_link_event(dc, DC_EVT_NEW_DATA, 0, 1);
+ 
+ 		/* Init template microcode */
+-		dc_write_tmpl(dc, 0, WROD(0), 0, map, SYNC_WAVE, 0, 8);
++		dc_write_tmpl(dc, 0, WROD(0), 0, map, SYNC_WAVE, 0, 8, 1);
+ 	} else {
+ 		if (dc->di) {
+ 			dc_link_event(dc, DC_EVT_NL, 2, 3);
+ 			dc_link_event(dc, DC_EVT_EOL, 3, 2);
+ 			dc_link_event(dc, DC_EVT_NEW_DATA, 4, 1);
+ 			/* Init template microcode */
+-			dc_write_tmpl(dc, 2, WROD(0), 0, map, SYNC_WAVE, 8, 5);
+-			dc_write_tmpl(dc, 3, WROD(0), 0, map, SYNC_WAVE, 4, 5);
+-			dc_write_tmpl(dc, 4, WROD(0), 0, map, SYNC_WAVE, 0, 5);
++			dc_write_tmpl(dc, 2, WROD(0), 0, map, SYNC_WAVE, 8, 5, 1);
++			dc_write_tmpl(dc, 3, WROD(0), 0, map, SYNC_WAVE, 4, 5, 1);
++			dc_write_tmpl(dc, 4, WROD(0), 0, map, SYNC_WAVE, 0, 5, 1);
+ 		} else {
+ 			dc_link_event(dc, DC_EVT_NL, 5, 3);
+ 			dc_link_event(dc, DC_EVT_EOL, 6, 2);
+ 			dc_link_event(dc, DC_EVT_NEW_DATA, 7, 1);
+ 			/* Init template microcode */
+-			dc_write_tmpl(dc, 5, WROD(0), 0, map, SYNC_WAVE, 8, 5);
+-			dc_write_tmpl(dc, 6, WROD(0), 0, map, SYNC_WAVE, 4, 5);
+-			dc_write_tmpl(dc, 7, WROD(0), 0, map, SYNC_WAVE, 0, 5);
++			dc_write_tmpl(dc, 5, WROD(0), 0, map, SYNC_WAVE, 8, 5, 1);
++			dc_write_tmpl(dc, 6, WROD(0), 0, map, SYNC_WAVE, 4, 5, 1);
++			dc_write_tmpl(dc, 7, WROD(0), 0, map, SYNC_WAVE, 0, 5, 1);
+ 		}
+ 	}
+ 	dc_link_event(dc, DC_EVT_NF, 0, 0);
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0015-staging-drm-imx-ipu-dc-force-black-output-during-bla.patch b/patches/gpu/0015-staging-drm-imx-ipu-dc-force-black-output-during-bla.patch
new file mode 100644
index 0000000000000000000000000000000000000000..9f486bb85226fd7ca47130df419469099e1754a0
--- /dev/null
+++ b/patches/gpu/0015-staging-drm-imx-ipu-dc-force-black-output-during-bla.patch
@@ -0,0 +1,46 @@
+From afead37d89ca0a8c24d23f8002d03c0662aeaa1b Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Fri, 5 Apr 2013 16:52:16 +0200
+Subject: [PATCH 15/16] staging: drm/imx: ipu-dc: force black output during
+ blanking
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ drivers/staging/imx-drm/ipu-v3/ipu-dc.c |   14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
+index 355b8a2..1cb0631 100644
+--- a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
++++ b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
+@@ -179,19 +179,21 @@ int ipu_dc_init_sync(struct ipu_dc *dc, struct ipu_di *di, bool interlaced,
+ 		if (dc->di) {
+ 			dc_link_event(dc, DC_EVT_NL, 2, 3);
+ 			dc_link_event(dc, DC_EVT_EOL, 3, 2);
+-			dc_link_event(dc, DC_EVT_NEW_DATA, 4, 1);
++			dc_link_event(dc, DC_EVT_NEW_DATA, 1, 1);
+ 			/* Init template microcode */
+ 			dc_write_tmpl(dc, 2, WROD(0), 0, map, SYNC_WAVE, 8, 5, 1);
+-			dc_write_tmpl(dc, 3, WROD(0), 0, map, SYNC_WAVE, 4, 5, 1);
+-			dc_write_tmpl(dc, 4, WROD(0), 0, map, SYNC_WAVE, 0, 5, 1);
++			dc_write_tmpl(dc, 3, WROD(0), 0, map, SYNC_WAVE, 4, 5, 0);
++			dc_write_tmpl(dc, 4, WRG, 0, map, NULL_WAVE, 0, 0, 1);
++			dc_write_tmpl(dc, 1, WROD(0), 0, map, SYNC_WAVE, 0, 5, 1);
+ 		} else {
+ 			dc_link_event(dc, DC_EVT_NL, 5, 3);
+ 			dc_link_event(dc, DC_EVT_EOL, 6, 2);
+-			dc_link_event(dc, DC_EVT_NEW_DATA, 7, 1);
++			dc_link_event(dc, DC_EVT_NEW_DATA, 8, 1);
+ 			/* Init template microcode */
+ 			dc_write_tmpl(dc, 5, WROD(0), 0, map, SYNC_WAVE, 8, 5, 1);
+-			dc_write_tmpl(dc, 6, WROD(0), 0, map, SYNC_WAVE, 4, 5, 1);
+-			dc_write_tmpl(dc, 7, WROD(0), 0, map, SYNC_WAVE, 0, 5, 1);
++			dc_write_tmpl(dc, 6, WROD(0), 0, map, SYNC_WAVE, 4, 5, 0);
++			dc_write_tmpl(dc, 7, WRG, 0, map, NULL_WAVE, 0, 0, 1);
++			dc_write_tmpl(dc, 8, WROD(0), 0, map, SYNC_WAVE, 0, 5, 1);
+ 		}
+ 	}
+ 	dc_link_event(dc, DC_EVT_NF, 0, 0);
+-- 
+1.7.10.4
+
diff --git a/patches/gpu/0016-staging-drm-imx-Add-support-for-Television-Encoder-T.patch b/patches/gpu/0016-staging-drm-imx-Add-support-for-Television-Encoder-T.patch
new file mode 100644
index 0000000000000000000000000000000000000000..fe574962bc7389b671afd51fef6ec5936bdffd59
--- /dev/null
+++ b/patches/gpu/0016-staging-drm-imx-Add-support-for-Television-Encoder-T.patch
@@ -0,0 +1,815 @@
+From eeb6c72f31b58dcd84075a8922f601c5fb1eff49 Mon Sep 17 00:00:00 2001
+From: Philipp Zabel <p.zabel@pengutronix.de>
+Date: Wed, 27 Mar 2013 17:04:04 +0100
+Subject: [PATCH 16/16] staging: drm/imx: Add support for Television Encoder
+ (TVEv2)
+
+This driver adds support for the Television Encoder integrated
+on i.MX53 SoCs (TVEv2).
+
+Currently only the VGA output mode is supported, which only uses
+the TVDAC to generate RGB levels. HSYNC and VSYNC signals are
+routed directly from the IPU signal generator pins through IOMUXC.
+
+Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
+---
+ drivers/staging/imx-drm/Kconfig   |    7 +
+ drivers/staging/imx-drm/Makefile  |    1 +
+ drivers/staging/imx-drm/imx-tve.c |  755 +++++++++++++++++++++++++++++++++++++
+ 3 files changed, 763 insertions(+)
+ create mode 100644 drivers/staging/imx-drm/imx-tve.c
+
+diff --git a/drivers/staging/imx-drm/Kconfig b/drivers/staging/imx-drm/Kconfig
+index be7e2e3..8c9e403 100644
+--- a/drivers/staging/imx-drm/Kconfig
++++ b/drivers/staging/imx-drm/Kconfig
+@@ -20,6 +20,13 @@ config DRM_IMX_PARALLEL_DISPLAY
+ 	tristate "Support for parallel displays"
+ 	depends on DRM_IMX
+ 
++config DRM_IMX_TVE
++	tristate "Support for TV and VGA displays"
++	depends on DRM_IMX
++	help
++	  Choose this to enable the internal Television Encoder (TVe)
++	  found on i.MX53 processors.
++
+ config DRM_IMX_IPUV3_CORE
+ 	tristate "IPUv3 core support"
+ 	depends on DRM_IMX
+diff --git a/drivers/staging/imx-drm/Makefile b/drivers/staging/imx-drm/Makefile
+index 83a9056..7e50184 100644
+--- a/drivers/staging/imx-drm/Makefile
++++ b/drivers/staging/imx-drm/Makefile
+@@ -4,6 +4,7 @@ imxdrm-objs := imx-drm-core.o imx-fb.o
+ obj-$(CONFIG_DRM_IMX) += imxdrm.o
+ 
+ obj-$(CONFIG_DRM_IMX_PARALLEL_DISPLAY) += parallel-display.o
++obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o
+ obj-$(CONFIG_DRM_IMX_FB_HELPER) += imx-fbdev.o
+ obj-$(CONFIG_DRM_IMX_IPUV3_CORE) += ipu-v3/
+ obj-$(CONFIG_DRM_IMX_IPUV3)	+= ipuv3-crtc.o
+diff --git a/drivers/staging/imx-drm/imx-tve.c b/drivers/staging/imx-drm/imx-tve.c
+new file mode 100644
+index 0000000..a14ed0e
+--- /dev/null
++++ b/drivers/staging/imx-drm/imx-tve.c
+@@ -0,0 +1,755 @@
++/*
++ * i.MX drm driver - Television Encoder (TVEv2)
++ *
++ * Copyright (C) 2013 Philipp Zabel, Pengutronix
++ *
++ * 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.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
++ * MA 02110-1301, USA.
++ */
++
++#include <linux/clk.h>
++#include <linux/clk-provider.h>
++#include <linux/module.h>
++#include <linux/of_i2c.h>
++#include <linux/pinctrl/consumer.h>
++#include <linux/regmap.h>
++#include <linux/regulator/consumer.h>
++#include <linux/spinlock.h>
++#include <linux/videodev2.h>
++#include <drm/drmP.h>
++#include <drm/drm_fb_helper.h>
++#include <drm/drm_crtc_helper.h>
++
++#include "imx-drm.h"
++
++#define TVE_COM_CONF_REG	0x00
++#define TVE_TVDAC0_CONT_REG	0x28
++#define TVE_TVDAC1_CONT_REG	0x2c
++#define TVE_TVDAC2_CONT_REG	0x30
++#define TVE_CD_CONT_REG		0x34
++#define TVE_INT_CONT_REG	0x64
++#define TVE_STAT_REG		0x68
++#define TVE_TST_MODE_REG	0x6c
++#define TVE_MV_CONT_REG		0xdc
++
++/* TVE_COM_CONF_REG */
++#define TVE_SYNC_CH_2_EN	BIT(22)
++#define TVE_SYNC_CH_1_EN	BIT(21)
++#define TVE_SYNC_CH_0_EN	BIT(20)
++#define TVE_TV_OUT_MODE_MASK	(0x7 << 12)
++#define TVE_TV_OUT_DISABLE	(0x0 << 12)
++#define TVE_TV_OUT_CVBS_0	(0x1 << 12)
++#define TVE_TV_OUT_CVBS_2	(0x2 << 12)
++#define TVE_TV_OUT_CVBS_0_2	(0x3 << 12)
++#define TVE_TV_OUT_SVIDEO_0_1	(0x4 << 12)
++#define TVE_TV_OUT_SVIDEO_0_1_CVBS2_2	(0x5 << 12)
++#define TVE_TV_OUT_YPBPR	(0x6 << 12)
++#define TVE_TV_OUT_RGB		(0x7 << 12)
++#define TVE_TV_STAND_MASK	(0xf << 8)
++#define TVE_TV_STAND_HD_1080P30	(0xc << 8)
++#define TVE_P2I_CONV_EN		BIT(7)
++#define TVE_INP_VIDEO_FORM	BIT(6)
++#define TVE_INP_YCBCR_422	(0x0 << 6)
++#define TVE_INP_YCBCR_444	(0x1 << 6)
++#define TVE_DATA_SOURCE_MASK	(0x3 << 4)
++#define TVE_DATA_SOURCE_BUS1	(0x0 << 4)
++#define TVE_DATA_SOURCE_BUS2	(0x1 << 4)
++#define TVE_DATA_SOURCE_EXT	(0x2 << 4)
++#define TVE_DATA_SOURCE_TESTGEN	(0x3 << 4)
++#define TVE_IPU_CLK_EN_OFS	3
++#define TVE_IPU_CLK_EN		BIT(3)
++#define TVE_DAC_SAMP_RATE_OFS	1
++#define TVE_DAC_SAMP_RATE_WIDTH	2
++#define TVE_DAC_SAMP_RATE_MASK	(0x3 << 1)
++#define TVE_DAC_FULL_RATE	(0x0 << 1)
++#define TVE_DAC_DIV2_RATE	(0x1 << 1)
++#define TVE_DAC_DIV4_RATE	(0x2 << 1)
++#define TVE_EN			BIT(0)
++
++/* TVE_TVDACx_CONT_REG */
++#define TVE_TVDAC_GAIN_MASK	(0x3f << 0)
++
++/* TVE_CD_CONT_REG */
++#define TVE_CD_CH_2_SM_EN	BIT(22)
++#define TVE_CD_CH_1_SM_EN	BIT(21)
++#define TVE_CD_CH_0_SM_EN	BIT(20)
++#define TVE_CD_CH_2_LM_EN	BIT(18)
++#define TVE_CD_CH_1_LM_EN	BIT(17)
++#define TVE_CD_CH_0_LM_EN	BIT(16)
++#define TVE_CD_CH_2_REF_LVL	BIT(10)
++#define TVE_CD_CH_1_REF_LVL	BIT(9)
++#define TVE_CD_CH_0_REF_LVL	BIT(8)
++#define TVE_CD_EN		BIT(0)
++
++/* TVE_INT_CONT_REG */
++#define TVE_FRAME_END_IEN	BIT(13)
++#define TVE_CD_MON_END_IEN	BIT(2)
++#define TVE_CD_SM_IEN		BIT(1)
++#define TVE_CD_LM_IEN		BIT(0)
++
++/* TVE_TST_MODE_REG */
++#define TVE_TVDAC_TEST_MODE_MASK	(0x7 << 0)
++
++#define con_to_tve(x) container_of(x, struct imx_tve, connector)
++#define enc_to_tve(x) container_of(x, struct imx_tve, encoder)
++
++enum {
++	TVE_MODE_TVOUT,
++	TVE_MODE_VGA,
++};
++
++struct imx_tve {
++	struct drm_connector connector;
++	struct imx_drm_connector *imx_drm_connector;
++	struct drm_encoder encoder;
++	struct imx_drm_encoder *imx_drm_encoder;
++	struct device *dev;
++	spinlock_t enable_lock;	/* serializes tve_enable/disable */
++	spinlock_t lock;	/* register lock */
++	bool enabled;
++	int mode;
++
++	struct regmap *regmap;
++	struct regulator *dac_reg;
++	struct i2c_adapter *ddc;
++	struct clk *clk;
++	struct clk *di_sel_clk;
++	struct clk_hw clk_hw_di;
++	struct clk *di_clk;
++	int vsync_pin;
++	int hsync_pin;
++};
++
++static void tve_lock(void *__tve)
++{
++	struct imx_tve *tve = __tve;
++        spin_lock(&tve->lock);
++}
++
++static void tve_unlock(void *__tve)
++{
++	struct imx_tve *tve = __tve;
++        spin_unlock(&tve->lock);
++}
++
++static void tve_enable(struct imx_tve *tve)
++{
++	unsigned long flags;
++	int ret;
++
++	spin_lock_irqsave(&tve->enable_lock, flags);
++	if (!tve->enabled) {
++		tve->enabled = 1;
++		clk_prepare_enable(tve->clk);
++		ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG,
++					 TVE_IPU_CLK_EN | TVE_EN,
++					 TVE_IPU_CLK_EN | TVE_EN);
++	}
++
++	/* clear interrupt status register */
++	regmap_write(tve->regmap, TVE_STAT_REG, 0xffffffff);
++
++	/* cable detection irq disabled in VGA mode, enabled in TVOUT mode */
++	if (tve->mode == TVE_MODE_VGA)
++		regmap_write(tve->regmap, TVE_INT_CONT_REG, 0);
++	else
++		regmap_write(tve->regmap, TVE_INT_CONT_REG,
++			     TVE_CD_SM_IEN | TVE_CD_LM_IEN | TVE_CD_MON_END_IEN);
++	spin_unlock_irqrestore(&tve->enable_lock, flags);
++}
++
++static void tve_disable(struct imx_tve *tve)
++{
++	unsigned long flags;
++	int ret;
++
++	spin_lock_irqsave(&tve->enable_lock, flags);
++	if (tve->enabled) {
++		tve->enabled = 0;
++		ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG,
++					 TVE_IPU_CLK_EN | TVE_EN, 0);
++		clk_disable_unprepare(tve->clk);
++	}
++	spin_unlock_irqrestore(&tve->enable_lock, flags);
++}
++
++static int tve_setup_tvout(struct imx_tve *tve)
++{
++	return -ENOTSUPP;
++}
++
++static int tve_setup_vga(struct imx_tve *tve)
++{
++	unsigned int mask;
++	unsigned int val;
++	int ret;
++
++	/* set gain to (1 + 10/128) to provide 0.7V peak-to-peak amplitude */
++	ret = regmap_update_bits(tve->regmap, TVE_TVDAC0_CONT_REG,
++				 TVE_TVDAC_GAIN_MASK, 0x0a);
++	ret = regmap_update_bits(tve->regmap, TVE_TVDAC1_CONT_REG,
++				 TVE_TVDAC_GAIN_MASK, 0x0a);
++	ret = regmap_update_bits(tve->regmap, TVE_TVDAC2_CONT_REG,
++				 TVE_TVDAC_GAIN_MASK, 0x0a);
++
++	/* set configuration register */
++	mask = TVE_DATA_SOURCE_MASK | TVE_INP_VIDEO_FORM;
++	val  = TVE_DATA_SOURCE_BUS2 | TVE_INP_YCBCR_444;
++	mask |= TVE_TV_STAND_MASK       | TVE_P2I_CONV_EN;
++	val  |= TVE_TV_STAND_HD_1080P30 | 0;
++	mask |= TVE_TV_OUT_MODE_MASK | TVE_SYNC_CH_0_EN;
++	val  |= TVE_TV_OUT_RGB       | TVE_SYNC_CH_0_EN;
++	ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG, mask, val);
++	if (ret < 0) {
++		dev_err(tve->dev, "failed to set configuration: %d\n", ret);
++		return ret;
++	}
++
++	/* set test mode (as documented) */
++	ret = regmap_update_bits(tve->regmap, TVE_TST_MODE_REG,
++				 TVE_TVDAC_TEST_MODE_MASK, 1);
++
++	return 0;
++}
++
++static enum drm_connector_status imx_tve_connector_detect(
++				struct drm_connector *connector, bool force)
++{
++	return connector_status_connected;
++}
++
++static void imx_tve_connector_destroy(struct drm_connector *connector)
++{
++	/* do not free here */
++}
++
++static int imx_tve_connector_get_modes(struct drm_connector *connector)
++{
++	struct imx_tve *tve = con_to_tve(connector);
++	struct edid *edid;
++	int ret = 0;
++
++	if (!tve->ddc)
++		return 0;
++
++	edid = drm_get_edid(connector, tve->ddc);
++	if (edid) {
++		drm_mode_connector_update_edid_property(connector, edid);
++		ret = drm_add_edid_modes(connector, edid);
++		kfree(edid);
++	}
++
++	return ret;
++}
++
++static int imx_tve_connector_mode_valid(struct drm_connector *connector,
++					struct drm_display_mode *mode)
++{
++	struct imx_tve *tve = con_to_tve(connector);
++	unsigned long rate;
++
++	/* pixel clock with 2x oversampling */
++	rate = clk_round_rate(tve->clk, 2000UL * mode->clock) / 2000;
++	if (rate == mode->clock)
++		return MODE_OK;
++
++	/* pixel clock without oversampling */
++	rate = clk_round_rate(tve->clk, 1000UL * mode->clock) / 1000;
++	if (rate == mode->clock)
++		return MODE_OK;
++
++	dev_warn(tve->dev, "ignoring mode %dx%d\n",
++		 mode->hdisplay, mode->vdisplay);
++
++	return MODE_BAD;
++}
++
++static struct drm_encoder *imx_tve_connector_best_encoder(
++		struct drm_connector *connector)
++{
++	struct imx_tve *tve = con_to_tve(connector);
++
++	return &tve->encoder;
++}
++
++static void imx_tve_encoder_dpms(struct drm_encoder *encoder, int mode)
++{
++	struct imx_tve *tve = enc_to_tve(encoder);
++	int ret;
++
++	ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG,
++				 TVE_TV_OUT_MODE_MASK, TVE_TV_OUT_DISABLE);
++	if (ret < 0)
++		dev_err(tve->dev, "failed to disable TVOUT: %d\n", ret);
++}
++
++static bool imx_tve_encoder_mode_fixup(struct drm_encoder *encoder,
++				       const struct drm_display_mode *mode,
++				       struct drm_display_mode *adjusted_mode)
++{
++	return true;
++}
++
++static void imx_tve_encoder_prepare(struct drm_encoder *encoder)
++{
++	struct imx_tve *tve = enc_to_tve(encoder);
++
++	tve_disable(tve);
++
++	switch (tve->mode) {
++	case TVE_MODE_VGA:
++		imx_drm_crtc_panel_format_pins(encoder->crtc,
++				DRM_MODE_ENCODER_DAC, IPU_PIX_FMT_GBR24,
++				tve->hsync_pin, tve->vsync_pin);
++		break;
++	case TVE_MODE_TVOUT:
++		imx_drm_crtc_panel_format(encoder->crtc, DRM_MODE_ENCODER_TVDAC,
++					  V4L2_PIX_FMT_YUV444);
++		break;
++	}
++}
++
++static void imx_tve_encoder_mode_set(struct drm_encoder *encoder,
++				     struct drm_display_mode *mode,
++				     struct drm_display_mode *adjusted_mode)
++{
++	struct imx_tve *tve = enc_to_tve(encoder);
++	unsigned long rounded_rate;
++	unsigned long rate;
++	int div = 1;
++	int ret;
++
++	/*
++	 * FIXME
++	 * we should try 4k * mode->clock first, 
++	 * and enable 4x oversampling for lower resolutions
++	 */
++	rate = 2000UL * mode->clock;
++	clk_set_rate(tve->clk, rate);
++	rounded_rate = clk_get_rate(tve->clk);
++	if (rounded_rate >= rate)
++		div = 2;
++	clk_set_rate(tve->di_clk, rounded_rate / div);
++
++	ret = clk_set_parent(tve->di_sel_clk, tve->di_clk);
++	if (ret < 0) {
++		dev_err(tve->dev, "failed to set di_sel parent to tve_di: %d\n",
++			ret);
++	}
++
++	if (tve->mode == TVE_MODE_VGA)
++		tve_setup_vga(tve);
++	else
++		tve_setup_tvout(tve);
++}
++
++static void imx_tve_encoder_commit(struct drm_encoder *encoder)
++{
++	struct imx_tve *tve = enc_to_tve(encoder);
++
++	tve_enable(tve);
++}
++
++static void imx_tve_encoder_disable(struct drm_encoder *encoder)
++{
++	struct imx_tve *tve = enc_to_tve(encoder);
++
++	tve_disable(tve);
++}
++
++static void imx_tve_encoder_destroy(struct drm_encoder *encoder)
++{
++	/* do not free here */
++}
++
++static struct drm_connector_funcs imx_tve_connector_funcs = {
++	.dpms = drm_helper_connector_dpms,
++	.fill_modes = drm_helper_probe_single_connector_modes,
++	.detect = imx_tve_connector_detect,
++	.destroy = imx_tve_connector_destroy,
++};
++
++static struct drm_connector_helper_funcs imx_tve_connector_helper_funcs = {
++	.get_modes = imx_tve_connector_get_modes,
++	.best_encoder = imx_tve_connector_best_encoder,
++	.mode_valid = imx_tve_connector_mode_valid,
++};
++
++static struct drm_encoder_funcs imx_tve_encoder_funcs = {
++	.destroy = imx_tve_encoder_destroy,
++};
++
++static struct drm_encoder_helper_funcs imx_tve_encoder_helper_funcs = {
++	.dpms = imx_tve_encoder_dpms,
++	.mode_fixup = imx_tve_encoder_mode_fixup,
++	.prepare = imx_tve_encoder_prepare,
++	.mode_set = imx_tve_encoder_mode_set,
++	.commit = imx_tve_encoder_commit,
++	.disable = imx_tve_encoder_disable,
++};
++
++static irqreturn_t imx_tve_irq_handler(int irq, void *data)
++{
++	struct imx_tve *tve = data;
++	unsigned int val;
++
++	regmap_read(tve->regmap, TVE_STAT_REG, &val);
++
++	/* clear interrupt status register */
++	regmap_write(tve->regmap, TVE_STAT_REG, 0xffffffff);
++
++	return IRQ_HANDLED;
++}
++
++static unsigned long clk_tve_di_recalc_rate(struct clk_hw *hw,
++					    unsigned long parent_rate)
++{
++	struct imx_tve *tve = container_of(hw, struct imx_tve, clk_hw_di);
++	unsigned int val;
++	int ret;
++
++	ret = regmap_read(tve->regmap, TVE_COM_CONF_REG, &val);
++	if (ret < 0)
++		return 0;
++
++	switch (val & TVE_DAC_SAMP_RATE_MASK) {
++	case TVE_DAC_DIV4_RATE:
++		return parent_rate / 4;
++	case TVE_DAC_DIV2_RATE:
++		return parent_rate / 2;
++	case TVE_DAC_FULL_RATE:
++	default:
++		return parent_rate;
++	}
++
++	return 0;
++}
++
++static long clk_tve_di_round_rate(struct clk_hw *hw, unsigned long rate,
++				  unsigned long *prate)
++{
++	unsigned long div;
++
++	div = *prate / rate;
++	if (div >= 4)
++		return *prate / 4;
++	else if (div >= 2)
++		return *prate / 2;
++	else
++		return *prate;
++}
++
++static int clk_tve_di_set_rate(struct clk_hw *hw, unsigned long rate,
++			       unsigned long parent_rate)
++{
++	struct imx_tve *tve = container_of(hw, struct imx_tve, clk_hw_di);
++	unsigned long div;
++	u32 val;
++	int ret;
++
++	div = parent_rate / rate;
++	if (div >= 4)
++		val = TVE_DAC_DIV4_RATE;
++	else if (div >= 2)
++		val = TVE_DAC_DIV2_RATE;
++	else
++		val = TVE_DAC_FULL_RATE;
++
++	ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG, TVE_DAC_SAMP_RATE_MASK, val);
++	if (ret < 0) {
++		dev_err(tve->dev, "failed to set divider: %d\n", ret);
++		return ret;
++	}
++
++	return 0;
++}
++
++static struct clk_ops clk_tve_di_ops = {
++	.round_rate = clk_tve_di_round_rate,
++	.set_rate = clk_tve_di_set_rate,
++	.recalc_rate = clk_tve_di_recalc_rate,
++};
++
++static int tve_clk_init(struct imx_tve *tve, void __iomem *base)
++{
++	const char *tve_di_parent[1];
++	struct clk_init_data init = {
++		.name = "tve_di",
++		.ops = &clk_tve_di_ops,
++		.num_parents = 1,
++		.flags = 0,
++	};
++
++	tve_di_parent[0] = __clk_get_name(tve->clk);
++	init.parent_names = (const char **)&tve_di_parent;
++
++	tve->clk_hw_di.init = &init;
++	tve->di_clk = clk_register(tve->dev, &tve->clk_hw_di);
++	if (IS_ERR(tve->di_clk)) {
++		dev_err(tve->dev, "failed to register TVE output clock: %ld\n",
++			PTR_ERR(tve->di_clk));
++		return PTR_ERR(tve->di_clk);
++	}
++
++	return 0;
++}
++
++static int imx_tve_register(struct imx_tve *tve)
++{
++	int ret;
++
++	tve->connector.funcs = &imx_tve_connector_funcs;
++	tve->encoder.funcs = &imx_tve_encoder_funcs;
++
++	tve->encoder.encoder_type = DRM_MODE_ENCODER_NONE;
++	tve->connector.connector_type = DRM_MODE_CONNECTOR_VGA;
++
++	drm_encoder_helper_add(&tve->encoder, &imx_tve_encoder_helper_funcs);
++	ret = imx_drm_add_encoder(&tve->encoder, &tve->imx_drm_encoder,
++			THIS_MODULE);
++	if (ret) {
++		dev_err(tve->dev, "adding encoder failed with %d\n", ret);
++		return ret;
++	}
++
++	drm_connector_helper_add(&tve->connector,
++			&imx_tve_connector_helper_funcs);
++
++	ret = imx_drm_add_connector(&tve->connector,
++			&tve->imx_drm_connector, THIS_MODULE);
++	if (ret) {
++		imx_drm_remove_encoder(tve->imx_drm_encoder);
++		dev_err(tve->dev, "adding connector failed with %d\n", ret);
++		return ret;
++	}
++
++	drm_mode_connector_attach_encoder(&tve->connector, &tve->encoder);
++
++	return 0;
++}
++
++static bool imx_tve_readable_reg(struct device *dev, unsigned int reg)
++{
++	return (reg % 4 == 0) && (reg <= 0xdc);
++}
++
++static struct regmap_config tve_regmap_config = {
++	.reg_bits = 32,
++	.val_bits = 32,
++	.reg_stride = 4,
++
++	.readable_reg = imx_tve_readable_reg,
++
++	.lock = tve_lock,
++	.unlock = tve_unlock,
++
++	.max_register = 0xdc,
++};
++
++static const char *imx_tve_modes[] = {
++	[TVE_MODE_TVOUT]  = "tvout",
++	[TVE_MODE_VGA] = "vga",
++};
++
++const int of_get_tve_mode(struct device_node *np)
++{
++	const char *bm;
++	int ret, i;
++
++	ret = of_property_read_string(np, "fsl,tve-mode", &bm);
++	if (ret < 0)
++		return ret;
++
++	for (i = 0; i < ARRAY_SIZE(imx_tve_modes); i++)
++		if (!strcasecmp(bm, imx_tve_modes[i]))
++			return i;
++
++	return -EINVAL;
++}
++
++static int imx_tve_probe(struct platform_device *pdev)
++{
++	struct device_node *np = pdev->dev.of_node;
++	struct device_node *ddc_node;
++	struct imx_tve *tve;
++	struct resource *res;
++	void __iomem *base;
++	unsigned int val;
++	int irq;
++	int ret;
++
++	tve = devm_kzalloc(&pdev->dev, sizeof(*tve), GFP_KERNEL);
++	if (!tve)
++		return -ENOMEM;
++
++	tve->dev = &pdev->dev;
++	spin_lock_init(&tve->lock);
++	spin_lock_init(&tve->enable_lock);
++
++	ddc_node = of_parse_phandle(np, "ddc", 0);
++	if (ddc_node) {
++		tve->ddc = of_find_i2c_adapter_by_node(ddc_node);
++		of_node_put(ddc_node);
++	}
++
++	tve->mode = of_get_tve_mode(np);
++	if (tve->mode != TVE_MODE_VGA) {
++		dev_err(&pdev->dev, "only VGA mode supported, currently\n");
++		return -EINVAL;
++	}
++
++	if (tve->mode == TVE_MODE_VGA) {
++		struct pinctrl *pinctrl;
++
++		pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
++		if (IS_ERR(pinctrl)) {
++			ret = PTR_ERR(pinctrl);
++			dev_warn(&pdev->dev, "failed to setup pinctrl: %d", ret);
++			return ret;
++		}
++
++		ret = of_property_read_u32(np, "fsl,hsync-pin", &tve->hsync_pin);
++		if (ret < 0) {
++			dev_err(&pdev->dev, "failed to get vsync pin\n");
++			return ret;
++		}
++
++		ret |= of_property_read_u32(np, "fsl,vsync-pin", &tve->vsync_pin);
++		if (ret < 0) {
++			dev_err(&pdev->dev, "failed to get vsync pin\n");
++			return ret;
++		}
++	}
++
++	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++	if (!res) {
++		dev_err(&pdev->dev, "failed to get memory region\n");
++		return -ENOENT;
++	}
++
++	base = devm_request_and_ioremap(&pdev->dev, res);
++	if (!base) {
++		dev_err(&pdev->dev, "failed to remap memory region\n");
++		return -ENOENT;
++	}
++
++	tve_regmap_config.lock_arg = tve;
++	tve->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "tve", base,
++						&tve_regmap_config);
++	if (IS_ERR(tve->regmap)) {
++		dev_err(&pdev->dev, "failed to init regmap: %ld\n",
++			PTR_ERR(tve->regmap));
++		return PTR_ERR(tve->regmap);
++	}
++
++	irq = platform_get_irq(pdev, 0);
++	if (irq < 0) {
++		dev_err(&pdev->dev, "failed to get irq\n");
++		return irq;
++	}
++
++	ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
++					imx_tve_irq_handler, IRQF_ONESHOT,
++					"imx-tve", tve);
++	if (ret < 0) {
++		dev_err(&pdev->dev, "failed to request irq: %d\n", ret);
++		return ret;
++	}
++
++	tve->dac_reg = devm_regulator_get(&pdev->dev, "dac");
++	if (!IS_ERR(tve->dac_reg)) {
++		regulator_set_voltage(tve->dac_reg, 2750000, 2750000);
++		regulator_enable(tve->dac_reg);
++	}
++
++	tve->clk = devm_clk_get(&pdev->dev, "tve");
++	if (IS_ERR(tve->clk)) {
++		dev_err(&pdev->dev, "failed to get high speed tve clock: %ld\n",
++			PTR_ERR(tve->clk));
++		return PTR_ERR(tve->clk);
++	}
++
++	/* this is the IPU DI clock input selector, can be parented to tve_di */
++	tve->di_sel_clk = devm_clk_get(&pdev->dev, "di_sel");
++	if (IS_ERR(tve->di_sel_clk)) {
++		dev_err(&pdev->dev, "failed to get ipu di mux clock: %ld\n",
++			PTR_ERR(tve->di_sel_clk));
++		return PTR_ERR(tve->di_sel_clk);
++	}
++
++	ret = tve_clk_init(tve, base);
++	if (ret < 0)
++		return ret;
++
++	ret = regmap_read(tve->regmap, TVE_COM_CONF_REG, &val);
++	if (ret < 0) {
++		dev_err(&pdev->dev, "failed to read configuration register: %d\n", ret);
++		return ret;
++	}
++	if (val != 0x00100000) {
++		dev_err(&pdev->dev, "configuration register default value indicates this is not a TVEv2\n");
++		return -ENODEV;
++	};
++
++	/* disable cable detection for VGA mode */
++	ret = regmap_write(tve->regmap, TVE_CD_CONT_REG, 0);
++
++	ret = imx_tve_register(tve);
++	if (ret)
++		return ret;
++
++	ret = imx_drm_encoder_add_possible_crtcs(tve->imx_drm_encoder, np);
++
++	platform_set_drvdata(pdev, tve);
++
++	return 0;
++}
++
++static int imx_tve_remove(struct platform_device *pdev)
++{
++	struct imx_tve *tve = platform_get_drvdata(pdev);
++	struct drm_connector *connector = &tve->connector;
++	struct drm_encoder *encoder = &tve->encoder;
++
++	drm_mode_connector_detach_encoder(connector, encoder);
++
++	imx_drm_remove_connector(tve->imx_drm_connector);
++	imx_drm_remove_encoder(tve->imx_drm_encoder);
++
++	if (!IS_ERR(tve->dac_reg))
++		regulator_disable(tve->dac_reg);
++
++	return 0;
++}
++
++static const struct of_device_id imx_tve_dt_ids[] = {
++	{ .compatible = "fsl,imx53-tve", },
++	{ /* sentinel */ }
++};
++
++static struct platform_driver imx_tve_driver = {
++	.probe		= imx_tve_probe,
++	.remove		= imx_tve_remove,
++	.driver		= {
++		.of_match_table = imx_tve_dt_ids,
++		.name	= "imx-tve",
++		.owner	= THIS_MODULE,
++	},
++};
++
++module_platform_driver(imx_tve_driver);
++
++MODULE_DESCRIPTION("i.MX Television Encoder driver");
++MODULE_AUTHOR("Philipp Zabel, Pengutronix");
++MODULE_LICENSE("GPL");
+-- 
+1.7.10.4
+
diff --git a/patches/imx/0006-arm-fec-use-random-mac-when-everything-else-fails.patch b/patches/imx/0006-arm-fec-use-random-mac-when-everything-else-fails.patch
new file mode 100644
index 0000000000000000000000000000000000000000..062133aa8180de28b33f88de8a9f1096f2485324
--- /dev/null
+++ b/patches/imx/0006-arm-fec-use-random-mac-when-everything-else-fails.patch
@@ -0,0 +1,34 @@
+From b34c2a6f67b556d968def771dd2f2124e9bcb388 Mon Sep 17 00:00:00 2001
+From: Robert Nelson <robertcnelson@gmail.com>
+Date: Wed, 24 Apr 2013 12:13:52 -0500
+Subject: [PATCH 6/6] arm: fec: use random mac when everything else fails
+
+Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
+---
+ drivers/net/ethernet/freescale/fec.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
+index 73195f6..728a319 100644
+--- a/drivers/net/ethernet/freescale/fec.c
++++ b/drivers/net/ethernet/freescale/fec.c
+@@ -954,6 +954,16 @@ static void fec_get_mac(struct net_device *ndev)
+ 		iap = &tmpaddr[0];
+ 	}
+ 
++	/*
++	 * 5) random mac address
++	 */
++	if (!is_valid_ether_addr(iap)) {
++		/* Report it and use a random ethernet address instead */
++		netdev_err(ndev, "Invalid MAC address: %pM\n", iap);
++		random_ether_addr(iap);
++		netdev_info(ndev, "Using random MAC address: %pM\n", iap);
++	}
++
+ 	memcpy(ndev->dev_addr, iap, ETH_ALEN);
+ 
+ 	/* Adjust MAC if using macaddr */
+-- 
+1.7.10.4
+
diff --git a/patches/omap3isp/0001-omap3isp-Use-the-common-clock-framework.patch b/patches/omap3isp/0001-omap3isp-Use-the-common-clock-framework.patch
new file mode 100644
index 0000000000000000000000000000000000000000..a61d5b8113d4278f3e89d4ed0c28bbf7cf1527ae
--- /dev/null
+++ b/patches/omap3isp/0001-omap3isp-Use-the-common-clock-framework.patch
@@ -0,0 +1,444 @@
+From 369b60c157f67a71a6f302ab9843ae2de1805a2a Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Date: Mon, 22 Oct 2012 15:43:00 +0200
+Subject: [PATCH 1/6] omap3isp: Use the common clock framework
+
+Expose the two ISP external clocks XCLKA and XCLKB as common clocks for
+subdev drivers.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Acked-by: Mike Turquette <mturquette@linaro.org>
+---
+ drivers/media/platform/omap3isp/isp.c |  277 ++++++++++++++++++++++++---------
+ drivers/media/platform/omap3isp/isp.h |   22 ++-
+ include/media/omap3isp.h              |   10 +-
+ 3 files changed, 225 insertions(+), 84 deletions(-)
+
+diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
+index 6e5ad8e..1d7dbd5 100644
+--- a/drivers/media/platform/omap3isp/isp.c
++++ b/drivers/media/platform/omap3isp/isp.c
+@@ -55,6 +55,7 @@
+ #include <asm/cacheflush.h>
+ 
+ #include <linux/clk.h>
++#include <linux/clkdev.h>
+ #include <linux/delay.h>
+ #include <linux/device.h>
+ #include <linux/dma-mapping.h>
+@@ -148,6 +149,201 @@ void omap3isp_flush(struct isp_device *isp)
+ 	isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_REVISION);
+ }
+ 
++/* -----------------------------------------------------------------------------
++ * XCLK
++ */
++
++#define to_isp_xclk(_hw)	container_of(_hw, struct isp_xclk, hw)
++
++static void isp_xclk_update(struct isp_xclk *xclk, u32 divider)
++{
++	switch (xclk->id) {
++	case ISP_XCLK_A:
++		isp_reg_clr_set(xclk->isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL,
++				ISPTCTRL_CTRL_DIVA_MASK,
++				divider << ISPTCTRL_CTRL_DIVA_SHIFT);
++		break;
++	case ISP_XCLK_B:
++		isp_reg_clr_set(xclk->isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL,
++				ISPTCTRL_CTRL_DIVB_MASK,
++				divider << ISPTCTRL_CTRL_DIVB_SHIFT);
++		break;
++	}
++}
++
++static int isp_xclk_prepare(struct clk_hw *hw)
++{
++	struct isp_xclk *xclk = to_isp_xclk(hw);
++
++	omap3isp_get(xclk->isp);
++
++	return 0;
++}
++
++static void isp_xclk_unprepare(struct clk_hw *hw)
++{
++	struct isp_xclk *xclk = to_isp_xclk(hw);
++
++	omap3isp_put(xclk->isp);
++}
++
++static int isp_xclk_enable(struct clk_hw *hw)
++{
++	struct isp_xclk *xclk = to_isp_xclk(hw);
++	unsigned long flags;
++
++	spin_lock_irqsave(&xclk->lock, flags);
++	isp_xclk_update(xclk, xclk->divider);
++	xclk->enabled = true;
++	spin_unlock_irqrestore(&xclk->lock, flags);
++
++	return 0;
++}
++
++static void isp_xclk_disable(struct clk_hw *hw)
++{
++	struct isp_xclk *xclk = to_isp_xclk(hw);
++	unsigned long flags;
++
++	spin_lock_irqsave(&xclk->lock, flags);
++	isp_xclk_update(xclk, 0);
++	xclk->enabled = false;
++	spin_unlock_irqrestore(&xclk->lock, flags);
++}
++
++static unsigned long isp_xclk_recalc_rate(struct clk_hw *hw,
++					  unsigned long parent_rate)
++{
++	struct isp_xclk *xclk = to_isp_xclk(hw);
++
++	return parent_rate / xclk->divider;
++}
++
++static u32 isp_xclk_calc_divider(unsigned long *rate, unsigned long parent_rate)
++{
++	u32 divider;
++
++	if (*rate >= parent_rate) {
++		*rate = parent_rate;
++		return ISPTCTRL_CTRL_DIV_BYPASS;
++	}
++
++	divider = DIV_ROUND_CLOSEST(parent_rate, *rate);
++	if (divider >= ISPTCTRL_CTRL_DIV_BYPASS)
++		divider = ISPTCTRL_CTRL_DIV_BYPASS - 1;
++
++	*rate = parent_rate / divider;
++	return divider;
++}
++
++static long isp_xclk_round_rate(struct clk_hw *hw, unsigned long rate,
++				unsigned long *parent_rate)
++{
++	isp_xclk_calc_divider(&rate, *parent_rate);
++	return rate;
++}
++
++static int isp_xclk_set_rate(struct clk_hw *hw, unsigned long rate,
++			     unsigned long parent_rate)
++{
++	struct isp_xclk *xclk = to_isp_xclk(hw);
++	unsigned long flags;
++	u32 divider;
++
++	divider = isp_xclk_calc_divider(&rate, parent_rate);
++
++	spin_lock_irqsave(&xclk->lock, flags);
++
++	xclk->divider = divider;
++	if (xclk->enabled)
++		isp_xclk_update(xclk, divider);
++
++	spin_unlock_irqrestore(&xclk->lock, flags);
++
++	dev_dbg(xclk->isp->dev, "%s: cam_xclk%c set to %lu Hz (div %u)\n",
++		__func__, xclk->id == ISP_XCLK_A ? 'a' : 'b', rate, divider);
++	return 0;
++}
++
++static const struct clk_ops isp_xclk_ops = {
++	.prepare = isp_xclk_prepare,
++	.unprepare = isp_xclk_unprepare,
++	.enable = isp_xclk_enable,
++	.disable = isp_xclk_disable,
++	.recalc_rate = isp_xclk_recalc_rate,
++	.round_rate = isp_xclk_round_rate,
++	.set_rate = isp_xclk_set_rate,
++};
++
++static const char *isp_xclk_parent_name = "cam_mclk";
++
++static const struct clk_init_data isp_xclk_init_data = {
++	.name = "cam_xclk",
++	.ops = &isp_xclk_ops,
++	.parent_names = &isp_xclk_parent_name,
++	.num_parents = 1,
++};
++
++static int isp_xclk_init(struct isp_device *isp)
++{
++	struct isp_platform_data *pdata = isp->pdata;
++	struct clk_init_data init;
++	unsigned int i;
++
++	for (i = 0; i < ARRAY_SIZE(isp->xclks); ++i) {
++		struct isp_xclk *xclk = &isp->xclks[i];
++		struct clk *clk;
++
++		xclk->isp = isp;
++		xclk->id = i == 0 ? ISP_XCLK_A : ISP_XCLK_B;
++		xclk->divider = 1;
++		spin_lock_init(&xclk->lock);
++
++		init.name = i == 0 ? "cam_xclka" : "cam_xclkb";
++		init.ops = &isp_xclk_ops;
++		init.parent_names = &isp_xclk_parent_name;
++		init.num_parents = 1;
++
++		xclk->hw.init = &init;
++
++		clk = devm_clk_register(isp->dev, &xclk->hw);
++		if (IS_ERR(clk))
++			return PTR_ERR(clk);
++
++		if (pdata->xclks[i].con_id == NULL &&
++		    pdata->xclks[i].dev_id == NULL)
++			continue;
++
++		xclk->lookup = kzalloc(sizeof(*xclk->lookup), GFP_KERNEL);
++		if (xclk->lookup == NULL)
++			return -ENOMEM;
++
++		xclk->lookup->con_id = pdata->xclks[i].con_id;
++		xclk->lookup->dev_id = pdata->xclks[i].dev_id;
++		xclk->lookup->clk = clk;
++
++		clkdev_add(xclk->lookup);
++	}
++
++	return 0;
++}
++
++static void isp_xclk_cleanup(struct isp_device *isp)
++{
++	unsigned int i;
++
++	for (i = 0; i < ARRAY_SIZE(isp->xclks); ++i) {
++		struct isp_xclk *xclk = &isp->xclks[i];
++
++		if (xclk->lookup)
++			clkdev_drop(xclk->lookup);
++	}
++}
++
++/* -----------------------------------------------------------------------------
++ * Interrupts
++ */
++
+ /*
+  * isp_enable_interrupts - Enable ISP interrupts.
+  * @isp: OMAP3 ISP device
+@@ -180,80 +376,6 @@ static void isp_disable_interrupts(struct isp_device *isp)
+ 	isp_reg_writel(isp, 0, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE);
+ }
+ 
+-/**
+- * isp_set_xclk - Configures the specified cam_xclk to the desired frequency.
+- * @isp: OMAP3 ISP device
+- * @xclk: Desired frequency of the clock in Hz. 0 = stable low, 1 is stable high
+- * @xclksel: XCLK to configure (0 = A, 1 = B).
+- *
+- * Configures the specified MCLK divisor in the ISP timing control register
+- * (TCTRL_CTRL) to generate the desired xclk clock value.
+- *
+- * Divisor = cam_mclk_hz / xclk
+- *
+- * Returns the final frequency that is actually being generated
+- **/
+-static u32 isp_set_xclk(struct isp_device *isp, u32 xclk, u8 xclksel)
+-{
+-	u32 divisor;
+-	u32 currentxclk;
+-	unsigned long mclk_hz;
+-
+-	if (!omap3isp_get(isp))
+-		return 0;
+-
+-	mclk_hz = clk_get_rate(isp->clock[ISP_CLK_CAM_MCLK]);
+-
+-	if (xclk >= mclk_hz) {
+-		divisor = ISPTCTRL_CTRL_DIV_BYPASS;
+-		currentxclk = mclk_hz;
+-	} else if (xclk >= 2) {
+-		divisor = mclk_hz / xclk;
+-		if (divisor >= ISPTCTRL_CTRL_DIV_BYPASS)
+-			divisor = ISPTCTRL_CTRL_DIV_BYPASS - 1;
+-		currentxclk = mclk_hz / divisor;
+-	} else {
+-		divisor = xclk;
+-		currentxclk = 0;
+-	}
+-
+-	switch (xclksel) {
+-	case ISP_XCLK_A:
+-		isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL,
+-				ISPTCTRL_CTRL_DIVA_MASK,
+-				divisor << ISPTCTRL_CTRL_DIVA_SHIFT);
+-		dev_dbg(isp->dev, "isp_set_xclk(): cam_xclka set to %d Hz\n",
+-			currentxclk);
+-		break;
+-	case ISP_XCLK_B:
+-		isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL,
+-				ISPTCTRL_CTRL_DIVB_MASK,
+-				divisor << ISPTCTRL_CTRL_DIVB_SHIFT);
+-		dev_dbg(isp->dev, "isp_set_xclk(): cam_xclkb set to %d Hz\n",
+-			currentxclk);
+-		break;
+-	case ISP_XCLK_NONE:
+-	default:
+-		omap3isp_put(isp);
+-		dev_dbg(isp->dev, "ISP_ERR: isp_set_xclk(): Invalid requested "
+-			"xclk. Must be 0 (A) or 1 (B).\n");
+-		return -EINVAL;
+-	}
+-
+-	/* Do we go from stable whatever to clock? */
+-	if (divisor >= 2 && isp->xclk_divisor[xclksel - 1] < 2)
+-		omap3isp_get(isp);
+-	/* Stopping the clock. */
+-	else if (divisor < 2 && isp->xclk_divisor[xclksel - 1] >= 2)
+-		omap3isp_put(isp);
+-
+-	isp->xclk_divisor[xclksel - 1] = divisor;
+-
+-	omap3isp_put(isp);
+-
+-	return currentxclk;
+-}
+-
+ /*
+  * isp_core_init - ISP core settings
+  * @isp: OMAP3 ISP device
+@@ -1969,6 +2091,7 @@ static int isp_remove(struct platform_device *pdev)
+ 
+ 	isp_unregister_entities(isp);
+ 	isp_cleanup_modules(isp);
++	isp_xclk_cleanup(isp);
+ 
+ 	__omap3isp_get(isp, false);
+ 	iommu_detach_device(isp->domain, &pdev->dev);
+@@ -2042,7 +2165,6 @@ static int isp_probe(struct platform_device *pdev)
+ 	}
+ 
+ 	isp->autoidle = autoidle;
+-	isp->platform_cb.set_xclk = isp_set_xclk;
+ 
+ 	mutex_init(&isp->isp_mutex);
+ 	spin_lock_init(&isp->stat_lock);
+@@ -2093,6 +2215,10 @@ static int isp_probe(struct platform_device *pdev)
+ 	if (ret < 0)
+ 		goto error_isp;
+ 
++	ret = isp_xclk_init(isp);
++	if (ret < 0)
++		goto error_isp;
++
+ 	/* Memory resources */
+ 	for (m = 0; m < ARRAY_SIZE(isp_res_maps); m++)
+ 		if (isp->revision == isp_res_maps[m].isp_rev)
+@@ -2162,6 +2288,7 @@ detach_dev:
+ free_domain:
+ 	iommu_domain_free(isp->domain);
+ error_isp:
++	isp_xclk_cleanup(isp);
+ 	omap3isp_put(isp);
+ error:
+ 	platform_set_drvdata(pdev, NULL);
+diff --git a/drivers/media/platform/omap3isp/isp.h b/drivers/media/platform/omap3isp/isp.h
+index c77e1f2..cd3eff4 100644
+--- a/drivers/media/platform/omap3isp/isp.h
++++ b/drivers/media/platform/omap3isp/isp.h
+@@ -29,6 +29,7 @@
+ 
+ #include <media/omap3isp.h>
+ #include <media/v4l2-device.h>
++#include <linux/clk-provider.h>
+ #include <linux/device.h>
+ #include <linux/io.h>
+ #include <linux/iommu.h>
+@@ -125,8 +126,20 @@ struct isp_reg {
+ 	u32 val;
+ };
+ 
+-struct isp_platform_callback {
+-	u32 (*set_xclk)(struct isp_device *isp, u32 xclk, u8 xclksel);
++enum isp_xclk_id {
++	ISP_XCLK_A,
++	ISP_XCLK_B,
++};
++
++struct isp_xclk {
++	struct isp_device *isp;
++	struct clk_hw hw;
++	struct clk_lookup *lookup;
++	enum isp_xclk_id id;
++
++	spinlock_t lock;	/* Protects enabled and divider */
++	bool enabled;
++	unsigned int divider;
+ };
+ 
+ /*
+@@ -149,6 +162,7 @@ struct isp_platform_callback {
+  * @cam_mclk: Pointer to camera functional clock structure.
+  * @csi2_fck: Pointer to camera CSI2 complexIO clock structure.
+  * @l3_ick: Pointer to OMAP3 L3 bus interface clock.
++ * @xclks: External clocks provided by the ISP
+  * @irq: Currently attached ISP ISR callbacks information structure.
+  * @isp_af: Pointer to current settings for ISP AutoFocus SCM.
+  * @isp_hist: Pointer to current settings for ISP Histogram SCM.
+@@ -185,12 +199,12 @@ struct isp_device {
+ 	int has_context;
+ 	int ref_count;
+ 	unsigned int autoidle;
+-	u32 xclk_divisor[2];	/* Two clocks, a and b. */
+ #define ISP_CLK_CAM_ICK		0
+ #define ISP_CLK_CAM_MCLK	1
+ #define ISP_CLK_CSI2_FCK	2
+ #define ISP_CLK_L3_ICK		3
+ 	struct clk *clock[4];
++	struct isp_xclk xclks[2];
+ 
+ 	/* ISP modules */
+ 	struct ispstat isp_af;
+@@ -209,8 +223,6 @@ struct isp_device {
+ 	unsigned int subclk_resources;
+ 
+ 	struct iommu_domain *domain;
+-
+-	struct isp_platform_callback platform_cb;
+ };
+ 
+ #define v4l2_dev_to_isp_device(dev) \
+diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h
+index 9584269..c9d06d9 100644
+--- a/include/media/omap3isp.h
++++ b/include/media/omap3isp.h
+@@ -29,10 +29,6 @@
+ struct i2c_board_info;
+ struct isp_device;
+ 
+-#define ISP_XCLK_NONE			0
+-#define ISP_XCLK_A			1
+-#define ISP_XCLK_B			2
+-
+ enum isp_interface_type {
+ 	ISP_INTERFACE_PARALLEL,
+ 	ISP_INTERFACE_CSI2A_PHY2,
+@@ -153,7 +149,13 @@ struct isp_v4l2_subdevs_group {
+ 	} bus; /* gcc < 4.6.0 chokes on anonymous union initializers */
+ };
+ 
++struct isp_platform_xclk {
++	const char *dev_id;
++	const char *con_id;
++};
++
+ struct isp_platform_data {
++	struct isp_platform_xclk xclks[2];
+ 	struct isp_v4l2_subdevs_group *subdevs;
+ 	void (*set_constraints)(struct isp_device *isp, bool enable);
+ };
+-- 
+1.7.10.4
+
diff --git a/patches/omap3isp/0002-mt9m032-Fix-PLL-setup.patch b/patches/omap3isp/0002-mt9m032-Fix-PLL-setup.patch
new file mode 100644
index 0000000000000000000000000000000000000000..9d2b19caf9a55368bb4e566cd9dea093de88ee28
--- /dev/null
+++ b/patches/omap3isp/0002-mt9m032-Fix-PLL-setup.patch
@@ -0,0 +1,91 @@
+From 7c44c8a989ad01bd7cd02370d4ca4a742db218be Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Date: Tue, 25 Sep 2012 15:46:34 +0200
+Subject: [PATCH 2/6] mt9m032: Fix PLL setup
+
+The MT9M032 PLL was assumed to be identical to the MT9P031 PLL but
+differs significantly. Update the registers definitions and PLL limits
+according to the datasheet.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+---
+ drivers/media/i2c/mt9m032.c |   24 +++++++++++++-----------
+ 1 file changed, 13 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/media/i2c/mt9m032.c b/drivers/media/i2c/mt9m032.c
+index f80c1d7e..30d755a 100644
+--- a/drivers/media/i2c/mt9m032.c
++++ b/drivers/media/i2c/mt9m032.c
+@@ -87,7 +87,7 @@
+ #define MT9M032_RESTART					0x0b
+ #define MT9M032_RESET					0x0d
+ #define MT9M032_PLL_CONFIG1				0x11
+-#define		MT9M032_PLL_CONFIG1_OUTDIV_MASK		0x3f
++#define		MT9M032_PLL_CONFIG1_PREDIV_MASK		0x3f
+ #define		MT9M032_PLL_CONFIG1_MUL_SHIFT		8
+ #define MT9M032_READ_MODE1				0x1e
+ #define MT9M032_READ_MODE2				0x20
+@@ -106,6 +106,8 @@
+ #define		MT9M032_GAIN_AMUL_SHIFT			6
+ #define		MT9M032_GAIN_ANALOG_MASK		0x3f
+ #define MT9M032_FORMATTER1				0x9e
++#define		MT9M032_FORMATTER1_PLL_P1_6		(1 << 8)
++#define		MT9M032_FORMATTER1_PARALLEL		(1 << 12)
+ #define MT9M032_FORMATTER2				0x9f
+ #define		MT9M032_FORMATTER2_DOUT_EN		0x1000
+ #define		MT9M032_FORMATTER2_PIXCLK_EN		0x2000
+@@ -121,8 +123,6 @@
+ #define		MT9P031_PLL_CONTROL_PWROFF		0x0050
+ #define		MT9P031_PLL_CONTROL_PWRON		0x0051
+ #define		MT9P031_PLL_CONTROL_USEPLL		0x0052
+-#define MT9P031_PLL_CONFIG2				0x11
+-#define		MT9P031_PLL_CONFIG2_P1_DIV_MASK		0x1f
+ 
+ struct mt9m032 {
+ 	struct v4l2_subdev subdev;
+@@ -255,13 +255,14 @@ static int mt9m032_setup_pll(struct mt9m032 *sensor)
+ 		.n_max = 64,
+ 		.m_min = 16,
+ 		.m_max = 255,
+-		.p1_min = 1,
+-		.p1_max = 128,
++		.p1_min = 6,
++		.p1_max = 7,
+ 	};
+ 
+ 	struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev);
+ 	struct mt9m032_platform_data *pdata = sensor->pdata;
+ 	struct aptina_pll pll;
++	u16 reg_val;
+ 	int ret;
+ 
+ 	pll.ext_clock = pdata->ext_clock;
+@@ -274,18 +275,19 @@ static int mt9m032_setup_pll(struct mt9m032 *sensor)
+ 	sensor->pix_clock = pdata->pix_clock;
+ 
+ 	ret = mt9m032_write(client, MT9M032_PLL_CONFIG1,
+-			    (pll.m << MT9M032_PLL_CONFIG1_MUL_SHIFT)
+-			    | (pll.p1 - 1));
+-	if (!ret)
+-		ret = mt9m032_write(client, MT9P031_PLL_CONFIG2, pll.n - 1);
++			    (pll.m << MT9M032_PLL_CONFIG1_MUL_SHIFT) |
++			    ((pll.n - 1) & MT9M032_PLL_CONFIG1_PREDIV_MASK));
+ 	if (!ret)
+ 		ret = mt9m032_write(client, MT9P031_PLL_CONTROL,
+ 				    MT9P031_PLL_CONTROL_PWRON |
+ 				    MT9P031_PLL_CONTROL_USEPLL);
+ 	if (!ret)		/* more reserved, Continuous, Master Mode */
+ 		ret = mt9m032_write(client, MT9M032_READ_MODE1, 0x8006);
+-	if (!ret)		/* Set 14-bit mode, select 7 divider */
+-		ret = mt9m032_write(client, MT9M032_FORMATTER1, 0x111e);
++	if (!ret) {
++		reg_val = (pll.p1 == 6 ? MT9M032_FORMATTER1_PLL_P1_6 : 0)
++			| MT9M032_FORMATTER1_PARALLEL | 0x001e; /* 14-bit */
++		ret = mt9m032_write(client, MT9M032_FORMATTER1, reg_val);
++	}
+ 
+ 	return ret;
+ }
+-- 
+1.7.10.4
+
diff --git a/patches/omap3isp/0003-mt9m032-Define-MT9M032_READ_MODE1-bits.patch b/patches/omap3isp/0003-mt9m032-Define-MT9M032_READ_MODE1-bits.patch
new file mode 100644
index 0000000000000000000000000000000000000000..c80e87641463e3b6ea933b6559af0623908cf020
--- /dev/null
+++ b/patches/omap3isp/0003-mt9m032-Define-MT9M032_READ_MODE1-bits.patch
@@ -0,0 +1,55 @@
+From 1115becbb4875d62abb10f94a9510c81f376606f Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Date: Wed, 26 Sep 2012 10:54:17 +0200
+Subject: [PATCH 3/6] mt9m032: Define MT9M032_READ_MODE1 bits
+
+Replace hardcoded values with #define's.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+---
+ drivers/media/i2c/mt9m032.c |   22 +++++++++++++++++++++-
+ 1 file changed, 21 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/media/i2c/mt9m032.c b/drivers/media/i2c/mt9m032.c
+index 30d755a..de150d3 100644
+--- a/drivers/media/i2c/mt9m032.c
++++ b/drivers/media/i2c/mt9m032.c
+@@ -90,6 +90,24 @@
+ #define		MT9M032_PLL_CONFIG1_PREDIV_MASK		0x3f
+ #define		MT9M032_PLL_CONFIG1_MUL_SHIFT		8
+ #define MT9M032_READ_MODE1				0x1e
++#define		MT9M032_READ_MODE1_OUTPUT_BAD_FRAMES	(1 << 13)
++#define		MT9M032_READ_MODE1_MAINTAIN_FRAME_RATE	(1 << 12)
++#define		MT9M032_READ_MODE1_XOR_LINE_VALID	(1 << 11)
++#define		MT9M032_READ_MODE1_CONT_LINE_VALID	(1 << 10)
++#define		MT9M032_READ_MODE1_INVERT_TRIGGER	(1 << 9)
++#define		MT9M032_READ_MODE1_SNAPSHOT		(1 << 8)
++#define		MT9M032_READ_MODE1_GLOBAL_RESET		(1 << 7)
++#define		MT9M032_READ_MODE1_BULB_EXPOSURE	(1 << 6)
++#define		MT9M032_READ_MODE1_INVERT_STROBE	(1 << 5)
++#define		MT9M032_READ_MODE1_STROBE_ENABLE	(1 << 4)
++#define		MT9M032_READ_MODE1_STROBE_START_TRIG1	(0 << 2)
++#define		MT9M032_READ_MODE1_STROBE_START_EXP	(1 << 2)
++#define		MT9M032_READ_MODE1_STROBE_START_SHUTTER	(2 << 2)
++#define		MT9M032_READ_MODE1_STROBE_START_TRIG2	(3 << 2)
++#define		MT9M032_READ_MODE1_STROBE_END_TRIG1	(0 << 0)
++#define		MT9M032_READ_MODE1_STROBE_END_EXP	(1 << 0)
++#define		MT9M032_READ_MODE1_STROBE_END_SHUTTER	(2 << 0)
++#define		MT9M032_READ_MODE1_STROBE_END_TRIG2	(3 << 0)
+ #define MT9M032_READ_MODE2				0x20
+ #define		MT9M032_READ_MODE2_VFLIP_SHIFT		15
+ #define		MT9M032_READ_MODE2_HFLIP_SHIFT		14
+@@ -282,7 +300,9 @@ static int mt9m032_setup_pll(struct mt9m032 *sensor)
+ 				    MT9P031_PLL_CONTROL_PWRON |
+ 				    MT9P031_PLL_CONTROL_USEPLL);
+ 	if (!ret)		/* more reserved, Continuous, Master Mode */
+-		ret = mt9m032_write(client, MT9M032_READ_MODE1, 0x8006);
++		ret = mt9m032_write(client, MT9M032_READ_MODE1, 0x8000 |
++				    MT9M032_READ_MODE1_STROBE_START_EXP |
++				    MT9M032_READ_MODE1_STROBE_END_SHUTTER);
+ 	if (!ret) {
+ 		reg_val = (pll.p1 == 6 ? MT9M032_FORMATTER1_PLL_P1_6 : 0)
+ 			| MT9M032_FORMATTER1_PARALLEL | 0x001e; /* 14-bit */
+-- 
+1.7.10.4
+
diff --git a/patches/omap3isp/0004-mt9p031-Use-devm_-managed-helpers.patch b/patches/omap3isp/0004-mt9p031-Use-devm_-managed-helpers.patch
new file mode 100644
index 0000000000000000000000000000000000000000..bcc4360144ee23fb4bd09565f01686cadf5063b1
--- /dev/null
+++ b/patches/omap3isp/0004-mt9p031-Use-devm_-managed-helpers.patch
@@ -0,0 +1,62 @@
+From d3f188f38eaa34acf6375d5d88fe27971aae1170 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Date: Fri, 21 Dec 2012 20:34:06 +0100
+Subject: [PATCH 4/6] mt9p031: Use devm_* managed helpers
+
+Replace kzalloc and gpio_request_one by their managed equivalents.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+---
+ drivers/media/i2c/mt9p031.c |   13 +++----------
+ 1 file changed, 3 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
+index e328332..e0bad59 100644
+--- a/drivers/media/i2c/mt9p031.c
++++ b/drivers/media/i2c/mt9p031.c
+@@ -927,7 +927,7 @@ static int mt9p031_probe(struct i2c_client *client,
+ 		return -EIO;
+ 	}
+ 
+-	mt9p031 = kzalloc(sizeof(*mt9p031), GFP_KERNEL);
++	mt9p031 = devm_kzalloc(&client->dev, sizeof(*mt9p031), GFP_KERNEL);
+ 	if (mt9p031 == NULL)
+ 		return -ENOMEM;
+ 
+@@ -1001,8 +1001,8 @@ static int mt9p031_probe(struct i2c_client *client,
+ 	mt9p031->format.colorspace = V4L2_COLORSPACE_SRGB;
+ 
+ 	if (pdata->reset != -1) {
+-		ret = gpio_request_one(pdata->reset, GPIOF_OUT_INIT_LOW,
+-				       "mt9p031_rst");
++		ret = devm_gpio_request_one(&client->dev, pdata->reset,
++					    GPIOF_OUT_INIT_LOW, "mt9p031_rst");
+ 		if (ret < 0)
+ 			goto done;
+ 
+@@ -1013,12 +1013,8 @@ static int mt9p031_probe(struct i2c_client *client,
+ 
+ done:
+ 	if (ret < 0) {
+-		if (mt9p031->reset != -1)
+-			gpio_free(mt9p031->reset);
+-
+ 		v4l2_ctrl_handler_free(&mt9p031->ctrls);
+ 		media_entity_cleanup(&mt9p031->subdev.entity);
+-		kfree(mt9p031);
+ 	}
+ 
+ 	return ret;
+@@ -1032,9 +1028,6 @@ static int mt9p031_remove(struct i2c_client *client)
+ 	v4l2_ctrl_handler_free(&mt9p031->ctrls);
+ 	v4l2_device_unregister_subdev(subdev);
+ 	media_entity_cleanup(&subdev->entity);
+-	if (mt9p031->reset != -1)
+-		gpio_free(mt9p031->reset);
+-	kfree(mt9p031);
+ 
+ 	return 0;
+ }
+-- 
+1.7.10.4
+
diff --git a/patches/omap3isp/0005-mt9p031-Add-support-for-regulators.patch b/patches/omap3isp/0005-mt9p031-Add-support-for-regulators.patch
new file mode 100644
index 0000000000000000000000000000000000000000..57c80fd0eb5fb5f43c81fbfa748447998d68632f
--- /dev/null
+++ b/patches/omap3isp/0005-mt9p031-Add-support-for-regulators.patch
@@ -0,0 +1,82 @@
+From 9ff2bc0c9458f0eecde6d9b52a899fd2bb1dd3a3 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Date: Tue, 8 May 2012 15:10:36 +0200
+Subject: [PATCH 5/6] mt9p031: Add support for regulators
+
+Enable the regulators when powering the sensor up, and disable them when
+powering it down.
+
+The regulators are mandatory. Boards that don't allow controlling the
+sensor power lines must provide fixed voltage regulators.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+---
+ drivers/media/i2c/mt9p031.c |   24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
+index e0bad59..ecf4492 100644
+--- a/drivers/media/i2c/mt9p031.c
++++ b/drivers/media/i2c/mt9p031.c
+@@ -19,6 +19,7 @@
+ #include <linux/i2c.h>
+ #include <linux/log2.h>
+ #include <linux/pm.h>
++#include <linux/regulator/consumer.h>
+ #include <linux/slab.h>
+ #include <linux/videodev2.h>
+ 
+@@ -121,6 +122,10 @@ struct mt9p031 {
+ 	struct mutex power_lock; /* lock to protect power_count */
+ 	int power_count;
+ 
++	struct regulator *vaa;
++	struct regulator *vdd;
++	struct regulator *vdd_io;
++
+ 	enum mt9p031_model model;
+ 	struct aptina_pll pll;
+ 	int reset;
+@@ -264,6 +269,11 @@ static int mt9p031_power_on(struct mt9p031 *mt9p031)
+ 		usleep_range(1000, 2000);
+ 	}
+ 
++	/* Bring up the supplies */
++	regulator_enable(mt9p031->vdd);
++	regulator_enable(mt9p031->vdd_io);
++	regulator_enable(mt9p031->vaa);
++
+ 	/* Emable clock */
+ 	if (mt9p031->pdata->set_xclk)
+ 		mt9p031->pdata->set_xclk(&mt9p031->subdev,
+@@ -285,6 +295,10 @@ static void mt9p031_power_off(struct mt9p031 *mt9p031)
+ 		usleep_range(1000, 2000);
+ 	}
+ 
++	regulator_disable(mt9p031->vaa);
++	regulator_disable(mt9p031->vdd_io);
++	regulator_disable(mt9p031->vdd);
++
+ 	if (mt9p031->pdata->set_xclk)
+ 		mt9p031->pdata->set_xclk(&mt9p031->subdev, 0);
+ }
+@@ -937,6 +951,16 @@ static int mt9p031_probe(struct i2c_client *client,
+ 	mt9p031->model = did->driver_data;
+ 	mt9p031->reset = -1;
+ 
++	mt9p031->vaa = devm_regulator_get(&client->dev, "vaa");
++	mt9p031->vdd = devm_regulator_get(&client->dev, "vdd");
++	mt9p031->vdd_io = devm_regulator_get(&client->dev, "vdd_io");
++
++	if (IS_ERR(mt9p031->vaa) || IS_ERR(mt9p031->vdd) ||
++	    IS_ERR(mt9p031->vdd_io)) {
++		dev_err(&client->dev, "Unable to get regulators\n");
++		return -ENODEV;
++	}
++
+ 	v4l2_ctrl_handler_init(&mt9p031->ctrls, ARRAY_SIZE(mt9p031_ctrls) + 6);
+ 
+ 	v4l2_ctrl_new_std(&mt9p031->ctrls, &mt9p031_ctrl_ops,
+-- 
+1.7.10.4
+
diff --git a/patches/omap3isp/0006-mt9p031-Use-the-common-clock-framework.patch b/patches/omap3isp/0006-mt9p031-Use-the-common-clock-framework.patch
new file mode 100644
index 0000000000000000000000000000000000000000..fc8d583e8df80ccaf2a29824aeb94d844562931d
--- /dev/null
+++ b/patches/omap3isp/0006-mt9p031-Use-the-common-clock-framework.patch
@@ -0,0 +1,110 @@
+From 6cd62f5ae305142c0490e80caa04f99f00029b68 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Date: Fri, 21 Dec 2012 20:11:55 +0100
+Subject: [PATCH 6/6] mt9p031: Use the common clock framework
+
+Configure the device external clock using the common clock framework
+instead of a board code callback function.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
+---
+ drivers/media/i2c/mt9p031.c |   21 ++++++++++++++-------
+ include/media/mt9p031.h     |    2 --
+ 2 files changed, 14 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
+index ecf4492..28cf95b 100644
+--- a/drivers/media/i2c/mt9p031.c
++++ b/drivers/media/i2c/mt9p031.c
+@@ -12,6 +12,7 @@
+  * published by the Free Software Foundation.
+  */
+ 
++#include <linux/clk.h>
+ #include <linux/delay.h>
+ #include <linux/device.h>
+ #include <linux/gpio.h>
+@@ -122,6 +123,7 @@ struct mt9p031 {
+ 	struct mutex power_lock; /* lock to protect power_count */
+ 	int power_count;
+ 
++	struct clk *clk;
+ 	struct regulator *vaa;
+ 	struct regulator *vdd;
+ 	struct regulator *vdd_io;
+@@ -200,7 +202,7 @@ static int mt9p031_reset(struct mt9p031 *mt9p031)
+ 					  0);
+ }
+ 
+-static int mt9p031_pll_setup(struct mt9p031 *mt9p031)
++static int mt9p031_clk_setup(struct mt9p031 *mt9p031)
+ {
+ 	static const struct aptina_pll_limits limits = {
+ 		.ext_clock_min = 6000000,
+@@ -221,6 +223,12 @@ static int mt9p031_pll_setup(struct mt9p031 *mt9p031)
+ 	struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
+ 	struct mt9p031_platform_data *pdata = mt9p031->pdata;
+ 
++	mt9p031->clk = devm_clk_get(&client->dev, NULL);
++	if (IS_ERR(mt9p031->clk))
++		return PTR_ERR(mt9p031->clk);
++
++	clk_set_rate(mt9p031->clk, pdata->ext_freq);
++
+ 	mt9p031->pll.ext_clock = pdata->ext_freq;
+ 	mt9p031->pll.pix_clock = pdata->target_freq;
+ 
+@@ -275,9 +283,8 @@ static int mt9p031_power_on(struct mt9p031 *mt9p031)
+ 	regulator_enable(mt9p031->vaa);
+ 
+ 	/* Emable clock */
+-	if (mt9p031->pdata->set_xclk)
+-		mt9p031->pdata->set_xclk(&mt9p031->subdev,
+-					 mt9p031->pdata->ext_freq);
++	if (mt9p031->clk)
++		clk_prepare_enable(mt9p031->clk);
+ 
+ 	/* Now RESET_BAR must be high */
+ 	if (mt9p031->reset != -1) {
+@@ -299,8 +306,8 @@ static void mt9p031_power_off(struct mt9p031 *mt9p031)
+ 	regulator_disable(mt9p031->vdd_io);
+ 	regulator_disable(mt9p031->vdd);
+ 
+-	if (mt9p031->pdata->set_xclk)
+-		mt9p031->pdata->set_xclk(&mt9p031->subdev, 0);
++	if (mt9p031->clk)
++		clk_disable_unprepare(mt9p031->clk);
+ }
+ 
+ static int __mt9p031_set_power(struct mt9p031 *mt9p031, bool on)
+@@ -1033,7 +1040,7 @@ static int mt9p031_probe(struct i2c_client *client,
+ 		mt9p031->reset = pdata->reset;
+ 	}
+ 
+-	ret = mt9p031_pll_setup(mt9p031);
++	ret = mt9p031_clk_setup(mt9p031);
+ 
+ done:
+ 	if (ret < 0) {
+diff --git a/include/media/mt9p031.h b/include/media/mt9p031.h
+index 0c97b19..b1e63f2 100644
+--- a/include/media/mt9p031.h
++++ b/include/media/mt9p031.h
+@@ -5,13 +5,11 @@ struct v4l2_subdev;
+ 
+ /*
+  * struct mt9p031_platform_data - MT9P031 platform data
+- * @set_xclk: Clock frequency set callback
+  * @reset: Chip reset GPIO (set to -1 if not used)
+  * @ext_freq: Input clock frequency
+  * @target_freq: Pixel clock frequency
+  */
+ struct mt9p031_platform_data {
+-	int (*set_xclk)(struct v4l2_subdev *subdev, int hz);
+ 	int reset;
+ 	int ext_freq;
+ 	int target_freq;
+-- 
+1.7.10.4
+
diff --git a/patches/omap_dt/0001-ARM-dts-AM33XX-Rename-I2C-and-GPIO-nodes.patch b/patches/omap_dt/0001-ARM-dts-AM33XX-Rename-I2C-and-GPIO-nodes.patch
deleted file mode 100644
index 942eda993433324013d0cc1bd5ada0787d420b7c..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0001-ARM-dts-AM33XX-Rename-I2C-and-GPIO-nodes.patch
+++ /dev/null
@@ -1,267 +0,0 @@
-From 9115b7c03565b5797714b2e819f6a79f040d8782 Mon Sep 17 00:00:00 2001
-From: AnilKumar Ch <anilkumar@ti.com>
-Date: Wed, 21 Nov 2012 17:22:17 +0530
-Subject: [PATCH 01/48] ARM: dts: AM33XX: Rename I2C and GPIO nodes
-
-Rename I2C and GPIO nodes according to AM33XX TRM. According to
-AM33XX TRM device instances are starting from "0" like i2c0, i2c1
-and i2c3.
-
-Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
-[panto@antoniou-consulting.com: initial patch by pantelis's]
-Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/am335x-bone.dts  |   10 +++++-----
- arch/arm/boot/dts/am335x-evm.dts   |   18 +++++++++---------
- arch/arm/boot/dts/am335x-evmsk.dts |   18 +++++++++---------
- arch/arm/boot/dts/am33xx.dtsi      |   14 +++++++-------
- 4 files changed, 30 insertions(+), 30 deletions(-)
-
-diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
-index a154ce0..80bff9c 100644
---- a/arch/arm/boot/dts/am335x-bone.dts
-+++ b/arch/arm/boot/dts/am335x-bone.dts
-@@ -43,7 +43,7 @@
- 			status = "okay";
- 		};
- 
--		i2c1: i2c@44e0b000 {
-+		i2c0: i2c@44e0b000 {
- 			status = "okay";
- 			clock-frequency = <400000>;
- 
-@@ -59,27 +59,27 @@
- 
- 		led@2 {
- 			label = "beaglebone:green:heartbeat";
--			gpios = <&gpio2 21 0>;
-+			gpios = <&gpio1 21 0>;
- 			linux,default-trigger = "heartbeat";
- 			default-state = "off";
- 		};
- 
- 		led@3 {
- 			label = "beaglebone:green:mmc0";
--			gpios = <&gpio2 22 0>;
-+			gpios = <&gpio1 22 0>;
- 			linux,default-trigger = "mmc0";
- 			default-state = "off";
- 		};
- 
- 		led@4 {
- 			label = "beaglebone:green:usr2";
--			gpios = <&gpio2 23 0>;
-+			gpios = <&gpio1 23 0>;
- 			default-state = "off";
- 		};
- 
- 		led@5 {
- 			label = "beaglebone:green:usr3";
--			gpios = <&gpio2 24 0>;
-+			gpios = <&gpio1 24 0>;
- 			default-state = "off";
- 		};
- 	};
-diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
-index 2907da6..62af561 100644
---- a/arch/arm/boot/dts/am335x-evm.dts
-+++ b/arch/arm/boot/dts/am335x-evm.dts
-@@ -51,7 +51,7 @@
- 			status = "okay";
- 		};
- 
--		i2c1: i2c@44e0b000 {
-+		i2c0: i2c@44e0b000 {
- 			status = "okay";
- 			clock-frequency = <400000>;
- 
-@@ -60,7 +60,7 @@
- 			};
- 		};
- 
--		i2c2: i2c@4802a000 {
-+		i2c1: i2c@4802a000 {
- 			status = "okay";
- 			clock-frequency = <100000>;
- 
-@@ -123,12 +123,12 @@
- 		debounce-delay-ms = <5>;
- 		col-scan-delay-us = <2>;
- 
--		row-gpios = <&gpio2 25 0	/* Bank1, pin25 */
--			     &gpio2 26 0	/* Bank1, pin26 */
--			     &gpio2 27 0>;	/* Bank1, pin27 */
-+		row-gpios = <&gpio1 25 0	/* Bank1, pin25 */
-+			     &gpio1 26 0	/* Bank1, pin26 */
-+			     &gpio1 27 0>;	/* Bank1, pin27 */
- 
--		col-gpios = <&gpio2 21 0	/* Bank1, pin21 */
--			     &gpio2 22 0>;	/* Bank1, pin22 */
-+		col-gpios = <&gpio1 21 0	/* Bank1, pin21 */
-+			     &gpio1 22 0>;	/* Bank1, pin22 */
- 
- 		linux,keymap = <0x0000008b	/* MENU */
- 				0x0100009e	/* BACK */
-@@ -147,14 +147,14 @@
- 		switch@9 {
- 			label = "volume-up";
- 			linux,code = <115>;
--			gpios = <&gpio1 2 1>;
-+			gpios = <&gpio0 2 1>;
- 			gpio-key,wakeup;
- 		};
- 
- 		switch@10 {
- 			label = "volume-down";
- 			linux,code = <114>;
--			gpios = <&gpio1 3 1>;
-+			gpios = <&gpio0 3 1>;
- 			gpio-key,wakeup;
- 		};
- 	};
-diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
-index f050c46..8904b88 100644
---- a/arch/arm/boot/dts/am335x-evmsk.dts
-+++ b/arch/arm/boot/dts/am335x-evmsk.dts
-@@ -58,7 +58,7 @@
- 			status = "okay";
- 		};
- 
--		i2c1: i2c@44e0b000 {
-+		i2c0: i2c@44e0b000 {
- 			status = "okay";
- 			clock-frequency = <400000>;
- 
-@@ -115,26 +115,26 @@
- 
- 		led@1 {
- 			label = "evmsk:green:usr0";
--			gpios = <&gpio2 4 0>;
-+			gpios = <&gpio1 4 0>;
- 			default-state = "off";
- 		};
- 
- 		led@2 {
- 			label = "evmsk:green:usr1";
--			gpios = <&gpio2 5 0>;
-+			gpios = <&gpio1 5 0>;
- 			default-state = "off";
- 		};
- 
- 		led@3 {
- 			label = "evmsk:green:mmc0";
--			gpios = <&gpio2 6 0>;
-+			gpios = <&gpio1 6 0>;
- 			linux,default-trigger = "mmc0";
- 			default-state = "off";
- 		};
- 
- 		led@4 {
- 			label = "evmsk:green:heartbeat";
--			gpios = <&gpio2 7 0>;
-+			gpios = <&gpio1 7 0>;
- 			linux,default-trigger = "heartbeat";
- 			default-state = "off";
- 		};
-@@ -148,26 +148,26 @@
- 		switch@1 {
- 			label = "button0";
- 			linux,code = <0x100>;
--			gpios = <&gpio3 3 0>;
-+			gpios = <&gpio2 3 0>;
- 		};
- 
- 		switch@2 {
- 			label = "button1";
- 			linux,code = <0x101>;
--			gpios = <&gpio3 2 0>;
-+			gpios = <&gpio2 2 0>;
- 		};
- 
- 		switch@3 {
- 			label = "button2";
- 			linux,code = <0x102>;
--			gpios = <&gpio1 30 0>;
-+			gpios = <&gpio0 30 0>;
- 			gpio-key,wakeup;
- 		};
- 
- 		switch@4 {
- 			label = "button3";
- 			linux,code = <0x103>;
--			gpios = <&gpio3 5 0>;
-+			gpios = <&gpio2 5 0>;
- 		};
- 	};
- };
-diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
-index e029eea..db3bb2b 100644
---- a/arch/arm/boot/dts/am33xx.dtsi
-+++ b/arch/arm/boot/dts/am33xx.dtsi
-@@ -106,7 +106,7 @@
- 			ti,edma-default-queue = <0>;
- 		};
- 
--		gpio1: gpio@44e07000 {
-+		gpio0: gpio@44e07000 {
- 			compatible = "ti,omap4-gpio";
- 			ti,hwmods = "gpio1";
- 			gpio-controller;
-@@ -117,7 +117,7 @@
- 			interrupts = <96>;
- 		};
- 
--		gpio2: gpio@4804c000 {
-+		gpio1: gpio@4804c000 {
- 			compatible = "ti,omap4-gpio";
- 			ti,hwmods = "gpio2";
- 			gpio-controller;
-@@ -128,7 +128,7 @@
- 			interrupts = <98>;
- 		};
- 
--		gpio3: gpio@481ac000 {
-+		gpio2: gpio@481ac000 {
- 			compatible = "ti,omap4-gpio";
- 			ti,hwmods = "gpio3";
- 			gpio-controller;
-@@ -139,7 +139,7 @@
- 			interrupts = <32>;
- 		};
- 
--		gpio4: gpio@481ae000 {
-+		gpio3: gpio@481ae000 {
- 			compatible = "ti,omap4-gpio";
- 			ti,hwmods = "gpio4";
- 			gpio-controller;
-@@ -204,7 +204,7 @@
- 			status = "disabled";
- 		};
- 
--		i2c1: i2c@44e0b000 {
-+		i2c0: i2c@44e0b000 {
- 			compatible = "ti,omap4-i2c";
- 			#address-cells = <1>;
- 			#size-cells = <0>;
-@@ -214,7 +214,7 @@
- 			status = "disabled";
- 		};
- 
--		i2c2: i2c@4802a000 {
-+		i2c1: i2c@4802a000 {
- 			compatible = "ti,omap4-i2c";
- 			#address-cells = <1>;
- 			#size-cells = <0>;
-@@ -224,7 +224,7 @@
- 			status = "disabled";
- 		};
- 
--		i2c3: i2c@4819c000 {
-+		i2c2: i2c@4819c000 {
- 			compatible = "ti,omap4-i2c";
- 			#address-cells = <1>;
- 			#size-cells = <0>;
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0002-ARM-dts-omap3-Add-generic-DT-support-for-IGEP-device.patch b/patches/omap_dt/0002-ARM-dts-omap3-Add-generic-DT-support-for-IGEP-device.patch
deleted file mode 100644
index 31027b299aba092016f259eb72492abb6135edb2..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0002-ARM-dts-omap3-Add-generic-DT-support-for-IGEP-device.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-From 53a9356f56c1c778a9d50d88360fd26f277c4688 Mon Sep 17 00:00:00 2001
-From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
-Date: Wed, 19 Dec 2012 14:33:08 +0100
-Subject: [PATCH 02/48] ARM: dts: omap3: Add generic DT support for IGEP
- devices
-
-Add a generic .dtsi device tree source file for the
-common characteristics across IGEP Technology devices.
-
-Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
-Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
-Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap3-igep.dtsi |   98 +++++++++++++++++++++++++++++++++++++
- 1 file changed, 98 insertions(+)
- create mode 100644 arch/arm/boot/dts/omap3-igep.dtsi
-
-diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi
-new file mode 100644
-index 0000000..100eb41
---- /dev/null
-+++ b/arch/arm/boot/dts/omap3-igep.dtsi
-@@ -0,0 +1,98 @@
-+/*
-+ * Device Tree Source for IGEP Technology devices
-+ *
-+ * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
-+ * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+/dts-v1/;
-+
-+/include/ "omap3.dtsi"
-+
-+/ {
-+	memory {
-+		device_type = "memory";
-+		reg = <0x80000000 0x20000000>; /* 512 MB */
-+	};
-+
-+	sound {
-+		compatible = "ti,omap-twl4030";
-+		ti,model = "igep2";
-+		ti,mcbsp = <&mcbsp2>;
-+		ti,codec = <&twl_audio>;
-+	};
-+};
-+
-+&omap3_pmx_core {
-+	uart3_pins: pinmux_uart3_pins {
-+		pinctrl-single,pins = <
-+			0x16e 0x100	/* uart3_rx.uart3_rx INPUT | MODE0 */
-+			0x170 0		/* uart3_tx.uart3_tx OUTPUT | MODE0 */
-+		>;
-+	};
-+
-+	mmc1_pins: pinmux_mmc1_pins {
-+		pinctrl-single,pins = <
-+			0x114 0x0118    /* sdmmc1_clk.sdmmc1_clk INPUT PULLUP | MODE 0 */
-+			0x116 0x0118    /* sdmmc1_cmd.sdmmc1_cmd INPUT PULLUP | MODE 0 */
-+			0x118 0x0118 	/* sdmmc1_dat0.sdmmc1_dat0 INPUT PULLUP | MODE 0 */
-+			0x11a 0x0118	/* sdmmc1_dat1.sdmmc1_dat1 INPUT PULLUP | MODE 0 */
-+			0x11c 0x0118	/* sdmmc1_dat2.sdmmc1_dat2 INPUT PULLUP | MODE 0 */
-+			0x11e 0x0118	/* sdmmc1_dat3.sdmmc1_dat3 INPUT PULLUP | MODE 0 */
-+			0x120 0x0100	/* sdmmc1_dat4.sdmmc1_dat4 INPUT | MODE 0 */
-+			0x122 0x0100	/* sdmmc1_dat5.sdmmc1_dat5 INPUT | MODE 0 */
-+			0x124 0x0100	/* sdmmc1_dat6.sdmmc1_dat6 INPUT | MODE 0 */
-+			0x126 0x0100	/* sdmmc1_dat7.sdmmc1_dat7 INPUT | MODE 0 */
-+		>;
-+	};
-+};
-+
-+&i2c1 {
-+	clock-frequency = <2600000>;
-+
-+	twl: twl@48 {
-+		reg = <0x48>;
-+		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
-+		interrupt-parent = <&intc>;
-+
-+		twl_audio: audio {
-+			compatible = "ti,twl4030-audio";
-+			codec {
-+			      };
-+		};
-+	};
-+};
-+
-+/include/ "twl4030.dtsi"
-+
-+&i2c2 {
-+	clock-frequency = <400000>;
-+};
-+
-+&mmc1 {
-+      pinctrl-names = "default";
-+      pinctrl-0 = <&mmc1_pins>;
-+      vmmc-supply = <&vmmc1>;
-+      vmmc_aux-supply = <&vsim>;
-+      bus-width = <8>;
-+};
-+
-+&mmc2 {
-+	status = "disabled";
-+};
-+
-+&mmc3 {
-+	status = "disabled";
-+};
-+
-+&uart3 {
-+       pinctrl-names = "default";
-+       pinctrl-0 = <&uart3_pins>;
-+};
-+
-+&twl_gpio {
-+	ti,use-leds;
-+};
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0003-ARM-dts-omap3-Add-support-for-IGEPv2-board.patch b/patches/omap_dt/0003-ARM-dts-omap3-Add-support-for-IGEPv2-board.patch
deleted file mode 100644
index 89a5771d9d8ae6fb81e915bbe05abcd9752962b7..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0003-ARM-dts-omap3-Add-support-for-IGEPv2-board.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From 25ba05a2bdde8cb9aedfa7f8257fd2ce4a375737 Mon Sep 17 00:00:00 2001
-From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
-Date: Wed, 19 Dec 2012 14:33:09 +0100
-Subject: [PATCH 03/48] ARM: dts: omap3: Add support for IGEPv2 board
-
-ISEE IGEPv2 is an TI OMAP3 SoC based embedded board.
-
-This patch adds an initial device tree support to boot
-an IGEPv2 from the MMC/SD.
-
-Currently is working everything that is supported by DT
-on OMAP3 SoCs (MMC/SD, GPIO LEDs, EEPROM, TWL4030 audio).
-
-Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
-Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
-[benoit.cousson@linaro.org: Update the Makefile for 3.8-rc2]
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/Makefile           |    1 +
- arch/arm/boot/dts/omap3-igep0020.dts |   56 ++++++++++++++++++++++++++++++++++
- 2 files changed, 57 insertions(+)
- create mode 100644 arch/arm/boot/dts/omap3-igep0020.dts
-
-diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
-index 9c62558..a098c94 100644
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -119,6 +119,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
- 	omap3-beagle-xm.dtb \
- 	omap3-evm.dtb \
- 	omap3-tobi.dtb \
-+	omap3-igep0020.dtb \
- 	omap4-panda.dtb \
- 	omap4-panda-a4.dtb \
- 	omap4-panda-es.dtb \
-diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts
-new file mode 100644
-index 0000000..e2b9849
---- /dev/null
-+++ b/arch/arm/boot/dts/omap3-igep0020.dts
-@@ -0,0 +1,56 @@
-+/*
-+ * Device Tree Source for IGEPv2 board
-+ *
-+ * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
-+ * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
-+/include/ "omap3-igep.dtsi"
-+
-+/ {
-+	model = "IGEPv2";
-+	compatible = "isee,omap3-igep0020", "ti,omap3";
-+
-+	leds {
-+		compatible = "gpio-leds";
-+		boot {
-+			 label = "omap3:green:boot";
-+			 gpios = <&gpio1 26 0>;
-+			 default-state = "on";
-+		};
-+
-+		user0 {
-+			 label = "omap3:red:user0";
-+			 gpios = <&gpio1 27 0>;
-+			 default-state = "off";
-+		};
-+
-+		user1 {
-+			 label = "omap3:red:user1";
-+			 gpios = <&gpio1 28 0>;
-+			 default-state = "off";
-+		};
-+
-+		user2 {
-+			label = "omap3:green:user1";
-+			gpios = <&twl_gpio 19 1>;
-+		};
-+	};
-+};
-+
-+&i2c3 {
-+	clock-frequency = <100000>;
-+
-+	/*
-+	 * Display monitor features are burnt in the EEPROM
-+	 * as EDID data.
-+	 */
-+	eeprom@50 {
-+		compatible = "ti,eeprom";
-+		reg = <0x50>;
-+	};
-+};
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0004-ARM-dts-omap3-Add-support-for-IGEP-COM-Module.patch b/patches/omap_dt/0004-ARM-dts-omap3-Add-support-for-IGEP-COM-Module.patch
deleted file mode 100644
index 0a06dfec484097c90d8058159de08142c7076063..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0004-ARM-dts-omap3-Add-support-for-IGEP-COM-Module.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 0b1927f34179ab208b5493b23a569904eef61bab Mon Sep 17 00:00:00 2001
-From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
-Date: Wed, 19 Dec 2012 14:33:10 +0100
-Subject: [PATCH 04/48] ARM: dts: omap3: Add support for IGEP COM Module
-
-ISEE IGEP COM Module is an TI OMAP3 SoC computer on module.
-
-This patch adds an initial device tree support to boot an
-IGEP COM Module from the MMC/SD.
-
-Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
-Tested-by: Enric Balletbo i Serra <eballetbo@gmail.com>
-[b-cousson@ti.com: Update the Makefile for 3.8-rc2]
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/Makefile           |    1 +
- arch/arm/boot/dts/omap3-igep0030.dts |   44 ++++++++++++++++++++++++++++++++++
- 2 files changed, 45 insertions(+)
- create mode 100644 arch/arm/boot/dts/omap3-igep0030.dts
-
-diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
-index a098c94..de29da5 100644
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -120,6 +120,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
- 	omap3-evm.dtb \
- 	omap3-tobi.dtb \
- 	omap3-igep0020.dtb \
-+	omap3-igep0030.dtb \
- 	omap4-panda.dtb \
- 	omap4-panda-a4.dtb \
- 	omap4-panda-es.dtb \
-diff --git a/arch/arm/boot/dts/omap3-igep0030.dts b/arch/arm/boot/dts/omap3-igep0030.dts
-new file mode 100644
-index 0000000..9dc48d2
---- /dev/null
-+++ b/arch/arm/boot/dts/omap3-igep0030.dts
-@@ -0,0 +1,44 @@
-+/*
-+ * Device Tree Source for IGEP COM Module
-+ *
-+ * Copyright (C) 2012 Javier Martinez Canillas <javier@collabora.co.uk>
-+ * Copyright (C) 2012 Enric Balletbo i Serra <eballetbo@gmail.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
-+/include/ "omap3-igep.dtsi"
-+
-+/ {
-+	model = "IGEP COM Module";
-+	compatible = "isee,omap3-igep0030", "ti,omap3";
-+
-+	leds {
-+		compatible = "gpio-leds";
-+		boot {
-+			 label = "omap3:green:boot";
-+			 gpios = <&twl_gpio 13 1>;
-+			 default-state = "on";
-+		};
-+
-+		user0 {
-+			 label = "omap3:red:user0";
-+			 gpios = <&twl_gpio 18 1>; /* LEDA */
-+			 default-state = "off";
-+		};
-+
-+		user1 {
-+			 label = "omap3:green:user1";
-+			 gpios = <&twl_gpio 19 1>; /* LEDB */
-+			 default-state = "off";
-+		};
-+
-+		user2 {
-+			 label = "omap3:red:user1";
-+			 gpios = <&gpio1 16 1>;
-+			 default-state = "off";
-+		};
-+	};
-+};
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0005-ARM-dts-omap3-igep-Add-uart1-and-uart2-to-igep-board.patch b/patches/omap_dt/0005-ARM-dts-omap3-igep-Add-uart1-and-uart2-to-igep-board.patch
deleted file mode 100644
index 499bc9630a8a823faf01da6823ae04d73701cc31..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0005-ARM-dts-omap3-igep-Add-uart1-and-uart2-to-igep-board.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 22d8e26e2749fe367a09d9fd6d09ea92f8553d19 Mon Sep 17 00:00:00 2001
-From: Matthias Brugger <matthias.bgg@gmail.com>
-Date: Wed, 12 Dec 2012 16:33:42 +0100
-Subject: [PATCH 05/48] ARM: dts: omap3-igep: Add uart1 and uart2 to igep
- boards
-
-This is a follow-up to Javier Martinez effort adding initial
-device tree support to IGEP technology devices [1].
-
-It adds uart1 and uart2 bindings to the generic dtsi for the IGEP boards.
-
-[1] http://www.spinics.net/lists/linux-omap/msg83409.html
-
-Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap3-igep.dtsi |   24 ++++++++++++++++++++++++
- 1 file changed, 24 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi
-index 100eb41..dd01c46 100644
---- a/arch/arm/boot/dts/omap3-igep.dtsi
-+++ b/arch/arm/boot/dts/omap3-igep.dtsi
-@@ -27,6 +27,20 @@
- };
- 
- &omap3_pmx_core {
-+	uart1_pins: pinmux_uart1_pins {
-+		pinctrl-single,pins = <
-+			0x152 0x100	/* uart1_rx.uart1_rx INPUT | MODE0 */
-+			0x14c 0		/* uart1_tx.uart1_tx OUTPUT | MODE0 */
-+		>;
-+	};
-+
-+	uart2_pins: pinmux_uart2_pins {
-+		pinctrl-single,pins = <
-+			0x14a 0x100	/* uart2_rx.uart2_rx INPUT | MODE0 */
-+			0x148 0		/* uart2_tx.uart2_tx OUTPUT | MODE0 */
-+		>;
-+	};
-+
- 	uart3_pins: pinmux_uart3_pins {
- 		pinctrl-single,pins = <
- 			0x16e 0x100	/* uart3_rx.uart3_rx INPUT | MODE0 */
-@@ -88,6 +102,16 @@
- 	status = "disabled";
- };
- 
-+&uart1 {
-+       pinctrl-names = "default";
-+       pinctrl-0 = <&uart1_pins>;
-+};
-+
-+&uart2 {
-+       pinctrl-names = "default";
-+       pinctrl-0 = <&uart2_pins>;
-+};
-+
- &uart3 {
-        pinctrl-names = "default";
-        pinctrl-0 = <&uart3_pins>;
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0006-ARM-dts-AM33XX-Add-d_can-instances-to-aliases.patch b/patches/omap_dt/0006-ARM-dts-AM33XX-Add-d_can-instances-to-aliases.patch
deleted file mode 100644
index ae76113960b4bf16299d863777b18329d8e06d16..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0006-ARM-dts-AM33XX-Add-d_can-instances-to-aliases.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 6b80607ba70e107389a2155b0652939f862e5e35 Mon Sep 17 00:00:00 2001
-From: AnilKumar Ch <anilkumar@ti.com>
-Date: Wed, 14 Nov 2012 23:38:24 +0530
-Subject: [PATCH 06/48] ARM: dts: AM33XX: Add d_can instances to aliases
-
-Add d_can instances to aliases node to get the D_CAN instance number
-from the driver. To initialize D_CAN message RAM, corresponding instance
-number is required.
-
-To initialize instance 0 message RAM then 0x1 should be written and for
-instance 1 message RAM, 0x2 should be written to control module register.
-
-With device-tree framework ip instance number is "-1" by default for all
-instances. To get device id/instance number then modules should be added
-to DT "aliases" node. of_alias_get_id() gives the device id number based
-on number of alias nodes present in "aliases node".
-
-Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
-Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/am33xx.dtsi |    2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
-index dd237de..a8fad53 100644
---- a/arch/arm/boot/dts/am33xx.dtsi
-+++ b/arch/arm/boot/dts/am33xx.dtsi
-@@ -21,6 +21,8 @@
- 		serial3 = &uart4;
- 		serial4 = &uart5;
- 		serial5 = &uart6;
-+		d_can0 = &dcan0;
-+		d_can1 = &dcan1;
- 	};
- 
- 	cpus {
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0007-ARM-dts-AM33XX-Add-memory-resource-to-d_can-node.patch b/patches/omap_dt/0007-ARM-dts-AM33XX-Add-memory-resource-to-d_can-node.patch
deleted file mode 100644
index 2dd64bb2aebe1735086c7713cdd540e82aed42ec..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0007-ARM-dts-AM33XX-Add-memory-resource-to-d_can-node.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From bcc2c71b4ea359b0cebb270029351404db79eb32 Mon Sep 17 00:00:00 2001
-From: AnilKumar Ch <anilkumar@ti.com>
-Date: Wed, 14 Nov 2012 23:38:25 +0530
-Subject: [PATCH 07/48] ARM: dts: AM33XX: Add memory resource to d_can node
-
-Add a new address space/memory resource to d_can device tree node. D_CAN
-RAM initialization is achieved through RAMINIT register which is part of
-AM33XX control module address space. D_CAN RAM init or de-init should be
-done by writing instance corresponding value to control module register.
-
-Till we have a separate control module driver to write to control module,
-d_can driver will handle the register writes to control module by itself.
-So a new address space to represent this control module register is added
-to d_can driver.
-
-Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
-Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/am33xx.dtsi |    6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
-index a8fad53..74a8125 100644
---- a/arch/arm/boot/dts/am33xx.dtsi
-+++ b/arch/arm/boot/dts/am33xx.dtsi
-@@ -227,7 +227,8 @@
- 		dcan0: d_can@481cc000 {
- 			compatible = "bosch,d_can";
- 			ti,hwmods = "d_can0";
--			reg = <0x481cc000 0x2000>;
-+			reg = <0x481cc000 0x2000
-+				0x44e10644 0x4>;
- 			interrupts = <52>;
- 			status = "disabled";
- 		};
-@@ -235,7 +236,8 @@
- 		dcan1: d_can@481d0000 {
- 			compatible = "bosch,d_can";
- 			ti,hwmods = "d_can1";
--			reg = <0x481d0000 0x2000>;
-+			reg = <0x481d0000 0x2000
-+				0x44e10644 0x4>;
- 			interrupts = <55>;
- 			status = "disabled";
- 		};
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0008-ARM-dts-twl4030-Add-PWM-support.patch b/patches/omap_dt/0008-ARM-dts-twl4030-Add-PWM-support.patch
deleted file mode 100644
index c8e21849b9df5c0812b1eda3256c95d5b714de64..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0008-ARM-dts-twl4030-Add-PWM-support.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From ce24199f87e1d8f482dba304f8d25e3e37962643 Mon Sep 17 00:00:00 2001
-From: Peter Ujfalusi <peter.ujfalusi@ti.com>
-Date: Wed, 7 Nov 2012 15:05:00 +0100
-Subject: [PATCH 08/48] ARM: dts: twl4030: Add PWM support
-
-Enable support for the PWMs and LEDs as PWM drivers.
-
-Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/twl4030.dtsi |   10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
-index ed0bc95..d216853 100644
---- a/arch/arm/boot/dts/twl4030.dtsi
-+++ b/arch/arm/boot/dts/twl4030.dtsi
-@@ -75,4 +75,14 @@
- 		usb3v1-supply = <&vusb3v1>;
- 		usb_mode = <1>;
- 	};
-+
-+	twl_pwm: pwm {
-+		compatible = "ti,twl4030-pwm";
-+		#pwm-cells = <2>;
-+	};
-+
-+	twl_pwmled: pwmled {
-+		compatible = "ti,twl4030-pwmled";
-+		#pwm-cells = <2>;
-+	};
- };
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0009-ARM-dts-twl6030-Add-PWM-support.patch b/patches/omap_dt/0009-ARM-dts-twl6030-Add-PWM-support.patch
deleted file mode 100644
index b0bdb3f25ed9bdb818a78e843ea1996d1feccdb1..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0009-ARM-dts-twl6030-Add-PWM-support.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 7d45883817218232ab7bbe51437227d251fa2db2 Mon Sep 17 00:00:00 2001
-From: Peter Ujfalusi <peter.ujfalusi@ti.com>
-Date: Wed, 7 Nov 2012 15:05:20 +0100
-Subject: [PATCH 09/48] ARM: dts: twl6030: Add PWM support
-
-Enable support for the PWMs and LED as PWM drivers.
-
-Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/twl6030.dtsi |   12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/arch/arm/boot/dts/twl6030.dtsi b/arch/arm/boot/dts/twl6030.dtsi
-index 9996cfc..2e3bd31 100644
---- a/arch/arm/boot/dts/twl6030.dtsi
-+++ b/arch/arm/boot/dts/twl6030.dtsi
-@@ -91,4 +91,16 @@
- 		compatible = "ti,twl6030-usb";
- 		interrupts = <4>, <10>;
- 	};
-+
-+	twl_pwm: pwm {
-+		/* provides two PWMs (id 0, 1 for PWM1 and PWM2) */
-+		compatible = "ti,twl6030-pwm";
-+		#pwm-cells = <2>;
-+	};
-+
-+	twl_pwmled: pwmled {
-+		/* provides one PWM (id 0 for Charging indicator LED) */
-+		compatible = "ti,twl6030-pwmled";
-+		#pwm-cells = <2>;
-+	};
- };
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0010-ARM-dts-omap3-beagle-xm-Use-pwm-leds-for-pmu_stat-LE.patch b/patches/omap_dt/0010-ARM-dts-omap3-beagle-xm-Use-pwm-leds-for-pmu_stat-LE.patch
deleted file mode 100644
index 6a730b997288d12e86f20e69b8f95074c53f2813..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0010-ARM-dts-omap3-beagle-xm-Use-pwm-leds-for-pmu_stat-LE.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 893dcd7e8b1410e287be059f15bf8d62c20d2a2a Mon Sep 17 00:00:00 2001
-From: Peter Ujfalusi <peter.ujfalusi@ti.com>
-Date: Fri, 18 Jan 2013 15:16:18 +0100
-Subject: [PATCH 10/48] ARM: dts: omap3-beagle-xm: Use pwm-leds for pmu_stat
- LED
-
-We have proper driver stack to handle the pmu_stat LED which is connected
-PWMB of twl4030.
-
-Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap3-beagle-xm.dts |   14 ++++++++++----
- 1 file changed, 10 insertions(+), 4 deletions(-)
-
-diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
-index 3705a81..1c85e0f 100644
---- a/arch/arm/boot/dts/omap3-beagle-xm.dts
-+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
-@@ -20,10 +20,6 @@
- 
- 	leds {
- 		compatible = "gpio-leds";
--		pmu_stat {
--			label = "beagleboard::pmu_stat";
--			gpios = <&twl_gpio 19 0>; /* LEDB */
--		};
- 
- 		heartbeat {
- 			label = "beagleboard::usr0";
-@@ -38,6 +34,16 @@
- 		};
- 	};
- 
-+	pwmleds {
-+		compatible = "pwm-leds";
-+
-+		pmu_stat {
-+			label = "beagleboard::pmu_stat";
-+			pwms = <&twl_pwmled 1 7812500>;
-+			max-brightness = <127>;
-+		};
-+	};
-+
- 	sound {
- 		compatible = "ti,omap-twl4030";
- 		ti,model = "omap3beagle";
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0011-ARM-dts-omap4-sdp-Add-support-for-pwm-leds-keypad-an.patch b/patches/omap_dt/0011-ARM-dts-omap4-sdp-Add-support-for-pwm-leds-keypad-an.patch
deleted file mode 100644
index 24442a140d84cb0c0636fd2f384f02e93dad6d54..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0011-ARM-dts-omap4-sdp-Add-support-for-pwm-leds-keypad-an.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 446f79f44d77369d22e7d17f3b181136bbf35b4f Mon Sep 17 00:00:00 2001
-From: Peter Ujfalusi <peter.ujfalusi@ti.com>
-Date: Mon, 12 Nov 2012 15:06:56 +0100
-Subject: [PATCH 11/48] ARM: dts: omap4-sdp: Add support for pwm-leds (keypad
- and charging LED)
-
-Sections to describe the pwm-leds in the system.
-
-Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap4-sdp.dts |   15 +++++++++++++++
- 1 file changed, 15 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
-index 43e5258..8101a94 100644
---- a/arch/arm/boot/dts/omap4-sdp.dts
-+++ b/arch/arm/boot/dts/omap4-sdp.dts
-@@ -80,6 +80,21 @@
- 		};
- 	};
- 
-+	pwmleds {
-+		compatible = "pwm-leds";
-+		kpad {
-+			label = "omap4::keypad";
-+			pwms = <&twl_pwm 0 7812500>;
-+			max-brightness = <127>;
-+		};
-+
-+		charging {
-+			label = "omap4:green:chrg";
-+			pwms = <&twl_pwmled 0 7812500>;
-+			max-brightness = <255>;
-+		};
-+	};
-+
- 	sound {
- 		compatible = "ti,abe-twl6040";
- 		ti,model = "SDP4430";
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0012-ARM-dts-omap4-sdp-Add-support-for-pwm-backlight.patch b/patches/omap_dt/0012-ARM-dts-omap4-sdp-Add-support-for-pwm-backlight.patch
deleted file mode 100644
index 423b71add9d426c3777b67793044710a9c848cf2..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0012-ARM-dts-omap4-sdp-Add-support-for-pwm-backlight.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 3bf75b66f9d1cbe6089352b4f35e906b39a5c57f Mon Sep 17 00:00:00 2001
-From: Peter Ujfalusi <peter.ujfalusi@ti.com>
-Date: Fri, 18 Jan 2013 15:00:47 +0100
-Subject: [PATCH 12/48] ARM: dts: omap4-sdp: Add support for pwm-backlight
-
-Section to describe the backlight for the LCD panels.
-
-Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap4-sdp.dts |   11 +++++++++++
- 1 file changed, 11 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
-index 8101a94..c2dee41 100644
---- a/arch/arm/boot/dts/omap4-sdp.dts
-+++ b/arch/arm/boot/dts/omap4-sdp.dts
-@@ -95,6 +95,17 @@
- 		};
- 	};
- 
-+	backlight {
-+		compatible = "pwm-backlight";
-+		pwms = <&twl_pwm 1 7812500>;
-+		brightness-levels = <
-+				0 10 20 30 40
-+				50 60 70 80 90
-+				100 110 120 127
-+				>;
-+		default-brightness-level = <13>;
-+	};
-+
- 	sound {
- 		compatible = "ti,abe-twl6040";
- 		ti,model = "SDP4430";
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0013-ARM-dts-omap3-overo-Add-support-for-pwm-leds.patch b/patches/omap_dt/0013-ARM-dts-omap3-overo-Add-support-for-pwm-leds.patch
deleted file mode 100644
index 6b879ce6b569f24493fba0aad73c7e12e87e1ec5..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0013-ARM-dts-omap3-overo-Add-support-for-pwm-leds.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 95dff7fbd96922fc37087c469c5fa0990450dd72 Mon Sep 17 00:00:00 2001
-From: Florian Vaussard <florian.vaussard@epfl.ch>
-Date: Wed, 23 Jan 2013 18:56:51 +0100
-Subject: [PATCH 13/48] ARM: dts: omap3-overo: Add support for pwm-leds
-
-Convert the on-board LED connected to the TWL4030 (LEDB) to use
-pwm-leds.
-
-Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap3-overo.dtsi |    9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi
-index 89808ce..800be29 100644
---- a/arch/arm/boot/dts/omap3-overo.dtsi
-+++ b/arch/arm/boot/dts/omap3-overo.dtsi
-@@ -14,12 +14,13 @@
- /include/ "omap3.dtsi"
- 
- / {
--	leds {
--		compatible = "gpio-leds";
-+	pwmleds {
-+		compatible = "pwm-leds";
-+
- 		overo {
- 			label = "overo:blue:COM";
--			gpios = <&twl_gpio 19 0>;
--			linux,default-trigger = "mmc0";
-+			pwms = <&twl_pwmled 1 7812500>;
-+			max-brightness = <127>;
- 		};
- 	};
- };
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0014-ARM-dts-omap4-sdp-Add-I2c-pinctrl-data.patch b/patches/omap_dt/0014-ARM-dts-omap4-sdp-Add-I2c-pinctrl-data.patch
deleted file mode 100644
index 19beadc650c554cc4fce9e78d32d5ebde71ac196..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0014-ARM-dts-omap4-sdp-Add-I2c-pinctrl-data.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From 0948949eef4e0abe918499e31f014120a1cfee71 Mon Sep 17 00:00:00 2001
-From: Sourav Poddar <sourav.poddar@ti.com>
-Date: Wed, 13 Feb 2013 14:58:12 +0530
-Subject: [PATCH 14/48] ARM: dts: omap4-sdp: Add I2c pinctrl data
-
-Booting 3.8-rc6 on omap 4430sdp results in the following error
-
-omap_i2c 48070000.i2c: did not get pins for i2c error: -19
-[    1.024261] omap_i2c 48070000.i2c: bus 0 rev0.12 at 100 kHz
-[    1.030181] omap_i2c 48072000.i2c: did not get pins for i2c error: -19
-[    1.037384] omap_i2c 48072000.i2c: bus 1 rev0.12 at 400 kHz
-[    1.043762] omap_i2c 48060000.i2c: did not get pins for i2c error: -19
-[    1.050964] omap_i2c 48060000.i2c: bus 2 rev0.12 at 100 kHz
-[    1.056823] omap_i2c 4807a000.i2c: did not get pins for i2c error: -19
-[    1.064025] omap_i2c 4807a000.i2c: bus 3 rev0.12 at 400 kHz
-
-This happens because omap4 dts file is not adapted to use i2c through pinctrl
-framework. Populating i2c pinctrl data to get rid of the error.
-
-Tested on omap4430 sdp with 3.8-rc6 kernel.
-
-Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
-Reported-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap4-sdp.dts |   40 +++++++++++++++++++++++++++++++++++++++
- 1 file changed, 40 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
-index c2dee41..0e32e8e 100644
---- a/arch/arm/boot/dts/omap4-sdp.dts
-+++ b/arch/arm/boot/dts/omap4-sdp.dts
-@@ -238,9 +238,40 @@
- 			0x58 0x10b	/* hdmi_hpd.gpio_63 INPUT PULLDOWN | MODE3 */
- 		>;
- 	};
-+
-+	i2c1_pins: pinmux_i2c1_pins {
-+		pinctrl-single,pins = <
-+			0xe2 0x118        /* i2c1_scl PULLUP | INPUTENABLE | MODE0 */
-+			0xe4 0x118       /* i2c1_sda PULLUP | INPUTENABLE | MODE0 */
-+		>;
-+	};
-+
-+	i2c2_pins: pinmux_i2c2_pins {
-+		pinctrl-single,pins = <
-+                        0xe6 0x118        /* i2c2_scl PULLUP | INPUTENABLE | MODE0 */
-+                        0xe8 0x118        /* i2c2_sda PULLUP | INPUTENABLE | MODE0 */
-+		>;
-+	};
-+
-+	i2c3_pins: pinmux_i2c3_pins {
-+		pinctrl-single,pins = <
-+			0xea 0x118        /* i2c3_scl PULLUP | INPUTENABLE | MODE0 */
-+			0xec 0x118     /* i2c3_sda PULLUP | INPUTENABLE | MODE0 */
-+		>;
-+	};
-+
-+	i2c4_pins: pinmux_i2c4_pins {
-+		pinctrl-single,pins = <
-+			0xee 0x118        /* i2c4_scl PULLUP | INPUTENABLE | MODE0 */
-+			0xf0 0x118     /* i2c4_sda PULLUP | INPUTENABLE | MODE0 */
-+		>;
-+	};
- };
- 
- &i2c1 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c1_pins>;
-+
- 	clock-frequency = <400000>;
- 
- 	twl: twl@48 {
-@@ -279,10 +310,16 @@
- /include/ "twl6030.dtsi"
- 
- &i2c2 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c2_pins>;
-+
- 	clock-frequency = <400000>;
- };
- 
- &i2c3 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c3_pins>;
-+
- 	clock-frequency = <400000>;
- 
- 	/*
-@@ -305,6 +342,9 @@
- };
- 
- &i2c4 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c4_pins>;
-+
- 	clock-frequency = <400000>;
- 
- 	/*
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0015-ARM-dts-omap3-overo-Add-audio-support.patch b/patches/omap_dt/0015-ARM-dts-omap3-overo-Add-audio-support.patch
deleted file mode 100644
index d45dee33114ae15799439537415fc2e4a8d47b04..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0015-ARM-dts-omap3-overo-Add-audio-support.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From a609b5b9916e31d3e21808f19d1b796ef04879ac Mon Sep 17 00:00:00 2001
-From: Florian Vaussard <florian.vaussard@epfl.ch>
-Date: Wed, 23 Jan 2013 18:56:52 +0100
-Subject: [PATCH 15/48] ARM: dts: omap3-overo: Add audio support
-
-Add the needed sections to enable audio support on Overo.
-
-Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap3-overo.dtsi |   14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi
-index 800be29..81341fa 100644
---- a/arch/arm/boot/dts/omap3-overo.dtsi
-+++ b/arch/arm/boot/dts/omap3-overo.dtsi
-@@ -23,6 +23,14 @@
- 			max-brightness = <127>;
- 		};
- 	};
-+
-+	sound {
-+		compatible = "ti,omap-twl4030";
-+		ti,model = "overo";
-+
-+		ti,mcbsp = <&mcbsp2>;
-+		ti,codec = <&twl_audio>;
-+	};
- };
- 
- &i2c1 {
-@@ -32,6 +40,12 @@
- 		reg = <0x48>;
- 		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
- 		interrupt-parent = <&intc>;
-+
-+		twl_audio: audio {
-+			compatible = "ti,twl4030-audio";
-+			codec {
-+			};
-+		};
- 	};
- };
- 
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0016-ARM-dts-omap5-evm-Add-I2c-pinctrl-data.patch b/patches/omap_dt/0016-ARM-dts-omap5-evm-Add-I2c-pinctrl-data.patch
deleted file mode 100644
index e77979c241c6d4b3af81b37e6f6e8bf9e5cd3454..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0016-ARM-dts-omap5-evm-Add-I2c-pinctrl-data.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-From f879c2220f5302d20ab02c3e0f803802e009347f Mon Sep 17 00:00:00 2001
-From: Sourav Poddar <sourav.poddar@ti.com>
-Date: Wed, 13 Feb 2013 14:58:22 +0530
-Subject: [PATCH 16/48] ARM: dts: omap5-evm: Add I2c pinctrl data
-
-Booting 3.8-rc6 on omap 5430evm results in the following error
-
-omap_i2c 48070000.i2c: did not get pins for i2c error: -19
-[    1.024261] omap_i2c 48070000.i2c: bus 0 rev0.12 at 100 kHz
-[    1.030181] omap_i2c 48072000.i2c: did not get pins for i2c error: -19
-[    1.037384] omap_i2c 48072000.i2c: bus 1 rev0.12 at 400 kHz
-[    1.043762] omap_i2c 48060000.i2c: did not get pins for i2c error: -19
-[    1.050964] omap_i2c 48060000.i2c: bus 2 rev0.12 at 100 kHz
-[    1.056823] omap_i2c 4807a000.i2c: did not get pins for i2c error: -19
-[    1.064025] omap_i2c 4807a000.i2c: bus 3 rev0.12 at 400 kHz
-
-This happens because omap5 dts file is not adapted to use i2c through pinctrl
-framework. Populating i2c pinctrl data to get rid of the error.
-
-Tested on omap5430 evm with 3.8-rc6 kernel.
-
-Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap5-evm.dts |   62 +++++++++++++++++++++++++++++++++++++++
- 1 file changed, 62 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
-index 8722c15..a4784be 100644
---- a/arch/arm/boot/dts/omap5-evm.dts
-+++ b/arch/arm/boot/dts/omap5-evm.dts
-@@ -80,6 +80,41 @@
- 			0x15a 0x100	/* abemcbsp2_clkx.abemcbsp2_clkx INPUT | MODE0 */
- 		>;
- 	};
-+
-+        i2c1_pins: pinmux_i2c1_pins {
-+                pinctrl-single,pins = <
-+                        0x1b2 0x118        /* i2c1_scl PULLUP | INPUTENABLE | MODE0 */
-+                        0x1b4 0x118        /* i2c1_sda PULLUP | INPUTENABLE | MODE0 */
-+                >;
-+        };
-+
-+	i2c2_pins: pinmux_i2c2_pins {
-+		pinctrl-single,pins = <
-+			0x178 0x100        /* i2c2_scl INPUTENABLE | MODE0 */
-+			0x17a 0x100        /* i2c2_sda INPUTENABLE | MODE0 */
-+		>;
-+	};
-+
-+	i2c3_pins: pinmux_i2c3_pins {
-+		pinctrl-single,pins = <
-+			0x13a 0x100        /* i2c3_scl INPUTENABLE | MODE0 */
-+			0x13c 0x100     /* i2c3_sda INPUTENABLE | MODE0 */
-+		>;
-+	};
-+
-+	i2c4_pins: pinmux_i2c4_pins {
-+		pinctrl-single,pins = <
-+			0xb8 0x100        /* i2c4_scl INPUTENABLE | MODE0 */
-+			0xba 0x100     /* i2c4_sda INPUTENABLE | MODE0 */
-+		>;
-+	};
-+
-+	i2c5_pins: pinmux_i2c5_pins {
-+		pinctrl-single,pins = <
-+			0x184 0x100        /* i2c5_scl INPUTENABLE | MODE0 */
-+			0x186 0x100     /* i2c5_sda INPUTENABLE | MODE0 */
-+		>;
-+	};
- };
- 
- &mmc1 {
-@@ -106,7 +141,17 @@
- 	status = "disabled";
- };
- 
-+&i2c1 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c1_pins>;
-+
-+	clock-frequency = <400000>;
-+};
-+
- &i2c2 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c2_pins>;
-+
- 	clock-frequency = <400000>;
- 
- 	/* Pressure Sensor */
-@@ -116,7 +161,17 @@
- 	};
- };
- 
-+&i2c3 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c3_pins>;
-+
-+	clock-frequency = <400000>;
-+};
-+
- &i2c4 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c4_pins>;
-+
- 	clock-frequency = <400000>;
- 
- 	/* Temperature Sensor */
-@@ -126,6 +181,13 @@
- 	};
- };
- 
-+&i2c5 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c5_pins>;
-+
-+	clock-frequency = <400000>;
-+};
-+
- &keypad {
- 	keypad,num-rows = <8>;
- 	keypad,num-columns = <8>;
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0017-ARM-dts-omap4-panda-Add-I2c-pinctrl-data.patch b/patches/omap_dt/0017-ARM-dts-omap4-panda-Add-I2c-pinctrl-data.patch
deleted file mode 100644
index 56424cc5405468d6c9849538f89b722a622a57f8..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0017-ARM-dts-omap4-panda-Add-I2c-pinctrl-data.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From d398f82755ec2cf5b2ad76b2baf5582947c2dace Mon Sep 17 00:00:00 2001
-From: Sourav Poddar <sourav.poddar@ti.com>
-Date: Wed, 13 Feb 2013 14:58:30 +0530
-Subject: [PATCH 17/48] ARM: dts: omap4-panda: Add I2c pinctrl data
-
-Booting 3.8-rc6 on omap4 panda results in the following error
-
-[    0.444427] omap_i2c 48070000.i2c: did not get pins for i2c error: -19
-[    0.445770] omap_i2c 48070000.i2c: bus 0 rev0.11 at 400 kHz
-[    0.473937] omap_i2c 48072000.i2c: did not get pins for i2c error: -19
-[    0.474670] omap_i2c 48072000.i2c: bus 1 rev0.11 at 400 kHz
-[    0.474822] omap_i2c 48060000.i2c: did not get pins for i2c error: -19
-[    0.476379] omap_i2c 48060000.i2c: bus 2 rev0.11 at 100 kHz
-[    0.477294] omap_i2c 48350000.i2c: did not get pins for i2c error: -19
-[    0.477996] omap_i2c 48350000.i2c: bus 3 rev0.11 at 400 kHz
-[    0.483398] Switching to clocksource 32k_counter
-
-This happens because omap4 panda dts file is not adapted to use i2c through
-pinctrl framework. Populating i2c pinctrl data to get rid of the error.
-
-Tested on omap4460 panda with 3.8-rc6 kernel.
-
-Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
-Reported-by: Luciano Coelho <coelho@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap4-panda.dts |   40 +++++++++++++++++++++++++++++++++++++
- 1 file changed, 40 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
-index 4122efe..f951e6b 100644
---- a/arch/arm/boot/dts/omap4-panda.dts
-+++ b/arch/arm/boot/dts/omap4-panda.dts
-@@ -110,9 +110,40 @@
- 			0x58 0x10b	/* hdmi_hpd.gpio_63 INPUT PULLDOWN | MODE3 */
- 		>;
- 	};
-+
-+	i2c1_pins: pinmux_i2c1_pins {
-+		pinctrl-single,pins = <
-+			0xe2 0x118        /* i2c1_scl PULLUP | INPUTENABLE | MODE0 */
-+			0xe4 0x118        /* i2c1_sda PULLUP | INPUTENABLE | MODE0 */
-+		>;
-+	};
-+
-+	i2c2_pins: pinmux_i2c2_pins {
-+		pinctrl-single,pins = <
-+			0xe6 0x118        /* i2c2_scl PULLUP | INPUTENABLE | MODE0 */
-+			0xe8 0x118        /* i2c2_sda PULLUP | INPUTENABLE | MODE0 */
-+		>;
-+	};
-+
-+	i2c3_pins: pinmux_i2c3_pins {
-+		pinctrl-single,pins = <
-+			0xea 0x118        /* i2c3_scl PULLUP | INPUTENABLE | MODE0 */
-+			0xec 0x118     /* i2c3_sda PULLUP | INPUTENABLE | MODE0 */
-+		>;
-+	};
-+
-+	i2c4_pins: pinmux_i2c4_pins {
-+		pinctrl-single,pins = <
-+			0xee 0x118        /* i2c4_scl PULLUP | INPUTENABLE | MODE0 */
-+			0xf0 0x118     /* i2c4_sda PULLUP | INPUTENABLE | MODE0 */
-+		>;
-+	};
- };
- 
- &i2c1 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c1_pins>;
-+
- 	clock-frequency = <400000>;
- 
- 	twl: twl@48 {
-@@ -139,10 +170,16 @@
- /include/ "twl6030.dtsi"
- 
- &i2c2 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c2_pins>;
-+
- 	clock-frequency = <400000>;
- };
- 
- &i2c3 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c3_pins>;
-+
- 	clock-frequency = <100000>;
- 
- 	/*
-@@ -156,6 +193,9 @@
- };
- 
- &i2c4 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c4_pins>;
-+
- 	clock-frequency = <400000>;
- };
- 
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0018-ARM-dts-OMAP5-Add-SPI-nodes.patch b/patches/omap_dt/0018-ARM-dts-OMAP5-Add-SPI-nodes.patch
deleted file mode 100644
index 018ccb59ae1f56b32f74134a62ab69cf96086477..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0018-ARM-dts-OMAP5-Add-SPI-nodes.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From e18c3f93be1d0e05dad0de0f243fef3cbcbfe5ff Mon Sep 17 00:00:00 2001
-From: Felipe Balbi <balbi@ti.com>
-Date: Wed, 13 Feb 2013 14:58:36 +0530
-Subject: [PATCH 18/48] ARM: dts: OMAP5: Add SPI nodes
-
-Add all 4 mcspi instances to omap5.dtsi file.
-
-Signed-off-by: Felipe Balbi <balbi@ti.com>
-Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
-[benoit.cousson@linaro.org: Update the subject]
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap5.dtsi |   40 ++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 40 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
-index 790bb2a..9e182a9 100644
---- a/arch/arm/boot/dts/omap5.dtsi
-+++ b/arch/arm/boot/dts/omap5.dtsi
-@@ -241,6 +241,46 @@
- 			ti,hwmods = "i2c5";
- 		};
- 
-+		mcspi1: spi@48098000 {
-+			compatible = "ti,omap4-mcspi";
-+			reg = <0x48098000 0x200>;
-+			interrupts = <0 65 0x4>;
-+			#address-cells = <1>;
-+			#size-cells = <0>;
-+			ti,hwmods = "mcspi1";
-+			ti,spi-num-cs = <4>;
-+		};
-+
-+		mcspi2: spi@4809a000 {
-+			compatible = "ti,omap4-mcspi";
-+			reg = <0x4809a000 0x200>;
-+			interrupts = <0 66 0x4>;
-+			#address-cells = <1>;
-+			#size-cells = <0>;
-+			ti,hwmods = "mcspi2";
-+			ti,spi-num-cs = <2>;
-+		};
-+
-+		mcspi3: spi@480b8000 {
-+			compatible = "ti,omap4-mcspi";
-+			reg = <0x480b8000 0x200>;
-+			interrupts = <0 91 0x4>;
-+			#address-cells = <1>;
-+			#size-cells = <0>;
-+			ti,hwmods = "mcspi3";
-+			ti,spi-num-cs = <2>;
-+		};
-+
-+		mcspi4: spi@480ba000 {
-+			compatible = "ti,omap4-mcspi";
-+			reg = <0x480ba000 0x200>;
-+			interrupts = <0 48 0x4>;
-+			#address-cells = <1>;
-+			#size-cells = <0>;
-+			ti,hwmods = "mcspi4";
-+			ti,spi-num-cs = <1>;
-+		};
-+
- 		uart1: serial@4806a000 {
- 			compatible = "ti,omap4-uart";
- 			reg = <0x4806a000 0x100>;
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0019-ARM-dts-omap5-evm-Add-mcspi-data.patch b/patches/omap_dt/0019-ARM-dts-omap5-evm-Add-mcspi-data.patch
deleted file mode 100644
index fcd02a91184496c6e006c2189c71b18894976ee5..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0019-ARM-dts-omap5-evm-Add-mcspi-data.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 4b12bf14ed7b57bb63ed6d3ce66beec6364f2410 Mon Sep 17 00:00:00 2001
-From: Sourav Poddar <sourav.poddar@ti.com>
-Date: Wed, 13 Feb 2013 14:58:44 +0530
-Subject: [PATCH 19/48] ARM: dts: omap5-evm: Add mcspi data
-
-Add mcspi node and pinmux data for omap5 mcspi controller.
-
-Tested on omap5430 evm with 3.8-rc6 custom kernel.
-
-Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap5-evm.dts |   46 +++++++++++++++++++++++++++++++++++++++
- 1 file changed, 46 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap5-evm.dts b/arch/arm/boot/dts/omap5-evm.dts
-index a4784be..64edd51 100644
---- a/arch/arm/boot/dts/omap5-evm.dts
-+++ b/arch/arm/boot/dts/omap5-evm.dts
-@@ -115,6 +115,33 @@
- 			0x186 0x100     /* i2c5_sda INPUTENABLE | MODE0 */
- 		>;
- 	};
-+
-+	mcspi2_pins: pinmux_mcspi2_pins {
-+		pinctrl-single,pins = <
-+			0xbc 0x100	/*  MCSPI2_CLK INPUTENABLE | MODE0 */
-+			0xbe 0x100	/*  MCSPI2_SIMO INPUTENABLE | MODE0 */
-+			0xc0 0x118	/*  MCSPI2_SOMI PULLUP | INPUTENABLE | MODE0*/
-+			0xc2 0x0	/*  MCSPI2_CS MODE0*/
-+		>;
-+	};
-+
-+	mcspi3_pins: pinmux_mcspi3_pins {
-+		pinctrl-single,pins = <
-+			0x78 0x101	/*  MCSPI2_SOMI INPUTENABLE | MODE1 */
-+			0x7a 0x101	/*  MCSPI2_CS INPUTENABLE | MODE1 */
-+			0x7c 0x101	/*  MCSPI2_SIMO INPUTENABLE | MODE1 */
-+			0x7e 0x101	/*  MCSPI2_CLK INPUTENABLE | MODE1 */
-+		>;
-+	};
-+
-+	mcspi4_pins: pinmux_mcspi4_pins {
-+		pinctrl-single,pins = <
-+			0x164 0x101	/*  MCSPI2_CLK INPUTENABLE | MODE1 */
-+			0x168 0x101	/*  MCSPI2_SIMO INPUTENABLE | MODE1 */
-+			0x16a 0x101	/*  MCSPI2_SOMI INPUTENABLE | MODE1 */
-+			0x16c 0x101	/*  MCSPI2_CS INPUTENABLE | MODE1 */
-+		>;
-+	};
- };
- 
- &mmc1 {
-@@ -213,3 +240,22 @@
- 	cs1-used;
- 	device-handle = <&samsung_K3PE0E000B>;
- };
-+
-+&mcspi1 {
-+
-+};
-+
-+&mcspi2 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&mcspi2_pins>;
-+};
-+
-+&mcspi3 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&mcspi3_pins>;
-+};
-+
-+&mcspi4 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&mcspi4_pins>;
-+};
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0020-ARM-dts-OMAP3-Add-GPMC-controller.patch b/patches/omap_dt/0020-ARM-dts-OMAP3-Add-GPMC-controller.patch
deleted file mode 100644
index 57e9b78eeaa265aba419dfd246bafb006de3bf43..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0020-ARM-dts-OMAP3-Add-GPMC-controller.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 1d6ff9999a4729d42866a3049c425546736699c4 Mon Sep 17 00:00:00 2001
-From: Florian Vaussard <florian.vaussard@epfl.ch>
-Date: Mon, 28 Jan 2013 18:54:07 +0100
-Subject: [PATCH 20/48] ARM: dts: OMAP3: Add GPMC controller
-
-Add device-tree support for the GPMC controller on the OMAP3.
-
-Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap3.dtsi |   11 +++++++++++
- 1 file changed, 11 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
-index 1acc261..9f36531 100644
---- a/arch/arm/boot/dts/omap3.dtsi
-+++ b/arch/arm/boot/dts/omap3.dtsi
-@@ -397,5 +397,16 @@
- 			ti,timer-alwon;
- 			ti,timer-secure;
- 		};
-+
-+		gpmc: gpmc@6e000000 {
-+			compatible = "ti,omap3430-gpmc";
-+			ti,hwmods = "gpmc";
-+			reg = <0x6e000000 0x1000000>;
-+			interrupts = <20>;
-+			gpmc,num-cs = <8>;
-+			gpmc,num-waitpins = <4>;
-+			#address-cells = <2>;
-+			#size-cells = <1>;
-+		};
- 	};
- };
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0021-ARM-dts-OMAP3-reduce-GPMC-mapped-registers-address-s.patch b/patches/omap_dt/0021-ARM-dts-OMAP3-reduce-GPMC-mapped-registers-address-s.patch
deleted file mode 100644
index 0ea750f0c910ff07ccff88b117c8daae6bbdd597..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0021-ARM-dts-OMAP3-reduce-GPMC-mapped-registers-address-s.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From c932da1611223f1feedaa97c3d0edf85b402b935 Mon Sep 17 00:00:00 2001
-From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
-Date: Wed, 27 Feb 2013 02:30:51 +0100
-Subject: [PATCH 21/48] ARM: dts: OMAP3: reduce GPMC mapped registers address
- space
-
-Currently the OMAP General-Purpose Memory Controller (GPMC) device
-node maps 16 MB of address space for its hardware registers.
-
-This is because the OMAP Technical Reference Manual says that the
-GPMC module register address space size is 16 MB. But in practice
-the maximum address offset used by a GPMC register is 0x02d0.
-
-So, there is no need to map such a big address space for GPMC regs.
-
-This change was suggested by Jon Hunter [1].
-
-[1]: https://patchwork.kernel.org/patch/2057111/
-
-Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
-Acked-by: Jon Hunter <jon-hunter@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap3.dtsi |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
-index 9f36531..33c3a6e 100644
---- a/arch/arm/boot/dts/omap3.dtsi
-+++ b/arch/arm/boot/dts/omap3.dtsi
-@@ -401,7 +401,7 @@
- 		gpmc: gpmc@6e000000 {
- 			compatible = "ti,omap3430-gpmc";
- 			ti,hwmods = "gpmc";
--			reg = <0x6e000000 0x1000000>;
-+			reg = <0x6e000000 0x02d0>;
- 			interrupts = <20>;
- 			gpmc,num-cs = <8>;
- 			gpmc,num-waitpins = <4>;
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0022-ARM-dts-OMAP4-Add-omap-control-usb-data.patch b/patches/omap_dt/0022-ARM-dts-OMAP4-Add-omap-control-usb-data.patch
deleted file mode 100644
index 95f0c932b61a7a5bb53cb5be509f33a10c20cce9..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0022-ARM-dts-OMAP4-Add-omap-control-usb-data.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From cff93c01eef585f3dd38dff75b43170953216385 Mon Sep 17 00:00:00 2001
-From: Kishon Vijay Abraham I <kishon@ti.com>
-Date: Thu, 7 Mar 2013 19:05:14 +0530
-Subject: [PATCH 22/48] ARM: dts: OMAP4: Add omap control usb data
-
-Add omap control usb data in omap4 device tree file. This will have the
-register address of registers to power on the PHY and to write to
-mailbox. The information about this data node is available @
-Documentation/devicetree/bindings/usb/omap-usb.txt
-
-Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap4.dtsi |    8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
-index 739bb79..ffc7352 100644
---- a/arch/arm/boot/dts/omap4.dtsi
-+++ b/arch/arm/boot/dts/omap4.dtsi
-@@ -529,5 +529,13 @@
- 			ti,hwmods = "timer11";
- 			ti,timer-pwm;
- 		};
-+
-+		omap_control_usb: omap-control-usb@4a002300 {
-+			compatible = "ti,omap-control-usb";
-+			reg = <0x4a002300 0x4>,
-+			      <0x4a00233c 0x4>;
-+			reg-names = "control_dev_conf", "otghs_control";
-+			ti,type = <1>;
-+		};
- 	};
- };
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0023-ARM-dts-OMAP4-Add-omap-usb2-data.patch b/patches/omap_dt/0023-ARM-dts-OMAP4-Add-omap-usb2-data.patch
deleted file mode 100644
index 84bd7616d114c3c29145a9a514295c480a1ea416..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0023-ARM-dts-OMAP4-Add-omap-usb2-data.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 699831b727aabdf2469e62932fbfb846dd243d53 Mon Sep 17 00:00:00 2001
-From: Kishon Vijay Abraham I <kishon@ti.com>
-Date: Thu, 7 Mar 2013 19:05:15 +0530
-Subject: [PATCH 23/48] ARM: dts: OMAP4: Add omap-usb2 data
-
-Add omap-usb2 data node in omap4 device tree file. Since omap-usb2
-is connected to ocp2scp, omap-usb2 dt data is added as a child node
-of ocp2scp. The information about this data node is availabe @
-Documentation/devicetree/bindings/usb/usb-phy.txt
-
-Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
-Acked-by: Felipe Balbi <balbi@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap4.dtsi |    5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
-index ffc7352..c829d7e 100644
---- a/arch/arm/boot/dts/omap4.dtsi
-+++ b/arch/arm/boot/dts/omap4.dtsi
-@@ -438,6 +438,11 @@
- 			#size-cells = <1>;
- 			ranges;
- 			ti,hwmods = "ocp2scp_usb_phy";
-+			usb2_phy: usb2phy@4a0ad080 {
-+				compatible = "ti,omap-usb2";
-+				reg = <0x4a0ad080 0x58>;
-+				ctrl-module = <&omap_control_usb>;
-+			};
- 		};
- 
- 		timer1: timer@4a318000 {
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0024-ARM-dts-OMAP-Add-usb_otg-and-glue-data-to-OMAP3-boar.patch b/patches/omap_dt/0024-ARM-dts-OMAP-Add-usb_otg-and-glue-data-to-OMAP3-boar.patch
deleted file mode 100644
index 247abeb869ea00d2677c3daadd3256cd3cbbc503..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0024-ARM-dts-OMAP-Add-usb_otg-and-glue-data-to-OMAP3-boar.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-From c4f373e84be65ab1777e971dedde0397d92131ef Mon Sep 17 00:00:00 2001
-From: Kishon Vijay Abraham I <kishon@ti.com>
-Date: Thu, 7 Mar 2013 19:05:16 +0530
-Subject: [PATCH 24/48] ARM: dts: OMAP: Add usb_otg and glue data to OMAP3+
- boards
-
-Add usb otg data node in omap4/omap3 device tree file. Also update
-the node with board specific setting in omapx-<board>.dts file.
-The dt data specifies among others the interface type (ULPI or UTMI),
-mode which is mostly OTG, power that specifies the amount of power
-this can supply when in host mode.
-
-The information about usb otg node is available @
-Documentation/devicetree/bindings/usb/omap-usb.txt
-
-Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
-Acked-by: Felipe Balbi <balbi@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- Documentation/devicetree/bindings/usb/omap-usb.txt |    1 +
- arch/arm/boot/dts/omap3-beagle-xm.dts              |    6 ++++++
- arch/arm/boot/dts/omap3-evm.dts                    |    6 ++++++
- arch/arm/boot/dts/omap3-overo.dtsi                 |    6 ++++++
- arch/arm/boot/dts/omap3.dtsi                       |   12 ++++++++++++
- arch/arm/boot/dts/omap4-panda.dts                  |    6 ++++++
- arch/arm/boot/dts/omap4-sdp.dts                    |    6 ++++++
- arch/arm/boot/dts/omap4.dtsi                       |   13 +++++++++++++
- arch/arm/boot/dts/twl4030.dtsi                     |    2 +-
- 9 files changed, 57 insertions(+), 1 deletion(-)
-
-diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt b/Documentation/devicetree/bindings/usb/omap-usb.txt
-index 1ef0ce7..abce256 100644
---- a/Documentation/devicetree/bindings/usb/omap-usb.txt
-+++ b/Documentation/devicetree/bindings/usb/omap-usb.txt
-@@ -18,6 +18,7 @@ OMAP MUSB GLUE
-    represents PERIPHERAL.
-  - power : Should be "50". This signifies the controller can supply upto
-    100mA when operating in host mode.
-+ - usb-phy : the phandle for the PHY device
- 
- Optional properties:
-  - ctrl-module : phandle of the control module this glue uses to write to
-diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
-index 1c85e0f..1177ff6 100644
---- a/arch/arm/boot/dts/omap3-beagle-xm.dts
-+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
-@@ -113,3 +113,9 @@
- 	 */
- 	ti,pulldowns = <0x03a1c4>;
- };
-+
-+&usb_otg_hs {
-+	interface-type = <0>;
-+	mode = <3>;
-+	power = <50>;
-+};
-diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts
-index e8ba1c2..6e6f80d 100644
---- a/arch/arm/boot/dts/omap3-evm.dts
-+++ b/arch/arm/boot/dts/omap3-evm.dts
-@@ -59,3 +59,9 @@
- &twl_gpio {
- 	ti,use-leds;
- };
-+
-+&usb_otg_hs {
-+	interface-type = <0>;
-+	mode = <3>;
-+	power = <50>;
-+};
-diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi
-index 81341fa..2d93a08 100644
---- a/arch/arm/boot/dts/omap3-overo.dtsi
-+++ b/arch/arm/boot/dts/omap3-overo.dtsi
-@@ -70,3 +70,9 @@
- &twl_gpio {
- 	ti,use-leds;
- };
-+
-+&usb_otg_hs {
-+	interface-type = <0>;
-+	mode = <3>;
-+	power = <50>;
-+};
-diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
-index 33c3a6e..d9970de 100644
---- a/arch/arm/boot/dts/omap3.dtsi
-+++ b/arch/arm/boot/dts/omap3.dtsi
-@@ -408,5 +408,17 @@
- 			#address-cells = <2>;
- 			#size-cells = <1>;
- 		};
-+
-+		usb_otg_hs: usb_otg_hs@480ab000 {
-+			compatible = "ti,omap3-musb";
-+			reg = <0x480ab000 0x1000>;
-+			interrupts = <0 92 0x4>, <0 93 0x4>;
-+			interrupt-names = "mc", "dma";
-+			ti,hwmods = "usb_otg_hs";
-+			usb-phy = <&usb2_phy>;
-+			multipoint = <1>;
-+			num-eps = <16>;
-+			ram-bits = <12>;
-+		};
- 	};
- };
-diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
-index f951e6b..1751a25 100644
---- a/arch/arm/boot/dts/omap4-panda.dts
-+++ b/arch/arm/boot/dts/omap4-panda.dts
-@@ -246,3 +246,9 @@
- &twl_usb_comparator {
- 	usb-supply = <&vusb>;
- };
-+
-+&usb_otg_hs {
-+	interface-type = <1>;
-+	mode = <3>;
-+	power = <50>;
-+};
-diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
-index 0e32e8e..a93a19d 100644
---- a/arch/arm/boot/dts/omap4-sdp.dts
-+++ b/arch/arm/boot/dts/omap4-sdp.dts
-@@ -494,3 +494,9 @@
- &twl_usb_comparator {
- 	usb-supply = <&vusb>;
- };
-+
-+&usb_otg_hs {
-+	interface-type = <1>;
-+	mode = <3>;
-+	power = <50>;
-+};
-diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
-index c829d7e..06d044e 100644
---- a/arch/arm/boot/dts/omap4.dtsi
-+++ b/arch/arm/boot/dts/omap4.dtsi
-@@ -542,5 +542,18 @@
- 			reg-names = "control_dev_conf", "otghs_control";
- 			ti,type = <1>;
- 		};
-+
-+		usb_otg_hs: usb_otg_hs@4a0ab000 {
-+			compatible = "ti,omap4-musb";
-+			reg = <0x4a0ab000 0x7ff>;
-+			interrupts = <0 92 0x4>, <0 93 0x4>;
-+			interrupt-names = "mc", "dma";
-+			ti,hwmods = "usb_otg_hs";
-+			usb-phy = <&usb2_phy>;
-+			multipoint = <1>;
-+			num-eps = <16>;
-+			ram-bits = <12>;
-+			ti,has-mailbox;
-+		};
- 	};
- };
-diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
-index d216853..23c0cdd 100644
---- a/arch/arm/boot/dts/twl4030.dtsi
-+++ b/arch/arm/boot/dts/twl4030.dtsi
-@@ -67,7 +67,7 @@
- 		#interrupt-cells = <1>;
- 	};
- 
--	twl4030-usb {
-+	usb2_phy: twl4030-usb {
- 		compatible = "ti,twl4030-usb";
- 		interrupts = <10>, <4>;
- 		usb1v5-supply = <&vusb1v5>;
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0025-ARM-dts-OMAP5-Add-OMAP-control-usb-data.patch b/patches/omap_dt/0025-ARM-dts-OMAP5-Add-OMAP-control-usb-data.patch
deleted file mode 100644
index 2971c0120b1d9a2d5079c4363a9e3acbae0f2de5..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0025-ARM-dts-OMAP5-Add-OMAP-control-usb-data.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 51cb3cfcf1b3a28a4cb985c31d4aacf36b31ebc6 Mon Sep 17 00:00:00 2001
-From: Kishon Vijay Abraham I <kishon@ti.com>
-Date: Thu, 7 Mar 2013 19:05:17 +0530
-Subject: [PATCH 25/48] ARM: dts: OMAP5: Add OMAP control usb data
-
-Add omap control usb data in OMAP5 device tree file.
-This will have the register address of registers to
-power on the USB2 PHY and USB3 PHY.
-
-The information for the node added here is available in
-Documentation/devicetree/bindings/usb/omap-usb.txt
-
-Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap5.dtsi |    8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
-index 9e182a9..116123b 100644
---- a/arch/arm/boot/dts/omap5.dtsi
-+++ b/arch/arm/boot/dts/omap5.dtsi
-@@ -536,5 +536,13 @@
- 			hw-caps-ll-interface;
- 			hw-caps-temp-alert;
- 		};
-+
-+		omap_control_usb: omap-control-usb@4a002300 {
-+			compatible = "ti,omap-control-usb";
-+			reg = <0x4a002300 0x4>,
-+			      <0x4a002370 0x4>;
-+			reg-names = "control_dev_conf", "phy_power_usb";
-+			ti,type = <2>;
-+		};
- 	};
- };
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0026-ARM-dts-OMAP5-Add-ocp2scp-data.patch b/patches/omap_dt/0026-ARM-dts-OMAP5-Add-ocp2scp-data.patch
deleted file mode 100644
index 13370deeddd25bfe9b225c95195f4eff3576a638..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0026-ARM-dts-OMAP5-Add-ocp2scp-data.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 7a3d5f2809ba4b6809f7f7e6836ef6496515efa0 Mon Sep 17 00:00:00 2001
-From: Kishon Vijay Abraham I <kishon@ti.com>
-Date: Thu, 7 Mar 2013 19:05:18 +0530
-Subject: [PATCH 26/48] ARM: dts: OMAP5: Add ocp2scp data
-
-Add ocp2scp data node in omap5 device tree file.
-
-The information for the node added here can be found @
-Documentation/devicetree/bindings/bus/omap-ocp2scp.txt
-
-Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap5.dtsi |    8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
-index 116123b..438241d 100644
---- a/arch/arm/boot/dts/omap5.dtsi
-+++ b/arch/arm/boot/dts/omap5.dtsi
-@@ -544,5 +544,13 @@
- 			reg-names = "control_dev_conf", "phy_power_usb";
- 			ti,type = <2>;
- 		};
-+
-+		ocp2scp {
-+			compatible = "ti,omap-ocp2scp";
-+			#address-cells = <1>;
-+			#size-cells = <1>;
-+			ranges;
-+			ti,hwmods = "ocp2scp1";
-+		};
- 	};
- };
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0027-ARM-dts-OMAP5-Add-omap-usb3-and-omap-usb2-data.patch b/patches/omap_dt/0027-ARM-dts-OMAP5-Add-omap-usb3-and-omap-usb2-data.patch
deleted file mode 100644
index 7b5079195a2048a8b9c066e0f27e8ba264d1bf04..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0027-ARM-dts-OMAP5-Add-omap-usb3-and-omap-usb2-data.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From eafbf70de777f6614fadae3196c255bfb421aad8 Mon Sep 17 00:00:00 2001
-From: Kishon Vijay Abraham I <kishon@ti.com>
-Date: Thu, 7 Mar 2013 19:05:19 +0530
-Subject: [PATCH 27/48] ARM: dts: OMAP5: Add omap-usb3 and omap-usb2 data
-
-Add omap-usb3 and omap-usb2 data node in OMAP5 device tree file.
-
-The information for the node added here is available @
-Documentation/devicetree/bindings/usb/usb-phy.txt
-
-Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap5.dtsi |   14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
-index 438241d..4094bfa 100644
---- a/arch/arm/boot/dts/omap5.dtsi
-+++ b/arch/arm/boot/dts/omap5.dtsi
-@@ -551,6 +551,20 @@
- 			#size-cells = <1>;
- 			ranges;
- 			ti,hwmods = "ocp2scp1";
-+			usb2_phy: usb2phy@4a084000 {
-+				compatible = "ti,omap-usb2";
-+				reg = <0x4a084000 0x7c>;
-+				ctrl-module = <&omap_control_usb>;
-+			};
-+
-+			usb3_phy: usb3phy@4a084400 {
-+				compatible = "ti,omap-usb3";
-+				reg = <0x4a084400 0x80>,
-+				      <0x4a084800 0x64>,
-+				      <0x4a084c00 0x40>;
-+				reg-names = "phy_rx", "phy_tx", "pll_ctrl";
-+				ctrl-module = <&omap_control_usb>;
-+			};
- 		};
- 	};
- };
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0028-ARM-dts-OMAP5-add-dwc3-omap-and-dwc3-core-data.patch b/patches/omap_dt/0028-ARM-dts-OMAP5-add-dwc3-omap-and-dwc3-core-data.patch
deleted file mode 100644
index 86b0c77904605b554d18e48c53a07002e8f5ec8f..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0028-ARM-dts-OMAP5-add-dwc3-omap-and-dwc3-core-data.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 5d36230e46955edebce852f84902765f03591b4f Mon Sep 17 00:00:00 2001
-From: Kishon Vijay Abraham I <kishon@ti.com>
-Date: Thu, 7 Mar 2013 19:05:20 +0530
-Subject: [PATCH 28/48] ARM: dts: OMAP5: add dwc3 omap and dwc3 core data
-
-Add dwc3 omap glue data to the omap5 dt data file.
-The information about the dt node added here is available @
-Documentation/devicetree/bindings/usb/omap-usb.txt.
-
-Also added dwc3 core dt data as a subnode to dwc3 omap glue
-data in omap5 dt data file.
-The information for the entered data node is available @
-Documentation/devicetree/bindings/usb/dwc3.txt
-
-Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap5.dtsi |   18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
-index 4094bfa..130fbf2 100644
---- a/arch/arm/boot/dts/omap5.dtsi
-+++ b/arch/arm/boot/dts/omap5.dtsi
-@@ -545,6 +545,24 @@
- 			ti,type = <2>;
- 		};
- 
-+		omap_dwc3@4a020000 {
-+			compatible = "ti,dwc3";
-+			ti,hwmods = "usb_otg_ss";
-+			reg = <0x4a020000 0x1000>;
-+			interrupts = <0 93 4>;
-+			#address-cells = <1>;
-+			#size-cells = <1>;
-+			utmi-mode = <2>;
-+			ranges;
-+			dwc3@4a030000 {
-+				compatible = "synopsys,dwc3";
-+				reg = <0x4a030000 0x1000>;
-+				interrupts = <0 92 4>;
-+				usb-phy = <&usb2_phy>, <&usb3_phy>;
-+				tx-fifo-resize;
-+			};
-+		};
-+
- 		ocp2scp {
- 			compatible = "ti,omap-ocp2scp";
- 			#address-cells = <1>;
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0029-ARM-OMAP2-Prepare-for-device-tree-PMU-support.patch b/patches/omap_dt/0029-ARM-OMAP2-Prepare-for-device-tree-PMU-support.patch
deleted file mode 100644
index cccd614c45f168b31a9b8301ce23c8c167570651..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0029-ARM-OMAP2-Prepare-for-device-tree-PMU-support.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 25c23e77438b98ad44dc35fde5619e6c125a5d68 Mon Sep 17 00:00:00 2001
-From: Jon Hunter <jon-hunter@ti.com>
-Date: Fri, 19 Oct 2012 14:27:34 -0500
-Subject: [PATCH 29/48] ARM: OMAP2+: Prepare for device-tree PMU support
-
-If device-tree is present, then do not create the PMU device from within
-the OMAP specific PMU code. This is required to allow device-tree to
-create the PMU device from the PMU device-tree node.
-
-PMU is not currently supported for OMAP4430 (due to a dependency on
-having a cross-trigger interface driver) and so ensure that this
-indicated on boot with or without device-tree.
-
-Signed-off-by: Jon Hunter <jon-hunter@ti.com>
-Acked-by: Tony Lindgren <tony@atomide.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/mach-omap2/pmu.c |   14 +++++++++++---
- 1 file changed, 11 insertions(+), 3 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/pmu.c b/arch/arm/mach-omap2/pmu.c
-index 9debf82..9ace8ea 100644
---- a/arch/arm/mach-omap2/pmu.c
-+++ b/arch/arm/mach-omap2/pmu.c
-@@ -11,6 +11,8 @@
-  * the Free Software Foundation; either version 2 of the License, or
-  * (at your option) any later version.
-  */
-+#include <linux/of.h>
-+
- #include <asm/pmu.h>
- 
- #include "soc.h"
-@@ -63,6 +65,15 @@ static int __init omap_init_pmu(void)
- 	unsigned oh_num;
- 	char **oh_names;
- 
-+	/* XXX Remove this check when the CTI driver is available */
-+	if (cpu_is_omap443x()) {
-+		pr_info("ARM PMU: not yet supported on OMAP4430 due to missing CTI driver\n");
-+		return 0;
-+	}
-+
-+	if (of_have_populated_dt())
-+		return 0;
-+
- 	/*
- 	 * To create an ARM-PMU device the following HWMODs
- 	 * are required for the various OMAP2+ devices.
-@@ -75,9 +86,6 @@ static int __init omap_init_pmu(void)
- 	if (cpu_is_omap443x()) {
- 		oh_num = ARRAY_SIZE(omap4430_pmu_oh_names);
- 		oh_names = omap4430_pmu_oh_names;
--		/* XXX Remove the next two lines when CTI driver available */
--		pr_info("ARM PMU: not yet supported on OMAP4430 due to missing CTI driver\n");
--		return 0;
- 	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
- 		oh_num = ARRAY_SIZE(omap3_pmu_oh_names);
- 		oh_names = omap3_pmu_oh_names;
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0030-ARM-dts-OMAP2-Add-PMU-nodes.patch b/patches/omap_dt/0030-ARM-dts-OMAP2-Add-PMU-nodes.patch
deleted file mode 100644
index cb06972f2efd17ac9dac71489839c33a60944256..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0030-ARM-dts-OMAP2-Add-PMU-nodes.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 90782646998d9f3aafbed0cbcedb8805037d7b61 Mon Sep 17 00:00:00 2001
-From: Jon Hunter <jon-hunter@ti.com>
-Date: Thu, 18 Oct 2012 09:28:52 -0500
-Subject: [PATCH 30/48] ARM: dts: OMAP2+: Add PMU nodes
-
-Add PMU nodes for OMAP2, OMAP3 and OMAP4460 devices.
-
-Please note that the node for OMAP4460 has been placed in a separate
-header file for OMAP4460, because the node is not compatible with
-OMAP4430. The node for OMAP4430 is not included because PMU is not
-currently supported on OMAP4430 due to the absence of a cross-trigger
-interface driver.
-
-Signed-off-by: Jon Hunter <jon-hunter@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap2.dtsi         |    5 +++++
- arch/arm/boot/dts/omap3.dtsi         |    6 ++++++
- arch/arm/boot/dts/omap4-panda-es.dts |    2 ++
- arch/arm/boot/dts/omap4460.dtsi      |   18 ++++++++++++++++++
- 4 files changed, 31 insertions(+)
- create mode 100644 arch/arm/boot/dts/omap4460.dtsi
-
-diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
-index 761c4b6..27f5ea1 100644
---- a/arch/arm/boot/dts/omap2.dtsi
-+++ b/arch/arm/boot/dts/omap2.dtsi
-@@ -26,6 +26,11 @@
- 		};
- 	};
- 
-+	pmu {
-+		compatible = "arm,arm1136-pmu";
-+		interrupts = <3>;
-+	};
-+
- 	soc {
- 		compatible = "ti,omap-infra";
- 		mpu {
-diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
-index d9970de..0ec7d5c 100644
---- a/arch/arm/boot/dts/omap3.dtsi
-+++ b/arch/arm/boot/dts/omap3.dtsi
-@@ -26,6 +26,12 @@
- 		};
- 	};
- 
-+	pmu {
-+		compatible = "arm,cortex-a8-pmu";
-+		interrupts = <3>;
-+		ti,hwmods = "debugss";
-+	};
-+
- 	/*
- 	 * The soc node represents the soc top level view. It is uses for IPs
- 	 * that are not memory mapped in the MPU view or for the MPU itself.
-diff --git a/arch/arm/boot/dts/omap4-panda-es.dts b/arch/arm/boot/dts/omap4-panda-es.dts
-index 73bc1a6..2a6e344 100644
---- a/arch/arm/boot/dts/omap4-panda-es.dts
-+++ b/arch/arm/boot/dts/omap4-panda-es.dts
-@@ -5,7 +5,9 @@
-  * it under the terms of the GNU General Public License version 2 as
-  * published by the Free Software Foundation.
-  */
-+
- /include/ "omap4-panda.dts"
-+/include/ "omap4460.dtsi"
- 
- /* Audio routing is differnet between PandaBoard4430 and PandaBoardES */
- &sound {
-diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
-new file mode 100644
-index 0000000..0a1d38b
---- /dev/null
-+++ b/arch/arm/boot/dts/omap4460.dtsi
-@@ -0,0 +1,18 @@
-+/*
-+ * Device Tree Source for OMAP4460 SoC
-+ *
-+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
-+ *
-+ * This file is licensed under the terms of the GNU General Public License
-+ * version 2.  This program is licensed "as is" without any warranty of any
-+ * kind, whether express or implied.
-+ */
-+
-+/ {
-+	pmu {
-+		compatible = "arm,cortex-a9-pmu";
-+		interrupts = <0 54 0x4>,
-+			     <0 55 0x4>;
-+		ti,hwmods = "debugss";
-+	};
-+};
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0031-ARM-dts-OMAP2-Add-SDMA-controller-bindings-and-nodes.patch b/patches/omap_dt/0031-ARM-dts-OMAP2-Add-SDMA-controller-bindings-and-nodes.patch
deleted file mode 100644
index 1b0d9e592e53f41df014cc13f9508b9e0b228a9e..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0031-ARM-dts-OMAP2-Add-SDMA-controller-bindings-and-nodes.patch
+++ /dev/null
@@ -1,374 +0,0 @@
-From ff59c18e504ae5207f466af13ab184ed5df25fc3 Mon Sep 17 00:00:00 2001
-From: Jon Hunter <jon-hunter@ti.com>
-Date: Thu, 26 Apr 2012 13:47:59 -0500
-Subject: [PATCH 31/48] ARM: dts: OMAP2+: Add SDMA controller bindings and
- nodes
-
-Add SDMA controller binding for OMAP2+ devices and populate DMA client
-information for SPI and MMC peripheral on OMAP3+ devices. Please note
-that OMAP24xx devices do not have SPI and MMC bindings available yet and
-so DMA client information is not populated.
-
-Signed-off-by: Jon Hunter <jon-hunter@ti.com>
-Reviewed-by: Felipe Balbi <balbi@ti.com>
-Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap2.dtsi |   12 ++++++++++++
- arch/arm/boot/dts/omap3.dtsi |   40 ++++++++++++++++++++++++++++++++++++++++
- arch/arm/boot/dts/omap4.dtsi |   41 +++++++++++++++++++++++++++++++++++++++++
- arch/arm/boot/dts/omap5.dtsi |   41 +++++++++++++++++++++++++++++++++++++++++
- 4 files changed, 134 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
-index 27f5ea1..84183f0 100644
---- a/arch/arm/boot/dts/omap2.dtsi
-+++ b/arch/arm/boot/dts/omap2.dtsi
-@@ -54,6 +54,18 @@
- 			reg = <0x480FE000 0x1000>;
- 		};
- 
-+		sdma: dma-controller@48056000 {
-+			compatible = "ti,omap2430-sdma", "ti,omap2420-sdma";
-+			reg = <0x48056000 0x1000>;
-+			interrupts = <12>,
-+				     <13>,
-+				     <14>,
-+				     <15>;
-+			#dma-cells = <1>;
-+			#dma-channels = <32>;
-+			#dma-requests = <64>;
-+		};
-+
- 		uart1: serial@4806a000 {
- 			compatible = "ti,omap2-uart";
- 			ti,hwmods = "uart1";
-diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
-index 0ec7d5c..1dc72ea 100644
---- a/arch/arm/boot/dts/omap3.dtsi
-+++ b/arch/arm/boot/dts/omap3.dtsi
-@@ -81,6 +81,18 @@
- 			reg = <0x48200000 0x1000>;
- 		};
- 
-+		sdma: dma-controller@48056000 {
-+			compatible = "ti,omap3630-sdma", "ti,omap3430-sdma";
-+			reg = <0x48056000 0x1000>;
-+			interrupts = <12>,
-+				     <13>,
-+				     <14>,
-+				     <15>;
-+			#dma-cells = <1>;
-+			#dma-channels = <32>;
-+			#dma-requests = <96>;
-+		};
-+
- 		omap3_pmx_core: pinmux@48002030 {
- 			compatible = "ti,omap3-padconf", "pinctrl-single";
- 			reg = <0x48002030 0x05cc>;
-@@ -198,6 +210,16 @@
- 			#size-cells = <0>;
- 			ti,hwmods = "mcspi1";
- 			ti,spi-num-cs = <4>;
-+			dmas = <&sdma 35>,
-+			       <&sdma 36>,
-+			       <&sdma 37>,
-+			       <&sdma 38>,
-+			       <&sdma 39>,
-+			       <&sdma 40>,
-+			       <&sdma 41>,
-+			       <&sdma 42>;
-+			dma-names = "tx0", "rx0", "tx1", "rx1",
-+				    "tx2", "rx2", "tx3", "rx3";
- 		};
- 
- 		mcspi2: spi@4809a000 {
-@@ -206,6 +228,11 @@
- 			#size-cells = <0>;
- 			ti,hwmods = "mcspi2";
- 			ti,spi-num-cs = <2>;
-+			dmas = <&sdma 43>,
-+			       <&sdma 44>,
-+			       <&sdma 45>,
-+			       <&sdma 46>;
-+			dma-names = "tx0", "rx0", "tx1", "rx1";
- 		};
- 
- 		mcspi3: spi@480b8000 {
-@@ -214,6 +241,11 @@
- 			#size-cells = <0>;
- 			ti,hwmods = "mcspi3";
- 			ti,spi-num-cs = <2>;
-+			dmas = <&sdma 15>,
-+			       <&sdma 16>,
-+			       <&sdma 23>,
-+			       <&sdma 24>;
-+			dma-names = "tx0", "rx0", "tx1", "rx1";
- 		};
- 
- 		mcspi4: spi@480ba000 {
-@@ -222,22 +254,30 @@
- 			#size-cells = <0>;
- 			ti,hwmods = "mcspi4";
- 			ti,spi-num-cs = <1>;
-+			dmas = <&sdma 70>, <&sdma 71>;
-+			dma-names = "tx0", "rx0";
- 		};
- 
- 		mmc1: mmc@4809c000 {
- 			compatible = "ti,omap3-hsmmc";
- 			ti,hwmods = "mmc1";
- 			ti,dual-volt;
-+			dmas = <&sdma 61>, <&sdma 62>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mmc2: mmc@480b4000 {
- 			compatible = "ti,omap3-hsmmc";
- 			ti,hwmods = "mmc2";
-+			dmas = <&sdma 47>, <&sdma 48>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mmc3: mmc@480ad000 {
- 			compatible = "ti,omap3-hsmmc";
- 			ti,hwmods = "mmc3";
-+			dmas = <&sdma 77>, <&sdma 78>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		wdt2: wdt@48314000 {
-diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
-index 06d044e..6669311 100644
---- a/arch/arm/boot/dts/omap4.dtsi
-+++ b/arch/arm/boot/dts/omap4.dtsi
-@@ -118,6 +118,18 @@
- 			pinctrl-single,function-mask = <0x7fff>;
- 		};
- 
-+		sdma: dma-controller@4a056000 {
-+			compatible = "ti,omap4430-sdma";
-+			reg = <0x4a056000 0x1000>;
-+			interrupts = <0 12 0x4>,
-+				     <0 13 0x4>,
-+				     <0 14 0x4>,
-+				     <0 15 0x4>;
-+			#dma-cells = <1>;
-+			#dma-channels = <32>;
-+			#dma-requests = <127>;
-+		};
-+
- 		gpio1: gpio@4a310000 {
- 			compatible = "ti,omap4-gpio";
- 			reg = <0x4a310000 0x200>;
-@@ -260,6 +272,16 @@
- 			#size-cells = <0>;
- 			ti,hwmods = "mcspi1";
- 			ti,spi-num-cs = <4>;
-+			dmas = <&sdma 35>,
-+			       <&sdma 36>,
-+			       <&sdma 37>,
-+			       <&sdma 38>,
-+			       <&sdma 39>,
-+			       <&sdma 40>,
-+			       <&sdma 41>,
-+			       <&sdma 42>;
-+			dma-names = "tx0", "rx0", "tx1", "rx1",
-+				    "tx2", "rx2", "tx3", "rx3";
- 		};
- 
- 		mcspi2: spi@4809a000 {
-@@ -270,6 +292,11 @@
- 			#size-cells = <0>;
- 			ti,hwmods = "mcspi2";
- 			ti,spi-num-cs = <2>;
-+			dmas = <&sdma 43>,
-+			       <&sdma 44>,
-+			       <&sdma 45>,
-+			       <&sdma 46>;
-+			dma-names = "tx0", "rx0", "tx1", "rx1";
- 		};
- 
- 		mcspi3: spi@480b8000 {
-@@ -280,6 +307,8 @@
- 			#size-cells = <0>;
- 			ti,hwmods = "mcspi3";
- 			ti,spi-num-cs = <2>;
-+			dmas = <&sdma 15>, <&sdma 16>;
-+			dma-names = "tx0", "rx0";
- 		};
- 
- 		mcspi4: spi@480ba000 {
-@@ -290,6 +319,8 @@
- 			#size-cells = <0>;
- 			ti,hwmods = "mcspi4";
- 			ti,spi-num-cs = <1>;
-+			dmas = <&sdma 70>, <&sdma 71>;
-+			dma-names = "tx0", "rx0";
- 		};
- 
- 		mmc1: mmc@4809c000 {
-@@ -299,6 +330,8 @@
- 			ti,hwmods = "mmc1";
- 			ti,dual-volt;
- 			ti,needs-special-reset;
-+			dmas = <&sdma 61>, <&sdma 62>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mmc2: mmc@480b4000 {
-@@ -307,6 +340,8 @@
- 			interrupts = <0 86 0x4>;
- 			ti,hwmods = "mmc2";
- 			ti,needs-special-reset;
-+			dmas = <&sdma 47>, <&sdma 48>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mmc3: mmc@480ad000 {
-@@ -315,6 +350,8 @@
- 			interrupts = <0 94 0x4>;
- 			ti,hwmods = "mmc3";
- 			ti,needs-special-reset;
-+			dmas = <&sdma 77>, <&sdma 78>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mmc4: mmc@480d1000 {
-@@ -323,6 +360,8 @@
- 			interrupts = <0 96 0x4>;
- 			ti,hwmods = "mmc4";
- 			ti,needs-special-reset;
-+			dmas = <&sdma 57>, <&sdma 58>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mmc5: mmc@480d5000 {
-@@ -331,6 +370,8 @@
- 			interrupts = <0 59 0x4>;
- 			ti,hwmods = "mmc5";
- 			ti,needs-special-reset;
-+			dmas = <&sdma 59>, <&sdma 60>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		wdt2: wdt@4a314000 {
-diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
-index 130fbf2..f840499 100644
---- a/arch/arm/boot/dts/omap5.dtsi
-+++ b/arch/arm/boot/dts/omap5.dtsi
-@@ -108,6 +108,18 @@
- 			      <0x48212000 0x1000>;
- 		};
- 
-+		sdma: dma-controller@4a056000 {
-+			compatible = "ti,omap4430-sdma";
-+			reg = <0x4a056000 0x1000>;
-+			interrupts = <0 12 0x4>,
-+				     <0 13 0x4>,
-+				     <0 14 0x4>,
-+				     <0 15 0x4>;
-+			#dma-cells = <1>;
-+			#dma-channels = <32>;
-+			#dma-requests = <127>;
-+		};
-+
- 		gpio1: gpio@4ae10000 {
- 			compatible = "ti,omap4-gpio";
- 			reg = <0x4ae10000 0x200>;
-@@ -249,6 +261,16 @@
- 			#size-cells = <0>;
- 			ti,hwmods = "mcspi1";
- 			ti,spi-num-cs = <4>;
-+			dmas = <&sdma 35>,
-+			       <&sdma 36>,
-+			       <&sdma 37>,
-+			       <&sdma 38>,
-+			       <&sdma 39>,
-+			       <&sdma 40>,
-+			       <&sdma 41>,
-+			       <&sdma 42>;
-+			dma-names = "tx0", "rx0", "tx1", "rx1",
-+				    "tx2", "rx2", "tx3", "rx3";
- 		};
- 
- 		mcspi2: spi@4809a000 {
-@@ -259,6 +281,11 @@
- 			#size-cells = <0>;
- 			ti,hwmods = "mcspi2";
- 			ti,spi-num-cs = <2>;
-+			dmas = <&sdma 43>,
-+			       <&sdma 44>,
-+			       <&sdma 45>,
-+			       <&sdma 46>;
-+			dma-names = "tx0", "rx0", "tx1", "rx1";
- 		};
- 
- 		mcspi3: spi@480b8000 {
-@@ -269,6 +296,8 @@
- 			#size-cells = <0>;
- 			ti,hwmods = "mcspi3";
- 			ti,spi-num-cs = <2>;
-+			dmas = <&sdma 15>, <&sdma 16>;
-+			dma-names = "tx0", "rx0";
- 		};
- 
- 		mcspi4: spi@480ba000 {
-@@ -279,6 +308,8 @@
- 			#size-cells = <0>;
- 			ti,hwmods = "mcspi4";
- 			ti,spi-num-cs = <1>;
-+			dmas = <&sdma 70>, <&sdma 71>;
-+			dma-names = "tx0", "rx0";
- 		};
- 
- 		uart1: serial@4806a000 {
-@@ -336,6 +367,8 @@
- 			ti,hwmods = "mmc1";
- 			ti,dual-volt;
- 			ti,needs-special-reset;
-+			dmas = <&sdma 61>, <&sdma 62>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mmc2: mmc@480b4000 {
-@@ -344,6 +377,8 @@
- 			interrupts = <0 86 0x4>;
- 			ti,hwmods = "mmc2";
- 			ti,needs-special-reset;
-+			dmas = <&sdma 47>, <&sdma 48>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mmc3: mmc@480ad000 {
-@@ -352,6 +387,8 @@
- 			interrupts = <0 94 0x4>;
- 			ti,hwmods = "mmc3";
- 			ti,needs-special-reset;
-+			dmas = <&sdma 77>, <&sdma 78>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mmc4: mmc@480d1000 {
-@@ -360,6 +397,8 @@
- 			interrupts = <0 96 0x4>;
- 			ti,hwmods = "mmc4";
- 			ti,needs-special-reset;
-+			dmas = <&sdma 57>, <&sdma 58>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mmc5: mmc@480d5000 {
-@@ -368,6 +407,8 @@
- 			interrupts = <0 59 0x4>;
- 			ti,hwmods = "mmc5";
- 			ti,needs-special-reset;
-+			dmas = <&sdma 59>, <&sdma 60>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		keypad: keypad@4ae1c000 {
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0032-ARM-dts-Add-GPMC-node-for-OMAP2-OMAP4-and-OMAP5.patch b/patches/omap_dt/0032-ARM-dts-Add-GPMC-node-for-OMAP2-OMAP4-and-OMAP5.patch
deleted file mode 100644
index 73da773b46859ce3d5a3a0a8170e56dd4a926dd0..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0032-ARM-dts-Add-GPMC-node-for-OMAP2-OMAP4-and-OMAP5.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From 14c66b725cb4737b25045251b02514b6cd139875 Mon Sep 17 00:00:00 2001
-From: Jon Hunter <jon-hunter@ti.com>
-Date: Fri, 22 Feb 2013 15:33:31 -0600
-Subject: [PATCH 32/48] ARM: dts: Add GPMC node for OMAP2, OMAP4 and OMAP5
-
-Add the device-tree node for GPMC on OMAP2, OMAP4 and OMAP5 devices.
-
-Signed-off-by: Jon Hunter <jon-hunter@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap2420.dtsi |   11 +++++++++++
- arch/arm/boot/dts/omap2430.dtsi |   11 +++++++++++
- arch/arm/boot/dts/omap4.dtsi    |   11 +++++++++++
- arch/arm/boot/dts/omap5.dtsi    |   11 +++++++++++
- 4 files changed, 44 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi
-index af65609..d4ce6c2 100644
---- a/arch/arm/boot/dts/omap2420.dtsi
-+++ b/arch/arm/boot/dts/omap2420.dtsi
-@@ -29,6 +29,17 @@
- 			pinctrl-single,function-mask = <0x3f>;
- 		};
- 
-+		gpmc: gpmc@6800a000 {
-+			compatible = "ti,omap2420-gpmc";
-+			reg = <0x6800a000 0x1000>;
-+			#address-cells = <2>;
-+			#size-cells = <1>;
-+			interrupts = <20>;
-+			gpmc,num-cs = <8>;
-+			gpmc,num-waitpins = <4>;
-+			ti,hwmods = "gpmc";
-+		};
-+
- 		mcbsp1: mcbsp@48074000 {
- 			compatible = "ti,omap2420-mcbsp";
- 			reg = <0x48074000 0xff>;
-diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi
-index c392445..832f184 100644
---- a/arch/arm/boot/dts/omap2430.dtsi
-+++ b/arch/arm/boot/dts/omap2430.dtsi
-@@ -29,6 +29,17 @@
- 			pinctrl-single,function-mask = <0x3f>;
- 		};
- 
-+		gpmc: gpmc@6e000000 {
-+			compatible = "ti,omap2430-gpmc";
-+			reg = <0x6e000000 0x1000>;
-+			#address-cells = <2>;
-+			#size-cells = <1>;
-+			interrupts = <20>;
-+			gpmc,num-cs = <8>;
-+			gpmc,num-waitpins = <4>;
-+			ti,hwmods = "gpmc";
-+		};
-+
- 		mcbsp1: mcbsp@48074000 {
- 			compatible = "ti,omap2430-mcbsp";
- 			reg = <0x48074000 0xff>;
-diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
-index 6669311..bcd64f5 100644
---- a/arch/arm/boot/dts/omap4.dtsi
-+++ b/arch/arm/boot/dts/omap4.dtsi
-@@ -196,6 +196,17 @@
- 			#interrupt-cells = <1>;
- 		};
- 
-+		gpmc: gpmc@50000000 {
-+			compatible = "ti,omap4430-gpmc";
-+			reg = <0x50000000 0x1000>;
-+			#address-cells = <2>;
-+			#size-cells = <1>;
-+			interrupts = <0 20 0x4>;
-+			gpmc,num-cs = <8>;
-+			gpmc,num-waitpins = <4>;
-+			ti,hwmods = "gpmc";
-+		};
-+
- 		uart1: serial@4806a000 {
- 			compatible = "ti,omap4-uart";
- 			reg = <0x4806a000 0x100>;
-diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
-index f840499..61cbd1c 100644
---- a/arch/arm/boot/dts/omap5.dtsi
-+++ b/arch/arm/boot/dts/omap5.dtsi
-@@ -208,6 +208,17 @@
- 			#interrupt-cells = <1>;
- 		};
- 
-+		gpmc: gpmc@50000000 {
-+			compatible = "ti,omap4430-gpmc";
-+			reg = <0x50000000 0x1000>;
-+			#address-cells = <2>;
-+			#size-cells = <1>;
-+			interrupts = <0 20 0x4>;
-+			gpmc,num-cs = <8>;
-+			gpmc,num-waitpins = <4>;
-+			ti,hwmods = "gpmc";
-+		};
-+
- 		i2c1: i2c@48070000 {
- 			compatible = "ti,omap4-i2c";
- 			reg = <0x48070000 0x100>;
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0033-ARM-dts-Add-OMAP2-gpio-bindings.patch b/patches/omap_dt/0033-ARM-dts-Add-OMAP2-gpio-bindings.patch
deleted file mode 100644
index 66fca98342483037a414fab6bf62b7a6ab026f80..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0033-ARM-dts-Add-OMAP2-gpio-bindings.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-From 412e01d4d6c8219e5b4ad977ecd3291302842869 Mon Sep 17 00:00:00 2001
-From: Jon Hunter <jon-hunter@ti.com>
-Date: Thu, 28 Feb 2013 15:32:00 -0600
-Subject: [PATCH 33/48] ARM: dts: Add OMAP2 gpio bindings
-
-Add gpios bindings for OMAP2420 and OMAP2430 devices.
-
-Signed-off-by: Jon Hunter <jon-hunter@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap2420.dtsi |   44 +++++++++++++++++++++++++++++++
- arch/arm/boot/dts/omap2430.dtsi |   55 +++++++++++++++++++++++++++++++++++++++
- 2 files changed, 99 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi
-index d4ce6c2..eee902f 100644
---- a/arch/arm/boot/dts/omap2420.dtsi
-+++ b/arch/arm/boot/dts/omap2420.dtsi
-@@ -29,6 +29,50 @@
- 			pinctrl-single,function-mask = <0x3f>;
- 		};
- 
-+		gpio1: gpio@48018000 {
-+			compatible = "ti,omap2-gpio";
-+			reg = <0x48018000 0x200>;
-+			interrupts = <29>;
-+			ti,hwmods = "gpio1";
-+			#gpio-cells = <2>;
-+			gpio-controller;
-+			#interrupt-cells = <2>;
-+			interrupt-controller;
-+		};
-+
-+		gpio2: gpio@4801a000 {
-+			compatible = "ti,omap2-gpio";
-+			reg = <0x4801a000 0x200>;
-+			interrupts = <30>;
-+			ti,hwmods = "gpio2";
-+			#gpio-cells = <2>;
-+			gpio-controller;
-+			#interrupt-cells = <2>;
-+			interrupt-controller;
-+		};
-+
-+		gpio3: gpio@4801c000 {
-+			compatible = "ti,omap2-gpio";
-+			reg = <0x4801c000 0x200>;
-+			interrupts = <31>;
-+			ti,hwmods = "gpio3";
-+			#gpio-cells = <2>;
-+			gpio-controller;
-+			#interrupt-cells = <2>;
-+			interrupt-controller;
-+		};
-+
-+		gpio4: gpio@4801e000 {
-+			compatible = "ti,omap2-gpio";
-+			reg = <0x4801e000 0x200>;
-+			interrupts = <32>;
-+			ti,hwmods = "gpio4";
-+			#gpio-cells = <2>;
-+			gpio-controller;
-+			#interrupt-cells = <2>;
-+			interrupt-controller;
-+		};
-+
- 		gpmc: gpmc@6800a000 {
- 			compatible = "ti,omap2420-gpmc";
- 			reg = <0x6800a000 0x1000>;
-diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi
-index 832f184..fb74382 100644
---- a/arch/arm/boot/dts/omap2430.dtsi
-+++ b/arch/arm/boot/dts/omap2430.dtsi
-@@ -29,6 +29,61 @@
- 			pinctrl-single,function-mask = <0x3f>;
- 		};
- 
-+		gpio1: gpio@4900c000 {
-+			compatible = "ti,omap2-gpio";
-+			reg = <0x4900c000 0x200>;
-+			interrupts = <29>;
-+			ti,hwmods = "gpio1";
-+			#gpio-cells = <2>;
-+			gpio-controller;
-+			#interrupt-cells = <2>;
-+			interrupt-controller;
-+		};
-+
-+		gpio2: gpio@4900e000 {
-+			compatible = "ti,omap2-gpio";
-+			reg = <0x4900e000 0x200>;
-+			interrupts = <30>;
-+			ti,hwmods = "gpio2";
-+			#gpio-cells = <2>;
-+			gpio-controller;
-+			#interrupt-cells = <2>;
-+			interrupt-controller;
-+		};
-+
-+		gpio3: gpio@49010000 {
-+			compatible = "ti,omap2-gpio";
-+			reg = <0x49010000 0x200>;
-+			interrupts = <31>;
-+			ti,hwmods = "gpio3";
-+			#gpio-cells = <2>;
-+			gpio-controller;
-+			#interrupt-cells = <2>;
-+			interrupt-controller;
-+		};
-+
-+		gpio4: gpio@49012000 {
-+			compatible = "ti,omap2-gpio";
-+			reg = <0x49012000 0x200>;
-+			interrupts = <32>;
-+			ti,hwmods = "gpio4";
-+			#gpio-cells = <2>;
-+			gpio-controller;
-+			#interrupt-cells = <2>;
-+			interrupt-controller;
-+		};
-+
-+		gpio5: gpio@480b6000 {
-+			compatible = "ti,omap2-gpio";
-+			reg = <0x480b6000 0x200>;
-+			interrupts = <33>;
-+			ti,hwmods = "gpio5";
-+			#gpio-cells = <2>;
-+			gpio-controller;
-+			#interrupt-cells = <2>;
-+			interrupt-controller;
-+		};
-+
- 		gpmc: gpmc@6e000000 {
- 			compatible = "ti,omap2430-gpmc";
- 			reg = <0x6e000000 0x1000>;
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0034-ARM-dts-OMAP3-Correct-gpio-interrupts-cells-property.patch b/patches/omap_dt/0034-ARM-dts-OMAP3-Correct-gpio-interrupts-cells-property.patch
deleted file mode 100644
index f5633afd0cfdaafc5bf5b25bb6694e59f540bd88..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0034-ARM-dts-OMAP3-Correct-gpio-interrupts-cells-property.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 1789338e5697c11cf19952d525587aa9a87f4b2b Mon Sep 17 00:00:00 2001
-From: Jon Hunter <jon-hunter@ti.com>
-Date: Thu, 7 Mar 2013 15:44:39 -0600
-Subject: [PATCH 34/48] ARM: dts: OMAP3+: Correct gpio #interrupts-cells
- property
-
-The OMAP gpio binding documention [1] states that the #interrupts-cells
-property for gpio controllers should be 2. Currently, for OMAP3+ devices
-the #interrupt-cells is set to 1. By setting this property to 2, it
-allows clients to pass a 2nd parameter indicating the sensitivity (level
-or edge) and polarity (high or low) of the interrupt. The OMAP gpio
-controllers support these options and so update the #interrupt-cells
-property for OMAP3+ devices to 2.
-
-[1] Documentation/devicetree/bindings/gpio/gpio-omap.txt
-
-Signed-off-by: Jon Hunter <jon-hunter@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap3.dtsi |   12 ++++++------
- arch/arm/boot/dts/omap4.dtsi |   12 ++++++------
- arch/arm/boot/dts/omap5.dtsi |   16 ++++++++--------
- 3 files changed, 20 insertions(+), 20 deletions(-)
-
-diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
-index 1dc72ea..badedc8 100644
---- a/arch/arm/boot/dts/omap3.dtsi
-+++ b/arch/arm/boot/dts/omap3.dtsi
-@@ -117,7 +117,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio2: gpio@49050000 {
-@@ -126,7 +126,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio3: gpio@49052000 {
-@@ -135,7 +135,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio4: gpio@49054000 {
-@@ -144,7 +144,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio5: gpio@49056000 {
-@@ -153,7 +153,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio6: gpio@49058000 {
-@@ -162,7 +162,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		uart1: serial@4806a000 {
-diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
-index bcd64f5..bed47c5 100644
---- a/arch/arm/boot/dts/omap4.dtsi
-+++ b/arch/arm/boot/dts/omap4.dtsi
-@@ -138,7 +138,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio2: gpio@48055000 {
-@@ -149,7 +149,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio3: gpio@48057000 {
-@@ -160,7 +160,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio4: gpio@48059000 {
-@@ -171,7 +171,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio5: gpio@4805b000 {
-@@ -182,7 +182,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio6: gpio@4805d000 {
-@@ -193,7 +193,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpmc: gpmc@50000000 {
-diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
-index 61cbd1c..b4d2eb9 100644
---- a/arch/arm/boot/dts/omap5.dtsi
-+++ b/arch/arm/boot/dts/omap5.dtsi
-@@ -128,7 +128,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio2: gpio@48055000 {
-@@ -139,7 +139,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio3: gpio@48057000 {
-@@ -150,7 +150,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio4: gpio@48059000 {
-@@ -161,7 +161,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio5: gpio@4805b000 {
-@@ -172,7 +172,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio6: gpio@4805d000 {
-@@ -183,7 +183,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio7: gpio@48051000 {
-@@ -194,7 +194,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpio8: gpio@48053000 {
-@@ -205,7 +205,7 @@
- 			gpio-controller;
- 			#gpio-cells = <2>;
- 			interrupt-controller;
--			#interrupt-cells = <1>;
-+			#interrupt-cells = <2>;
- 		};
- 
- 		gpmc: gpmc@50000000 {
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0035-ARM-dts-OMAP3-Add-reg-and-interrupt-properties-for-g.patch b/patches/omap_dt/0035-ARM-dts-OMAP3-Add-reg-and-interrupt-properties-for-g.patch
deleted file mode 100644
index 55c83a32242d80b593c4ae63d4c00abb8ecf0dc9..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0035-ARM-dts-OMAP3-Add-reg-and-interrupt-properties-for-g.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From 74b84b58720d204562c8e02c32aebeb771a1b8dc Mon Sep 17 00:00:00 2001
-From: Jon Hunter <jon-hunter@ti.com>
-Date: Thu, 7 Mar 2013 16:02:31 -0600
-Subject: [PATCH 35/48] ARM: dts: OMAP3: Add reg and interrupt properties for
- gpio
-
-The OMAP3 gpio bindings are currently missing the reg and interrupt
-properties and so add these properties.
-
-Signed-off-by: Jon Hunter <jon-hunter@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap3.dtsi |   12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
-index badedc8..0cc65b5 100644
---- a/arch/arm/boot/dts/omap3.dtsi
-+++ b/arch/arm/boot/dts/omap3.dtsi
-@@ -113,6 +113,8 @@
- 
- 		gpio1: gpio@48310000 {
- 			compatible = "ti,omap3-gpio";
-+			reg = <0x48310000 0x200>;
-+			interrupts = <29>;
- 			ti,hwmods = "gpio1";
- 			gpio-controller;
- 			#gpio-cells = <2>;
-@@ -122,6 +124,8 @@
- 
- 		gpio2: gpio@49050000 {
- 			compatible = "ti,omap3-gpio";
-+			reg = <0x49050000 0x200>;
-+			interrupts = <30>;
- 			ti,hwmods = "gpio2";
- 			gpio-controller;
- 			#gpio-cells = <2>;
-@@ -131,6 +135,8 @@
- 
- 		gpio3: gpio@49052000 {
- 			compatible = "ti,omap3-gpio";
-+			reg = <0x49052000 0x200>;
-+			interrupts = <31>;
- 			ti,hwmods = "gpio3";
- 			gpio-controller;
- 			#gpio-cells = <2>;
-@@ -140,6 +146,8 @@
- 
- 		gpio4: gpio@49054000 {
- 			compatible = "ti,omap3-gpio";
-+			reg = <0x49054000 0x200>;
-+			interrupts = <32>;
- 			ti,hwmods = "gpio4";
- 			gpio-controller;
- 			#gpio-cells = <2>;
-@@ -149,6 +157,8 @@
- 
- 		gpio5: gpio@49056000 {
- 			compatible = "ti,omap3-gpio";
-+			reg = <0x49056000 0x200>;
-+			interrupts = <33>;
- 			ti,hwmods = "gpio5";
- 			gpio-controller;
- 			#gpio-cells = <2>;
-@@ -158,6 +168,8 @@
- 
- 		gpio6: gpio@49058000 {
- 			compatible = "ti,omap3-gpio";
-+			reg = <0x49058000 0x200>;
-+			interrupts = <34>;
- 			ti,hwmods = "gpio6";
- 			gpio-controller;
- 			#gpio-cells = <2>;
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0036-ARM-dts-OMAP3-Add-support-for-OMAP3430-SDP-board.patch b/patches/omap_dt/0036-ARM-dts-OMAP3-Add-support-for-OMAP3430-SDP-board.patch
deleted file mode 100644
index 89d4ddd1df603b5cde255bd6dcf779415c6f87a0..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0036-ARM-dts-OMAP3-Add-support-for-OMAP3430-SDP-board.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-From 666dbf4220470c63e21157b0e93a9cf20cca9fb2 Mon Sep 17 00:00:00 2001
-From: Jon Hunter <jon-hunter@ti.com>
-Date: Fri, 11 Jan 2013 16:39:22 +0000
-Subject: [PATCH 36/48] ARM: dts: OMAP3: Add support for OMAP3430 SDP board
-
-Adds basic device-tree support for OMAP3430 SDP board which has 256MB
-of RAM, 128MB ONENAND flash, 256MB NAND flash and uses the TWL4030
-power management IC.
-
-Signed-off-by: Jon Hunter <jon-hunter@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/Makefile         |    1 +
- arch/arm/boot/dts/omap3430-sdp.dts |  141 ++++++++++++++++++++++++++++++++++++
- 2 files changed, 142 insertions(+)
- create mode 100644 arch/arm/boot/dts/omap3430-sdp.dts
-
-diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
-index de29da5..a38dcd4 100644
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -115,6 +115,7 @@ dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
- 	imx28-tx28.dtb
- dtb-$(CONFIG_ARCH_NOMADIK) += ste-nomadik-s8815.dtb
- dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
-+	omap3430-sdp.dtb \
- 	omap3-beagle.dtb \
- 	omap3-beagle-xm.dtb \
- 	omap3-evm.dtb \
-diff --git a/arch/arm/boot/dts/omap3430-sdp.dts b/arch/arm/boot/dts/omap3430-sdp.dts
-new file mode 100644
-index 0000000..535a6f9
---- /dev/null
-+++ b/arch/arm/boot/dts/omap3430-sdp.dts
-@@ -0,0 +1,141 @@
-+/*
-+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+/dts-v1/;
-+
-+/include/ "omap3.dtsi"
-+
-+/ {
-+	model = "TI OMAP3430 SDP";
-+	compatible = "ti,omap3430-sdp", "ti,omap3";
-+
-+	memory {
-+		device_type = "memory";
-+		reg = <0x80000000 0x10000000>; /* 256 MB */
-+	};
-+};
-+
-+&i2c1 {
-+	clock-frequency = <2600000>;
-+
-+	twl: twl@48 {
-+		reg = <0x48>;
-+		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
-+	};
-+};
-+
-+/include/ "twl4030.dtsi"
-+
-+&mmc1 {
-+	vmmc-supply = <&vmmc1>;
-+	vmmc_aux-supply = <&vsim>;
-+	bus-width = <8>;
-+};
-+
-+&mmc2 {
-+	status = "disabled";
-+};
-+
-+&mmc3 {
-+	status = "disabled";
-+};
-+
-+&gpmc {
-+	ranges = <1 0 0x28000000 0x08000000>,
-+		 <2 0 0x20000000 0x10000000>;
-+
-+	nand@1,0 {
-+		linux,mtd-name= "micron,mt29f1g08abb";
-+		#address-cells = <1>;
-+		#size-cells = <1>;
-+		reg = <1 0 0x08000000>;
-+		nand-bus-width = <8>;
-+
-+		ti,nand-ecc-opt = "sw";
-+		gpmc,device-nand;
-+		gpmc,cs-on = <0>;
-+		gpmc,cs-rd-off = <36>;
-+		gpmc,cs-wr-off = <36>;
-+		gpmc,adv-on = <6>;
-+		gpmc,adv-rd-off = <24>;
-+		gpmc,adv-wr-off = <36>;
-+		gpmc,oe-on = <6>;
-+		gpmc,oe-off = <48>;
-+		gpmc,we-on = <6>;
-+		gpmc,we-off = <30>;
-+		gpmc,rd-cycle = <72>;
-+		gpmc,wr-cycle = <72>;
-+		gpmc,access = <54>;
-+		gpmc,wr-access = <30>;
-+
-+		partition@0 {
-+			label = "xloader-nand";
-+			reg = <0 0x80000>;
-+		};
-+		partition@0x80000 {
-+			label = "bootloader-nand";
-+			reg = <0x80000 0x140000>;
-+		};
-+		partition@0x1c0000 {
-+			label = "params-nand";
-+			reg = <0x1c0000 0xc0000>;
-+		};
-+		partition@0x280000 {
-+			label = "kernel-nand";
-+			reg = <0x280000 0x500000>;
-+		};
-+		partition@0x780000 {
-+			label = "filesystem-nand";
-+			reg = <0x780000 0x7880000>;
-+		};
-+	};
-+
-+	onenand@2,0 {
-+		linux,mtd-name= "samsung,kfm2g16q2m-deb8";
-+		#address-cells = <1>;
-+		#size-cells = <1>;
-+		reg = <2 0 0x10000000>;
-+
-+		gpmc,device-width = <2>;
-+		gpmc,mux-add-data = <2>;
-+		gpmc,cs-on = <0>;
-+		gpmc,cs-rd-off = <84>;
-+		gpmc,cs-wr-off = <72>;
-+		gpmc,adv-on = <0>;
-+		gpmc,adv-rd-off = <18>;
-+		gpmc,adv-wr-off = <18>;
-+		gpmc,oe-on = <30>;
-+		gpmc,oe-off = <84>;
-+		gpmc,we-on = <0>;
-+		gpmc,we-off = <42>;
-+		gpmc,rd-cycle = <108>;
-+		gpmc,wr-cycle = <96>;
-+		gpmc,access = <78>;
-+		gpmc,wr-data-mux-bus = <30>;
-+
-+		partition@0 {
-+			label = "xloader-onenand";
-+			reg = <0 0x80000>;
-+		};
-+		partition@0x80000 {
-+			label = "bootloader-onenand";
-+			reg = <0x80000 0x40000>;
-+		};
-+		partition@0xc0000 {
-+			label = "params-onenand";
-+			reg = <0xc0000 0x20000>;
-+		};
-+		partition@0xe0000 {
-+			label = "kernel-onenand";
-+			reg = <0xe0000 0x200000>;
-+		};
-+		partition@0x2e0000 {
-+			label = "filesystem-onenand";
-+			reg = <0x2e0000 0xfd20000>;
-+		};
-+	};
-+};
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0037-ARM-dts-OMAP2-Add-SDMA-Audio-IPs-bindings.patch b/patches/omap_dt/0037-ARM-dts-OMAP2-Add-SDMA-Audio-IPs-bindings.patch
deleted file mode 100644
index 6571f371d289df41e6b3cdaaff53c7314470e0c5..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0037-ARM-dts-OMAP2-Add-SDMA-Audio-IPs-bindings.patch
+++ /dev/null
@@ -1,269 +0,0 @@
-From a1bd6f0e7d9a773d38ba4648f8f9a8876f4d08fe Mon Sep 17 00:00:00 2001
-From: Sebastien Guiriec <s-guiriec@ti.com>
-Date: Mon, 11 Mar 2013 08:50:21 +0100
-Subject: [PATCH 37/48] ARM: dts: OMAP2+: Add SDMA Audio IPs bindings
-
-Populate DMA client information for McBSP DMIC and McPDM periperhal on
-OMAP2+ devices.
-
-Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap2420.dtsi |    6 ++++++
- arch/arm/boot/dts/omap2430.dtsi |   15 +++++++++++++++
- arch/arm/boot/dts/omap3.dtsi    |   15 +++++++++++++++
- arch/arm/boot/dts/omap4.dtsi    |   17 +++++++++++++++++
- arch/arm/boot/dts/omap5.dtsi    |   14 ++++++++++++++
- 5 files changed, 67 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi
-index eee902f..455b239 100644
---- a/arch/arm/boot/dts/omap2420.dtsi
-+++ b/arch/arm/boot/dts/omap2420.dtsi
-@@ -92,6 +92,9 @@
- 				     <60>; /* RX interrupt */
- 			interrupt-names = "tx", "rx";
- 			ti,hwmods = "mcbsp1";
-+			dmas = <&sdma 31>,
-+			       <&sdma 32>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp2: mcbsp@48076000 {
-@@ -102,6 +105,9 @@
- 				     <63>; /* RX interrupt */
- 			interrupt-names = "tx", "rx";
- 			ti,hwmods = "mcbsp2";
-+			dmas = <&sdma 33>,
-+			       <&sdma 34>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		timer1: timer@48028000 {
-diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi
-index fb74382..477b120 100644
---- a/arch/arm/boot/dts/omap2430.dtsi
-+++ b/arch/arm/boot/dts/omap2430.dtsi
-@@ -106,6 +106,9 @@
- 			interrupt-names = "common", "tx", "rx", "rx_overflow";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp1";
-+			dmas = <&sdma 31>,
-+			       <&sdma 32>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp2: mcbsp@48076000 {
-@@ -118,6 +121,9 @@
- 			interrupt-names = "common", "tx", "rx";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp2";
-+			dmas = <&sdma 33>,
-+			       <&sdma 34>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp3: mcbsp@4808c000 {
-@@ -130,6 +136,9 @@
- 			interrupt-names = "common", "tx", "rx";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp3";
-+			dmas = <&sdma 17>,
-+			       <&sdma 18>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp4: mcbsp@4808e000 {
-@@ -142,6 +151,9 @@
- 			interrupt-names = "common", "tx", "rx";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp4";
-+			dmas = <&sdma 19>,
-+			       <&sdma 20>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp5: mcbsp@48096000 {
-@@ -154,6 +166,9 @@
- 			interrupt-names = "common", "tx", "rx";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp5";
-+			dmas = <&sdma 21>,
-+			       <&sdma 22>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		timer1: timer@49018000 {
-diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
-index 0cc65b5..3344f05 100644
---- a/arch/arm/boot/dts/omap3.dtsi
-+++ b/arch/arm/boot/dts/omap3.dtsi
-@@ -307,6 +307,9 @@
- 			interrupt-names = "common", "tx", "rx";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp1";
-+			dmas = <&sdma 31>,
-+			       <&sdma 32>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp2: mcbsp@49022000 {
-@@ -321,6 +324,9 @@
- 			interrupt-names = "common", "tx", "rx", "sidetone";
- 			ti,buffer-size = <1280>;
- 			ti,hwmods = "mcbsp2", "mcbsp2_sidetone";
-+			dmas = <&sdma 33>,
-+			       <&sdma 34>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp3: mcbsp@49024000 {
-@@ -335,6 +341,9 @@
- 			interrupt-names = "common", "tx", "rx", "sidetone";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp3", "mcbsp3_sidetone";
-+			dmas = <&sdma 17>,
-+			       <&sdma 18>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp4: mcbsp@49026000 {
-@@ -347,6 +356,9 @@
- 			interrupt-names = "common", "tx", "rx";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp4";
-+			dmas = <&sdma 19>,
-+			       <&sdma 20>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp5: mcbsp@48096000 {
-@@ -359,6 +371,9 @@
- 			interrupt-names = "common", "tx", "rx";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp5";
-+			dmas = <&sdma 21>,
-+			       <&sdma 22>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		timer1: timer@48318000 {
-diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
-index bed47c5..ddfc54a 100644
---- a/arch/arm/boot/dts/omap4.dtsi
-+++ b/arch/arm/boot/dts/omap4.dtsi
-@@ -399,6 +399,9 @@
- 			reg-names = "mpu", "dma";
- 			interrupts = <0 112 0x4>;
- 			ti,hwmods = "mcpdm";
-+			dmas = <&sdma 65>,
-+			       <&sdma 66>;
-+			dma-names = "up_link", "dn_link";
- 		};
- 
- 		dmic: dmic@4012e000 {
-@@ -408,6 +411,8 @@
- 			reg-names = "mpu", "dma";
- 			interrupts = <0 114 0x4>;
- 			ti,hwmods = "dmic";
-+			dmas = <&sdma 67>;
-+			dma-names = "up_link";
- 		};
- 
- 		mcbsp1: mcbsp@40122000 {
-@@ -419,6 +424,9 @@
- 			interrupt-names = "common";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp1";
-+			dmas = <&sdma 33>,
-+			       <&sdma 34>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp2: mcbsp@40124000 {
-@@ -430,6 +438,9 @@
- 			interrupt-names = "common";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp2";
-+			dmas = <&sdma 17>,
-+			       <&sdma 18>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp3: mcbsp@40126000 {
-@@ -441,6 +452,9 @@
- 			interrupt-names = "common";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp3";
-+			dmas = <&sdma 19>,
-+			       <&sdma 20>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp4: mcbsp@48096000 {
-@@ -451,6 +465,9 @@
- 			interrupt-names = "common";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp4";
-+			dmas = <&sdma 31>,
-+			       <&sdma 32>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		keypad: keypad@4a31c000 {
-diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
-index b4d2eb9..b760c11 100644
---- a/arch/arm/boot/dts/omap5.dtsi
-+++ b/arch/arm/boot/dts/omap5.dtsi
-@@ -434,6 +434,9 @@
- 			reg-names = "mpu", "dma";
- 			interrupts = <0 112 0x4>;
- 			ti,hwmods = "mcpdm";
-+			dmas = <&sdma 65>,
-+			       <&sdma 66>;
-+			dma-names = "up_link", "dn_link";
- 		};
- 
- 		dmic: dmic@4012e000 {
-@@ -443,6 +446,8 @@
- 			reg-names = "mpu", "dma";
- 			interrupts = <0 114 0x4>;
- 			ti,hwmods = "dmic";
-+			dmas = <&sdma 67>;
-+			dma-names = "up_link";
- 		};
- 
- 		mcbsp1: mcbsp@40122000 {
-@@ -454,6 +459,9 @@
- 			interrupt-names = "common";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp1";
-+			dmas = <&sdma 33>,
-+			       <&sdma 34>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp2: mcbsp@40124000 {
-@@ -465,6 +473,9 @@
- 			interrupt-names = "common";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp2";
-+			dmas = <&sdma 17>,
-+			       <&sdma 18>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		mcbsp3: mcbsp@40126000 {
-@@ -476,6 +487,9 @@
- 			interrupt-names = "common";
- 			ti,buffer-size = <128>;
- 			ti,hwmods = "mcbsp3";
-+			dmas = <&sdma 19>,
-+			       <&sdma 20>;
-+			dma-names = "tx", "rx";
- 		};
- 
- 		timer1: timer@4ae18000 {
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0038-ARM-dts-Add-minimal-DT-support-for-DevKit8000.patch b/patches/omap_dt/0038-ARM-dts-Add-minimal-DT-support-for-DevKit8000.patch
deleted file mode 100644
index 633a20e68ceec0782f18a0618df747328f587aac..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0038-ARM-dts-Add-minimal-DT-support-for-DevKit8000.patch
+++ /dev/null
@@ -1,161 +0,0 @@
-From e4ef82512dd27f1e861f32becd2d86f98a08a525 Mon Sep 17 00:00:00 2001
-From: Anil Kumar <anilk4.v@gmail.com>
-Date: Sat, 16 Mar 2013 15:29:21 +0530
-Subject: [PATCH 38/48] ARM: dts: Add minimal DT support for DevKit8000
-
-DevKit8000 is a beagle board clone from Timll, sold by
-armkits.com. The DevKit8000 has RS232 serial port, LCD, DVI-D,
-S-Video, Ethernet, SD/MMC, keyboard, camera, SPI, I2C, USB and
-JTAG interface.
-
-Add the basic DT support for devkit8000. It includes:
-- twl4030 (PMIC)
-- MMC1
-- I2C1
-- leds
-
-Signed-off-by: Anil Kumar <anilk4.v@gmail.com>
-Tested-by: Thomas Weber <thomas@tomweber.eu>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/Makefile             |    1 +
- arch/arm/boot/dts/omap3-devkit8000.dts |  102 ++++++++++++++++++++++++++++++++
- arch/arm/mach-omap2/board-generic.c    |    1 +
- 3 files changed, 104 insertions(+)
- create mode 100644 arch/arm/boot/dts/omap3-devkit8000.dts
-
-diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
-index a38dcd4..f4c2dde 100644
---- a/arch/arm/boot/dts/Makefile
-+++ b/arch/arm/boot/dts/Makefile
-@@ -117,6 +117,7 @@ dtb-$(CONFIG_ARCH_NOMADIK) += ste-nomadik-s8815.dtb
- dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
- 	omap3430-sdp.dtb \
- 	omap3-beagle.dtb \
-+	omap3-devkit8000.dtb \
- 	omap3-beagle-xm.dtb \
- 	omap3-evm.dtb \
- 	omap3-tobi.dtb \
-diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts
-new file mode 100644
-index 0000000..d6cff34
---- /dev/null
-+++ b/arch/arm/boot/dts/omap3-devkit8000.dts
-@@ -0,0 +1,102 @@
-+/*
-+ * Author: Anil Kumar <anilk4.v@gmail.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+/dts-v1/;
-+
-+/include/ "omap3.dtsi"
-+/ {
-+	model = "TimLL OMAP3 Devkit8000";
-+	compatible = "timll,omap3-devkit8000", "ti,omap3";
-+
-+	memory {
-+		device_type = "memory";
-+		reg = <0x80000000 0x10000000>;	/* 256 MB */
-+	};
-+
-+	leds {
-+		compatible = "gpio-leds";
-+
-+		heartbeat {
-+			label = "devkit8000::led1";
-+			gpios = <&gpio6 26 0>;	/* 186 -> LED1 */
-+			default-state = "on";
-+			linux,default-trigger = "heartbeat";
-+		};
-+
-+		mmc {
-+			label = "devkit8000::led2";
-+			gpios = <&gpio6 3 0>;	/* 163 -> LED2 */
-+			default-state = "on";
-+			linux,default-trigger = "none";
-+		};
-+
-+		usr {
-+			label = "devkit8000::led3";
-+			gpios = <&gpio6 4 0>;	/* 164 -> LED3 */
-+			default-state = "on";
-+			linux,default-trigger = "usr";
-+                };
-+
-+	};
-+};
-+
-+&i2c1 {
-+	clock-frequency = <2600000>;
-+
-+	twl: twl@48 {
-+		reg = <0x48>;
-+		interrupts = <7>;	/* SYS_NIRQ cascaded to intc */
-+	};
-+};
-+
-+&i2c2 {
-+	status = "disabled";
-+};
-+
-+&i2c3 {
-+	status = "disabled";
-+};
-+
-+/include/ "twl4030.dtsi"
-+
-+&mmc1 {
-+	vmmc-supply = <&vmmc1>;
-+	vmmc_aux-supply = <&vsim>;
-+	bus-width = <8>;
-+};
-+
-+&mmc2 {
-+	status = "disabled";
-+};
-+
-+&mmc3 {
-+	status = "disabled";
-+};
-+
-+&wdt2 {
-+	status = "disabled";
-+};
-+
-+&mcbsp1 {
-+	status = "disabled";
-+};
-+
-+&mcbsp2 {
-+	status = "disabled";
-+};
-+
-+&mcbsp3 {
-+	status = "disabled";
-+};
-+
-+&mcbsp4 {
-+	status = "disabled";
-+};
-+
-+&mcbsp5 {
-+	status = "disabled";
-+};
-diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
-index e54a480..afa509a 100644
---- a/arch/arm/mach-omap2/board-generic.c
-+++ b/arch/arm/mach-omap2/board-generic.c
-@@ -110,6 +110,7 @@ MACHINE_END
- 
- static const char *omap3_gp_boards_compat[] __initdata = {
- 	"ti,omap3-beagle",
-+	"timll,omap3-devkit8000",
- 	NULL,
- };
- 
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0039-ARM-dts-omap3-devkit8000-Enable-audio-support.patch b/patches/omap_dt/0039-ARM-dts-omap3-devkit8000-Enable-audio-support.patch
deleted file mode 100644
index 64007bbcc00039bc5b4daba487f42a2bf2906f4e..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0039-ARM-dts-omap3-devkit8000-Enable-audio-support.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From a84d2cf8882c97574f1a787596bb357b199f4d85 Mon Sep 17 00:00:00 2001
-From: Anil Kumar <anilk4.v@gmail.com>
-Date: Mon, 4 Feb 2013 20:25:07 +0530
-Subject: [PATCH 39/48] ARM: dts: omap3-devkit8000: Enable audio support
-
-Add the needed sections to enable audio support on
-Devkit8000 when booted with DT blob.
-
-Signed-off-by: Anil Kumar <anilk4.v@gmail.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap3-devkit8000.dts |   23 +++++++++++++++++++----
- 1 file changed, 19 insertions(+), 4 deletions(-)
-
-diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts
-index d6cff34..b4faddc 100644
---- a/arch/arm/boot/dts/omap3-devkit8000.dts
-+++ b/arch/arm/boot/dts/omap3-devkit8000.dts
-@@ -42,6 +42,19 @@
-                 };
- 
- 	};
-+
-+	sound {
-+		compatible = "ti,omap-twl4030";
-+		ti,model = "devkit8000";
-+
-+		ti,mcbsp = <&mcbsp2>;
-+		ti,codec = <&twl_audio>;
-+		ti,audio-routing =
-+			"Ext Spk", "PREDRIVEL",
-+			"Ext Spk", "PREDRIVER",
-+			"MAINMIC", "Main Mic",
-+			"Main Mic", "Mic Bias 1";
-+	};
- };
- 
- &i2c1 {
-@@ -50,6 +63,12 @@
- 	twl: twl@48 {
- 		reg = <0x48>;
- 		interrupts = <7>;	/* SYS_NIRQ cascaded to intc */
-+
-+		twl_audio: audio {
-+			compatible = "ti,twl4030-audio";
-+			codec {
-+			};
-+		};
- 	};
- };
- 
-@@ -85,10 +104,6 @@
- 	status = "disabled";
- };
- 
--&mcbsp2 {
--	status = "disabled";
--};
--
- &mcbsp3 {
- 	status = "disabled";
- };
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0040-ARM-dts-omap3-devkit8000-Add-NAND-DT-node.patch b/patches/omap_dt/0040-ARM-dts-omap3-devkit8000-Add-NAND-DT-node.patch
deleted file mode 100644
index 6f0bc0ce16f305aa93460dfcce044c613ce0e07a..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0040-ARM-dts-omap3-devkit8000-Add-NAND-DT-node.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 44fab7a60d4c3929a04b7dc882ac1143b3f21b0f Mon Sep 17 00:00:00 2001
-From: Anil Kumar <anilk4.v@gmail.com>
-Date: Fri, 15 Feb 2013 23:32:25 +0530
-Subject: [PATCH 40/48] ARM: dts: omap3-devkit8000: Add NAND DT node
-
-Add the needed sections to enable nand support on
-Devkit8000.
-
-Add nand partitions information.
-
-Signed-off-by: Anil Kumar <anilk4.v@gmail.com>
-Signed-off-by: Benoit Cousson <benoit.cousson@linaro.org>
----
- arch/arm/boot/dts/omap3-devkit8000.dts |   52 ++++++++++++++++++++++++++++++++
- 1 file changed, 52 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts
-index b4faddc..54d3da7 100644
---- a/arch/arm/boot/dts/omap3-devkit8000.dts
-+++ b/arch/arm/boot/dts/omap3-devkit8000.dts
-@@ -115,3 +115,55 @@
- &mcbsp5 {
- 	status = "disabled";
- };
-+
-+&gpmc {
-+	ranges = <0 0 0x30000000 0x04>;       /* CS0: NAND */
-+
-+	nand@0,0 {
-+		reg = <0 0 0>; /* CS0, offset 0 */
-+		nand-bus-width = <16>;
-+
-+		gpmc,sync-clk = <0>;
-+		gpmc,cs-on = <0>;
-+		gpmc,cs-rd-off = <44>;
-+		gpmc,cs-wr-off = <44>;
-+		gpmc,adv-on = <6>;
-+		gpmc,adv-rd-off = <34>;
-+		gpmc,adv-wr-off = <44>;
-+		gpmc,we-off = <40>;
-+		gpmc,oe-off = <54>;
-+		gpmc,access = <64>;
-+		gpmc,rd-cycle = <82>;
-+		gpmc,wr-cycle = <82>;
-+		gpmc,wr-access = <40>;
-+		gpmc,wr-data-mux-bus = <0>;
-+
-+		#address-cells = <1>;
-+		#size-cells = <1>;
-+
-+		x-loader@0 {
-+			label = "X-Loader";
-+			reg = <0 0x80000>;
-+		};
-+
-+		bootloaders@80000 {
-+			label = "U-Boot";
-+			reg = <0x80000 0x1e0000>;
-+		};
-+
-+		bootloaders_env@260000 {
-+			label = "U-Boot Env";
-+			reg = <0x260000 0x20000>;
-+		};
-+
-+		kernel@280000 {
-+			label = "Kernel";
-+			reg = <0x280000 0x400000>;
-+		};
-+
-+		filesystem@680000 {
-+			label = "File System";
-+			reg = <0x680000 0xf980000>;
-+		};
-+	};
-+};
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0041-ARM-dts-OMAP34xx-35xx-Add-CPU-OPP-table.patch b/patches/omap_dt/0041-ARM-dts-OMAP34xx-35xx-Add-CPU-OPP-table.patch
deleted file mode 100644
index 0ed7120e618f214e3f6c52b9eec00bcb23b64da1..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0041-ARM-dts-OMAP34xx-35xx-Add-CPU-OPP-table.patch
+++ /dev/null
@@ -1,188 +0,0 @@
-From fddb9e4d2aa23534553878251e4dbe18127018f3 Mon Sep 17 00:00:00 2001
-From: Nishanth Menon <nm@ti.com>
-Date: Tue, 12 Mar 2013 14:26:41 -0500
-Subject: [PATCH 41/48] ARM: dts: OMAP34xx/35xx: Add CPU OPP table
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Add DT OPP table for OMAP34xx/35xx family of devices. This data is
-decoded by OF with of_init_opp_table() helper function.
-
-OPP data here is based on existing opp3xxx_data.c
-
-Since the omap36xx OPP tables would be different from OMAP34xx/35xx,
-introduce an new omap34xx.dtsi for 34xx/35xx specific entries and use
-existing omap3.dtsi as the common dtsi file for all OMAP3 platforms.
-
-This is in preparation to use generic cpufreq-cpu0 driver for device
-tree enabled boot. Legacy non device tree enabled boot continues to
-use omap-cpufreq.c and opp3xxx_data.c.
-
-Cc: Kevin Hilman <khilman@deeprootsystems.com>
-Cc: Jon Hunter <jon-hunter@ti.com>
-Cc: "Benoît Cousson" <b-cousson@ti.com>
-Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Cc: Shawn Guo <shawn.guo@linaro.org>
-Cc: Keerthy <j-keerthy@ti.com>
-Cc: linux-omap@vger.kernel.org
-Cc: devicetree-discuss@lists.ozlabs.org
-Cc: linux-arm-kernel@lists.infradead.org
-Cc: cpufreq@vger.kernel.org
-Cc: linux-pm@vger.kernel.org
-
-Signed-off-by: Nishanth Menon <nm@ti.com>
----
- arch/arm/boot/dts/am3517-evm.dts        |    2 +-
- arch/arm/boot/dts/am3517_mt_ventoux.dts |    2 +-
- arch/arm/boot/dts/omap3-beagle.dts      |    2 +-
- arch/arm/boot/dts/omap3-devkit8000.dts  |    2 +-
- arch/arm/boot/dts/omap3-evm.dts         |    2 +-
- arch/arm/boot/dts/omap3-igep.dtsi       |    2 +-
- arch/arm/boot/dts/omap3-overo.dtsi      |    2 +-
- arch/arm/boot/dts/omap3430-sdp.dts      |    2 +-
- arch/arm/boot/dts/omap34xx.dtsi         |   28 ++++++++++++++++++++++++++++
- 9 files changed, 36 insertions(+), 8 deletions(-)
- create mode 100644 arch/arm/boot/dts/omap34xx.dtsi
-
-diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts
-index 474f760..e9b5bda 100644
---- a/arch/arm/boot/dts/am3517-evm.dts
-+++ b/arch/arm/boot/dts/am3517-evm.dts
-@@ -7,7 +7,7 @@
-  */
- /dts-v1/;
- 
--/include/ "omap3.dtsi"
-+/include/ "omap34xx.dtsi"
- 
- / {
- 	model = "TI AM3517 EVM (AM3517/05)";
-diff --git a/arch/arm/boot/dts/am3517_mt_ventoux.dts b/arch/arm/boot/dts/am3517_mt_ventoux.dts
-index 5eb26d7..5568683 100644
---- a/arch/arm/boot/dts/am3517_mt_ventoux.dts
-+++ b/arch/arm/boot/dts/am3517_mt_ventoux.dts
-@@ -7,7 +7,7 @@
-  */
- /dts-v1/;
- 
--/include/ "omap3.dtsi"
-+/include/ "omap34xx.dtsi"
- 
- / {
- 	model = "TeeJet Mt.Ventoux";
-diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
-index f624dc8..418550c 100644
---- a/arch/arm/boot/dts/omap3-beagle.dts
-+++ b/arch/arm/boot/dts/omap3-beagle.dts
-@@ -7,7 +7,7 @@
-  */
- /dts-v1/;
- 
--/include/ "omap3.dtsi"
-+/include/ "omap34xx.dtsi"
- 
- / {
- 	model = "TI OMAP3 BeagleBoard";
-diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts
-index 54d3da7..8a5cdcc 100644
---- a/arch/arm/boot/dts/omap3-devkit8000.dts
-+++ b/arch/arm/boot/dts/omap3-devkit8000.dts
-@@ -7,7 +7,7 @@
-  */
- /dts-v1/;
- 
--/include/ "omap3.dtsi"
-+/include/ "omap34xx.dtsi"
- / {
- 	model = "TimLL OMAP3 Devkit8000";
- 	compatible = "timll,omap3-devkit8000", "ti,omap3";
-diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts
-index 6e6f80d..f14370e 100644
---- a/arch/arm/boot/dts/omap3-evm.dts
-+++ b/arch/arm/boot/dts/omap3-evm.dts
-@@ -7,7 +7,7 @@
-  */
- /dts-v1/;
- 
--/include/ "omap3.dtsi"
-+/include/ "omap34xx.dtsi"
- 
- / {
- 	model = "TI OMAP3 EVM (OMAP3530, AM/DM37x)";
-diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi
-index dd01c46..f8fe3b7 100644
---- a/arch/arm/boot/dts/omap3-igep.dtsi
-+++ b/arch/arm/boot/dts/omap3-igep.dtsi
-@@ -10,7 +10,7 @@
-  */
- /dts-v1/;
- 
--/include/ "omap3.dtsi"
-+/include/ "omap34xx.dtsi"
- 
- / {
- 	memory {
-diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi
-index 2d93a08..d4a7280 100644
---- a/arch/arm/boot/dts/omap3-overo.dtsi
-+++ b/arch/arm/boot/dts/omap3-overo.dtsi
-@@ -11,7 +11,7 @@
-  */
- /dts-v1/;
- 
--/include/ "omap3.dtsi"
-+/include/ "omap34xx.dtsi"
- 
- / {
- 	pwmleds {
-diff --git a/arch/arm/boot/dts/omap3430-sdp.dts b/arch/arm/boot/dts/omap3430-sdp.dts
-index 535a6f9..05cd8ba 100644
---- a/arch/arm/boot/dts/omap3430-sdp.dts
-+++ b/arch/arm/boot/dts/omap3430-sdp.dts
-@@ -7,7 +7,7 @@
-  */
- /dts-v1/;
- 
--/include/ "omap3.dtsi"
-+/include/ "omap34xx.dtsi"
- 
- / {
- 	model = "TI OMAP3430 SDP";
-diff --git a/arch/arm/boot/dts/omap34xx.dtsi b/arch/arm/boot/dts/omap34xx.dtsi
-new file mode 100644
-index 0000000..75ed4ae
---- /dev/null
-+++ b/arch/arm/boot/dts/omap34xx.dtsi
-@@ -0,0 +1,28 @@
-+/*
-+ * Device Tree Source for OMAP34xx/OMAP35xx SoC
-+ *
-+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
-+ *
-+ * This file is licensed under the terms of the GNU General Public License
-+ * version 2.  This program is licensed "as is" without any warranty of any
-+ * kind, whether express or implied.
-+ */
-+
-+/include/ "omap3.dtsi"
-+
-+/ {
-+	cpus {
-+		cpu@0 {
-+			/* OMAP343x/OMAP35xx variants OPP1-5 */
-+			operating-points = <
-+				/* kHz    uV */
-+				125000   975000
-+				250000  1075000
-+				500000  1200000
-+				550000  1270000
-+				600000  1350000
-+			>;
-+			clock-latency = <300000>; /* From legacy driver */
-+		};
-+	};
-+};
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0042-ARM-dts-OMAP36xx-Add-CPU-OPP-table.patch b/patches/omap_dt/0042-ARM-dts-OMAP36xx-Add-CPU-OPP-table.patch
deleted file mode 100644
index c99aab70870c42713df0c426c403926a1939db6b..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0042-ARM-dts-OMAP36xx-Add-CPU-OPP-table.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 966ba7b81a8aa084bca431a70cebc42ab1b405fb Mon Sep 17 00:00:00 2001
-From: Nishanth Menon <nm@ti.com>
-Date: Tue, 12 Mar 2013 14:36:44 -0500
-Subject: [PATCH 42/48] ARM: dts: OMAP36xx: Add CPU OPP table
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Add DT OPP table for OMAP36xx/37xx family of devices. This data is
-decoded by OF with of_init_opp_table() helper function.
-
-OPP data here is based on existing opp3xxx_data.c
-
-This is in preparation to use generic cpufreq-cpu0 driver for device
-tree enabled boot. Legacy non device tree enabled boot continues to
-use omap-cpufreq.c and opp3xxx_data.c.
-
-Cc: Kevin Hilman <khilman@deeprootsystems.com>
-Cc: Jon Hunter <jon-hunter@ti.com>
-Cc: "Benoît Cousson" <b-cousson@ti.com>
-Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Cc: Shawn Guo <shawn.guo@linaro.org>
-Cc: Keerthy <j-keerthy@ti.com>
-Cc: linux-omap@vger.kernel.org
-Cc: devicetree-discuss@lists.ozlabs.org
-Cc: linux-arm-kernel@lists.infradead.org
-Cc: cpufreq@vger.kernel.org
-Cc: linux-pm@vger.kernel.org
-
-Signed-off-by: Nishanth Menon <nm@ti.com>
----
- arch/arm/boot/dts/omap36xx.dtsi |   13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap36xx.dtsi b/arch/arm/boot/dts/omap36xx.dtsi
-index 96bf028..b89233e 100644
---- a/arch/arm/boot/dts/omap36xx.dtsi
-+++ b/arch/arm/boot/dts/omap36xx.dtsi
-@@ -15,6 +15,19 @@
- 		serial3 = &uart4;
- 	};
- 
-+	cpus {
-+		/* OMAP3630/OMAP37xx 'standard device' variants OPP50 to OPP130 */
-+		cpu@0 {
-+			operating-points = <
-+				/* kHz    uV */
-+				300000   975000
-+				600000  1075000
-+				800000  1200000
-+			>;
-+			clock-latency = <300000>; /* From legacy driver */
-+		};
-+	};
-+
- 	ocp {
- 		uart4: serial@49042000 {
- 			compatible = "ti,omap3-uart";
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0043-ARM-dts-OMAP3-use-twl4030-vdd1-regulator-for-CPU.patch b/patches/omap_dt/0043-ARM-dts-OMAP3-use-twl4030-vdd1-regulator-for-CPU.patch
deleted file mode 100644
index c46fefd07d6831ca6426f4f0caf7d398648ff10a..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0043-ARM-dts-OMAP3-use-twl4030-vdd1-regulator-for-CPU.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From 5aa20b1d259db4f996cd49c7900f18859edbd9c5 Mon Sep 17 00:00:00 2001
-From: Nishanth Menon <nm@ti.com>
-Date: Tue, 12 Mar 2013 15:53:59 -0500
-Subject: [PATCH 43/48] ARM: dts: OMAP3: use twl4030 vdd1 regulator for CPU
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Define VDD1 regulator in twl4030 DT and mark it as the supply for the
-various OMAP34xx/35xx/36xx/37xx platforms (all use TWL4030 variants with
-VDD1 supplying the CPU).
-
-NOTE: This currently will use I2C1 bus communication path to set the
-voltage in device tree boot. In the legacy non device tree boot, we
-continue to use twl-common.c which bypasses I2C1 bus communication path
-and uses I2C4 bus path using OMAP voltage libraries. We should
-eventually be able to use I2C4 path once we have voltage regulator for
-OMAP which is capable of using the voltage controller/voltage processor
-IP blocks.
-
-Cc: Kevin Hilman <khilman@deeprootsystems.com>
-Cc: Jon Hunter <jon-hunter@ti.com>
-Cc: "Benoît Cousson" <b-cousson@ti.com>
-Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Cc: Shawn Guo <shawn.guo@linaro.org>
-Cc: Keerthy <j-keerthy@ti.com>
-Cc: linux-omap@vger.kernel.org
-Cc: devicetree-discuss@lists.ozlabs.org
-Cc: linux-arm-kernel@lists.infradead.org
-Cc: cpufreq@vger.kernel.org
-Cc: linux-pm@vger.kernel.org
-
-Signed-off-by: Nishanth Menon <nm@ti.com>
----
- arch/arm/boot/dts/omap3-beagle-xm.dts |    6 ++++++
- arch/arm/boot/dts/omap3-beagle.dts    |    6 ++++++
- arch/arm/boot/dts/omap3-evm.dts       |    6 ++++++
- arch/arm/boot/dts/twl4030.dtsi        |    6 ++++++
- 4 files changed, 24 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
-index 1177ff6..5a31964 100644
---- a/arch/arm/boot/dts/omap3-beagle-xm.dts
-+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
-@@ -13,6 +13,12 @@
- 	model = "TI OMAP3 BeagleBoard xM";
- 	compatible = "ti,omap3-beagle-xm, ti,omap3-beagle", "ti,omap3";
- 
-+	cpus {
-+		cpu@0 {
-+			cpu0-supply = <&vcc>;
-+		};
-+	};
-+
- 	memory {
- 		device_type = "memory";
- 		reg = <0x80000000 0x20000000>; /* 512 MB */
-diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
-index 418550c..07dea0a 100644
---- a/arch/arm/boot/dts/omap3-beagle.dts
-+++ b/arch/arm/boot/dts/omap3-beagle.dts
-@@ -13,6 +13,12 @@
- 	model = "TI OMAP3 BeagleBoard";
- 	compatible = "ti,omap3-beagle", "ti,omap3";
- 
-+	cpus {
-+		cpu@0 {
-+			cpu0-supply = <&vcc>;
-+		};
-+	};
-+
- 	memory {
- 		device_type = "memory";
- 		reg = <0x80000000 0x10000000>; /* 256 MB */
-diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts
-index f14370e..05f51e1 100644
---- a/arch/arm/boot/dts/omap3-evm.dts
-+++ b/arch/arm/boot/dts/omap3-evm.dts
-@@ -13,6 +13,12 @@
- 	model = "TI OMAP3 EVM (OMAP3530, AM/DM37x)";
- 	compatible = "ti,omap3-evm", "ti,omap3";
- 
-+	cpus {
-+		cpu@0 {
-+			cpu0-supply = <&vcc>;
-+		};
-+	};
-+
- 	memory {
- 		device_type = "memory";
- 		reg = <0x80000000 0x10000000>; /* 256 MB */
-diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
-index 23c0cdd..b3034da 100644
---- a/arch/arm/boot/dts/twl4030.dtsi
-+++ b/arch/arm/boot/dts/twl4030.dtsi
-@@ -23,6 +23,12 @@
- 		compatible = "ti,twl4030-wdt";
- 	};
- 
-+	vcc: regulator-vdd1 {
-+		compatible = "ti,twl4030-vdd1";
-+		regulator-min-microvolt = <600000>;
-+		regulator-max-microvolt = <1450000>;
-+	};
-+
- 	vdac: regulator-vdac {
- 		compatible = "ti,twl4030-vdac";
- 		regulator-min-microvolt = <1800000>;
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0044-ARM-dts-OMAP443x-Add-CPU-OPP-table.patch b/patches/omap_dt/0044-ARM-dts-OMAP443x-Add-CPU-OPP-table.patch
deleted file mode 100644
index 1644816a0f7401be190a7c1f6a28d9ff3b6386a2..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0044-ARM-dts-OMAP443x-Add-CPU-OPP-table.patch
+++ /dev/null
@@ -1,117 +0,0 @@
-From 3194af7165771655711895cd5465205820bedd69 Mon Sep 17 00:00:00 2001
-From: Nishanth Menon <nm@ti.com>
-Date: Tue, 12 Mar 2013 16:35:02 -0500
-Subject: [PATCH 44/48] ARM: dts: OMAP443x: Add CPU OPP table
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Add DT OPP table for OMAP443x family of devices. This data is
-decoded by OF with of_init_opp_table() helper function.
-
-OPP data here is based on existing opp4xxx_data.c
-
-Since the omap4460 OPP tables would be different from OMAP443x,
-introduce an new omap443x.dtsi for 443x specific entries and use
-existing omap4.dtsi as the common dtsi file for all OMAP4 platforms.
-
-This is in preparation to use generic cpufreq-cpu0 driver for device
-tree enabled boot. Legacy non device tree enabled boot continues to
-use omap-cpufreq.c and opp4xxx_data.c.
-
-Cc: Kevin Hilman <khilman@deeprootsystems.com>
-Cc: Jon Hunter <jon-hunter@ti.com>
-Cc: "Benoît Cousson" <b-cousson@ti.com>
-Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Cc: Shawn Guo <shawn.guo@linaro.org>
-Cc: Keerthy <j-keerthy@ti.com>
-Cc: linux-omap@vger.kernel.org
-Cc: devicetree-discuss@lists.ozlabs.org
-Cc: linux-arm-kernel@lists.infradead.org
-Cc: cpufreq@vger.kernel.org
-Cc: linux-pm@vger.kernel.org
-
-Signed-off-by: Nishanth Menon <nm@ti.com>
----
- arch/arm/boot/dts/omap4-panda.dts   |    2 +-
- arch/arm/boot/dts/omap4-sdp.dts     |    2 +-
- arch/arm/boot/dts/omap4-var-som.dts |    2 +-
- arch/arm/boot/dts/omap443x.dtsi     |   27 +++++++++++++++++++++++++++
- 4 files changed, 30 insertions(+), 3 deletions(-)
- create mode 100644 arch/arm/boot/dts/omap443x.dtsi
-
-diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
-index 1751a25..e05b1b0 100644
---- a/arch/arm/boot/dts/omap4-panda.dts
-+++ b/arch/arm/boot/dts/omap4-panda.dts
-@@ -7,7 +7,7 @@
-  */
- /dts-v1/;
- 
--/include/ "omap4.dtsi"
-+/include/ "omap443x.dtsi"
- /include/ "elpida_ecb240abacn.dtsi"
- 
- / {
-diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
-index a93a19d..c387bdc 100644
---- a/arch/arm/boot/dts/omap4-sdp.dts
-+++ b/arch/arm/boot/dts/omap4-sdp.dts
-@@ -7,7 +7,7 @@
-  */
- /dts-v1/;
- 
--/include/ "omap4.dtsi"
-+/include/ "omap443x.dtsi"
- /include/ "elpida_ecb240abacn.dtsi"
- 
- / {
-diff --git a/arch/arm/boot/dts/omap4-var-som.dts b/arch/arm/boot/dts/omap4-var-som.dts
-index 6601e6a..222a413 100644
---- a/arch/arm/boot/dts/omap4-var-som.dts
-+++ b/arch/arm/boot/dts/omap4-var-som.dts
-@@ -7,7 +7,7 @@
-  */
- /dts-v1/;
- 
--/include/ "omap4.dtsi"
-+/include/ "omap443x.dtsi"
- 
- / {
- 	model = "Variscite OMAP4 SOM";
-diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
-new file mode 100644
-index 0000000..cccf39a
---- /dev/null
-+++ b/arch/arm/boot/dts/omap443x.dtsi
-@@ -0,0 +1,27 @@
-+/*
-+ * Device Tree Source for OMAP443x SoC
-+ *
-+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
-+ *
-+ * This file is licensed under the terms of the GNU General Public License
-+ * version 2.  This program is licensed "as is" without any warranty of any
-+ * kind, whether express or implied.
-+ */
-+
-+/include/ "omap4.dtsi"
-+
-+/ {
-+	cpus {
-+		cpu@0 {
-+			/* OMAP443x variants OPP50-OPPNT */
-+			operating-points = <
-+				/* kHz    uV */
-+				300000  1025000
-+				600000  1200000
-+				800000  1313000
-+				1008000 1375000
-+			>;
-+			clock-latency = <300000>; /* From legacy driver */
-+		};
-+	};
-+};
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0045-ARM-dts-omap4-panda-move-generic-sections-to-panda-c.patch b/patches/omap_dt/0045-ARM-dts-omap4-panda-move-generic-sections-to-panda-c.patch
deleted file mode 100644
index fa9c71eb108064987f193c9dd150c2f6b06a78fd..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0045-ARM-dts-omap4-panda-move-generic-sections-to-panda-c.patch
+++ /dev/null
@@ -1,597 +0,0 @@
-From aabdf71cb8baaad882fed4def9fdd1ca26c6cba5 Mon Sep 17 00:00:00 2001
-From: Nishanth Menon <nm@ti.com>
-Date: Tue, 12 Mar 2013 17:49:47 -0500
-Subject: [PATCH 45/48] ARM: dts: omap4-panda: move generic sections to
- panda-common
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-PandaBoard, PandaBoard-A4 revisions use OMAP4430.
-PandaBoard-ES version of the board uses OMAP4460.
-
-Move the original panda dts file into a common dtsi used by all panda
-variants. This allows us to introduce SoC variation for PandaBoard ES
-without impacting other PandaBoard versions that are supported.
-As part of this change, since OMAP4460 adds on to OMAP4430, add
-omap4.dtsi to omap4460.dtsi.
-
-Cc: Kevin Hilman <khilman@deeprootsystems.com>
-Cc: Jon Hunter <jon-hunter@ti.com>
-Cc: "Benoît Cousson" <b-cousson@ti.com>
-Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Cc: Shawn Guo <shawn.guo@linaro.org>
-Cc: Keerthy <j-keerthy@ti.com>
-Cc: linux-omap@vger.kernel.org
-Cc: devicetree-discuss@lists.ozlabs.org
-Cc: linux-arm-kernel@lists.infradead.org
-Cc: cpufreq@vger.kernel.org
-Cc: linux-pm@vger.kernel.org
-
-Signed-off-by: Nishanth Menon <nm@ti.com>
----
- arch/arm/boot/dts/omap4-panda-a4.dts      |    5 +-
- arch/arm/boot/dts/omap4-panda-common.dtsi |  251 +++++++++++++++++++++++++++++
- arch/arm/boot/dts/omap4-panda-es.dts      |    3 +-
- arch/arm/boot/dts/omap4-panda.dts         |  245 +---------------------------
- arch/arm/boot/dts/omap4460.dtsi           |    1 +
- 5 files changed, 259 insertions(+), 246 deletions(-)
- create mode 100644 arch/arm/boot/dts/omap4-panda-common.dtsi
-
-diff --git a/arch/arm/boot/dts/omap4-panda-a4.dts b/arch/arm/boot/dts/omap4-panda-a4.dts
-index 75466d2..e30cdf0 100644
---- a/arch/arm/boot/dts/omap4-panda-a4.dts
-+++ b/arch/arm/boot/dts/omap4-panda-a4.dts
-@@ -5,7 +5,10 @@
-  * it under the terms of the GNU General Public License version 2 as
-  * published by the Free Software Foundation.
-  */
--/include/ "omap4-panda.dts"
-+/dts-v1/;
-+
-+/include/ "omap443x.dtsi"
-+/include/ "omap4-panda-common.dtsi"
- 
- /* Pandaboard Rev A4+ have external pullups on SCL & SDA */
- &dss_hdmi_pins {
-diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
-new file mode 100644
-index 0000000..03bd60d
---- /dev/null
-+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
-@@ -0,0 +1,251 @@
-+/*
-+ * Copyright (C) 2011-2013 Texas Instruments Incorporated - http://www.ti.com/
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+/include/ "elpida_ecb240abacn.dtsi"
-+
-+/ {
-+	model = "TI OMAP4 PandaBoard";
-+	compatible = "ti,omap4-panda", "ti,omap4430", "ti,omap4";
-+
-+	memory {
-+		device_type = "memory";
-+		reg = <0x80000000 0x40000000>; /* 1 GB */
-+	};
-+
-+	leds {
-+		compatible = "gpio-leds";
-+		heartbeat {
-+			label = "pandaboard::status1";
-+			gpios = <&gpio1 7 0>;
-+			linux,default-trigger = "heartbeat";
-+		};
-+
-+		mmc {
-+			label = "pandaboard::status2";
-+			gpios = <&gpio1 8 0>;
-+			linux,default-trigger = "mmc0";
-+		};
-+	};
-+
-+	sound: sound {
-+		compatible = "ti,abe-twl6040";
-+		ti,model = "PandaBoard";
-+
-+		ti,mclk-freq = <38400000>;
-+
-+		ti,mcpdm = <&mcpdm>;
-+
-+		ti,twl6040 = <&twl6040>;
-+
-+		/* Audio routing */
-+		ti,audio-routing =
-+			"Headset Stereophone", "HSOL",
-+			"Headset Stereophone", "HSOR",
-+			"Ext Spk", "HFL",
-+			"Ext Spk", "HFR",
-+			"Line Out", "AUXL",
-+			"Line Out", "AUXR",
-+			"HSMIC", "Headset Mic",
-+			"Headset Mic", "Headset Mic Bias",
-+			"AFML", "Line In",
-+			"AFMR", "Line In";
-+	};
-+};
-+
-+&omap4_pmx_core {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <
-+			&twl6040_pins
-+			&mcpdm_pins
-+			&mcbsp1_pins
-+			&dss_hdmi_pins
-+			&tpd12s015_pins
-+	>;
-+
-+	twl6040_pins: pinmux_twl6040_pins {
-+		pinctrl-single,pins = <
-+			0xe0 0x3	/* hdq_sio.gpio_127 OUTPUT | MODE3 */
-+			0x160 0x100	/* sys_nirq2.sys_nirq2 INPUT | MODE0 */
-+		>;
-+	};
-+
-+	mcpdm_pins: pinmux_mcpdm_pins {
-+		pinctrl-single,pins = <
-+			0xc6 0x108	/* abe_pdm_ul_data.abe_pdm_ul_data INPUT PULLDOWN | MODE0 */
-+			0xc8 0x108	/* abe_pdm_dl_data.abe_pdm_dl_data INPUT PULLDOWN | MODE0 */
-+			0xca 0x118	/* abe_pdm_frame.abe_pdm_frame INPUT PULLUP | MODE0 */
-+			0xcc 0x108	/* abe_pdm_lb_clk.abe_pdm_lb_clk INPUT PULLDOWN | MODE0 */
-+			0xce 0x108	/* abe_clks.abe_clks INPUT PULLDOWN | MODE0 */
-+		>;
-+	};
-+
-+	mcbsp1_pins: pinmux_mcbsp1_pins {
-+		pinctrl-single,pins = <
-+			0xbe 0x100	/* abe_mcbsp1_clkx.abe_mcbsp1_clkx INPUT | MODE0 */
-+			0xc0 0x108	/* abe_mcbsp1_dr.abe_mcbsp1_dr INPUT PULLDOWN | MODE0 */
-+			0xc2 0x8		/* abe_mcbsp1_dx.abe_mcbsp1_dx OUTPUT PULLDOWN | MODE0 */
-+			0xc4 0x100	/* abe_mcbsp1_fsx.abe_mcbsp1_fsx INPUT | MODE0 */
-+		>;
-+	};
-+
-+	dss_hdmi_pins: pinmux_dss_hdmi_pins {
-+		pinctrl-single,pins = <
-+			0x5a 0x118	/* hdmi_cec.hdmi_cec INPUT PULLUP | MODE 0 */
-+			0x5c 0x118	/* hdmi_scl.hdmi_scl INPUT PULLUP | MODE 0 */
-+			0x5e 0x118	/* hdmi_sda.hdmi_sda INPUT PULLUP | MODE 0 */
-+		>;
-+	};
-+
-+	tpd12s015_pins: pinmux_tpd12s015_pins {
-+		pinctrl-single,pins = <
-+			0x22 0x3	/* gpmc_a17.gpio_41 OUTPUT | MODE3 */
-+			0x48 0x3	/* gpmc_nbe1.gpio_60 OUTPUT | MODE3 */
-+			0x58 0x10b	/* hdmi_hpd.gpio_63 INPUT PULLDOWN | MODE3 */
-+		>;
-+	};
-+
-+	i2c1_pins: pinmux_i2c1_pins {
-+		pinctrl-single,pins = <
-+			0xe2 0x118        /* i2c1_scl PULLUP | INPUTENABLE | MODE0 */
-+			0xe4 0x118        /* i2c1_sda PULLUP | INPUTENABLE | MODE0 */
-+		>;
-+	};
-+
-+	i2c2_pins: pinmux_i2c2_pins {
-+		pinctrl-single,pins = <
-+			0xe6 0x118        /* i2c2_scl PULLUP | INPUTENABLE | MODE0 */
-+			0xe8 0x118        /* i2c2_sda PULLUP | INPUTENABLE | MODE0 */
-+		>;
-+	};
-+
-+	i2c3_pins: pinmux_i2c3_pins {
-+		pinctrl-single,pins = <
-+			0xea 0x118        /* i2c3_scl PULLUP | INPUTENABLE | MODE0 */
-+			0xec 0x118     /* i2c3_sda PULLUP | INPUTENABLE | MODE0 */
-+		>;
-+	};
-+
-+	i2c4_pins: pinmux_i2c4_pins {
-+		pinctrl-single,pins = <
-+			0xee 0x118        /* i2c4_scl PULLUP | INPUTENABLE | MODE0 */
-+			0xf0 0x118     /* i2c4_sda PULLUP | INPUTENABLE | MODE0 */
-+		>;
-+	};
-+};
-+
-+&i2c1 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c1_pins>;
-+
-+	clock-frequency = <400000>;
-+
-+	twl: twl@48 {
-+		reg = <0x48>;
-+		/* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */
-+		interrupts = <0 7 4>; /* IRQ_SYS_1N cascaded to gic */
-+		interrupt-parent = <&gic>;
-+	};
-+
-+	twl6040: twl@4b {
-+		compatible = "ti,twl6040";
-+		reg = <0x4b>;
-+		/* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */
-+		interrupts = <0 119 4>; /* IRQ_SYS_2N cascaded to gic */
-+		interrupt-parent = <&gic>;
-+		ti,audpwron-gpio = <&gpio4 31 0>;  /* gpio line 127 */
-+
-+		vio-supply = <&v1v8>;
-+		v2v1-supply = <&v2v1>;
-+		enable-active-high;
-+	};
-+};
-+
-+/include/ "twl6030.dtsi"
-+
-+&i2c2 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c2_pins>;
-+
-+	clock-frequency = <400000>;
-+};
-+
-+&i2c3 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c3_pins>;
-+
-+	clock-frequency = <100000>;
-+
-+	/*
-+	 * Display monitor features are burnt in their EEPROM as EDID data.
-+	 * The EEPROM is connected as I2C slave device.
-+	 */
-+	eeprom@50 {
-+		compatible = "ti,eeprom";
-+		reg = <0x50>;
-+	};
-+};
-+
-+&i2c4 {
-+	pinctrl-names = "default";
-+	pinctrl-0 = <&i2c4_pins>;
-+
-+	clock-frequency = <400000>;
-+};
-+
-+&mmc1 {
-+	vmmc-supply = <&vmmc>;
-+	bus-width = <8>;
-+};
-+
-+&mmc2 {
-+	status = "disabled";
-+};
-+
-+&mmc3 {
-+	status = "disabled";
-+};
-+
-+&mmc4 {
-+	status = "disabled";
-+};
-+
-+&mmc5 {
-+	ti,non-removable;
-+	bus-width = <4>;
-+};
-+
-+&emif1 {
-+	cs1-used;
-+	device-handle = <&elpida_ECB240ABACN>;
-+};
-+
-+&emif2 {
-+	cs1-used;
-+	device-handle = <&elpida_ECB240ABACN>;
-+};
-+
-+&mcbsp2 {
-+	status = "disabled";
-+};
-+
-+&mcbsp3 {
-+	status = "disabled";
-+};
-+
-+&dmic {
-+	status = "disabled";
-+};
-+
-+&twl_usb_comparator {
-+	usb-supply = <&vusb>;
-+};
-+
-+&usb_otg_hs {
-+	interface-type = <1>;
-+	mode = <3>;
-+	power = <50>;
-+};
-diff --git a/arch/arm/boot/dts/omap4-panda-es.dts b/arch/arm/boot/dts/omap4-panda-es.dts
-index 2a6e344..f1d8c21 100644
---- a/arch/arm/boot/dts/omap4-panda-es.dts
-+++ b/arch/arm/boot/dts/omap4-panda-es.dts
-@@ -5,9 +5,10 @@
-  * it under the terms of the GNU General Public License version 2 as
-  * published by the Free Software Foundation.
-  */
-+/dts-v1/;
- 
--/include/ "omap4-panda.dts"
- /include/ "omap4460.dtsi"
-+/include/ "omap4-panda-common.dtsi"
- 
- /* Audio routing is differnet between PandaBoard4430 and PandaBoardES */
- &sound {
-diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
-index e05b1b0..f8b221f 100644
---- a/arch/arm/boot/dts/omap4-panda.dts
-+++ b/arch/arm/boot/dts/omap4-panda.dts
-@@ -8,247 +8,4 @@
- /dts-v1/;
- 
- /include/ "omap443x.dtsi"
--/include/ "elpida_ecb240abacn.dtsi"
--
--/ {
--	model = "TI OMAP4 PandaBoard";
--	compatible = "ti,omap4-panda", "ti,omap4430", "ti,omap4";
--
--	memory {
--		device_type = "memory";
--		reg = <0x80000000 0x40000000>; /* 1 GB */
--	};
--
--	leds {
--		compatible = "gpio-leds";
--		heartbeat {
--			label = "pandaboard::status1";
--			gpios = <&gpio1 7 0>;
--			linux,default-trigger = "heartbeat";
--		};
--
--		mmc {
--			label = "pandaboard::status2";
--			gpios = <&gpio1 8 0>;
--			linux,default-trigger = "mmc0";
--		};
--	};
--
--	sound: sound {
--		compatible = "ti,abe-twl6040";
--		ti,model = "PandaBoard";
--
--		ti,mclk-freq = <38400000>;
--
--		ti,mcpdm = <&mcpdm>;
--
--		ti,twl6040 = <&twl6040>;
--
--		/* Audio routing */
--		ti,audio-routing =
--			"Headset Stereophone", "HSOL",
--			"Headset Stereophone", "HSOR",
--			"Ext Spk", "HFL",
--			"Ext Spk", "HFR",
--			"Line Out", "AUXL",
--			"Line Out", "AUXR",
--			"HSMIC", "Headset Mic",
--			"Headset Mic", "Headset Mic Bias",
--			"AFML", "Line In",
--			"AFMR", "Line In";
--	};
--};
--
--&omap4_pmx_core {
--	pinctrl-names = "default";
--	pinctrl-0 = <
--			&twl6040_pins
--			&mcpdm_pins
--			&mcbsp1_pins
--			&dss_hdmi_pins
--			&tpd12s015_pins
--	>;
--
--	twl6040_pins: pinmux_twl6040_pins {
--		pinctrl-single,pins = <
--			0xe0 0x3	/* hdq_sio.gpio_127 OUTPUT | MODE3 */
--			0x160 0x100	/* sys_nirq2.sys_nirq2 INPUT | MODE0 */
--		>;
--	};
--
--	mcpdm_pins: pinmux_mcpdm_pins {
--		pinctrl-single,pins = <
--			0xc6 0x108	/* abe_pdm_ul_data.abe_pdm_ul_data INPUT PULLDOWN | MODE0 */
--			0xc8 0x108	/* abe_pdm_dl_data.abe_pdm_dl_data INPUT PULLDOWN | MODE0 */
--			0xca 0x118	/* abe_pdm_frame.abe_pdm_frame INPUT PULLUP | MODE0 */
--			0xcc 0x108	/* abe_pdm_lb_clk.abe_pdm_lb_clk INPUT PULLDOWN | MODE0 */
--			0xce 0x108	/* abe_clks.abe_clks INPUT PULLDOWN | MODE0 */
--		>;
--	};
--
--	mcbsp1_pins: pinmux_mcbsp1_pins {
--		pinctrl-single,pins = <
--			0xbe 0x100	/* abe_mcbsp1_clkx.abe_mcbsp1_clkx INPUT | MODE0 */
--			0xc0 0x108	/* abe_mcbsp1_dr.abe_mcbsp1_dr INPUT PULLDOWN | MODE0 */
--			0xc2 0x8		/* abe_mcbsp1_dx.abe_mcbsp1_dx OUTPUT PULLDOWN | MODE0 */
--			0xc4 0x100	/* abe_mcbsp1_fsx.abe_mcbsp1_fsx INPUT | MODE0 */
--		>;
--	};
--
--	dss_hdmi_pins: pinmux_dss_hdmi_pins {
--		pinctrl-single,pins = <
--			0x5a 0x118	/* hdmi_cec.hdmi_cec INPUT PULLUP | MODE 0 */
--			0x5c 0x118	/* hdmi_scl.hdmi_scl INPUT PULLUP | MODE 0 */
--			0x5e 0x118	/* hdmi_sda.hdmi_sda INPUT PULLUP | MODE 0 */
--		>;
--	};
--
--	tpd12s015_pins: pinmux_tpd12s015_pins {
--		pinctrl-single,pins = <
--			0x22 0x3	/* gpmc_a17.gpio_41 OUTPUT | MODE3 */
--			0x48 0x3	/* gpmc_nbe1.gpio_60 OUTPUT | MODE3 */
--			0x58 0x10b	/* hdmi_hpd.gpio_63 INPUT PULLDOWN | MODE3 */
--		>;
--	};
--
--	i2c1_pins: pinmux_i2c1_pins {
--		pinctrl-single,pins = <
--			0xe2 0x118        /* i2c1_scl PULLUP | INPUTENABLE | MODE0 */
--			0xe4 0x118        /* i2c1_sda PULLUP | INPUTENABLE | MODE0 */
--		>;
--	};
--
--	i2c2_pins: pinmux_i2c2_pins {
--		pinctrl-single,pins = <
--			0xe6 0x118        /* i2c2_scl PULLUP | INPUTENABLE | MODE0 */
--			0xe8 0x118        /* i2c2_sda PULLUP | INPUTENABLE | MODE0 */
--		>;
--	};
--
--	i2c3_pins: pinmux_i2c3_pins {
--		pinctrl-single,pins = <
--			0xea 0x118        /* i2c3_scl PULLUP | INPUTENABLE | MODE0 */
--			0xec 0x118     /* i2c3_sda PULLUP | INPUTENABLE | MODE0 */
--		>;
--	};
--
--	i2c4_pins: pinmux_i2c4_pins {
--		pinctrl-single,pins = <
--			0xee 0x118        /* i2c4_scl PULLUP | INPUTENABLE | MODE0 */
--			0xf0 0x118     /* i2c4_sda PULLUP | INPUTENABLE | MODE0 */
--		>;
--	};
--};
--
--&i2c1 {
--	pinctrl-names = "default";
--	pinctrl-0 = <&i2c1_pins>;
--
--	clock-frequency = <400000>;
--
--	twl: twl@48 {
--		reg = <0x48>;
--		/* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */
--		interrupts = <0 7 4>; /* IRQ_SYS_1N cascaded to gic */
--		interrupt-parent = <&gic>;
--	};
--
--	twl6040: twl@4b {
--		compatible = "ti,twl6040";
--		reg = <0x4b>;
--		/* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */
--		interrupts = <0 119 4>; /* IRQ_SYS_2N cascaded to gic */
--		interrupt-parent = <&gic>;
--		ti,audpwron-gpio = <&gpio4 31 0>;  /* gpio line 127 */
--
--		vio-supply = <&v1v8>;
--		v2v1-supply = <&v2v1>;
--		enable-active-high;
--	};
--};
--
--/include/ "twl6030.dtsi"
--
--&i2c2 {
--	pinctrl-names = "default";
--	pinctrl-0 = <&i2c2_pins>;
--
--	clock-frequency = <400000>;
--};
--
--&i2c3 {
--	pinctrl-names = "default";
--	pinctrl-0 = <&i2c3_pins>;
--
--	clock-frequency = <100000>;
--
--	/*
--	 * Display monitor features are burnt in their EEPROM as EDID data.
--	 * The EEPROM is connected as I2C slave device.
--	 */
--	eeprom@50 {
--		compatible = "ti,eeprom";
--		reg = <0x50>;
--	};
--};
--
--&i2c4 {
--	pinctrl-names = "default";
--	pinctrl-0 = <&i2c4_pins>;
--
--	clock-frequency = <400000>;
--};
--
--&mmc1 {
--	vmmc-supply = <&vmmc>;
--	bus-width = <8>;
--};
--
--&mmc2 {
--	status = "disabled";
--};
--
--&mmc3 {
--	status = "disabled";
--};
--
--&mmc4 {
--	status = "disabled";
--};
--
--&mmc5 {
--	ti,non-removable;
--	bus-width = <4>;
--};
--
--&emif1 {
--	cs1-used;
--	device-handle = <&elpida_ECB240ABACN>;
--};
--
--&emif2 {
--	cs1-used;
--	device-handle = <&elpida_ECB240ABACN>;
--};
--
--&mcbsp2 {
--	status = "disabled";
--};
--
--&mcbsp3 {
--	status = "disabled";
--};
--
--&dmic {
--	status = "disabled";
--};
--
--&twl_usb_comparator {
--	usb-supply = <&vusb>;
--};
--
--&usb_otg_hs {
--	interface-type = <1>;
--	mode = <3>;
--	power = <50>;
--};
-+/include/ "omap4-panda-common.dtsi"
-diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
-index 0a1d38b..e09b3e1 100644
---- a/arch/arm/boot/dts/omap4460.dtsi
-+++ b/arch/arm/boot/dts/omap4460.dtsi
-@@ -7,6 +7,7 @@
-  * version 2.  This program is licensed "as is" without any warranty of any
-  * kind, whether express or implied.
-  */
-+/include/ "omap4.dtsi"
- 
- / {
- 	pmu {
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0046-ARM-dts-OMAP4460-Add-CPU-OPP-table.patch b/patches/omap_dt/0046-ARM-dts-OMAP4460-Add-CPU-OPP-table.patch
deleted file mode 100644
index 2be84ec6d491a18e1177db614770e80732fba177..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0046-ARM-dts-OMAP4460-Add-CPU-OPP-table.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From c5be7b24f4f12f3d4a7d3a3ef527b335cc154008 Mon Sep 17 00:00:00 2001
-From: Nishanth Menon <nm@ti.com>
-Date: Fri, 15 Mar 2013 11:33:02 -0500
-Subject: [PATCH 46/48] ARM: dts: OMAP4460: Add CPU OPP table
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Add DT OPP table for OMAP4460 family of devices. This data is
-decoded by OF with of_init_opp_table() helper function.
-
-OPP data here is based on existing opp4xxx_data.c
-
-This is in preparation to use generic cpufreq-cpu0 driver for device
-tree enabled boot. Legacy non device tree enabled boot continues to
-use omap-cpufreq.c and opp4xxx_data.c.
-
-Cc: Kevin Hilman <khilman@deeprootsystems.com>
-Cc: Jon Hunter <jon-hunter@ti.com>
-Cc: "Benoît Cousson" <b-cousson@ti.com>
-Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Cc: Shawn Guo <shawn.guo@linaro.org>
-Cc: Keerthy <j-keerthy@ti.com>
-Cc: linux-omap@vger.kernel.org
-Cc: devicetree-discuss@lists.ozlabs.org
-Cc: linux-arm-kernel@lists.infradead.org
-Cc: cpufreq@vger.kernel.org
-Cc: linux-pm@vger.kernel.org
-
-Signed-off-by: Nishanth Menon <nm@ti.com>
----
- arch/arm/boot/dts/omap4460.dtsi |   13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
-index e09b3e1..7c2c23c 100644
---- a/arch/arm/boot/dts/omap4460.dtsi
-+++ b/arch/arm/boot/dts/omap4460.dtsi
-@@ -10,6 +10,19 @@
- /include/ "omap4.dtsi"
- 
- / {
-+	cpus {
-+		/* OMAP446x 'standard device' variants OPP50 to OPPTurbo */
-+		cpu@0 {
-+			operating-points = <
-+				/* kHz    uV */
-+				350000   975000
-+				700000  1075000
-+				920000  1200000
-+			>;
-+			clock-latency = <300000>; /* From legacy driver */
-+		};
-+	};
-+
- 	pmu {
- 		compatible = "arm,cortex-a9-pmu";
- 		interrupts = <0 54 0x4>,
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0047-ARM-OMAP3-use-cpu0-cpufreq-driver-in-device-tree-sup.patch b/patches/omap_dt/0047-ARM-OMAP3-use-cpu0-cpufreq-driver-in-device-tree-sup.patch
deleted file mode 100644
index d5f0daa997f86c9549f1feb083651519bbfe3c4c..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0047-ARM-OMAP3-use-cpu0-cpufreq-driver-in-device-tree-sup.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From f3c141b7774702914725386167754833e3e7d119 Mon Sep 17 00:00:00 2001
-From: Nishanth Menon <nm@ti.com>
-Date: Fri, 15 Mar 2013 12:03:30 -0500
-Subject: [PATCH 47/48] ARM: OMAP3+: use cpu0-cpufreq driver in device tree
- supported boot
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-With OMAP3+ and AM33xx supported SoC having defined CPU device tree
-entries with operating-points defined, we can now use the SoC
-generic cpufreq-cpu0 driver by registering appropriate device.
-
-As part of this change, add dummy clock node to use cpufreq-cpu0.
-This is an suggested solution till we have OMAP clock nodes in DT.
-Once the DT conversion is complete, we can then do:
-clocks = <&dpll_mpu_ck>; or the SoC specific equivalent.
-
-Inspired by patch: https://patchwork.kernel.org/patch/2067841/
-now made generic.
-
-Cc: Kevin Hilman <khilman@deeprootsystems.com>
-Cc: Jon Hunter <jon-hunter@ti.com>
-Cc: "Benoît Cousson" <b-cousson@ti.com>
-Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Cc: Shawn Guo <shawn.guo@linaro.org>
-Cc: Keerthy <j-keerthy@ti.com>
-Cc: linux-omap@vger.kernel.org
-Cc: devicetree-discuss@lists.ozlabs.org
-Cc: linux-arm-kernel@lists.infradead.org
-Cc: cpufreq@vger.kernel.org
-Cc: linux-pm@vger.kernel.org
-
-Signed-off-by: Nishanth Menon <nm@ti.com>
----
- arch/arm/mach-omap2/board-generic.c   |    5 +++++
- arch/arm/mach-omap2/cclock33xx_data.c |    2 +-
- arch/arm/mach-omap2/cclock3xxx_data.c |    3 ++-
- arch/arm/mach-omap2/cclock44xx_data.c |    3 ++-
- 4 files changed, 10 insertions(+), 3 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
-index afa509a..5b147ef 100644
---- a/arch/arm/mach-omap2/board-generic.c
-+++ b/arch/arm/mach-omap2/board-generic.c
-@@ -49,6 +49,11 @@ static void __init omap_generic_init(void)
- 		omap4_panda_display_init_of();
- 	else if (of_machine_is_compatible("ti,omap4-sdp"))
- 		omap_4430sdp_display_init_of();
-+
-+	if (IS_ENABLED(CONFIG_GENERIC_CPUFREQ_CPU0)) {
-+		struct platform_device_info devinfo = { .name = "cpufreq-cpu0", };
-+		platform_device_register_full(&devinfo);
-+	}
- }
- 
- #ifdef CONFIG_SOC_OMAP2420
-diff --git a/arch/arm/mach-omap2/cclock33xx_data.c b/arch/arm/mach-omap2/cclock33xx_data.c
-index 476b820..cf7e736 100644
---- a/arch/arm/mach-omap2/cclock33xx_data.c
-+++ b/arch/arm/mach-omap2/cclock33xx_data.c
-@@ -852,7 +852,7 @@ static struct omap_clk am33xx_clks[] = {
- 	CLK(NULL,	"dpll_core_m5_ck",	&dpll_core_m5_ck,	CK_AM33XX),
- 	CLK(NULL,	"dpll_core_m6_ck",	&dpll_core_m6_ck,	CK_AM33XX),
- 	CLK(NULL,	"dpll_mpu_ck",		&dpll_mpu_ck,	CK_AM33XX),
--	CLK("cpu0",	NULL,			&dpll_mpu_ck,	CK_AM33XX),
-+	CLK("cpufreq-cpu0.0",	NULL,			&dpll_mpu_ck,	CK_AM33XX),
- 	CLK(NULL,	"dpll_mpu_m2_ck",	&dpll_mpu_m2_ck,	CK_AM33XX),
- 	CLK(NULL,	"dpll_ddr_ck",		&dpll_ddr_ck,	CK_AM33XX),
- 	CLK(NULL,	"dpll_ddr_m2_ck",	&dpll_ddr_m2_ck,	CK_AM33XX),
-diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
-index 4579c3c..5a5b471 100644
---- a/arch/arm/mach-omap2/cclock3xxx_data.c
-+++ b/arch/arm/mach-omap2/cclock3xxx_data.c
-@@ -3501,7 +3501,8 @@ static struct omap_clk omap3xxx_clks[] = {
- 	CLK(NULL,	"uart4_ick",	&uart4_ick_am35xx,	CK_AM35XX),
- 	CLK(NULL,	"timer_32k_ck",	&omap_32k_fck,  CK_3XXX),
- 	CLK(NULL,	"timer_sys_ck",	&sys_ck,	CK_3XXX),
--	CLK(NULL,	"cpufreq_ck",	&dpll1_ck,	CK_3XXX),
-+	CLK(NULL,	"cpufreq_ck",	&dpll1_ck,	CK_3XXX), /* used in non-device tree boot */
-+	CLK("cpufreq-cpu0.0",	NULL,	&dpll1_ck,	CK_3XXX), /* used in device tree boot */
- };
- 
- static const char *enable_init_clks[] = {
-diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c
-index 3d58f33..bcea785 100644
---- a/arch/arm/mach-omap2/cclock44xx_data.c
-+++ b/arch/arm/mach-omap2/cclock44xx_data.c
-@@ -1660,7 +1660,8 @@ static struct omap_clk omap44xx_clks[] = {
- 	CLK("4013a000.timer",	"timer_sys_ck",	&syc_clk_div_ck,	CK_443X),
- 	CLK("4013c000.timer",	"timer_sys_ck",	&syc_clk_div_ck,	CK_443X),
- 	CLK("4013e000.timer",	"timer_sys_ck",	&syc_clk_div_ck,	CK_443X),
--	CLK(NULL,	"cpufreq_ck",	&dpll_mpu_ck,	CK_443X),
-+	CLK(NULL,	"cpufreq_ck",	&dpll_mpu_ck,	CK_443X), /* used in non-device tree boot */
-+	CLK("cpufreq-cpu0.0",	NULL,	&dpll_mpu_ck,	CK_443X), /* used in device tree boot */
- };
- 
- int __init omap4xxx_clk_init(void)
--- 
-1.7.10.4
-
diff --git a/patches/omap_dt/0048-cpufreq-OMAP-donot-allow-to-be-used-with-device-tree.patch b/patches/omap_dt/0048-cpufreq-OMAP-donot-allow-to-be-used-with-device-tree.patch
deleted file mode 100644
index 1d5c79f34592dc9a49f960cca6e77e9e51197aad..0000000000000000000000000000000000000000
--- a/patches/omap_dt/0048-cpufreq-OMAP-donot-allow-to-be-used-with-device-tree.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From 4d39ac7f0b706975387c22513b5dff71e550389f Mon Sep 17 00:00:00 2001
-From: Nishanth Menon <nm@ti.com>
-Date: Fri, 15 Mar 2013 12:27:55 -0500
-Subject: [PATCH 48/48] cpufreq: OMAP: donot allow to be used with device tree
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-We now use Soc generic cpufreq-cpu0 driver using DT entries.
-However to allow cpufreq-cpu0 and omap-cpufreq drivers to co-exist,
-we need to ensure the following using the same image:
-1. With device tree boot, we use cpufreq-cpu0
-2. With non device tree boot, we use omap-cpufreq
-
-In the case of (1), we will have cpu OPPs and regulator registered
-as part of the DT, to ensure that omap-cpufreq and cpufreq-cpu0 don't
-conflict in managing the frequency of the same cpu, we should not
-permit init to pass in omap-cpufreq.
-
-In the case of (2), we will not have the cpufreq-cpu0 device, hence
-only omap-cpufreq will be active.
-
-So, to acommodate both these usage conditions, we fail init of
-omap-cpufreq when we boot with device tree.
-
-Cc: Kevin Hilman <khilman@deeprootsystems.com>
-Cc: Jon Hunter <jon-hunter@ti.com>
-Cc: "Benoît Cousson" <b-cousson@ti.com>
-Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Cc: Shawn Guo <shawn.guo@linaro.org>
-Cc: Keerthy <j-keerthy@ti.com>
-Cc: linux-omap@vger.kernel.org
-Cc: devicetree-discuss@lists.ozlabs.org
-Cc: linux-arm-kernel@lists.infradead.org
-Cc: cpufreq@vger.kernel.org
-Cc: linux-pm@vger.kernel.org
-
-Signed-off-by: Nishanth Menon <nm@ti.com>
----
- drivers/cpufreq/omap-cpufreq.c |   14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
-index 9128c07..9382ed0 100644
---- a/drivers/cpufreq/omap-cpufreq.c
-+++ b/drivers/cpufreq/omap-cpufreq.c
-@@ -22,6 +22,7 @@
- #include <linux/err.h>
- #include <linux/clk.h>
- #include <linux/io.h>
-+#include <linux/of.h>
- #include <linux/opp.h>
- #include <linux/cpu.h>
- #include <linux/module.h>
-@@ -174,6 +175,19 @@ static inline void freq_table_free(void)
- static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
- {
- 	int result = 0;
-+	struct device_node *np;
-+
-+	/*
-+	 * If we have a device tree node describing OPPs,
-+	 * we will NOT permit usage of omap-cpufreq driver.
-+	 * use cpufreq-cpu0 driver to manage.
-+	 */
-+	if (of_have_populated_dt()) {
-+		for_each_child_of_node(of_find_node_by_path("/cpus"), np) {
-+			if (of_get_property(np, "operating-points", NULL))
-+				return -EPERM;
-+		}
-+	}
- 
- 	mpu_clk = clk_get(NULL, "cpufreq_ck");
- 	if (IS_ERR(mpu_clk))
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0001-ARM-OMAP3-clock-Back-propagate-rate-change-from-cam_.patch b/patches/omap_late/0001-ARM-OMAP3-clock-Back-propagate-rate-change-from-cam_.patch
deleted file mode 100644
index 8aab611e697d4e4c654b1ae18aaaf66f6519073a..0000000000000000000000000000000000000000
--- a/patches/omap_late/0001-ARM-OMAP3-clock-Back-propagate-rate-change-from-cam_.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 0d3bef4d2f37ae5043e4288ddb543bdb4901b535 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sat, 10 Nov 2012 12:04:15 +0100
-Subject: [PATCH 01/32] ARM: OMAP3: clock: Back-propagate rate change from
- cam_mclk to dpll4_m5
-
-The cam_mclk clock is generated through the following clocks chain:
-
-dpll4 -> dpll4_m5 -> dpll4_m5x2 -> cam_mclk
-
-As dpll4_m5 and dpll4_m5x2 do not driver any clock other than cam_mclk,
-back-propagate the cam_clk rate changes up to dpll4_m5.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Reviewed-by: Mike Turquette <mturquette@linaro.org>
-Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
-Tested-by: Sakari Ailus <sakari.ailus@iki.fi>
----
- arch/arm/mach-omap2/cclock3xxx_data.c |   10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
-index 6ef8758..4579c3c 100644
---- a/arch/arm/mach-omap2/cclock3xxx_data.c
-+++ b/arch/arm/mach-omap2/cclock3xxx_data.c
-@@ -426,6 +426,7 @@ static struct clk dpll4_m5x2_ck_3630 = {
- 	.parent_names	= dpll4_m5x2_ck_parent_names,
- 	.num_parents	= ARRAY_SIZE(dpll4_m5x2_ck_parent_names),
- 	.ops		= &dpll4_m5x2_ck_3630_ops,
-+	.flags		= CLK_SET_RATE_PARENT,
- };
- 
- static struct clk cam_mclk;
-@@ -443,7 +444,14 @@ static struct clk_hw_omap cam_mclk_hw = {
- 	.clkdm_name	= "cam_clkdm",
- };
- 
--DEFINE_STRUCT_CLK(cam_mclk, cam_mclk_parent_names, aes2_ick_ops);
-+static struct clk cam_mclk = {
-+	.name		= "cam_mclk",
-+	.hw		= &cam_mclk_hw.hw,
-+	.parent_names	= cam_mclk_parent_names,
-+	.num_parents	= ARRAY_SIZE(cam_mclk_parent_names),
-+	.ops		= &aes2_ick_ops,
-+	.flags		= CLK_SET_RATE_PARENT,
-+};
- 
- static const struct clksel_rate clkout2_src_core_rates[] = {
- 	{ .div = 1, .val = 0, .flags = RATE_IN_3XXX },
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0002-omap3isp-Set-cam_mclk-rate-directly.patch b/patches/omap_late/0002-omap3isp-Set-cam_mclk-rate-directly.patch
deleted file mode 100644
index 4c1f8cf96e381233462ffdb882b119106019eae3..0000000000000000000000000000000000000000
--- a/patches/omap_late/0002-omap3isp-Set-cam_mclk-rate-directly.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From 2d0f131b5580faea5e48b24059df320c31d2f7e1 Mon Sep 17 00:00:00 2001
-From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Date: Sat, 10 Nov 2012 12:06:25 +0100
-Subject: [PATCH 02/32] omap3isp: Set cam_mclk rate directly
-
-Now that the cam_mclk rate changes are back-propagated to dpll4_m5_ck we
-can set the cam_mclk rate directly instead of manually setting the rate
-of the parent clock.
-
-Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-Reviewed-by: Mike Turquette <mturquette@linaro.org>
-Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
-Tested-by: Sakari Ailus <sakari.ailus@iki.fi>
----
- drivers/media/platform/omap3isp/isp.c |   18 ++----------------
- drivers/media/platform/omap3isp/isp.h |    8 +++-----
- 2 files changed, 5 insertions(+), 21 deletions(-)
-
-diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
-index 383a727..6e5ad8e 100644
---- a/drivers/media/platform/omap3isp/isp.c
-+++ b/drivers/media/platform/omap3isp/isp.c
-@@ -1338,28 +1338,15 @@ static int isp_enable_clocks(struct isp_device *isp)
- {
- 	int r;
- 	unsigned long rate;
--	int divisor;
--
--	/*
--	 * cam_mclk clock chain:
--	 *   dpll4 -> dpll4_m5 -> dpll4_m5x2 -> cam_mclk
--	 *
--	 * In OMAP3630 dpll4_m5x2 != 2 x dpll4_m5 but both are
--	 * set to the same value. Hence the rate set for dpll4_m5
--	 * has to be twice of what is set on OMAP3430 to get
--	 * the required value for cam_mclk
--	 */
--	divisor = isp->revision == ISP_REVISION_15_0 ? 1 : 2;
- 
- 	r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_ICK]);
- 	if (r) {
- 		dev_err(isp->dev, "failed to enable cam_ick clock\n");
- 		goto out_clk_enable_ick;
- 	}
--	r = clk_set_rate(isp->clock[ISP_CLK_DPLL4_M5_CK],
--			 CM_CAM_MCLK_HZ/divisor);
-+	r = clk_set_rate(isp->clock[ISP_CLK_CAM_MCLK], CM_CAM_MCLK_HZ);
- 	if (r) {
--		dev_err(isp->dev, "clk_set_rate for dpll4_m5_ck failed\n");
-+		dev_err(isp->dev, "clk_set_rate for cam_mclk failed\n");
- 		goto out_clk_enable_mclk;
- 	}
- 	r = clk_prepare_enable(isp->clock[ISP_CLK_CAM_MCLK]);
-@@ -1401,7 +1388,6 @@ static void isp_disable_clocks(struct isp_device *isp)
- static const char *isp_clocks[] = {
- 	"cam_ick",
- 	"cam_mclk",
--	"dpll4_m5_ck",
- 	"csi2_96m_fck",
- 	"l3_ick",
- };
-diff --git a/drivers/media/platform/omap3isp/isp.h b/drivers/media/platform/omap3isp/isp.h
-index 517d348..c77e1f2 100644
---- a/drivers/media/platform/omap3isp/isp.h
-+++ b/drivers/media/platform/omap3isp/isp.h
-@@ -147,7 +147,6 @@ struct isp_platform_callback {
-  * @ref_count: Reference count for handling multiple ISP requests.
-  * @cam_ick: Pointer to camera interface clock structure.
-  * @cam_mclk: Pointer to camera functional clock structure.
-- * @dpll4_m5_ck: Pointer to DPLL4 M5 clock structure.
-  * @csi2_fck: Pointer to camera CSI2 complexIO clock structure.
-  * @l3_ick: Pointer to OMAP3 L3 bus interface clock.
-  * @irq: Currently attached ISP ISR callbacks information structure.
-@@ -189,10 +188,9 @@ struct isp_device {
- 	u32 xclk_divisor[2];	/* Two clocks, a and b. */
- #define ISP_CLK_CAM_ICK		0
- #define ISP_CLK_CAM_MCLK	1
--#define ISP_CLK_DPLL4_M5_CK	2
--#define ISP_CLK_CSI2_FCK	3
--#define ISP_CLK_L3_ICK		4
--	struct clk *clock[5];
-+#define ISP_CLK_CSI2_FCK	2
-+#define ISP_CLK_L3_ICK		3
-+	struct clk *clock[4];
- 
- 	/* ISP modules */
- 	struct ispstat isp_af;
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0003-ARM-OMAP2-dpll-am335x-avoid-freqsel.patch b/patches/omap_late/0003-ARM-OMAP2-dpll-am335x-avoid-freqsel.patch
deleted file mode 100644
index 3bd3020d2ccc60d87644a05a44d48e304c317852..0000000000000000000000000000000000000000
--- a/patches/omap_late/0003-ARM-OMAP2-dpll-am335x-avoid-freqsel.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From e993637f1e71d96783734468f8504eb1b68b9eda Mon Sep 17 00:00:00 2001
-From: Afzal Mohammed <afzal@ti.com>
-Date: Thu, 31 Jan 2013 09:24:52 -0700
-Subject: [PATCH 03/32] ARM: OMAP2+: dpll: am335x - avoid freqsel
-
-am335x does not have freqsel, avoid it.
-
-Signed-off-by: Afzal Mohammed <afzal@ti.com>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/dpll3xxx.c |    5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
-index 0a02aab..3aed4b0 100644
---- a/arch/arm/mach-omap2/dpll3xxx.c
-+++ b/arch/arm/mach-omap2/dpll3xxx.c
-@@ -500,8 +500,9 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
- 		if (dd->last_rounded_rate == 0)
- 			return -EINVAL;
- 
--		/* No freqsel on OMAP4 and OMAP3630 */
--		if (!cpu_is_omap44xx() && !cpu_is_omap3630()) {
-+		/* No freqsel on AM335x, OMAP4 and OMAP3630 */
-+		if (!soc_is_am33xx() && !cpu_is_omap44xx() &&
-+		    !cpu_is_omap3630()) {
- 			freqsel = _omap3_dpll_compute_freqsel(clk,
- 						dd->last_rounded_n);
- 			WARN_ON(!freqsel);
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0004-ARM-OMAP2-clock-data-add-DEFINE_STRUCT_CLK_FLAGS-hel.patch b/patches/omap_late/0004-ARM-OMAP2-clock-data-add-DEFINE_STRUCT_CLK_FLAGS-hel.patch
deleted file mode 100644
index c487a0e5d7a7253042fea19b521ec103e50b7a3d..0000000000000000000000000000000000000000
--- a/patches/omap_late/0004-ARM-OMAP2-clock-data-add-DEFINE_STRUCT_CLK_FLAGS-hel.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From baee75de4ceecc447b53d68a0f98b759eb3921ba Mon Sep 17 00:00:00 2001
-From: Afzal Mohammed <afzal@ti.com>
-Date: Wed, 23 Jan 2013 17:12:05 +0530
-Subject: [PATCH 04/32] ARM: OMAP2+: clock data: add DEFINE_STRUCT_CLK_FLAGS
- helper
-
-DEFINE_STRUCT_CLK does not have the capability to set flags, define
-DEFINE_STRUCT_CLK_FLAGS to handle flags. This is needed to add
-SET_RATE_PARENT flag in statically defined lcd clock in am335x.
-
-Signed-off-by: Afzal Mohammed <afzal@ti.com>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/clock.h |   11 +++++++++++
- 1 file changed, 11 insertions(+)
-
-diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
-index b402048..60ddd86 100644
---- a/arch/arm/mach-omap2/clock.h
-+++ b/arch/arm/mach-omap2/clock.h
-@@ -65,6 +65,17 @@ struct clockdomain;
- 		.ops = &_clkops_name,				\
- 	};
- 
-+#define DEFINE_STRUCT_CLK_FLAGS(_name, _parent_array_name,	\
-+				_clkops_name, _flags)		\
-+	static struct clk _name = {				\
-+		.name = #_name,					\
-+		.hw = &_name##_hw.hw,				\
-+		.parent_names = _parent_array_name,		\
-+		.num_parents = ARRAY_SIZE(_parent_array_name),	\
-+		.ops = &_clkops_name,				\
-+		.flags = _flags,				\
-+	};
-+
- #define DEFINE_STRUCT_CLK_HW_OMAP(_name, _clkdm_name)		\
- 	static struct clk_hw_omap _name##_hw = {		\
- 		.hw = {						\
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0005-ARM-OMAP-AM33XX-clock-data-SET_RATE_PARENT-in-lcd-pa.patch b/patches/omap_late/0005-ARM-OMAP-AM33XX-clock-data-SET_RATE_PARENT-in-lcd-pa.patch
deleted file mode 100644
index b8bc34885fd0d9cecc4f75b6ca9a47d13e4082d1..0000000000000000000000000000000000000000
--- a/patches/omap_late/0005-ARM-OMAP-AM33XX-clock-data-SET_RATE_PARENT-in-lcd-pa.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 1c59bb99d4790ff2f2e2b3e2dafc548e81ac1c1e Mon Sep 17 00:00:00 2001
-From: Afzal Mohammed <afzal@ti.com>
-Date: Wed, 23 Jan 2013 17:12:11 +0530
-Subject: [PATCH 05/32] ARM: OMAP AM33XX: clock data: SET_RATE_PARENT in lcd
- path
-
-LCDC clock node is a one that does not have set rate capability. It
-just passes on the rate that is sent downstream by it's parent. While
-lcdc clock parent and it's grand parent - dpll_disp_m2_ck and
-dpll_disp_ck has the capability to configure rate.
-
-And the default rates provided by LCDC clock's ancestors are not
-sufficient to obtain pixel clock for current LCDC use cases, hence
-currently display would not work on AM335x SoC's (with driver
-modifications in platfrom independent way).
-
-Hence inform clock framework to propogate set rate for LCDC clock as
-well as it's parent - dpll_disp_m2_ck. With this change, set rate on
-LCDC clock would get propogated till dpll_disp_ck via dpll_disp_m2_ck,
-hence allowing the driver (same driver is used in DaVinci too) to set
-rates using LCDC clock without worrying about platform dependent clock
-details.
-
-Signed-off-by: Afzal Mohammed <afzal@ti.com>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/cclock33xx_data.c |   10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/cclock33xx_data.c b/arch/arm/mach-omap2/cclock33xx_data.c
-index ea64ad6..476b820 100644
---- a/arch/arm/mach-omap2/cclock33xx_data.c
-+++ b/arch/arm/mach-omap2/cclock33xx_data.c
-@@ -284,9 +284,10 @@ DEFINE_STRUCT_CLK(dpll_disp_ck, dpll_core_ck_parents, dpll_ddr_ck_ops);
-  * TODO: Add clksel here (sys_clkin, CORE_CLKOUTM6, PER_CLKOUTM2
-  * and ALT_CLK1/2)
-  */
--DEFINE_CLK_DIVIDER(dpll_disp_m2_ck, "dpll_disp_ck", &dpll_disp_ck, 0x0,
--		   AM33XX_CM_DIV_M2_DPLL_DISP, AM33XX_DPLL_CLKOUT_DIV_SHIFT,
--		   AM33XX_DPLL_CLKOUT_DIV_WIDTH, CLK_DIVIDER_ONE_BASED, NULL);
-+DEFINE_CLK_DIVIDER(dpll_disp_m2_ck, "dpll_disp_ck", &dpll_disp_ck,
-+		   CLK_SET_RATE_PARENT, AM33XX_CM_DIV_M2_DPLL_DISP,
-+		   AM33XX_DPLL_CLKOUT_DIV_SHIFT, AM33XX_DPLL_CLKOUT_DIV_WIDTH,
-+		   CLK_DIVIDER_ONE_BASED, NULL);
- 
- /* DPLL_PER */
- static struct dpll_data dpll_per_dd = {
-@@ -723,7 +724,8 @@ static struct clk_hw_omap lcd_gclk_hw = {
- 	.clksel_mask	= AM33XX_CLKSEL_0_1_MASK,
- };
- 
--DEFINE_STRUCT_CLK(lcd_gclk, lcd_ck_parents, gpio_fck_ops);
-+DEFINE_STRUCT_CLK_FLAGS(lcd_gclk, lcd_ck_parents,
-+			gpio_fck_ops, CLK_SET_RATE_PARENT);
- 
- DEFINE_CLK_FIXED_FACTOR(mmc_clk, "dpll_per_m2_ck", &dpll_per_m2_ck, 0x0, 1, 2);
- 
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0006-ARM-OMAP2-AM33xx-Add-SoC-specific-restart-hook.patch b/patches/omap_late/0006-ARM-OMAP2-AM33xx-Add-SoC-specific-restart-hook.patch
deleted file mode 100644
index a55f510165149f52f03baf3303454f3b6b0d4f17..0000000000000000000000000000000000000000
--- a/patches/omap_late/0006-ARM-OMAP2-AM33xx-Add-SoC-specific-restart-hook.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From 87a0a2af66293c234ebb05a3756bfaebce36ea12 Mon Sep 17 00:00:00 2001
-From: "Jean-Sebastien A. Beaudry" <jsabeaudry@handyem.com>
-Date: Wed, 23 Jan 2013 16:02:40 -0500
-Subject: [PATCH 06/32] ARM: OMAP2+: AM33xx: Add SoC specific restart hook
-
-Add restart hook so that DTS based AM33xx builds can restart
-the platform.
-
-Tested-by: Nishanth Menon <nm@ti.com>
-Signed-off-by: Jean-Sebastien A. Beaudry <jsabeaudry@handyem.com>
-Signed-off-by: Tony Lindgren <tony@atomide.com>
----
- arch/arm/mach-omap2/Makefile         |    1 +
- arch/arm/mach-omap2/am33xx-restart.c |   34 ++++++++++++++++++++++++++++++++++
- arch/arm/mach-omap2/board-generic.c  |    1 +
- arch/arm/mach-omap2/common.h         |    8 ++++++++
- 4 files changed, 44 insertions(+)
- create mode 100644 arch/arm/mach-omap2/am33xx-restart.c
-
-diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
-index ff528df..3643c0b 100644
---- a/arch/arm/mach-omap2/Makefile
-+++ b/arch/arm/mach-omap2/Makefile
-@@ -56,6 +56,7 @@ AFLAGS_sram34xx.o			:=-Wa,-march=armv7-a
- # Restart code (OMAP4/5 currently in omap4-common.c)
- obj-$(CONFIG_SOC_OMAP2420)		+= omap2-restart.o
- obj-$(CONFIG_SOC_OMAP2430)		+= omap2-restart.o
-+obj-$(CONFIG_SOC_AM33XX)		+= am33xx-restart.o
- obj-$(CONFIG_ARCH_OMAP3)		+= omap3-restart.o
- 
- # Pin multiplexing
-diff --git a/arch/arm/mach-omap2/am33xx-restart.c b/arch/arm/mach-omap2/am33xx-restart.c
-new file mode 100644
-index 0000000..88e4fa8
---- /dev/null
-+++ b/arch/arm/mach-omap2/am33xx-restart.c
-@@ -0,0 +1,34 @@
-+/*
-+ * am33xx-restart.c - Code common to all AM33xx machines.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+#include <linux/kernel.h>
-+
-+#include "common.h"
-+#include "prm-regbits-33xx.h"
-+#include "prm33xx.h"
-+
-+/**
-+ * am3xx_restart - trigger a software restart of the SoC
-+ * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
-+ * @cmd: passed from the userspace program rebooting the system (if provided)
-+ *
-+ * Resets the SoC.  For @cmd, see the 'reboot' syscall in
-+ * kernel/sys.c.  No return value.
-+ */
-+void am33xx_restart(char mode, const char *cmd)
-+{
-+	/* TODO: Handle mode and cmd if necessary */
-+
-+	am33xx_prm_rmw_reg_bits(AM33XX_GLOBAL_WARM_SW_RST_MASK,
-+				AM33XX_GLOBAL_WARM_SW_RST_MASK,
-+				AM33XX_PRM_DEVICE_MOD,
-+				AM33XX_PRM_RSTCTRL_OFFSET);
-+
-+	/* OCP barrier */
-+	(void)am33xx_prm_read_reg(AM33XX_PRM_DEVICE_MOD,
-+				  AM33XX_PRM_RSTCTRL_OFFSET);
-+}
-diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
-index 2590463..0274ff7 100644
---- a/arch/arm/mach-omap2/board-generic.c
-+++ b/arch/arm/mach-omap2/board-generic.c
-@@ -140,6 +140,7 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
- 	.init_machine	= omap_generic_init,
- 	.init_time	= omap3_am33xx_gptimer_timer_init,
- 	.dt_compat	= am33xx_boards_compat,
-+	.restart	= am33xx_restart,
- MACHINE_END
- #endif
- 
-diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
-index b435027..0a6b9c7 100644
---- a/arch/arm/mach-omap2/common.h
-+++ b/arch/arm/mach-omap2/common.h
-@@ -119,6 +119,14 @@ static inline void omap2xxx_restart(char mode, const char *cmd)
- }
- #endif
- 
-+#ifdef CONFIG_SOC_AM33XX
-+void am33xx_restart(char mode, const char *cmd);
-+#else
-+static inline void am33xx_restart(char mode, const char *cmd)
-+{
-+}
-+#endif
-+
- #ifdef CONFIG_ARCH_OMAP3
- void omap3xxx_restart(char mode, const char *cmd);
- #else
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0007-ARM-OMAP2-Get-rid-of-custom-OMAP_32K_TIMER_HZ.patch b/patches/omap_late/0007-ARM-OMAP2-Get-rid-of-custom-OMAP_32K_TIMER_HZ.patch
deleted file mode 100644
index 653ca540e74d59c575419fd2f0e8aa86c47bdcb1..0000000000000000000000000000000000000000
--- a/patches/omap_late/0007-ARM-OMAP2-Get-rid-of-custom-OMAP_32K_TIMER_HZ.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 1882b85370dc6106dcafb98434119ff27622798b Mon Sep 17 00:00:00 2001
-From: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Date: Thu, 31 Jan 2013 21:02:00 +0530
-Subject: [PATCH 07/32] ARM: OMAP2+: Get rid of custom OMAP_32K_TIMER_HZ
-
-The timekeeping doesn't depend on HZ value in presence of fine grained
-clocksource and hence there should not be any time drift because of HZ
-value which was chosen to be divisor of 32768.
-
-OMAP has been using HZ = 128 value to avoid any time drift issues
-because of 32768 HZ clock. But with various measurements performed
-with HZ = 100, no time drift is observed and it also proves the
-point about HZ not having impact on time keeping on OMAP.
-
-Very informative thread on this topic is here:
-	https://lkml.org/lkml/2013/1/29/435
-
-Special thanks to John Stulz, Arnd Bergmann and Russell King for their
-valuable suggestions.
-
-Cc: Arnd Bergmann <arnd@arndb.de>
-Cc: Russell King <linux@arm.linux.org.uk>
-Cc: John Stultz <john.stultz@linaro.org>
-Cc: Tony Lindgren <tony@atomide.com>
-
-Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Tested-by: Lokesh Vutla <lokeshvutla@ti.com>
-Signed-off-by: Tony Lindgren <tony@atomide.com>
----
- arch/arm/Kconfig                        |    1 -
- arch/arm/plat-omap/Kconfig              |    9 ---------
- arch/arm/plat-omap/include/plat/timex.h |    8 --------
- 3 files changed, 18 deletions(-)
-
-diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index a955d89..65c6276 100644
---- a/arch/arm/Kconfig
-+++ b/arch/arm/Kconfig
-@@ -1654,7 +1654,6 @@ config HZ
- 	int
- 	default 200 if ARCH_EBSA110 || ARCH_S3C24XX || ARCH_S5P64X0 || \
- 		ARCH_S5PV210 || ARCH_EXYNOS4
--	default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER
- 	default AT91_TIMER_HZ if ARCH_AT91
- 	default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE
- 	default 100
-diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
-index 67c859c..ce66eb9 100644
---- a/arch/arm/plat-omap/Kconfig
-+++ b/arch/arm/plat-omap/Kconfig
-@@ -147,15 +147,6 @@ config OMAP3_L2_AUX_SECURE_SERVICE_SET_ID
- 	help
- 	  PPA routine service ID for setting L2 auxiliary control register.
- 
--config OMAP_32K_TIMER_HZ
--	int "Kernel internal timer frequency for 32KHz timer"
--	range 32 1024
--	depends on OMAP_32K_TIMER
--	default "128"
--	help
--	  Kernel internal timer frequency should be a divisor of 32768,
--	  such as 64 or 128.
--
- config OMAP_DM_TIMER
- 	bool "Use dual-mode timer"
- 	depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS
-diff --git a/arch/arm/plat-omap/include/plat/timex.h b/arch/arm/plat-omap/include/plat/timex.h
-index 6d35767..e27d2da 100644
---- a/arch/arm/plat-omap/include/plat/timex.h
-+++ b/arch/arm/plat-omap/include/plat/timex.h
-@@ -28,14 +28,6 @@
- #if !defined(__ASM_ARCH_OMAP_TIMEX_H)
- #define __ASM_ARCH_OMAP_TIMEX_H
- 
--/*
-- * OMAP 32KHz timer updates time one jiffie at a time from a secondary timer,
-- * and that's why the CLOCK_TICK_RATE is not 32768.
-- */
--#ifdef CONFIG_OMAP_32K_TIMER
--#define CLOCK_TICK_RATE		(CONFIG_OMAP_32K_TIMER_HZ)
--#else
- #define CLOCK_TICK_RATE		(HZ * 100000UL)
--#endif
- 
- #endif /* __ASM_ARCH_OMAP_TIMEX_H */
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0008-ARM-OMAP2-AM33XX-id-Add-support-for-AM335x-PG2.0.patch b/patches/omap_late/0008-ARM-OMAP2-AM33XX-id-Add-support-for-AM335x-PG2.0.patch
deleted file mode 100644
index e5ab60fea0fcac0d0a432a4bcec73b229d06f226..0000000000000000000000000000000000000000
--- a/patches/omap_late/0008-ARM-OMAP2-AM33XX-id-Add-support-for-AM335x-PG2.0.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From baa25474f6117779a49969872f475711df400c4c Mon Sep 17 00:00:00 2001
-From: AnilKumar Ch <anilkumar@ti.com>
-Date: Fri, 1 Feb 2013 15:58:22 +0530
-Subject: [PATCH 08/32] ARM: OMAP2: AM33XX: id: Add support for AM335x PG2.0
-
-Add support for chip id recognition of AM335x PG2.0 silicon. By default
-omap3xxx_check_revision() recognizes PG1.0, which is extended by adding
-PG2.0 support
-
-Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
-Signed-off-by: Tony Lindgren <tony@atomide.com>
----
- arch/arm/mach-omap2/id.c  |   14 ++++++++++++--
- arch/arm/mach-omap2/soc.h |    1 +
- 2 files changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
-index 45cc7ed4..8a68f1e 100644
---- a/arch/arm/mach-omap2/id.c
-+++ b/arch/arm/mach-omap2/id.c
-@@ -399,8 +399,18 @@ void __init omap3xxx_check_revision(void)
- 		}
- 		break;
- 	case 0xb944:
--		omap_revision = AM335X_REV_ES1_0;
--		cpu_rev = "1.0";
-+		switch (rev) {
-+		case 0:
-+			omap_revision = AM335X_REV_ES1_0;
-+			cpu_rev = "1.0";
-+			break;
-+		case 1:
-+		/* FALLTHROUGH */
-+		default:
-+			omap_revision = AM335X_REV_ES2_0;
-+			cpu_rev = "2.0";
-+			break;
-+		}
- 		break;
- 	case 0xb8f2:
- 		switch (rev) {
-diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
-index 092aedd..c62116b 100644
---- a/arch/arm/mach-omap2/soc.h
-+++ b/arch/arm/mach-omap2/soc.h
-@@ -395,6 +395,7 @@ IS_OMAP_TYPE(3430, 0x3430)
- 
- #define AM335X_CLASS		0x33500033
- #define AM335X_REV_ES1_0	AM335X_CLASS
-+#define AM335X_REV_ES2_0	(AM335X_CLASS | (0x1 << 8))
- 
- #define OMAP443X_CLASS		0x44300044
- #define OMAP4430_REV_ES1_0	(OMAP443X_CLASS | (0x10 << 8))
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0009-ARM-OMAP2xxx-PM-enter-WFI-via-inline-asm-if-CORE-sta.patch b/patches/omap_late/0009-ARM-OMAP2xxx-PM-enter-WFI-via-inline-asm-if-CORE-sta.patch
deleted file mode 100644
index e090c01b3182058f95802c7673002930113158e5..0000000000000000000000000000000000000000
--- a/patches/omap_late/0009-ARM-OMAP2xxx-PM-enter-WFI-via-inline-asm-if-CORE-sta.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From 30be7bb26844f4e93c996e9bde8e01b9d0c4191e Mon Sep 17 00:00:00 2001
-From: Paul Walmsley <paul@pwsan.com>
-Date: Sun, 30 Dec 2012 10:15:48 -0700
-Subject: [PATCH 9/9] ARM: OMAP2xxx: PM: enter WFI via inline asm if CORE
- stays active
-
-There shouldn't be any need to jump to SRAM code if the OMAP CORE
-clockdomain (and consequently the SDRAM controller and CORE PLL) stays
-active during MPU WFI.  The SRAM code should only be needed when the RAM
-enters self-refresh.  So in the case where CORE stays active, just call
-WFI directly from the mach-omap2/pm24xx.c code.  This removes some
-unnecessary SRAM code.
-
-This second version replaces the inline WFI with the corresponding
-coprocessor register call, using tlbflush.h as an example.  This is
-because the assembler doesn't recognize WFI as a valid ARMv6
-instruction.
-
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
-Cc: Richard Woodruff <r-woodruff2@ti.com>
-Cc: Kevin Hilman <khilman@deeprootsystems.com>
----
- arch/arm/mach-omap2/pm24xx.c    |   12 ++++++------
- arch/arm/mach-omap2/sleep24xx.S |   19 -------------------
- 2 files changed, 6 insertions(+), 25 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
-index b2a4df6..b59d939 100644
---- a/arch/arm/mach-omap2/pm24xx.c
-+++ b/arch/arm/mach-omap2/pm24xx.c
-@@ -54,7 +54,6 @@
- #include "powerdomain.h"
- #include "clockdomain.h"
- 
--static void (*omap2_sram_idle)(void);
- static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl,
- 				  void __iomem *sdrc_power);
- 
-@@ -163,6 +162,8 @@ static int omap2_allow_mpu_retention(void)
- 
- static void omap2_enter_mpu_retention(void)
- {
-+	const int zero = 0;
-+
- 	/* The peripherals seem not to be able to wake up the MPU when
- 	 * it is in retention mode. */
- 	if (omap2_allow_mpu_retention()) {
-@@ -179,7 +180,8 @@ static void omap2_enter_mpu_retention(void)
- 		pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
- 	}
- 
--	omap2_sram_idle();
-+	/* WFI */
-+	asm("mcr p15, 0, %0, c7, c0, 4" : : "r" (zero) : "memory", "cc");
- 
- 	pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
- }
-@@ -333,11 +335,9 @@ int __init omap2_pm_init(void)
- 	/*
- 	 * We copy the assembler sleep/wakeup routines to SRAM.
- 	 * These routines need to be in SRAM as that's the only
--	 * memory the MPU can see when it wakes up.
-+	 * memory the MPU can see when it wakes up after the entire
-+	 * chip enters idle.
- 	 */
--	omap2_sram_idle = omap_sram_push(omap24xx_idle_loop_suspend,
--					 omap24xx_idle_loop_suspend_sz);
--
- 	omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend,
- 					    omap24xx_cpu_suspend_sz);
- 
-diff --git a/arch/arm/mach-omap2/sleep24xx.S b/arch/arm/mach-omap2/sleep24xx.S
-index ce0ccd2..1d3cb25 100644
---- a/arch/arm/mach-omap2/sleep24xx.S
-+++ b/arch/arm/mach-omap2/sleep24xx.S
-@@ -37,25 +37,6 @@
- 	.text
- 
- /*
-- * Forces OMAP into idle state
-- *
-- * omap24xx_idle_loop_suspend() - This bit of code just executes the WFI
-- * for normal idles.
-- *
-- * Note: This code get's copied to internal SRAM at boot. When the OMAP
-- *	 wakes up it continues execution at the point it went to sleep.
-- */
--	.align	3
--ENTRY(omap24xx_idle_loop_suspend)
--	stmfd	sp!, {r0, lr}		@ save registers on stack
--	mov	r0, #0			@ clear for mcr setup
--	mcr	p15, 0, r0, c7, c0, 4	@ wait for interrupt
--	ldmfd	sp!, {r0, pc}		@ restore regs and return
--
--ENTRY(omap24xx_idle_loop_suspend_sz)
--	.word	. - omap24xx_idle_loop_suspend
--
--/*
-  * omap24xx_cpu_suspend() - Forces OMAP into deep sleep state by completing
-  * SDRC shutdown then ARM shutdown.  Upon wake MPU is back on so just restore
-  * SDRC.
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0010-ARM-OMAP-AM3517-05-hwmod-data-block-WFI-when-EMAC-ac.patch b/patches/omap_late/0010-ARM-OMAP-AM3517-05-hwmod-data-block-WFI-when-EMAC-ac.patch
deleted file mode 100644
index 7c9017ba1726b436d91ccbf85dec56f470d69292..0000000000000000000000000000000000000000
--- a/patches/omap_late/0010-ARM-OMAP-AM3517-05-hwmod-data-block-WFI-when-EMAC-ac.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 250f40d784f41e1cb618457002496bb74fb5f162 Mon Sep 17 00:00:00 2001
-From: Paul Walmsley <paul@pwsan.com>
-Date: Wed, 6 Feb 2013 13:48:56 -0700
-Subject: [PATCH 10/32] ARM: OMAP AM3517/05: hwmod data: block WFI when EMAC
- active
-
-According to Mark Greer, on OMAP AM3517/3505 chips, the EMAC is unable
-to wake the ARM up from WFI:
-
-    http://www.spinics.net/lists/arm-kernel/msg174734.html
-
-Further troubleshooting was unable to narrow the problem down.  So we
-don't have much choice other than to block WFI when the EMAC is active
-with the HWMOD_BLOCK_WFI flag.
-
-Based on Mark's original patch.  We're removing the omap_device-based
-pm_lats code, so a different approach was needed.
-
-This third version contains some corrections thanks to Mark's review.
-
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
-Cc: Mark A. Greer <mgreer@animalcreek.com>
-Acked-by: Mark A. Greer <mgreer@animalcreek.com>
----
- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |    7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
-index 8bb2628..ac7e03e 100644
---- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
-+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
-@@ -3493,7 +3493,12 @@ static struct omap_hwmod am35xx_emac_hwmod = {
- 	.name		= "davinci_emac",
- 	.mpu_irqs	= am35xx_emac_mpu_irqs,
- 	.class		= &am35xx_emac_class,
--	.flags		= HWMOD_NO_IDLEST,
-+	/*
-+	 * According to Mark Greer, the MPU will not return from WFI
-+	 * when the EMAC signals an interrupt.
-+	 * http://www.spinics.net/lists/arm-kernel/msg174734.html
-+	 */
-+	.flags		= (HWMOD_NO_IDLEST | HWMOD_BLOCK_WFI),
- };
- 
- /* l3_core -> davinci emac interface */
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0011-ARM-OMAP4-PM-Warn-users-about-usage-of-older-bootloa.patch b/patches/omap_late/0011-ARM-OMAP4-PM-Warn-users-about-usage-of-older-bootloa.patch
deleted file mode 100644
index e98edb80143acf52656f25f6058234cff9eb34a8..0000000000000000000000000000000000000000
--- a/patches/omap_late/0011-ARM-OMAP4-PM-Warn-users-about-usage-of-older-bootloa.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-From d542ae8a0e16dfe301b865b80d8e8567ff5915fd Mon Sep 17 00:00:00 2001
-From: Rajendra Nayak <rnayak@ti.com>
-Date: Mon, 4 Feb 2013 17:54:43 +0530
-Subject: [PATCH 11/32] ARM: OMAP4: PM: Warn users about usage of older
- bootloaders
-
-OMAP4 CHIP level PM works only with newer bootloaders. The
-dependency on the bootloader comes from the fact that the
-kernel is missing reset and initialization code for some
-devices.
-
-While the right thing to do is to add reset and init code in
-the kernel, for some co-processor IP blocks like DSP and IVA
-it means downloading firmware into each one of them to execute
-idle instructions.
-
-While a feasible solution is worked upon on how such IP blocks
-can be better handled in the kernel, in the interim, to avoid
-any further frustration to users testing PM on OMAP4 and finding
-it broken, warn them about the bootloader being a possible
-cause.
-
-Signed-off-by: Rajendra Nayak <rnayak@ti.com>
-Cc: Tero Kristo <t-kristo@ti.com>
-Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Cc: R Sricharan <r.sricharan@ti.com>
-[paul@pwsan.com: tweaked warning messages and comments slightly]
-Acked-by: Kevin Hilman <khilman@linaro.org>
-[paul@pwsan.com: fixed checkpatch warning]
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/pm44xx.c |   21 +++++++++++++++++++--
- 1 file changed, 19 insertions(+), 2 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
-index aa6fd98..ea62e75 100644
---- a/arch/arm/mach-omap2/pm44xx.c
-+++ b/arch/arm/mach-omap2/pm44xx.c
-@@ -77,10 +77,20 @@ static int omap4_pm_suspend(void)
- 		omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state);
- 		pwrdm_set_logic_retst(pwrst->pwrdm, pwrst->saved_logic_state);
- 	}
--	if (ret)
-+	if (ret) {
- 		pr_crit("Could not enter target state in pm_suspend\n");
--	else
-+		/*
-+		 * OMAP4 chip PM currently works only with certain (newer)
-+		 * versions of bootloaders. This is due to missing code in the
-+		 * kernel to properly reset and initialize some devices.
-+		 * Warn the user about the bootloader version being one of the
-+		 * possible causes.
-+		 * http://www.spinics.net/lists/arm-kernel/msg218641.html
-+		 */
-+		pr_warn("A possible cause could be an old bootloader - try u-boot >= v2012.07\n");
-+	} else {
- 		pr_info("Successfully put all powerdomains to target state\n");
-+	}
- 
- 	return 0;
- }
-@@ -146,6 +156,13 @@ int __init omap4_pm_init(void)
- 	}
- 
- 	pr_err("Power Management for TI OMAP4.\n");
-+	/*
-+	 * OMAP4 chip PM currently works only with certain (newer)
-+	 * versions of bootloaders. This is due to missing code in the
-+	 * kernel to properly reset and initialize some devices.
-+	 * http://www.spinics.net/lists/arm-kernel/msg218641.html
-+	 */
-+	pr_warn("OMAP4 PM: u-boot >= v2012.07 is required for full PM support\n");
- 
- 	ret = pwrdm_for_each(pwrdms_setup, NULL);
- 	if (ret) {
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0012-ARM-OMAP2-AM33XX-CM-Get-rid-of-unnecessary-header-in.patch b/patches/omap_late/0012-ARM-OMAP2-AM33XX-CM-Get-rid-of-unnecessary-header-in.patch
deleted file mode 100644
index e27b56421228d7b5eb13b4bdb84b258ca772bd9e..0000000000000000000000000000000000000000
--- a/patches/omap_late/0012-ARM-OMAP2-AM33XX-CM-Get-rid-of-unnecessary-header-in.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From a4bb27828a97d192ee4d2cac3f90482d88d08b4d Mon Sep 17 00:00:00 2001
-From: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Date: Tue, 29 Jan 2013 16:45:00 +0530
-Subject: [PATCH 12/32] ARM: OMAP2+: AM33XX: CM: Get rid of unnecessary header
- inclusions
-
-cm33xx.h unnecessarily includes a lot of header files.
-Get rid of these and directly include "iomap.h" which
-is needed to keep things compiling.
-
-Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/cm33xx.h |    7 +------
- 1 file changed, 1 insertion(+), 6 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/cm33xx.h b/arch/arm/mach-omap2/cm33xx.h
-index 5fa0b62..8009e13 100644
---- a/arch/arm/mach-omap2/cm33xx.h
-+++ b/arch/arm/mach-omap2/cm33xx.h
-@@ -17,16 +17,11 @@
- #ifndef __ARCH_ARM_MACH_OMAP2_CM_33XX_H
- #define __ARCH_ARM_MACH_OMAP2_CM_33XX_H
- 
--#include <linux/delay.h>
--#include <linux/errno.h>
--#include <linux/err.h>
--#include <linux/io.h>
--
- #include "common.h"
- 
- #include "cm.h"
- #include "cm-regbits-33xx.h"
--#include "cm33xx.h"
-+#include "iomap.h"
- 
- /* CM base address */
- #define AM33XX_CM_BASE		0x44e00000
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0013-ARM-OMAP2-AM33XX-CM-PRM-Use-__ASSEMBLER__-macros-in-.patch b/patches/omap_late/0013-ARM-OMAP2-AM33XX-CM-PRM-Use-__ASSEMBLER__-macros-in-.patch
deleted file mode 100644
index 7c23d6cc99a2a12be1b740db805136ce5fa0c467..0000000000000000000000000000000000000000
--- a/patches/omap_late/0013-ARM-OMAP2-AM33XX-CM-PRM-Use-__ASSEMBLER__-macros-in-.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 0101fdc3e33dd7c5728fd0cc9e763c92cdeb41ab Mon Sep 17 00:00:00 2001
-From: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Date: Tue, 29 Jan 2013 16:45:01 +0530
-Subject: [PATCH 13/32] ARM: OMAP2+: AM33XX: CM/PRM: Use __ASSEMBLER__ macros
- in header files
-
-This is necessary to ensure that macros declared here can
-be reused from assembly files.
-
-Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/cm33xx.h  |    2 ++
- arch/arm/mach-omap2/prm33xx.h |    2 ++
- 2 files changed, 4 insertions(+)
-
-diff --git a/arch/arm/mach-omap2/cm33xx.h b/arch/arm/mach-omap2/cm33xx.h
-index 8009e13..64f4baf 100644
---- a/arch/arm/mach-omap2/cm33xx.h
-+++ b/arch/arm/mach-omap2/cm33xx.h
-@@ -376,6 +376,7 @@
- #define AM33XX_CM_CEFUSE_CEFUSE_CLKCTRL			AM33XX_CM_REGADDR(AM33XX_CM_CEFUSE_MOD, 0x0020)
- 
- 
-+#ifndef __ASSEMBLER__
- extern bool am33xx_cm_is_clkdm_in_hwsup(s16 inst, u16 cdoffs);
- extern void am33xx_cm_clkdm_enable_hwsup(s16 inst, u16 cdoffs);
- extern void am33xx_cm_clkdm_disable_hwsup(s16 inst, u16 cdoffs);
-@@ -412,4 +413,5 @@ static inline int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs,
- }
- #endif
- 
-+#endif /* ASSEMBLER */
- #endif
-diff --git a/arch/arm/mach-omap2/prm33xx.h b/arch/arm/mach-omap2/prm33xx.h
-index 3f25c56..1c40373 100644
---- a/arch/arm/mach-omap2/prm33xx.h
-+++ b/arch/arm/mach-omap2/prm33xx.h
-@@ -117,6 +117,7 @@
- #define AM33XX_PM_CEFUSE_PWRSTST_OFFSET		0x0004
- #define AM33XX_PM_CEFUSE_PWRSTST		AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0004)
- 
-+#ifndef __ASSEMBLER__
- extern u32 am33xx_prm_read_reg(s16 inst, u16 idx);
- extern void am33xx_prm_write_reg(u32 val, s16 inst, u16 idx);
- extern u32 am33xx_prm_rmw_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx);
-@@ -126,4 +127,5 @@ extern int am33xx_prm_is_hardreset_asserted(u8 shift, s16 inst,
- extern int am33xx_prm_assert_hardreset(u8 shift, s16 inst, u16 rstctrl_offs);
- extern int am33xx_prm_deassert_hardreset(u8 shift, s16 inst,
- 		u16 rstctrl_offs, u16 rstst_offs);
-+#endif /* ASSEMBLER */
- #endif
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0014-ARM-OMAP2-AM33XX-hwmod-Register-OCMC-RAM-hwmod.patch b/patches/omap_late/0014-ARM-OMAP2-AM33XX-hwmod-Register-OCMC-RAM-hwmod.patch
deleted file mode 100644
index 7fdd8d7724a35c9fa88bd77ebd41a868a561a7a0..0000000000000000000000000000000000000000
--- a/patches/omap_late/0014-ARM-OMAP2-AM33XX-hwmod-Register-OCMC-RAM-hwmod.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-From 9faca74ed0a71ecd3705f8dfb0997203a2200b12 Mon Sep 17 00:00:00 2001
-From: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Date: Tue, 29 Jan 2013 16:45:02 +0530
-Subject: [PATCH 14/32] ARM: OMAP2+: AM33XX: hwmod: Register OCMC RAM hwmod
-
-OCMC RAM lies in the PER power domain and this memory
-support retention.
-
-Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/omap_hwmod_33xx_data.c |   47 ++++++++++++++++------------
- 1 file changed, 27 insertions(+), 20 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-index 646c14d..8280f11 100644
---- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-@@ -414,7 +414,6 @@ static struct omap_hwmod am33xx_adc_tsc_hwmod = {
-  *    - cEFUSE (doesn't fall under any ocp_if)
-  *    - clkdiv32k
-  *    - debugss
-- *    - ocmc ram
-  *    - ocp watch point
-  *    - aes0
-  *    - sha0
-@@ -481,25 +480,6 @@ static struct omap_hwmod am33xx_debugss_hwmod = {
- 	},
- };
- 
--/* ocmcram */
--static struct omap_hwmod_class am33xx_ocmcram_hwmod_class = {
--	.name = "ocmcram",
--};
--
--static struct omap_hwmod am33xx_ocmcram_hwmod = {
--	.name		= "ocmcram",
--	.class		= &am33xx_ocmcram_hwmod_class,
--	.clkdm_name	= "l3_clkdm",
--	.flags		= (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
--	.main_clk	= "l3_gclk",
--	.prcm		= {
--		.omap4	= {
--			.clkctrl_offs	= AM33XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET,
--			.modulemode	= MODULEMODE_SWCTRL,
--		},
--	},
--};
--
- /* ocpwp */
- static struct omap_hwmod_class am33xx_ocpwp_hwmod_class = {
- 	.name		= "ocpwp",
-@@ -570,6 +550,25 @@ static struct omap_hwmod am33xx_sha0_hwmod = {
- 
- #endif
- 
-+/* ocmcram */
-+static struct omap_hwmod_class am33xx_ocmcram_hwmod_class = {
-+	.name = "ocmcram",
-+};
-+
-+static struct omap_hwmod am33xx_ocmcram_hwmod = {
-+	.name		= "ocmcram",
-+	.class		= &am33xx_ocmcram_hwmod_class,
-+	.clkdm_name	= "l3_clkdm",
-+	.flags		= (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
-+	.main_clk	= "l3_gclk",
-+	.prcm		= {
-+		.omap4	= {
-+			.clkctrl_offs	= AM33XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET,
-+			.modulemode	= MODULEMODE_SWCTRL,
-+		},
-+	},
-+};
-+
- /* 'smartreflex' class */
- static struct omap_hwmod_class am33xx_smartreflex_hwmod_class = {
- 	.name		= "smartreflex",
-@@ -3328,6 +3327,13 @@ static struct omap_hwmod_ocp_if am33xx_l3_s__usbss = {
- 	.flags		= OCPIF_SWSUP_IDLE,
- };
- 
-+/* l3 main -> ocmc */
-+static struct omap_hwmod_ocp_if am33xx_l3_main__ocmc = {
-+	.master		= &am33xx_l3_main_hwmod,
-+	.slave		= &am33xx_ocmcram_hwmod,
-+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
-+};
-+
- static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
- 	&am33xx_l4_fw__emif_fw,
- 	&am33xx_l3_main__emif,
-@@ -3398,6 +3404,7 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
- 	&am33xx_l3_main__tptc0,
- 	&am33xx_l3_main__tptc1,
- 	&am33xx_l3_main__tptc2,
-+	&am33xx_l3_main__ocmc,
- 	&am33xx_l3_s__usbss,
- 	&am33xx_l4_hs__cpgmac0,
- 	&am33xx_cpgmac0__mdio,
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0015-ARM-OMAP2-AM33XX-hwmod-Update-TPTC0-hwmod-with-the-r.patch b/patches/omap_late/0015-ARM-OMAP2-AM33XX-hwmod-Update-TPTC0-hwmod-with-the-r.patch
deleted file mode 100644
index 8817ba7ad49f6cbd602514c0a9c64dcee4bb6c12..0000000000000000000000000000000000000000
--- a/patches/omap_late/0015-ARM-OMAP2-AM33XX-hwmod-Update-TPTC0-hwmod-with-the-r.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From e95672874746b653c5da70eaced1d1e1aa509bf6 Mon Sep 17 00:00:00 2001
-From: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Date: Tue, 29 Jan 2013 16:45:03 +0530
-Subject: [PATCH 15/32] ARM: OMAP2+: AM33XX: hwmod: Update TPTC0 hwmod with
- the right flags
-
-Third Party Transfer Controller (TPTC0) needs to be idled and
-put to standby under SW control. Add the appropriate flags in
-the TPTC0 hwmod entry.
-
-Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/omap_hwmod_33xx_data.c |    1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-index 8280f11..94254e8 100644
---- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-@@ -1823,6 +1823,7 @@ static struct omap_hwmod am33xx_tptc0_hwmod = {
- 	.class		= &am33xx_tptc_hwmod_class,
- 	.clkdm_name	= "l3_clkdm",
- 	.mpu_irqs	= am33xx_tptc0_irqs,
-+	.flags		= HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
- 	.main_clk	= "l3_gclk",
- 	.prcm		= {
- 		.omap4	= {
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0016-ARM-OMAP2-AM33XX-hwmod-Fixup-cpgmac0-hwmod-entry.patch b/patches/omap_late/0016-ARM-OMAP2-AM33XX-hwmod-Fixup-cpgmac0-hwmod-entry.patch
deleted file mode 100644
index 59fe189f9de2f49c23dd0ead48cbbf6cf0d9abf2..0000000000000000000000000000000000000000
--- a/patches/omap_late/0016-ARM-OMAP2-AM33XX-hwmod-Fixup-cpgmac0-hwmod-entry.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 44ee5b3b142efa7cbacde04df74cfa974de4c25b Mon Sep 17 00:00:00 2001
-From: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Date: Tue, 29 Jan 2013 16:45:04 +0530
-Subject: [PATCH 16/32] ARM: OMAP2+: AM33XX: hwmod: Fixup cpgmac0 hwmod entry
-
-The current HWMOD code expects the memory region with
-the IP's SYSCONFIG register to be marked with ADDR_TYPE_RT
-flag.
-
-CPGMAC0 hwmod entry specifies two memory regions and marks
-both with the flag ADDR_TYPE_RT although only the 2nd region
-has the SYSCONFIG register. This leads to the HWMOD code
-accessing the wrong memory address for idle and standby
-operations. Fix this by removing the ADDR_TYPE_RT flag from
-the 1st memory region in CPGMAC0 hwmod entry.
-
-Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/omap_hwmod_33xx_data.c |    1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-index 94254e8..40bfde3 100644
---- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-@@ -2496,7 +2496,6 @@ static struct omap_hwmod_addr_space am33xx_cpgmac0_addr_space[] = {
- 	{
- 		.pa_start	= 0x4a100000,
- 		.pa_end		= 0x4a100000 + SZ_2K - 1,
--		.flags		= ADDR_TYPE_RT,
- 	},
- 	/* cpsw wr */
- 	{
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0017-ARM-OMAP2-AM33XX-hwmod-Update-the-WKUP-M3-hwmod-with.patch b/patches/omap_late/0017-ARM-OMAP2-AM33XX-hwmod-Update-the-WKUP-M3-hwmod-with.patch
deleted file mode 100644
index f65c1f706298f4e0923e00147eccebd4baadc93c..0000000000000000000000000000000000000000
--- a/patches/omap_late/0017-ARM-OMAP2-AM33XX-hwmod-Update-the-WKUP-M3-hwmod-with.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 052efd08c29c49c6b040ea5e8a6dc777654b9b70 Mon Sep 17 00:00:00 2001
-From: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Date: Tue, 29 Jan 2013 16:45:05 +0530
-Subject: [PATCH 17/32] ARM: OMAP2+: AM33XX: hwmod: Update the WKUP-M3 hwmod
- with reset status bit
-
-WKUP-M3 has a reset status bit (RM_WKUP_STST.WKUP_M3_LRST)
-Update the WKUP-M3 hwmod data to reflect the same.
-
-Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/omap_hwmod_33xx_data.c |    1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-index 40bfde3..9e34d4c 100644
---- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-@@ -269,6 +269,7 @@ static struct omap_hwmod am33xx_wkup_m3_hwmod = {
- 		.omap4	= {
- 			.clkctrl_offs	= AM33XX_CM_WKUP_WKUP_M3_CLKCTRL_OFFSET,
- 			.rstctrl_offs	= AM33XX_RM_WKUP_RSTCTRL_OFFSET,
-+			.rstst_offs	= AM33XX_RM_WKUP_RSTST_OFFSET,
- 			.modulemode	= MODULEMODE_SWCTRL,
- 		},
- 	},
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0018-ARM-OMAP2-AM33XX-Update-the-hardreset-API.patch b/patches/omap_late/0018-ARM-OMAP2-AM33XX-Update-the-hardreset-API.patch
deleted file mode 100644
index bfaaa1c1ea9e582536b32c80dac461e9571cea11..0000000000000000000000000000000000000000
--- a/patches/omap_late/0018-ARM-OMAP2-AM33XX-Update-the-hardreset-API.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From 09c341ba97dace7db30de3daaa4e03be6eb26933 Mon Sep 17 00:00:00 2001
-From: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Date: Tue, 29 Jan 2013 16:45:06 +0530
-Subject: [PATCH 18/32] ARM: OMAP2+: AM33XX: Update the hardreset API
-
-WKUP-M3 has a reset status bit (RM_WKUP_STST.WKUP_M3_LRST)
-Update the hardreset API to ensure that the reset line properly
-deasserted.
-
-Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/omap_hwmod.c |    5 +----
- arch/arm/mach-omap2/prm33xx.c    |   11 +++++++----
- arch/arm/mach-omap2/prm33xx.h    |    2 +-
- 3 files changed, 9 insertions(+), 9 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
-index a898498..31cdbff 100644
---- a/arch/arm/mach-omap2/omap_hwmod.c
-+++ b/arch/arm/mach-omap2/omap_hwmod.c
-@@ -3049,11 +3049,8 @@ static int _am33xx_assert_hardreset(struct omap_hwmod *oh,
- static int _am33xx_deassert_hardreset(struct omap_hwmod *oh,
- 				     struct omap_hwmod_rst_info *ohri)
- {
--	if (ohri->st_shift)
--		pr_err("omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
--		       oh->name, ohri->name);
--
- 	return am33xx_prm_deassert_hardreset(ohri->rst_shift,
-+				ohri->st_shift,
- 				oh->clkdm->pwrdm.ptr->prcm_offs,
- 				oh->prcm.omap4.rstctrl_offs,
- 				oh->prcm.omap4.rstst_offs);
-diff --git a/arch/arm/mach-omap2/prm33xx.c b/arch/arm/mach-omap2/prm33xx.c
-index 1ac7388..44c0d72 100644
---- a/arch/arm/mach-omap2/prm33xx.c
-+++ b/arch/arm/mach-omap2/prm33xx.c
-@@ -110,11 +110,11 @@ int am33xx_prm_assert_hardreset(u8 shift, s16 inst, u16 rstctrl_offs)
-  * -EINVAL upon an argument error, -EEXIST if the submodule was already out
-  * of reset, or -EBUSY if the submodule did not exit reset promptly.
-  */
--int am33xx_prm_deassert_hardreset(u8 shift, s16 inst,
-+int am33xx_prm_deassert_hardreset(u8 shift, u8 st_shift, s16 inst,
- 		u16 rstctrl_offs, u16 rstst_offs)
- {
- 	int c;
--	u32 mask = 1 << shift;
-+	u32 mask = 1 << st_shift;
- 
- 	/* Check the current status to avoid  de-asserting the line twice */
- 	if (am33xx_prm_is_hardreset_asserted(shift, inst, rstctrl_offs) == 0)
-@@ -122,11 +122,14 @@ int am33xx_prm_deassert_hardreset(u8 shift, s16 inst,
- 
- 	/* Clear the reset status by writing 1 to the status bit */
- 	am33xx_prm_rmw_reg_bits(0xffffffff, mask, inst, rstst_offs);
-+
- 	/* de-assert the reset control line */
-+	mask = 1 << shift;
-+
- 	am33xx_prm_rmw_reg_bits(mask, 0, inst, rstctrl_offs);
--	/* wait the status to be set */
- 
--	omap_test_timeout(am33xx_prm_is_hardreset_asserted(shift, inst,
-+	/* wait the status to be set */
-+	omap_test_timeout(am33xx_prm_is_hardreset_asserted(st_shift, inst,
- 							   rstst_offs),
- 			  MAX_MODULE_HARDRESET_WAIT, c);
- 
-diff --git a/arch/arm/mach-omap2/prm33xx.h b/arch/arm/mach-omap2/prm33xx.h
-index 1c40373..9b9918d 100644
---- a/arch/arm/mach-omap2/prm33xx.h
-+++ b/arch/arm/mach-omap2/prm33xx.h
-@@ -125,7 +125,7 @@ extern void am33xx_prm_global_warm_sw_reset(void);
- extern int am33xx_prm_is_hardreset_asserted(u8 shift, s16 inst,
- 		u16 rstctrl_offs);
- extern int am33xx_prm_assert_hardreset(u8 shift, s16 inst, u16 rstctrl_offs);
--extern int am33xx_prm_deassert_hardreset(u8 shift, s16 inst,
-+extern int am33xx_prm_deassert_hardreset(u8 shift, u8 st_shift, s16 inst,
- 		u16 rstctrl_offs, u16 rstst_offs);
- #endif /* ASSEMBLER */
- #endif
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0019-ARM-DTS-AM33XX-Add-nodes-for-OCMC-RAM-and-WKUP-M3.patch b/patches/omap_late/0019-ARM-DTS-AM33XX-Add-nodes-for-OCMC-RAM-and-WKUP-M3.patch
deleted file mode 100644
index 87eaf18dfe360df8d810c8ab151b7510c4e85994..0000000000000000000000000000000000000000
--- a/patches/omap_late/0019-ARM-DTS-AM33XX-Add-nodes-for-OCMC-RAM-and-WKUP-M3.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From a98376b8f77599ffcd71c185938fd12d23a39a8d Mon Sep 17 00:00:00 2001
-From: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Date: Tue, 29 Jan 2013 16:45:07 +0530
-Subject: [PATCH 19/32] ARM: DTS: AM33XX: Add nodes for OCMC RAM and WKUP-M3
-
-Since AM33XX supports only DT-boot, this is needed
-for the appropriate device nodes to be created.
-
-Note: OCMC RAM is part of the PER power domain and supports
-retention. The assembly code for low power entry/exit will
-run from OCMC RAM. To ensure that the OMAP PM code does not
-attempt to disable the clock to OCMC RAM as part of the
-suspend process add the no_idle_on_suspend flag.
-
-Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
-Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/boot/dts/am33xx.dtsi |   14 ++++++++++++++
- 1 file changed, 14 insertions(+)
-
-diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
-index c2f14e8..0957645 100644
---- a/arch/arm/boot/dts/am33xx.dtsi
-+++ b/arch/arm/boot/dts/am33xx.dtsi
-@@ -385,5 +385,19 @@
- 				mac-address = [ 00 00 00 00 00 00 ];
- 			};
- 		};
-+
-+		ocmcram: ocmcram@40300000 {
-+			compatible = "ti,am3352-ocmcram";
-+			reg = <0x40300000 0x10000>;
-+			ti,hwmods = "ocmcram";
-+			ti,no_idle_on_suspend;
-+		};
-+
-+		wkup_m3: wkup_m3@44d00000 {
-+			compatible = "ti,am3353-wkup-m3";
-+			reg = <0x44d00000 0x4000	/* M3 UMEM */
-+			       0x44d80000 0x2000>;	/* M3 DMEM */
-+			ti,hwmods = "wkup_m3";
-+		};
- 	};
- };
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0020-ARM-OMAP-AM33xx-hwmod-Corrects-PWM-subsystem-HWMOD-e.patch b/patches/omap_late/0020-ARM-OMAP-AM33xx-hwmod-Corrects-PWM-subsystem-HWMOD-e.patch
deleted file mode 100644
index d84c3b5e154fe5e7f88a09f8fa71529cc7831b45..0000000000000000000000000000000000000000
--- a/patches/omap_late/0020-ARM-OMAP-AM33xx-hwmod-Corrects-PWM-subsystem-HWMOD-e.patch
+++ /dev/null
@@ -1,256 +0,0 @@
-From 175e21a77b791aa5290ca6d175ab9de0ba498f25 Mon Sep 17 00:00:00 2001
-From: Philip Avinash <avinashphilip@ti.com>
-Date: Wed, 2 Jan 2013 18:54:48 +0530
-Subject: [PATCH 20/32] ARM: OMAP: AM33xx hwmod: Corrects PWM subsystem HWMOD
- entries
-
-EQEP IP block integration data is not present in HWMOD data. Also
-address ranges specified for EACP & EHRPWM are not correct & HWMOD
-flags of ADDR_TYPE_RT are added to PWM subsystem register address
-space. This patch:
-1. Corrects register address mapping for ECAP & EHRPWM
-2. Removes  HWMOD flags in PWM submodule register address space.
-3. Adds EQEP HWMOD entries.
-
-Signed-off-by: Philip Avinash <avinashphilip@ti.com>
-[paul@pwsan.com: tweaked patch description]
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/omap_hwmod_33xx_data.c |  158 +++++++++++++++++++++++++---
- 1 file changed, 145 insertions(+), 13 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-index 9e34d4c..4b1cc4d 100644
---- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-@@ -784,7 +784,7 @@ static struct omap_hwmod am33xx_elm_hwmod = {
- };
- 
- /*
-- * 'epwmss' class: ecap0,1,2,  ehrpwm0,1,2
-+ * 'epwmss' class: ehrpwm0,1,2 eqep0,1,2 ecap0,1,2
-  */
- static struct omap_hwmod_class_sysconfig am33xx_epwmss_sysc = {
- 	.rev_offs	= 0x0,
-@@ -864,6 +864,66 @@ static struct omap_hwmod am33xx_ehrpwm2_hwmod = {
- 	},
- };
- 
-+/* eqep0 */
-+static struct omap_hwmod_irq_info am33xx_eqep0_irqs[] = {
-+	{ .irq = 79 + OMAP_INTC_START, },
-+	{ .irq = -1 },
-+};
-+
-+static struct omap_hwmod am33xx_eqep0_hwmod = {
-+	.name		= "eqep0",
-+	.class		= &am33xx_epwmss_hwmod_class,
-+	.clkdm_name	= "l4ls_clkdm",
-+	.mpu_irqs	= am33xx_eqep0_irqs,
-+	.main_clk	= "l4ls_gclk",
-+	.prcm		= {
-+		.omap4	= {
-+			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET,
-+			.modulemode	= MODULEMODE_SWCTRL,
-+		},
-+	},
-+};
-+
-+/* eqep1 */
-+static struct omap_hwmod_irq_info am33xx_eqep1_irqs[] = {
-+	{ .irq = 88 + OMAP_INTC_START, },
-+	{ .irq = -1 },
-+};
-+
-+static struct omap_hwmod am33xx_eqep1_hwmod = {
-+	.name		= "eqep1",
-+	.class		= &am33xx_epwmss_hwmod_class,
-+	.clkdm_name	= "l4ls_clkdm",
-+	.mpu_irqs	= am33xx_eqep1_irqs,
-+	.main_clk	= "l4ls_gclk",
-+	.prcm		= {
-+		.omap4	= {
-+			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET,
-+			.modulemode	= MODULEMODE_SWCTRL,
-+		},
-+	},
-+};
-+
-+/* eqep2 */
-+static struct omap_hwmod_irq_info am33xx_eqep2_irqs[] = {
-+	{ .irq = 89 + OMAP_INTC_START, },
-+	{ .irq = -1 },
-+};
-+
-+static struct omap_hwmod am33xx_eqep2_hwmod = {
-+	.name		= "eqep2",
-+	.class		= &am33xx_epwmss_hwmod_class,
-+	.clkdm_name	= "l4ls_clkdm",
-+	.mpu_irqs	= am33xx_eqep2_irqs,
-+	.main_clk	= "l4ls_gclk",
-+	.prcm		= {
-+		.omap4	= {
-+			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET,
-+			.modulemode	= MODULEMODE_SWCTRL,
-+		},
-+	},
-+};
-+
- /* ecap0 */
- static struct omap_hwmod_irq_info am33xx_ecap0_irqs[] = {
- 	{ .irq = 31 + OMAP_INTC_START, },
-@@ -2559,8 +2619,7 @@ static struct omap_hwmod_addr_space am33xx_ehrpwm0_addr_space[] = {
- 	},
- 	{
- 		.pa_start	= 0x48300200,
--		.pa_end		= 0x48300200 + SZ_256 - 1,
--		.flags		= ADDR_TYPE_RT
-+		.pa_end		= 0x48300200 + SZ_128 - 1,
- 	},
- 	{ }
- };
-@@ -2585,8 +2644,7 @@ static struct omap_hwmod_addr_space am33xx_ehrpwm1_addr_space[] = {
- 	},
- 	{
- 		.pa_start	= 0x48302200,
--		.pa_end		= 0x48302200 + SZ_256 - 1,
--		.flags		= ADDR_TYPE_RT
-+		.pa_end		= 0x48302200 + SZ_128 - 1,
- 	},
- 	{ }
- };
-@@ -2611,8 +2669,7 @@ static struct omap_hwmod_addr_space am33xx_ehrpwm2_addr_space[] = {
- 	},
- 	{
- 		.pa_start	= 0x48304200,
--		.pa_end		= 0x48304200 + SZ_256 - 1,
--		.flags		= ADDR_TYPE_RT
-+		.pa_end		= 0x48304200 + SZ_128 - 1,
- 	},
- 	{ }
- };
-@@ -2629,6 +2686,81 @@ static struct omap_hwmod_ocp_if am33xx_l4_ls__ehrpwm2 = {
-  * Splitting the resources to handle access of PWMSS config space
-  * and module specific part independently
-  */
-+static struct omap_hwmod_addr_space am33xx_eqep0_addr_space[] = {
-+	{
-+		.pa_start	= 0x48300000,
-+		.pa_end		= 0x48300000 + SZ_16 - 1,
-+		.flags		= ADDR_TYPE_RT
-+	},
-+	{
-+		.pa_start	= 0x48300180,
-+		.pa_end		= 0x48300180 + SZ_128 - 1,
-+	},
-+	{ }
-+};
-+
-+static struct omap_hwmod_ocp_if am33xx_l4_ls__eqep0 = {
-+	.master		= &am33xx_l4_ls_hwmod,
-+	.slave		= &am33xx_eqep0_hwmod,
-+	.clk		= "l4ls_gclk",
-+	.addr		= am33xx_eqep0_addr_space,
-+	.user		= OCP_USER_MPU,
-+};
-+
-+/*
-+ * Splitting the resources to handle access of PWMSS config space
-+ * and module specific part independently
-+ */
-+static struct omap_hwmod_addr_space am33xx_eqep1_addr_space[] = {
-+	{
-+		.pa_start	= 0x48302000,
-+		.pa_end		= 0x48302000 + SZ_16 - 1,
-+		.flags		= ADDR_TYPE_RT
-+	},
-+	{
-+		.pa_start	= 0x48302180,
-+		.pa_end		= 0x48302180 + SZ_128 - 1,
-+	},
-+	{ }
-+};
-+
-+static struct omap_hwmod_ocp_if am33xx_l4_ls__eqep1 = {
-+	.master		= &am33xx_l4_ls_hwmod,
-+	.slave		= &am33xx_eqep1_hwmod,
-+	.clk		= "l4ls_gclk",
-+	.addr		= am33xx_eqep1_addr_space,
-+	.user		= OCP_USER_MPU,
-+};
-+
-+/*
-+ * Splitting the resources to handle access of PWMSS config space
-+ * and module specific part independently
-+ */
-+static struct omap_hwmod_addr_space am33xx_eqep2_addr_space[] = {
-+	{
-+		.pa_start	= 0x48304000,
-+		.pa_end		= 0x48304000 + SZ_16 - 1,
-+		.flags		= ADDR_TYPE_RT
-+	},
-+	{
-+		.pa_start	= 0x48304180,
-+		.pa_end		= 0x48304180 + SZ_128 - 1,
-+	},
-+	{ }
-+};
-+
-+static struct omap_hwmod_ocp_if am33xx_l4_ls__eqep2 = {
-+	.master		= &am33xx_l4_ls_hwmod,
-+	.slave		= &am33xx_eqep2_hwmod,
-+	.clk		= "l4ls_gclk",
-+	.addr		= am33xx_eqep2_addr_space,
-+	.user		= OCP_USER_MPU,
-+};
-+
-+/*
-+ * Splitting the resources to handle access of PWMSS config space
-+ * and module specific part independently
-+ */
- static struct omap_hwmod_addr_space am33xx_ecap0_addr_space[] = {
- 	{
- 		.pa_start	= 0x48300000,
-@@ -2637,8 +2769,7 @@ static struct omap_hwmod_addr_space am33xx_ecap0_addr_space[] = {
- 	},
- 	{
- 		.pa_start	= 0x48300100,
--		.pa_end		= 0x48300100 + SZ_256 - 1,
--		.flags		= ADDR_TYPE_RT
-+		.pa_end		= 0x48300100 + SZ_128 - 1,
- 	},
- 	{ }
- };
-@@ -2663,8 +2794,7 @@ static struct omap_hwmod_addr_space am33xx_ecap1_addr_space[] = {
- 	},
- 	{
- 		.pa_start	= 0x48302100,
--		.pa_end		= 0x48302100 + SZ_256 - 1,
--		.flags		= ADDR_TYPE_RT
-+		.pa_end		= 0x48302100 + SZ_128 - 1,
- 	},
- 	{ }
- };
-@@ -2689,8 +2819,7 @@ static struct omap_hwmod_addr_space am33xx_ecap2_addr_space[] = {
- 	},
- 	{
- 		.pa_start	= 0x48304100,
--		.pa_end		= 0x48304100 + SZ_256 - 1,
--		.flags		= ADDR_TYPE_RT
-+		.pa_end		= 0x48304100 + SZ_128 - 1,
- 	},
- 	{ }
- };
-@@ -3395,6 +3524,9 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
- 	&am33xx_l4_ls__ehrpwm0,
- 	&am33xx_l4_ls__ehrpwm1,
- 	&am33xx_l4_ls__ehrpwm2,
-+	&am33xx_l4_ls__eqep0,
-+	&am33xx_l4_ls__eqep1,
-+	&am33xx_l4_ls__eqep2,
- 	&am33xx_l4_ls__ecap0,
- 	&am33xx_l4_ls__ecap1,
- 	&am33xx_l4_ls__ecap2,
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0021-ARM-OMAP-AM33xx-hwmod-Add-parent-child-relationship-.patch b/patches/omap_late/0021-ARM-OMAP-AM33xx-hwmod-Add-parent-child-relationship-.patch
deleted file mode 100644
index fc37b024fff2056bed6b19560a948253101f0de5..0000000000000000000000000000000000000000
--- a/patches/omap_late/0021-ARM-OMAP-AM33xx-hwmod-Add-parent-child-relationship-.patch
+++ /dev/null
@@ -1,659 +0,0 @@
-From 91703af10d30d14d832ae31b7d91c770681f58e9 Mon Sep 17 00:00:00 2001
-From: Philip Avinash <avinashphilip@ti.com>
-Date: Wed, 2 Jan 2013 18:54:49 +0530
-Subject: [PATCH 21/32] ARM: OMAP: AM33xx hwmod: Add parent-child relationship
- for PWM subsystem
-
-As part of PWM subsystem integration, PWM subsystem are sharing
-resources like clock across submodules (ECAP, EQEP & EHRPWM). To handle
-resource sharing & IP integration  rework on parent child relation
-between PWMSS and ECAP, EQEP & EHRPWM child devices to support runtime PM.
-
-Signed-off-by: Philip Avinash <avinashphilip@ti.com>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/omap_hwmod_33xx_data.c |  434 +++++++++++++---------------
- 1 file changed, 203 insertions(+), 231 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-index 4b1cc4d..8441538 100644
---- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-@@ -783,9 +783,7 @@ static struct omap_hwmod am33xx_elm_hwmod = {
- 	},
- };
- 
--/*
-- * 'epwmss' class: ehrpwm0,1,2 eqep0,1,2 ecap0,1,2
-- */
-+/* pwmss  */
- static struct omap_hwmod_class_sysconfig am33xx_epwmss_sysc = {
- 	.rev_offs	= 0x0,
- 	.sysc_offs	= 0x4,
-@@ -801,67 +799,44 @@ static struct omap_hwmod_class am33xx_epwmss_hwmod_class = {
- 	.sysc		= &am33xx_epwmss_sysc,
- };
- 
--/* ehrpwm0 */
--static struct omap_hwmod_irq_info am33xx_ehrpwm0_irqs[] = {
--	{ .name = "int", .irq = 86 + OMAP_INTC_START, },
--	{ .name = "tzint", .irq = 58 + OMAP_INTC_START, },
--	{ .irq = -1 },
-+static struct omap_hwmod_class am33xx_ecap_hwmod_class = {
-+	.name		= "ecap",
- };
- 
--static struct omap_hwmod am33xx_ehrpwm0_hwmod = {
--	.name		= "ehrpwm0",
--	.class		= &am33xx_epwmss_hwmod_class,
--	.clkdm_name	= "l4ls_clkdm",
--	.mpu_irqs	= am33xx_ehrpwm0_irqs,
--	.main_clk	= "l4ls_gclk",
--	.prcm		= {
--		.omap4	= {
--			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET,
--			.modulemode	= MODULEMODE_SWCTRL,
--		},
--	},
-+static struct omap_hwmod_class am33xx_eqep_hwmod_class = {
-+	.name		= "eqep",
- };
- 
--/* ehrpwm1 */
--static struct omap_hwmod_irq_info am33xx_ehrpwm1_irqs[] = {
--	{ .name = "int", .irq = 87 + OMAP_INTC_START, },
--	{ .name = "tzint", .irq = 59 + OMAP_INTC_START, },
--	{ .irq = -1 },
-+static struct omap_hwmod_class am33xx_ehrpwm_hwmod_class = {
-+	.name		= "ehrpwm",
- };
- 
--static struct omap_hwmod am33xx_ehrpwm1_hwmod = {
--	.name		= "ehrpwm1",
-+/* epwmss0 */
-+static struct omap_hwmod am33xx_epwmss0_hwmod = {
-+	.name		= "epwmss0",
- 	.class		= &am33xx_epwmss_hwmod_class,
- 	.clkdm_name	= "l4ls_clkdm",
--	.mpu_irqs	= am33xx_ehrpwm1_irqs,
- 	.main_clk	= "l4ls_gclk",
- 	.prcm		= {
- 		.omap4	= {
--			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET,
-+			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET,
- 			.modulemode	= MODULEMODE_SWCTRL,
- 		},
- 	},
- };
- 
--/* ehrpwm2 */
--static struct omap_hwmod_irq_info am33xx_ehrpwm2_irqs[] = {
--	{ .name = "int", .irq = 39 + OMAP_INTC_START, },
--	{ .name = "tzint", .irq = 60 + OMAP_INTC_START, },
-+/* ecap0 */
-+static struct omap_hwmod_irq_info am33xx_ecap0_irqs[] = {
-+	{ .irq = 31 + OMAP_INTC_START, },
- 	{ .irq = -1 },
- };
- 
--static struct omap_hwmod am33xx_ehrpwm2_hwmod = {
--	.name		= "ehrpwm2",
--	.class		= &am33xx_epwmss_hwmod_class,
-+static struct omap_hwmod am33xx_ecap0_hwmod = {
-+	.name		= "ecap0",
-+	.class		= &am33xx_ecap_hwmod_class,
- 	.clkdm_name	= "l4ls_clkdm",
--	.mpu_irqs	= am33xx_ehrpwm2_irqs,
-+	.mpu_irqs	= am33xx_ecap0_irqs,
- 	.main_clk	= "l4ls_gclk",
--	.prcm		= {
--		.omap4	= {
--			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET,
--			.modulemode	= MODULEMODE_SWCTRL,
--		},
--	},
- };
- 
- /* eqep0 */
-@@ -872,29 +847,32 @@ static struct omap_hwmod_irq_info am33xx_eqep0_irqs[] = {
- 
- static struct omap_hwmod am33xx_eqep0_hwmod = {
- 	.name		= "eqep0",
--	.class		= &am33xx_epwmss_hwmod_class,
-+	.class		= &am33xx_eqep_hwmod_class,
- 	.clkdm_name	= "l4ls_clkdm",
- 	.mpu_irqs	= am33xx_eqep0_irqs,
- 	.main_clk	= "l4ls_gclk",
--	.prcm		= {
--		.omap4	= {
--			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET,
--			.modulemode	= MODULEMODE_SWCTRL,
--		},
--	},
- };
- 
--/* eqep1 */
--static struct omap_hwmod_irq_info am33xx_eqep1_irqs[] = {
--	{ .irq = 88 + OMAP_INTC_START, },
-+/* ehrpwm0 */
-+static struct omap_hwmod_irq_info am33xx_ehrpwm0_irqs[] = {
-+	{ .name = "int", .irq = 86 + OMAP_INTC_START, },
-+	{ .name = "tzint", .irq = 58 + OMAP_INTC_START, },
- 	{ .irq = -1 },
- };
- 
--static struct omap_hwmod am33xx_eqep1_hwmod = {
--	.name		= "eqep1",
-+static struct omap_hwmod am33xx_ehrpwm0_hwmod = {
-+	.name		= "ehrpwm0",
-+	.class		= &am33xx_ehrpwm_hwmod_class,
-+	.clkdm_name	= "l4ls_clkdm",
-+	.mpu_irqs	= am33xx_ehrpwm0_irqs,
-+	.main_clk	= "l4ls_gclk",
-+};
-+
-+/* epwmss1 */
-+static struct omap_hwmod am33xx_epwmss1_hwmod = {
-+	.name		= "epwmss1",
- 	.class		= &am33xx_epwmss_hwmod_class,
- 	.clkdm_name	= "l4ls_clkdm",
--	.mpu_irqs	= am33xx_eqep1_irqs,
- 	.main_clk	= "l4ls_gclk",
- 	.prcm		= {
- 		.omap4	= {
-@@ -904,61 +882,58 @@ static struct omap_hwmod am33xx_eqep1_hwmod = {
- 	},
- };
- 
--/* eqep2 */
--static struct omap_hwmod_irq_info am33xx_eqep2_irqs[] = {
--	{ .irq = 89 + OMAP_INTC_START, },
-+/* ecap1 */
-+static struct omap_hwmod_irq_info am33xx_ecap1_irqs[] = {
-+	{ .irq = 47 + OMAP_INTC_START, },
- 	{ .irq = -1 },
- };
- 
--static struct omap_hwmod am33xx_eqep2_hwmod = {
--	.name		= "eqep2",
--	.class		= &am33xx_epwmss_hwmod_class,
-+static struct omap_hwmod am33xx_ecap1_hwmod = {
-+	.name		= "ecap1",
-+	.class		= &am33xx_ecap_hwmod_class,
- 	.clkdm_name	= "l4ls_clkdm",
--	.mpu_irqs	= am33xx_eqep2_irqs,
-+	.mpu_irqs	= am33xx_ecap1_irqs,
- 	.main_clk	= "l4ls_gclk",
--	.prcm		= {
--		.omap4	= {
--			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET,
--			.modulemode	= MODULEMODE_SWCTRL,
--		},
--	},
- };
- 
--/* ecap0 */
--static struct omap_hwmod_irq_info am33xx_ecap0_irqs[] = {
--	{ .irq = 31 + OMAP_INTC_START, },
-+/* eqep1 */
-+static struct omap_hwmod_irq_info am33xx_eqep1_irqs[] = {
-+	{ .irq = 88 + OMAP_INTC_START, },
- 	{ .irq = -1 },
- };
- 
--static struct omap_hwmod am33xx_ecap0_hwmod = {
--	.name		= "ecap0",
--	.class		= &am33xx_epwmss_hwmod_class,
-+static struct omap_hwmod am33xx_eqep1_hwmod = {
-+	.name		= "eqep1",
-+	.class		= &am33xx_eqep_hwmod_class,
- 	.clkdm_name	= "l4ls_clkdm",
--	.mpu_irqs	= am33xx_ecap0_irqs,
-+	.mpu_irqs	= am33xx_eqep1_irqs,
- 	.main_clk	= "l4ls_gclk",
--	.prcm		= {
--		.omap4	= {
--			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET,
--			.modulemode	= MODULEMODE_SWCTRL,
--		},
--	},
- };
- 
--/* ecap1 */
--static struct omap_hwmod_irq_info am33xx_ecap1_irqs[] = {
--	{ .irq = 47 + OMAP_INTC_START, },
-+/* ehrpwm1 */
-+static struct omap_hwmod_irq_info am33xx_ehrpwm1_irqs[] = {
-+	{ .name = "int", .irq = 87 + OMAP_INTC_START, },
-+	{ .name = "tzint", .irq = 59 + OMAP_INTC_START, },
- 	{ .irq = -1 },
- };
- 
--static struct omap_hwmod am33xx_ecap1_hwmod = {
--	.name		= "ecap1",
-+static struct omap_hwmod am33xx_ehrpwm1_hwmod = {
-+	.name		= "ehrpwm1",
-+	.class		= &am33xx_ehrpwm_hwmod_class,
-+	.clkdm_name	= "l4ls_clkdm",
-+	.mpu_irqs	= am33xx_ehrpwm1_irqs,
-+	.main_clk	= "l4ls_gclk",
-+};
-+
-+/* epwmss2 */
-+static struct omap_hwmod am33xx_epwmss2_hwmod = {
-+	.name		= "epwmss2",
- 	.class		= &am33xx_epwmss_hwmod_class,
- 	.clkdm_name	= "l4ls_clkdm",
--	.mpu_irqs	= am33xx_ecap1_irqs,
- 	.main_clk	= "l4ls_gclk",
- 	.prcm		= {
- 		.omap4	= {
--			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET,
-+			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET,
- 			.modulemode	= MODULEMODE_SWCTRL,
- 		},
- 	},
-@@ -972,16 +947,39 @@ static struct omap_hwmod_irq_info am33xx_ecap2_irqs[] = {
- 
- static struct omap_hwmod am33xx_ecap2_hwmod = {
- 	.name		= "ecap2",
-+	.class		= &am33xx_ecap_hwmod_class,
-+	.clkdm_name	= "l4ls_clkdm",
- 	.mpu_irqs	= am33xx_ecap2_irqs,
--	.class		= &am33xx_epwmss_hwmod_class,
-+	.main_clk	= "l4ls_gclk",
-+};
-+
-+/* eqep2 */
-+static struct omap_hwmod_irq_info am33xx_eqep2_irqs[] = {
-+	{ .irq = 89 + OMAP_INTC_START, },
-+	{ .irq = -1 },
-+};
-+
-+static struct omap_hwmod am33xx_eqep2_hwmod = {
-+	.name		= "eqep2",
-+	.class		= &am33xx_eqep_hwmod_class,
- 	.clkdm_name	= "l4ls_clkdm",
-+	.mpu_irqs	= am33xx_eqep2_irqs,
-+	.main_clk	= "l4ls_gclk",
-+};
-+
-+/* ehrpwm2 */
-+static struct omap_hwmod_irq_info am33xx_ehrpwm2_irqs[] = {
-+	{ .name = "int", .irq = 39 + OMAP_INTC_START, },
-+	{ .name = "tzint", .irq = 60 + OMAP_INTC_START, },
-+	{ .irq = -1 },
-+};
-+
-+static struct omap_hwmod am33xx_ehrpwm2_hwmod = {
-+	.name		= "ehrpwm2",
-+	.class		= &am33xx_ehrpwm_hwmod_class,
-+	.clkdm_name	= "l4ls_clkdm",
-+	.mpu_irqs	= am33xx_ehrpwm2_irqs,
- 	.main_clk	= "l4ls_gclk",
--	.prcm		= {
--		.omap4	= {
--			.clkctrl_offs	= AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET,
--			.modulemode	= MODULEMODE_SWCTRL,
--		},
--	},
- };
- 
- /*
-@@ -2607,116 +2605,106 @@ static struct omap_hwmod_ocp_if am33xx_l4_ls__elm = {
- 	.user		= OCP_USER_MPU,
- };
- 
--/*
-- * Splitting the resources to handle access of PWMSS config space
-- * and module specific part independently
-- */
--static struct omap_hwmod_addr_space am33xx_ehrpwm0_addr_space[] = {
-+static struct omap_hwmod_addr_space am33xx_epwmss0_addr_space[] = {
- 	{
- 		.pa_start	= 0x48300000,
- 		.pa_end		= 0x48300000 + SZ_16 - 1,
- 		.flags		= ADDR_TYPE_RT
- 	},
--	{
--		.pa_start	= 0x48300200,
--		.pa_end		= 0x48300200 + SZ_128 - 1,
--	},
- 	{ }
- };
- 
--static struct omap_hwmod_ocp_if am33xx_l4_ls__ehrpwm0 = {
-+static struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss0 = {
- 	.master		= &am33xx_l4_ls_hwmod,
--	.slave		= &am33xx_ehrpwm0_hwmod,
-+	.slave		= &am33xx_epwmss0_hwmod,
- 	.clk		= "l4ls_gclk",
--	.addr		= am33xx_ehrpwm0_addr_space,
-+	.addr		= am33xx_epwmss0_addr_space,
- 	.user		= OCP_USER_MPU,
- };
- 
--/*
-- * Splitting the resources to handle access of PWMSS config space
-- * and module specific part independently
-- */
--static struct omap_hwmod_addr_space am33xx_ehrpwm1_addr_space[] = {
--	{
--		.pa_start	= 0x48302000,
--		.pa_end		= 0x48302000 + SZ_16 - 1,
--		.flags		= ADDR_TYPE_RT
--	},
-+static struct omap_hwmod_addr_space am33xx_ecap0_addr_space[] = {
- 	{
--		.pa_start	= 0x48302200,
--		.pa_end		= 0x48302200 + SZ_128 - 1,
-+		.pa_start	= 0x48300100,
-+		.pa_end		= 0x48300100 + SZ_128 - 1,
- 	},
- 	{ }
- };
- 
--static struct omap_hwmod_ocp_if am33xx_l4_ls__ehrpwm1 = {
--	.master		= &am33xx_l4_ls_hwmod,
--	.slave		= &am33xx_ehrpwm1_hwmod,
-+static struct omap_hwmod_ocp_if am33xx_epwmss0__ecap0 = {
-+	.master		= &am33xx_epwmss0_hwmod,
-+	.slave		= &am33xx_ecap0_hwmod,
- 	.clk		= "l4ls_gclk",
--	.addr		= am33xx_ehrpwm1_addr_space,
-+	.addr		= am33xx_ecap0_addr_space,
- 	.user		= OCP_USER_MPU,
- };
- 
--/*
-- * Splitting the resources to handle access of PWMSS config space
-- * and module specific part independently
-- */
--static struct omap_hwmod_addr_space am33xx_ehrpwm2_addr_space[] = {
-+static struct omap_hwmod_addr_space am33xx_eqep0_addr_space[] = {
- 	{
--		.pa_start	= 0x48304000,
--		.pa_end		= 0x48304000 + SZ_16 - 1,
--		.flags		= ADDR_TYPE_RT
-+		.pa_start	= 0x48300180,
-+		.pa_end		= 0x48300180 + SZ_128 - 1,
- 	},
-+	{ }
-+};
-+
-+static struct omap_hwmod_ocp_if am33xx_epwmss0__eqep0 = {
-+	.master		= &am33xx_epwmss0_hwmod,
-+	.slave		= &am33xx_eqep0_hwmod,
-+	.clk		= "l4ls_gclk",
-+	.addr		= am33xx_eqep0_addr_space,
-+	.user		= OCP_USER_MPU,
-+};
-+
-+static struct omap_hwmod_addr_space am33xx_ehrpwm0_addr_space[] = {
- 	{
--		.pa_start	= 0x48304200,
--		.pa_end		= 0x48304200 + SZ_128 - 1,
-+		.pa_start	= 0x48300200,
-+		.pa_end		= 0x48300200 + SZ_128 - 1,
- 	},
- 	{ }
- };
- 
--static struct omap_hwmod_ocp_if am33xx_l4_ls__ehrpwm2 = {
--	.master		= &am33xx_l4_ls_hwmod,
--	.slave		= &am33xx_ehrpwm2_hwmod,
-+static struct omap_hwmod_ocp_if am33xx_epwmss0__ehrpwm0 = {
-+	.master		= &am33xx_epwmss0_hwmod,
-+	.slave		= &am33xx_ehrpwm0_hwmod,
- 	.clk		= "l4ls_gclk",
--	.addr		= am33xx_ehrpwm2_addr_space,
-+	.addr		= am33xx_ehrpwm0_addr_space,
- 	.user		= OCP_USER_MPU,
- };
- 
--/*
-- * Splitting the resources to handle access of PWMSS config space
-- * and module specific part independently
-- */
--static struct omap_hwmod_addr_space am33xx_eqep0_addr_space[] = {
-+
-+static struct omap_hwmod_addr_space am33xx_epwmss1_addr_space[] = {
- 	{
--		.pa_start	= 0x48300000,
--		.pa_end		= 0x48300000 + SZ_16 - 1,
-+		.pa_start	= 0x48302000,
-+		.pa_end		= 0x48302000 + SZ_16 - 1,
- 		.flags		= ADDR_TYPE_RT
- 	},
--	{
--		.pa_start	= 0x48300180,
--		.pa_end		= 0x48300180 + SZ_128 - 1,
--	},
- 	{ }
- };
- 
--static struct omap_hwmod_ocp_if am33xx_l4_ls__eqep0 = {
-+static struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss1 = {
- 	.master		= &am33xx_l4_ls_hwmod,
--	.slave		= &am33xx_eqep0_hwmod,
-+	.slave		= &am33xx_epwmss1_hwmod,
- 	.clk		= "l4ls_gclk",
--	.addr		= am33xx_eqep0_addr_space,
-+	.addr		= am33xx_epwmss1_addr_space,
- 	.user		= OCP_USER_MPU,
- };
- 
--/*
-- * Splitting the resources to handle access of PWMSS config space
-- * and module specific part independently
-- */
--static struct omap_hwmod_addr_space am33xx_eqep1_addr_space[] = {
-+static struct omap_hwmod_addr_space am33xx_ecap1_addr_space[] = {
- 	{
--		.pa_start	= 0x48302000,
--		.pa_end		= 0x48302000 + SZ_16 - 1,
--		.flags		= ADDR_TYPE_RT
-+		.pa_start	= 0x48302100,
-+		.pa_end		= 0x48302100 + SZ_128 - 1,
- 	},
-+	{ }
-+};
-+
-+static struct omap_hwmod_ocp_if am33xx_epwmss1__ecap1 = {
-+	.master		= &am33xx_epwmss1_hwmod,
-+	.slave		= &am33xx_ecap1_hwmod,
-+	.clk		= "l4ls_gclk",
-+	.addr		= am33xx_ecap1_addr_space,
-+	.user		= OCP_USER_MPU,
-+};
-+
-+static struct omap_hwmod_addr_space am33xx_eqep1_addr_space[] = {
- 	{
- 		.pa_start	= 0x48302180,
- 		.pa_end		= 0x48302180 + SZ_128 - 1,
-@@ -2724,111 +2712,92 @@ static struct omap_hwmod_addr_space am33xx_eqep1_addr_space[] = {
- 	{ }
- };
- 
--static struct omap_hwmod_ocp_if am33xx_l4_ls__eqep1 = {
--	.master		= &am33xx_l4_ls_hwmod,
-+static struct omap_hwmod_ocp_if am33xx_epwmss1__eqep1 = {
-+	.master		= &am33xx_epwmss1_hwmod,
- 	.slave		= &am33xx_eqep1_hwmod,
- 	.clk		= "l4ls_gclk",
- 	.addr		= am33xx_eqep1_addr_space,
- 	.user		= OCP_USER_MPU,
- };
- 
--/*
-- * Splitting the resources to handle access of PWMSS config space
-- * and module specific part independently
-- */
--static struct omap_hwmod_addr_space am33xx_eqep2_addr_space[] = {
--	{
--		.pa_start	= 0x48304000,
--		.pa_end		= 0x48304000 + SZ_16 - 1,
--		.flags		= ADDR_TYPE_RT
--	},
-+static struct omap_hwmod_addr_space am33xx_ehrpwm1_addr_space[] = {
- 	{
--		.pa_start	= 0x48304180,
--		.pa_end		= 0x48304180 + SZ_128 - 1,
-+		.pa_start	= 0x48302200,
-+		.pa_end		= 0x48302200 + SZ_128 - 1,
- 	},
- 	{ }
- };
- 
--static struct omap_hwmod_ocp_if am33xx_l4_ls__eqep2 = {
--	.master		= &am33xx_l4_ls_hwmod,
--	.slave		= &am33xx_eqep2_hwmod,
-+static struct omap_hwmod_ocp_if am33xx_epwmss1__ehrpwm1 = {
-+	.master		= &am33xx_epwmss1_hwmod,
-+	.slave		= &am33xx_ehrpwm1_hwmod,
- 	.clk		= "l4ls_gclk",
--	.addr		= am33xx_eqep2_addr_space,
-+	.addr		= am33xx_ehrpwm1_addr_space,
- 	.user		= OCP_USER_MPU,
- };
- 
--/*
-- * Splitting the resources to handle access of PWMSS config space
-- * and module specific part independently
-- */
--static struct omap_hwmod_addr_space am33xx_ecap0_addr_space[] = {
-+static struct omap_hwmod_addr_space am33xx_epwmss2_addr_space[] = {
- 	{
--		.pa_start	= 0x48300000,
--		.pa_end		= 0x48300000 + SZ_16 - 1,
-+		.pa_start	= 0x48304000,
-+		.pa_end		= 0x48304000 + SZ_16 - 1,
- 		.flags		= ADDR_TYPE_RT
- 	},
--	{
--		.pa_start	= 0x48300100,
--		.pa_end		= 0x48300100 + SZ_128 - 1,
--	},
- 	{ }
- };
- 
--static struct omap_hwmod_ocp_if am33xx_l4_ls__ecap0 = {
-+static struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss2 = {
- 	.master		= &am33xx_l4_ls_hwmod,
--	.slave		= &am33xx_ecap0_hwmod,
-+	.slave		= &am33xx_epwmss2_hwmod,
- 	.clk		= "l4ls_gclk",
--	.addr		= am33xx_ecap0_addr_space,
-+	.addr		= am33xx_epwmss2_addr_space,
- 	.user		= OCP_USER_MPU,
- };
- 
--/*
-- * Splitting the resources to handle access of PWMSS config space
-- * and module specific part independently
-- */
--static struct omap_hwmod_addr_space am33xx_ecap1_addr_space[] = {
--	{
--		.pa_start	= 0x48302000,
--		.pa_end		= 0x48302000 + SZ_16 - 1,
--		.flags		= ADDR_TYPE_RT
--	},
-+static struct omap_hwmod_addr_space am33xx_ecap2_addr_space[] = {
- 	{
--		.pa_start	= 0x48302100,
--		.pa_end		= 0x48302100 + SZ_128 - 1,
-+		.pa_start	= 0x48304100,
-+		.pa_end		= 0x48304100 + SZ_128 - 1,
- 	},
- 	{ }
- };
- 
--static struct omap_hwmod_ocp_if am33xx_l4_ls__ecap1 = {
--	.master		= &am33xx_l4_ls_hwmod,
--	.slave		= &am33xx_ecap1_hwmod,
-+static struct omap_hwmod_ocp_if am33xx_epwmss2__ecap2 = {
-+	.master		= &am33xx_epwmss2_hwmod,
-+	.slave		= &am33xx_ecap2_hwmod,
- 	.clk		= "l4ls_gclk",
--	.addr		= am33xx_ecap1_addr_space,
-+	.addr		= am33xx_ecap2_addr_space,
- 	.user		= OCP_USER_MPU,
- };
- 
--/*
-- * Splitting the resources to handle access of PWMSS config space
-- * and module specific part independently
-- */
--static struct omap_hwmod_addr_space am33xx_ecap2_addr_space[] = {
-+static struct omap_hwmod_addr_space am33xx_eqep2_addr_space[] = {
- 	{
--		.pa_start	= 0x48304000,
--		.pa_end		= 0x48304000 + SZ_16 - 1,
--		.flags		= ADDR_TYPE_RT
-+		.pa_start	= 0x48304180,
-+		.pa_end		= 0x48304180 + SZ_128 - 1,
- 	},
-+	{ }
-+};
-+
-+static struct omap_hwmod_ocp_if am33xx_epwmss2__eqep2 = {
-+	.master		= &am33xx_epwmss2_hwmod,
-+	.slave		= &am33xx_eqep2_hwmod,
-+	.clk		= "l4ls_gclk",
-+	.addr		= am33xx_eqep2_addr_space,
-+	.user		= OCP_USER_MPU,
-+};
-+
-+static struct omap_hwmod_addr_space am33xx_ehrpwm2_addr_space[] = {
- 	{
--		.pa_start	= 0x48304100,
--		.pa_end		= 0x48304100 + SZ_128 - 1,
-+		.pa_start	= 0x48304200,
-+		.pa_end		= 0x48304200 + SZ_128 - 1,
- 	},
- 	{ }
- };
- 
--static struct omap_hwmod_ocp_if am33xx_l4_ls__ecap2 = {
--	.master		= &am33xx_l4_ls_hwmod,
--	.slave		= &am33xx_ecap2_hwmod,
-+static struct omap_hwmod_ocp_if am33xx_epwmss2__ehrpwm2 = {
-+	.master		= &am33xx_epwmss2_hwmod,
-+	.slave		= &am33xx_ehrpwm2_hwmod,
- 	.clk		= "l4ls_gclk",
--	.addr		= am33xx_ecap2_addr_space,
-+	.addr		= am33xx_ehrpwm2_addr_space,
- 	.user		= OCP_USER_MPU,
- };
- 
-@@ -3521,15 +3490,18 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
- 	&am33xx_l4_ls__uart6,
- 	&am33xx_l4_ls__spinlock,
- 	&am33xx_l4_ls__elm,
--	&am33xx_l4_ls__ehrpwm0,
--	&am33xx_l4_ls__ehrpwm1,
--	&am33xx_l4_ls__ehrpwm2,
--	&am33xx_l4_ls__eqep0,
--	&am33xx_l4_ls__eqep1,
--	&am33xx_l4_ls__eqep2,
--	&am33xx_l4_ls__ecap0,
--	&am33xx_l4_ls__ecap1,
--	&am33xx_l4_ls__ecap2,
-+	&am33xx_l4_ls__epwmss0,
-+	&am33xx_epwmss0__ecap0,
-+	&am33xx_epwmss0__eqep0,
-+	&am33xx_epwmss0__ehrpwm0,
-+	&am33xx_l4_ls__epwmss1,
-+	&am33xx_epwmss1__ecap1,
-+	&am33xx_epwmss1__eqep1,
-+	&am33xx_epwmss1__ehrpwm1,
-+	&am33xx_l4_ls__epwmss2,
-+	&am33xx_epwmss2__ecap2,
-+	&am33xx_epwmss2__eqep2,
-+	&am33xx_epwmss2__ehrpwm2,
- 	&am33xx_l3_s__gpmc,
- 	&am33xx_l3_main__lcdc,
- 	&am33xx_l4_ls__mcspi0,
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0022-ARM-OMAP2-AM33xx-hwmod-add-missing-HWMOD_NO_IDLEST-f.patch b/patches/omap_late/0022-ARM-OMAP2-AM33xx-hwmod-add-missing-HWMOD_NO_IDLEST-f.patch
deleted file mode 100644
index 3bf4b6ca6ce07b46315176ec2424f262f053eb60..0000000000000000000000000000000000000000
--- a/patches/omap_late/0022-ARM-OMAP2-AM33xx-hwmod-add-missing-HWMOD_NO_IDLEST-f.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From e5d6570a72cdfeac054f0a1013fd5f5199af7de2 Mon Sep 17 00:00:00 2001
-From: Hebbar Gururaja <gururaja.hebbar@ti.com>
-Date: Fri, 8 Feb 2013 08:21:10 -0700
-Subject: [PATCH 22/32] ARM: OMAP2+: AM33xx: hwmod: add missing
- HWMOD_NO_IDLEST flags
-
-struct omap_hwmod records belonging to wkup m3 domain is missing
-HWMOD_NO_IDLEST flags; add them.
-
-This patch is a prerequisite for a subsequent patch, 'ARM: OMAP2:
-am33xx-hwmod: Fix "register offset NULL check" bug'.  That patch would
-otherwise attempt to read from reserved bits.
-
-Signed-off-by: Hebbar Gururaja <gururaja.hebbar@ti.com>
-[paul@pwsan.com: add some more explanation in the patch description]
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/omap_hwmod_33xx_data.c |    3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-index 8441538..26eee4a 100644
---- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
-@@ -262,7 +262,8 @@ static struct omap_hwmod am33xx_wkup_m3_hwmod = {
- 	.name		= "wkup_m3",
- 	.class		= &am33xx_wkup_m3_hwmod_class,
- 	.clkdm_name	= "l4_wkup_aon_clkdm",
--	.flags		= HWMOD_INIT_NO_RESET,	/* Keep hardreset asserted */
-+	/* Keep hardreset asserted */
-+	.flags		= HWMOD_INIT_NO_RESET | HWMOD_NO_IDLEST,
- 	.mpu_irqs	= am33xx_wkup_m3_irqs,
- 	.main_clk	= "dpll_core_m4_div2_ck",
- 	.prcm		= {
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0023-ARM-OMAP2-am33xx-hwmod-Fix-register-offset-NULL-chec.patch b/patches/omap_late/0023-ARM-OMAP2-am33xx-hwmod-Fix-register-offset-NULL-chec.patch
deleted file mode 100644
index b6f9799b598f339e0db6b0e07a3552eb7ffe1475..0000000000000000000000000000000000000000
--- a/patches/omap_late/0023-ARM-OMAP2-am33xx-hwmod-Fix-register-offset-NULL-chec.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 3458bf298664ccd80e2862d7da515df5ec1a14ba Mon Sep 17 00:00:00 2001
-From: Hebbar Gururaja <gururaja.hebbar@ti.com>
-Date: Fri, 8 Feb 2013 08:21:13 -0700
-Subject: [PATCH 23/32] ARM: OMAP2: am33xx-hwmod: Fix "register offset NULL
- check" bug
-
-am33xx_cm_wait_module_ready() checks if register offset is NULL.
-
-int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs, u16 clkctrl_offs)
-{
-	int i = 0;
-
-	if (!clkctrl_offs)
-		return 0;
-
-In case of AM33xx, CLKCTRL register offset for different clock domains
-are not uniformly placed. An example of this would be the RTC clock
-domain with CLKCTRL offset at 0x00.
-In such cases the module ready check is skipped which leads to a data
-abort during boot-up when RTC registers is accessed.
-
-Remove this check here to avoid checking module readiness for modules
-with clkctrl register offset at 0x00.
-
-Koen Kooi notes that this patch fixes a crash on boot with
-CONFIG_RTC_DRV_OMAP=y with v3.8-rc5.
-
-Signed-off-by: Hebbar Gururaja <gururaja.hebbar@ti.com>
-Cc: Koen Kooi <koen@dominion.thruhere.net>
-[paul@pwsan.com: noted Koen's test in the patch description]
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/cm33xx.c |    3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c
-index 058ce3c..325a515 100644
---- a/arch/arm/mach-omap2/cm33xx.c
-+++ b/arch/arm/mach-omap2/cm33xx.c
-@@ -241,9 +241,6 @@ int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs, u16 clkctrl_offs)
- {
- 	int i = 0;
- 
--	if (!clkctrl_offs)
--		return 0;
--
- 	omap_test_timeout(_is_module_ready(inst, cdoffs, clkctrl_offs),
- 			  MAX_MODULE_READY_TIME, i);
- 
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0024-ARM-OMAP2-PM-Fix-the-dt-return-condition-in-pm_late_.patch b/patches/omap_late/0024-ARM-OMAP2-PM-Fix-the-dt-return-condition-in-pm_late_.patch
deleted file mode 100644
index d2219220a1f8f36ed93c11dc8cbfdbd9061243ef..0000000000000000000000000000000000000000
--- a/patches/omap_late/0024-ARM-OMAP2-PM-Fix-the-dt-return-condition-in-pm_late_.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From c2f18bb3db7477a2a5c9154817c355a3ee28bbc3 Mon Sep 17 00:00:00 2001
-From: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Date: Fri, 8 Feb 2013 20:41:44 +0530
-Subject: [PATCH 24/32] ARM: OMAP2+: PM: Fix the dt return condition in
- pm_late_init()
-
-Commit 1416408d {ARM: OMAP2+: PM: share some suspend-related functions
-across OMAP2, 3, 4} moved suspend code to common place but now with
-that change, for DT build on OMAP4, suspend hooks are not getting
-registered which results in no suspend support.
-
-The DT return condition is limited to PMIC and smartreflex
-initialization and hence restrict it so that suspend ops gets
-registered.
-
-Cc: Paul Walmsley <paul@pwsan.com>
-Cc: Kevin Hilman <khilman@deeprootsystems.com>
-Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-Reviewed-by: Felipe Balbi <balbi@ti.com>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/pm.c |   20 ++++++++++----------
- 1 file changed, 10 insertions(+), 10 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
-index cd6682d..673a4c1 100644
---- a/arch/arm/mach-omap2/pm.c
-+++ b/arch/arm/mach-omap2/pm.c
-@@ -282,19 +282,19 @@ int __init omap2_common_pm_late_init(void)
- 	 * a completely different mechanism.
- 	 * Disable this part if a DT blob is available.
- 	 */
--	if (of_have_populated_dt())
--		return 0;
-+	if (!of_have_populated_dt()) {
- 
--	/* Init the voltage layer */
--	omap_pmic_late_init();
--	omap_voltage_late_init();
-+		/* Init the voltage layer */
-+		omap_pmic_late_init();
-+		omap_voltage_late_init();
- 
--	/* Initialize the voltages */
--	omap3_init_voltages();
--	omap4_init_voltages();
-+		/* Initialize the voltages */
-+		omap3_init_voltages();
-+		omap4_init_voltages();
- 
--	/* Smartreflex device init */
--	omap_devinit_smartreflex();
-+		/* Smartreflex device init */
-+		omap_devinit_smartreflex();
-+	}
- 
- #ifdef CONFIG_SUSPEND
- 	suspend_set_ops(&omap_pm_ops);
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0025-ARM-OMAP4-clock-data-Add-missing-clkdm-association-f.patch b/patches/omap_late/0025-ARM-OMAP4-clock-data-Add-missing-clkdm-association-f.patch
deleted file mode 100644
index 2d866c483d7ec08722dc1ece5e26db49b811e51d..0000000000000000000000000000000000000000
--- a/patches/omap_late/0025-ARM-OMAP4-clock-data-Add-missing-clkdm-association-f.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 3c00608ad344ea10c2b112828de9f138773b4518 Mon Sep 17 00:00:00 2001
-From: Rajendra Nayak <rnayak@ti.com>
-Date: Fri, 8 Feb 2013 08:35:14 -0700
-Subject: [PATCH 25/32] ARM: OMAP4: clock data: Add missing clkdm association
- for dpll_usb
-
-dpll_usb needs the clkdm association so the clkdm can be
-turned on before a relock. All other dplls for omap4 belong
-to the ALWON (always on) domain.
-
-The association was present as part of the older data file
-(clock44xx_data.c) but looks like got accidently dropped with
-the common clk convertion.
-
-More details of the patch which fixed this up in the older
-data file can be dound here..
-http://www.spinics.net/lists/linux-omap/msg63076.html
-
-Adding the .clkdm_name as part of the clk_hw_omap struct also
-means a new .init needs to be part of the clk_ops for dpll_usb
-to initialise the clkdm.
-
-Signed-off-by: Rajendra Nayak <rnayak@ti.com>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/cclock44xx_data.c |   13 ++++++++++++-
- 1 file changed, 12 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c
-index cebe2b3..3d58f33 100644
---- a/arch/arm/mach-omap2/cclock44xx_data.c
-+++ b/arch/arm/mach-omap2/cclock44xx_data.c
-@@ -605,15 +605,26 @@ static const char *dpll_usb_ck_parents[] = {
- 
- static struct clk dpll_usb_ck;
- 
-+static const struct clk_ops dpll_usb_ck_ops = {
-+	.enable		= &omap3_noncore_dpll_enable,
-+	.disable	= &omap3_noncore_dpll_disable,
-+	.recalc_rate	= &omap3_dpll_recalc,
-+	.round_rate	= &omap2_dpll_round_rate,
-+	.set_rate	= &omap3_noncore_dpll_set_rate,
-+	.get_parent	= &omap2_init_dpll_parent,
-+	.init		= &omap2_init_clk_clkdm,
-+};
-+
- static struct clk_hw_omap dpll_usb_ck_hw = {
- 	.hw = {
- 		.clk = &dpll_usb_ck,
- 	},
- 	.dpll_data	= &dpll_usb_dd,
-+	.clkdm_name	= "l3_init_clkdm",
- 	.ops		= &clkhwops_omap3_dpll,
- };
- 
--DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_usb_ck_parents, dpll_ck_ops);
-+DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_usb_ck_parents, dpll_usb_ck_ops);
- 
- static const char *dpll_usb_clkdcoldo_ck_parents[] = {
- 	"dpll_usb_ck",
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0026-ARM-OMAP2-hwmod-add-enable_preprogram-hook.patch b/patches/omap_late/0026-ARM-OMAP2-hwmod-add-enable_preprogram-hook.patch
deleted file mode 100644
index f263225ea0df02f47b76e6f6fd83d69aa5db9b9d..0000000000000000000000000000000000000000
--- a/patches/omap_late/0026-ARM-OMAP2-hwmod-add-enable_preprogram-hook.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 0672d82c55aa857f3d0a7908ac60697997033312 Mon Sep 17 00:00:00 2001
-From: Paul Walmsley <paul@pwsan.com>
-Date: Sun, 10 Feb 2013 11:22:22 -0700
-Subject: [PATCH 26/32] ARM: OMAP2+: hwmod: add enable_preprogram hook
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-After setup/enable, some IP blocks need some additional setting to
-indicate the PRCM that they are inactive until they are configured.
-Some examples on OMAP4 include the AESS and FSUSB IP blocks.
-
-To fix this cleanly, this patch adds another optional function
-pointer, enable_preprogram, to the IP block's hwmod data.  The function
-that is pointed to is called by the hwmod code immediately after the
-IP block is reset.
-
-This version of the patch includes a patch description fix from Felipe.
-
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
-Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
-Cc: Benoît Cousson <b-cousson@ti.com>
-Cc: Péter Ujfalusi <peter.ujfalusi@ti.com>
-Cc: Felipe Balbi <balbi@ti.com>
----
- arch/arm/mach-omap2/omap_hwmod.c |   18 ++++++++++++++++++
- arch/arm/mach-omap2/omap_hwmod.h |    2 ++
- 2 files changed, 20 insertions(+)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
-index 31cdbff..c2c798c 100644
---- a/arch/arm/mach-omap2/omap_hwmod.c
-+++ b/arch/arm/mach-omap2/omap_hwmod.c
-@@ -2055,6 +2055,23 @@ static int _omap4_get_context_lost(struct omap_hwmod *oh)
- }
- 
- /**
-+ * _enable_preprogram - Pre-program an IP block during the _enable() process
-+ * @oh: struct omap_hwmod *
-+ *
-+ * Some IP blocks (such as AESS) require some additional programming
-+ * after enable before they can enter idle.  If a function pointer to
-+ * do so is present in the hwmod data, then call it and pass along the
-+ * return value; otherwise, return 0.
-+ */
-+static int __init _enable_preprogram(struct omap_hwmod *oh)
-+{
-+	if (!oh->class->enable_preprogram)
-+		return 0;
-+
-+	return oh->class->enable_preprogram(oh);
-+}
-+
-+/**
-  * _enable - enable an omap_hwmod
-  * @oh: struct omap_hwmod *
-  *
-@@ -2160,6 +2177,7 @@ static int _enable(struct omap_hwmod *oh)
- 				_update_sysc_cache(oh);
- 			_enable_sysc(oh);
- 		}
-+		r = _enable_preprogram(oh);
- 	} else {
- 		if (soc_ops.disable_module)
- 			soc_ops.disable_module(oh);
-diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
-index 80c00e7..08b4e3f 100644
---- a/arch/arm/mach-omap2/omap_hwmod.h
-+++ b/arch/arm/mach-omap2/omap_hwmod.h
-@@ -510,6 +510,7 @@ struct omap_hwmod_omap4_prcm {
-  * @rev: revision of the IP class
-  * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
-  * @reset: ptr to fn to be executed in place of the standard hwmod reset fn
-+ * @enable_preprogram:  ptr to fn to be executed during device enable
-  *
-  * Represent the class of a OMAP hardware "modules" (e.g. timer,
-  * smartreflex, gpio, uart...)
-@@ -533,6 +534,7 @@ struct omap_hwmod_class {
- 	u32					rev;
- 	int					(*pre_shutdown)(struct omap_hwmod *oh);
- 	int					(*reset)(struct omap_hwmod *oh);
-+	int					(*enable_preprogram)(struct omap_hwmod *oh);
- };
- 
- /**
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0027-ASoC-TI-AESS-add-autogating-enable-function-callable.patch b/patches/omap_late/0027-ASoC-TI-AESS-add-autogating-enable-function-callable.patch
deleted file mode 100644
index ecac7433d187dc0bf452eee230db25a2fa15817a..0000000000000000000000000000000000000000
--- a/patches/omap_late/0027-ASoC-TI-AESS-add-autogating-enable-function-callable.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 9b03a4171e2eea7068ed723a80de9c005a006ed9 Mon Sep 17 00:00:00 2001
-From: Paul Walmsley <paul@pwsan.com>
-Date: Sun, 10 Feb 2013 11:22:23 -0700
-Subject: [PATCH 27/32] ASoC: TI AESS: add autogating-enable function,
- callable from architecture code
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Add a basic header file for the TI AESS IP block, located in the OMAP4
-Audio Back-End subsystem.
-
-Currently, this header file only contains a function to enable the
-AESS internal clock auto-gating.  This will be used by a subsequent
-patch to ensure that the AESS won't block the entire chip
-low-power-idle mode.  We wish to be able to place the AESS into idle
-even when no AESS driver has been compiled in.
-
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
-Cc: Liam Girdwood <lrg@ti.com>
-Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
-Cc: Péter Ujfalusi <peter.ujfalusi@ti.com>
-Cc: Tony Lindgren <tony@atomide.com>
-Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
----
- include/sound/aess.h |   53 ++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 53 insertions(+)
- create mode 100644 include/sound/aess.h
-
-diff --git a/include/sound/aess.h b/include/sound/aess.h
-new file mode 100644
-index 0000000..cee0d09
---- /dev/null
-+++ b/include/sound/aess.h
-@@ -0,0 +1,53 @@
-+/*
-+ * AESS IP block reset
-+ *
-+ * Copyright (C) 2012 Texas Instruments, Inc.
-+ * Paul Walmsley
-+ *
-+ * 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 version 2.
-+ *
-+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
-+ * kind, whether express or implied; without even the implied warranty
-+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-+ * 02110-1301 USA
-+ */
-+#ifndef __SOUND_AESS_H__
-+#define __SOUND_AESS_H__
-+
-+#include <linux/kernel.h>
-+#include <linux/io.h>
-+
-+/*
-+ * AESS_AUTO_GATING_ENABLE_OFFSET: offset in bytes of the AESS IP
-+ *     block's AESS_AUTO_GATING_ENABLE__1 register from the IP block's
-+ *     base address
-+ */
-+#define AESS_AUTO_GATING_ENABLE_OFFSET			0x07c
-+
-+/* Register bitfields in the AESS_AUTO_GATING_ENABLE__1 register */
-+#define AESS_AUTO_GATING_ENABLE_SHIFT			0
-+
-+/**
-+ * aess_enable_autogating - enable AESS internal autogating
-+ * @oh: struct omap_hwmod *
-+ *
-+ * Enable internal autogating on the AESS.  This allows the AESS to
-+ * indicate that it is idle to the OMAP PRCM.  Returns 0.
-+ */
-+static inline void aess_enable_autogating(void __iomem *base)
-+{
-+	u32 v;
-+
-+	/* Set AESS_AUTO_GATING_ENABLE__1.ENABLE to allow idle entry */
-+	v = 1 << AESS_AUTO_GATING_ENABLE_SHIFT;
-+	writel(v, base + AESS_AUTO_GATING_ENABLE_OFFSET);
-+}
-+
-+#endif /* __SOUND_AESS_H__ */
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0028-ARM-OMAP4-AESS-enable-internal-auto-gating-during-in.patch b/patches/omap_late/0028-ARM-OMAP4-AESS-enable-internal-auto-gating-during-in.patch
deleted file mode 100644
index 7349309ab5667f5bf1b20f1073cc282b9c8dcb0e..0000000000000000000000000000000000000000
--- a/patches/omap_late/0028-ARM-OMAP4-AESS-enable-internal-auto-gating-during-in.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-From 11c8807612cdd209d1d5ba144e8a188911f02b37 Mon Sep 17 00:00:00 2001
-From: Paul Walmsley <paul@pwsan.com>
-Date: Sun, 10 Feb 2013 11:22:23 -0700
-Subject: [PATCH 28/32] ARM: OMAP4+: AESS: enable internal auto-gating during
- initial setup
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Enable the AESS auto-gating control bit during AESS hwmod setup.  This
-fixes the following boot warning on OMAP4:
-
-omap_hwmod: aess: _wait_target_disable failed
-
-Without this patch, the AESS IP block does not indicate to the PRCM
-that it is idle after it is reset.  This prevents some types of SoC
-power management until something sets the auto-gating control bit.
-
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
-Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
-Cc: Benoît Cousson <b-cousson@ti.com>
-Cc: Péter Ujfalusi <peter.ujfalusi@ti.com>
-Cc: Tony Lindgren <tony@atomide.com>
----
- arch/arm/mach-omap2/Makefile               |    2 +-
- arch/arm/mach-omap2/omap_hwmod.h           |    6 ++++
- arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    1 +
- arch/arm/mach-omap2/omap_hwmod_reset.c     |   52 ++++++++++++++++++++++++++++
- 4 files changed, 60 insertions(+), 1 deletion(-)
- create mode 100644 arch/arm/mach-omap2/omap_hwmod_reset.c
-
-diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
-index 3643c0b..b068b7f 100644
---- a/arch/arm/mach-omap2/Makefile
-+++ b/arch/arm/mach-omap2/Makefile
-@@ -11,7 +11,7 @@ obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \
- 	 omap_device.o sram.o
- 
- omap-2-3-common				= irq.o
--hwmod-common				= omap_hwmod.o \
-+hwmod-common				= omap_hwmod.o omap_hwmod_reset.o \
- 					  omap_hwmod_common_data.o
- clock-common				= clock.o clock_common_data.o \
- 					  clkt_dpll.o clkt_clksel.o
-diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
-index 08b4e3f..d43d9b6 100644
---- a/arch/arm/mach-omap2/omap_hwmod.h
-+++ b/arch/arm/mach-omap2/omap_hwmod.h
-@@ -682,6 +682,12 @@ extern void __init omap_hwmod_init(void);
- const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
- 
- /*
-+ *
-+ */
-+
-+extern int omap_hwmod_aess_preprogram(struct omap_hwmod *oh);
-+
-+/*
-  * Chip variant-specific hwmod init routines - XXX should be converted
-  * to use initcalls once the initial boot ordering is straightened out
-  */
-diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
-index 7ec1083..e4438bd 100644
---- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
-+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
-@@ -322,6 +322,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_aess_sysc = {
- static struct omap_hwmod_class omap44xx_aess_hwmod_class = {
- 	.name	= "aess",
- 	.sysc	= &omap44xx_aess_sysc,
-+	.enable_preprogram = omap_hwmod_aess_preprogram,
- };
- 
- /* aess */
-diff --git a/arch/arm/mach-omap2/omap_hwmod_reset.c b/arch/arm/mach-omap2/omap_hwmod_reset.c
-new file mode 100644
-index 0000000..bba43fa
---- /dev/null
-+++ b/arch/arm/mach-omap2/omap_hwmod_reset.c
-@@ -0,0 +1,52 @@
-+/*
-+ * OMAP IP block custom reset and preprogramming stubs
-+ *
-+ * Copyright (C) 2012 Texas Instruments, Inc.
-+ * Paul Walmsley
-+ *
-+ * A small number of IP blocks need custom reset and preprogramming
-+ * functions.  The stubs in this file provide a standard way for the
-+ * hwmod code to call these functions, which are to be located under
-+ * drivers/.
-+ *
-+ * 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 version 2.
-+ *
-+ * This program is distributed "as is" WITHOUT ANY WARRANTY of any
-+ * kind, whether express or implied; without even the implied warranty
-+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-+ * 02110-1301 USA
-+ */
-+#include <linux/kernel.h>
-+
-+#include <sound/aess.h>
-+
-+#include "omap_hwmod.h"
-+
-+/**
-+ * omap_hwmod_aess_preprogram - enable AESS internal autogating
-+ * @oh: struct omap_hwmod *
-+ *
-+ * The AESS will not IdleAck to the PRCM until its internal autogating
-+ * is enabled.  Since internal autogating is disabled by default after
-+ * AESS reset, we must enable autogating after the hwmod code resets
-+ * the AESS.  Returns 0.
-+ */
-+int omap_hwmod_aess_preprogram(struct omap_hwmod *oh)
-+{
-+	void __iomem *va;
-+
-+	va = omap_hwmod_get_mpu_rt_va(oh);
-+	if (!va)
-+		return -EINVAL;
-+
-+	aess_enable_autogating(va);
-+
-+	return 0;
-+}
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0029-ARM-OMAP4-hwmod-data-Update-AESS-data-with-memory-ba.patch b/patches/omap_late/0029-ARM-OMAP4-hwmod-data-Update-AESS-data-with-memory-ba.patch
deleted file mode 100644
index f7fb594f711821ddc87abc8b0a369e169417f96f..0000000000000000000000000000000000000000
--- a/patches/omap_late/0029-ARM-OMAP4-hwmod-data-Update-AESS-data-with-memory-ba.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From 0b78ddb219bbec445d6ee8a3cd6164c0e25b2fcf Mon Sep 17 00:00:00 2001
-From: Sebastien Guiriec <s-guiriec@ti.com>
-Date: Sun, 10 Feb 2013 11:22:24 -0700
-Subject: [PATCH 29/32] ARM: OMAP4: hwmod data: Update AESS data with memory
- bank area
-
-Add AESS memory bank data in hwmod in order to provide memory address
-information to the driver.
-
-This version also changes the AESS main clock to use a
-non-CLKCTRL-based functional clock.  These are being removed from the
-clock data, since they should be handled by the IP block integration
-code.  Without this change, the kernel crashes during boot.  Thanks to
-Tony Lindgren for reporting this during a test merge.
-
-Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
-[paul@pwsan.com: updated to change the AESS main_clk]
-Cc: Tony Lindgren <tony@atomide.com>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/omap_hwmod_44xx_data.c |   44 +++++++++++++++++++++++++++-
- 1 file changed, 43 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
-index e4438bd..6f2d944 100644
---- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
-+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
-@@ -349,7 +349,7 @@ static struct omap_hwmod omap44xx_aess_hwmod = {
- 	.clkdm_name	= "abe_clkdm",
- 	.mpu_irqs	= omap44xx_aess_irqs,
- 	.sdma_reqs	= omap44xx_aess_sdma_reqs,
--	.main_clk	= "aess_fck",
-+	.main_clk	= "aess_fclk",
- 	.prcm = {
- 		.omap4 = {
- 			.clkctrl_offs = OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET,
-@@ -4242,6 +4242,27 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ocp_wp_noc = {
- 
- static struct omap_hwmod_addr_space omap44xx_aess_addrs[] = {
- 	{
-+		.name		= "dmem",
-+		.pa_start	= 0x40180000,
-+		.pa_end		= 0x4018ffff
-+	},
-+	{
-+		.name		= "cmem",
-+		.pa_start	= 0x401a0000,
-+		.pa_end		= 0x401a1fff
-+	},
-+	{
-+		.name		= "smem",
-+		.pa_start	= 0x401c0000,
-+		.pa_end		= 0x401c5fff
-+	},
-+	{
-+		.name		= "pmem",
-+		.pa_start	= 0x401e0000,
-+		.pa_end		= 0x401e1fff
-+	},
-+	{
-+		.name		= "mpu",
- 		.pa_start	= 0x401f1000,
- 		.pa_end		= 0x401f13ff,
- 		.flags		= ADDR_TYPE_RT
-@@ -4260,6 +4281,27 @@ static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_abe__aess = {
- 
- static struct omap_hwmod_addr_space omap44xx_aess_dma_addrs[] = {
- 	{
-+		.name		= "dmem_dma",
-+		.pa_start	= 0x49080000,
-+		.pa_end		= 0x4908ffff
-+	},
-+	{
-+		.name		= "cmem_dma",
-+		.pa_start	= 0x490a0000,
-+		.pa_end		= 0x490a1fff
-+	},
-+	{
-+		.name		= "smem_dma",
-+		.pa_start	= 0x490c0000,
-+		.pa_end		= 0x490c5fff
-+	},
-+	{
-+		.name		= "pmem_dma",
-+		.pa_start	= 0x490e0000,
-+		.pa_end		= 0x490e1fff
-+	},
-+	{
-+		.name		= "dma",
- 		.pa_start	= 0x490f1000,
- 		.pa_end		= 0x490f13ff,
- 		.flags		= ADDR_TYPE_RT
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0030-ARM-OMAP4-hwmod-data-Enable-AESS-hwmod-device.patch b/patches/omap_late/0030-ARM-OMAP4-hwmod-data-Enable-AESS-hwmod-device.patch
deleted file mode 100644
index 11d3e5d9c98a06e105e808f00dc2a9828e4e841a..0000000000000000000000000000000000000000
--- a/patches/omap_late/0030-ARM-OMAP4-hwmod-data-Enable-AESS-hwmod-device.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 54047da24e793635658d167b613f692c0976713f Mon Sep 17 00:00:00 2001
-From: Sebastien Guiriec <s-guiriec@ti.com>
-Date: Sun, 10 Feb 2013 11:17:16 -0700
-Subject: [PATCH 30/32] ARM: OMAP4: hwmod data: Enable AESS hwmod device
-
-Enable AESS data in hwmod in order to be able to probe
-audio driver.
-
-Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
----
- arch/arm/mach-omap2/omap_hwmod_44xx_data.c |    6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
-index 6f2d944..0e47d2e 100644
---- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
-+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
-@@ -6311,7 +6311,7 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
- 	&omap44xx_l3_main_1__l3_main_3,
- 	&omap44xx_l3_main_2__l3_main_3,
- 	&omap44xx_l4_cfg__l3_main_3,
--	/* &omap44xx_aess__l4_abe, */
-+	&omap44xx_aess__l4_abe,
- 	&omap44xx_dsp__l4_abe,
- 	&omap44xx_l3_main_1__l4_abe,
- 	&omap44xx_mpu__l4_abe,
-@@ -6320,8 +6320,8 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
- 	&omap44xx_l4_cfg__l4_wkup,
- 	&omap44xx_mpu__mpu_private,
- 	&omap44xx_l4_cfg__ocp_wp_noc,
--	/* &omap44xx_l4_abe__aess, */
--	/* &omap44xx_l4_abe__aess_dma, */
-+	&omap44xx_l4_abe__aess,
-+	&omap44xx_l4_abe__aess_dma,
- 	&omap44xx_l3_main_2__c2c,
- 	&omap44xx_l4_wkup__counter_32k,
- 	&omap44xx_l4_cfg__ctrl_module_core,
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0031-ARM-OMAP2-fix-some-omap_device_build-calls-that-aren.patch b/patches/omap_late/0031-ARM-OMAP2-fix-some-omap_device_build-calls-that-aren.patch
deleted file mode 100644
index d90ca55664dfb27111cead0a40641ec97b2d1cd3..0000000000000000000000000000000000000000
--- a/patches/omap_late/0031-ARM-OMAP2-fix-some-omap_device_build-calls-that-aren.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From c8ac77c76001a5b24c129a008b29c9c2819cd752 Mon Sep 17 00:00:00 2001
-From: Paul Walmsley <paul@pwsan.com>
-Date: Tue, 12 Feb 2013 03:58:35 +0000
-Subject: [PATCH 31/32] ARM: OMAP2+: fix some omap_device_build() calls that
- aren't compiled by default
-
-Commit c1d1cd597fc77af3086470f8627d77f52f7f8b6c ("ARM: OMAP2+:
-omap_device: remove obsolete pm_lats and early_device code") missed a
-few omap_device_build() calls that aren't included as part of the default
-OMAP2+ Kconfig, omap2plus_defconfig.
-
-Ideally, all devices that are present on the SoC should be created by
-default, and only the corresponding device driver should be configured
-or deconfigured in Kconfig.  This allows drivers to be built as
-modules and loaded later, even if they weren't part of the original
-kernel build.  Unfortunately, we're not quite there yet.
-
-Thanks to Tony Lindgren for reporting this, found during his
-randconfig tests.
-
-Signed-off-by: Paul Walmsley <paul@pwsan.com>
-Signed-off-by: Tony Lindgren <tony@atomide.com>
----
- arch/arm/mach-omap2/am35xx-emac.c |    3 +--
- arch/arm/mach-omap2/devices.c     |    2 +-
- arch/arm/mach-omap2/sr_device.c   |    2 +-
- 3 files changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/arch/arm/mach-omap2/am35xx-emac.c b/arch/arm/mach-omap2/am35xx-emac.c
-index a00d391..25b79a2 100644
---- a/arch/arm/mach-omap2/am35xx-emac.c
-+++ b/arch/arm/mach-omap2/am35xx-emac.c
-@@ -62,8 +62,7 @@ static int __init omap_davinci_emac_dev_init(struct omap_hwmod *oh,
- {
- 	struct platform_device *pdev;
- 
--	pdev = omap_device_build(oh->class->name, 0, oh, pdata, pdata_len,
--				 false);
-+	pdev = omap_device_build(oh->class->name, 0, oh, pdata, pdata_len);
- 	if (IS_ERR(pdev)) {
- 		WARN(1, "Can't build omap_device for %s:%s.\n",
- 		     oh->class->name, oh->name);
-diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
-index 142d9c6..1ec7f05 100644
---- a/arch/arm/mach-omap2/devices.c
-+++ b/arch/arm/mach-omap2/devices.c
-@@ -426,7 +426,7 @@ static void __init omap_init_hdmi_audio(void)
- 		return;
- 	}
- 
--	pdev = omap_device_build("omap-hdmi-audio-dai", -1, oh, NULL, 0, 0);
-+	pdev = omap_device_build("omap-hdmi-audio-dai", -1, oh, NULL, 0);
- 	WARN(IS_ERR(pdev),
- 	     "Can't build omap_device for omap-hdmi-audio-dai.\n");
- 
-diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
-index bb829e0..d7bc33f 100644
---- a/arch/arm/mach-omap2/sr_device.c
-+++ b/arch/arm/mach-omap2/sr_device.c
-@@ -152,7 +152,7 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
- 
- 	sr_data->enable_on_init = sr_enable_on_init;
- 
--	pdev = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data), 0);
-+	pdev = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data));
- 	if (IS_ERR(pdev))
- 		pr_warning("%s: Could not build omap_device for %s: %s.\n\n",
- 			__func__, name, oh->name);
--- 
-1.7.10.4
-
diff --git a/patches/omap_late/0032-ARM-omap2-include-linux-errno.h-in-hwmod_reset.patch b/patches/omap_late/0032-ARM-omap2-include-linux-errno.h-in-hwmod_reset.patch
deleted file mode 100644
index 63a92a83fc447b104bbff27fa63c8030ee11106e..0000000000000000000000000000000000000000
--- a/patches/omap_late/0032-ARM-omap2-include-linux-errno.h-in-hwmod_reset.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 19ea66db8afbab2792ea46fa817e2c4ba7c350b4 Mon Sep 17 00:00:00 2001
-From: Arnd Bergmann <arnd@arndb.de>
-Date: Thu, 14 Feb 2013 17:47:35 +0100
-Subject: [PATCH 32/32] ARM: omap2: include linux/errno.h in hwmod_reset
-
-The newly created omap_hwmod_reset.c is missing an
-include of linux/errno.h in commit c02060d8 "ARM:
-OMAP4+: AESS: enable internal auto-gating during
-initial setup". It still works in omap2_defconfig,
-but not in all other combinations.
-
-Without this patch, building allmodconfig results in:
-
-arch/arm/mach-omap2/omap_hwmod_reset.c: In function 'omap_hwmod_aess_preprogram':
-arch/arm/mach-omap2/omap_hwmod_reset.c:47:11: error: 'EINVAL' undeclared (first use in this function)
-arch/arm/mach-omap2/omap_hwmod_reset.c:47:11: note: each undeclared identifier is reported only once for each function it appears in
-
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Acked-by: Tony Lindgren <tony@atomide.com>
-Cc: Paul Walmsley <paul@pwsan.com>
-Cc: Sebastien Guiriec <s-guiriec@ti.com>
----
- arch/arm/mach-omap2/omap_hwmod_reset.c |    1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/arch/arm/mach-omap2/omap_hwmod_reset.c b/arch/arm/mach-omap2/omap_hwmod_reset.c
-index bba43fa..65e186c 100644
---- a/arch/arm/mach-omap2/omap_hwmod_reset.c
-+++ b/arch/arm/mach-omap2/omap_hwmod_reset.c
-@@ -24,6 +24,7 @@
-  * 02110-1301 USA
-  */
- #include <linux/kernel.h>
-+#include <linux/errno.h>
- 
- #include <sound/aess.h>
- 
--- 
-1.7.10.4
-
diff --git a/patches/omap_panda/0004-HACK-PandaES-disable-cpufreq-so-board-will-boot.patch b/patches/omap_panda/0004-HACK-PandaES-disable-cpufreq-so-board-will-boot.patch
new file mode 100644
index 0000000000000000000000000000000000000000..01d312f1848bc2af823d882a1a9e7d959d67c3ea
--- /dev/null
+++ b/patches/omap_panda/0004-HACK-PandaES-disable-cpufreq-so-board-will-boot.patch
@@ -0,0 +1,38 @@
+From 359104632fa556e3c5c78e4016c2585896225716 Mon Sep 17 00:00:00 2001
+From: Robert Nelson <robertcnelson@gmail.com>
+Date: Mon, 1 Apr 2013 12:17:50 -0500
+Subject: [PATCH 4/4] HACK: PandaES: disable cpufreq so board will boot
+
+Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
+---
+ drivers/cpufreq/omap-cpufreq.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
+index 9128c07..39a3aef 100644
+--- a/drivers/cpufreq/omap-cpufreq.c
++++ b/drivers/cpufreq/omap-cpufreq.c
+@@ -30,6 +30,8 @@
+ #include <asm/smp_plat.h>
+ #include <asm/cpu.h>
+ 
++#include "../../arch/arm/mach-omap2/soc.h"
++
+ /* OPP tolerance in percentage */
+ #define	OPP_TOLERANCE	4
+ 
+@@ -254,6 +256,11 @@ static struct cpufreq_driver omap_driver = {
+ 
+ static int __init omap_cpufreq_init(void)
+ {
++	if (cpu_is_omap446x()) {
++		pr_err("%s: unsupported Silicon?\n", __func__);
++		return -EINVAL;
++	}
++
+ 	mpu_dev = get_cpu_device(0);
+ 	if (!mpu_dev) {
+ 		pr_warning("%s: unable to get the mpu device\n", __func__);
+-- 
+1.7.10.4
+
diff --git a/patches/omap_panda/0005-HACK-panda-enable-OMAP4_ERRATA_I688.patch b/patches/omap_panda/0005-HACK-panda-enable-OMAP4_ERRATA_I688.patch
new file mode 100644
index 0000000000000000000000000000000000000000..a9c855454b54f70e65c55605ebbb10da8dc16e47
--- /dev/null
+++ b/patches/omap_panda/0005-HACK-panda-enable-OMAP4_ERRATA_I688.patch
@@ -0,0 +1,41 @@
+From 96f76b06268a1048768a8544da0300fa7fed750e Mon Sep 17 00:00:00 2001
+From: Robert Nelson <robertcnelson@gmail.com>
+Date: Wed, 27 Mar 2013 17:37:45 -0500
+Subject: [PATCH] HACK: panda: enable OMAP4_ERRATA_I688
+
+Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
+---
+ arch/arm/include/asm/barrier.h |    3 ++-
+ arch/arm/mach-omap2/Kconfig    |    2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/include/asm/barrier.h b/arch/arm/include/asm/barrier.h
+index 8dcd9c7..3937ac3 100644
+--- a/arch/arm/include/asm/barrier.h
++++ b/arch/arm/include/asm/barrier.h
+@@ -38,7 +38,8 @@
+ #endif
+ 
+ #ifdef CONFIG_ARCH_HAS_BARRIERS
+-#include <mach/barriers.h>
++//#include <mach/barriers.h>
++#include "../mach-omap2/include/mach/barriers.h"
+ #elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP)
+ #define mb()		do { dsb(); outer_sync(); } while (0)
+ #define rmb()		dsb()
+diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
+index 1d01905..1dba009 100644
+--- a/arch/arm/mach-omap2/Kconfig
++++ b/arch/arm/mach-omap2/Kconfig
+@@ -409,7 +409,7 @@ config OMAP3_SDRC_AC_TIMING
+ 
+ config OMAP4_ERRATA_I688
+ 	bool "OMAP4 errata: Async Bridge Corruption"
+-	depends on ARCH_OMAP4 && !ARCH_MULTIPLATFORM
++	depends on ARCH_OMAP4
+ 	select ARCH_HAS_BARRIERS
+ 	help
+ 	  If a data is stalled inside asynchronous bridge because of back
+-- 
+1.7.10.4
+
diff --git a/patches/omap_panda/0006-ARM-hw_breakpoint-Enable-debug-powerdown-only-if-sys.patch b/patches/omap_panda/0006-ARM-hw_breakpoint-Enable-debug-powerdown-only-if-sys.patch
new file mode 100644
index 0000000000000000000000000000000000000000..fa64934baea4b18e74e7f576c934690635b394b0
--- /dev/null
+++ b/patches/omap_panda/0006-ARM-hw_breakpoint-Enable-debug-powerdown-only-if-sys.patch
@@ -0,0 +1,122 @@
+From 76c1d8cdfa0967b04ca8168a77bb101d4ea71150 Mon Sep 17 00:00:00 2001
+From: Santosh Shilimkar <santosh.shilimkar@ti.com>
+Date: Mon, 18 Mar 2013 06:51:30 +0000
+Subject: [PATCH 6/6] ARM: hw_breakpoint: Enable debug powerdown only if
+ system supports 'has_ossr'
+
+On Friday 15 March 2013 10:30 AM, Will Deacon wrote:
+> On Thu, Mar 14, 2013 at 01:08:00PM +0530, Santosh Shilimkar wrote:
+>> Will,
+>
+> Hi guys,
+>
+> I'm out of the office at the moment and have really terrible connectivity,
+> so I can't do too much until next week. However, I don't think adding the
+> has_ossr check is the right fix for this problem.
+>
+>> On Wednesday 13 March 2013 05:59 PM, Lokesh Vutla wrote:
+>>> Hi Dietmar,
+>>> On Wednesday 13 March 2013 05:35 PM, Dietmar Eggemann wrote:
+>>>> On 13/03/13 06:52, Lokesh Vutla wrote:
+>>>>> Commit {9a6eb31 ARM: hw_breakpoint: Debug powerdown support for
+>>>>> self-hosted
+>>>>> debug} introduces debug powerdown support for self-hosted debug.
+>>>>> While merging the patch 'has_ossr' check was removed which
+>>>>> was needed for hardwares which doesn't support self-hosted debug.
+>>>>> Pandaboard (A9) is one such hardware and Dietmar's orginial
+>>>>> patch did mention this issue.
+>>>>> Without that check on Panda with CPUIDLE enabled, a flood of
+>>>>> below messages thrown.
+>>>>>
+>>>>> [ 3.597930] hw-breakpoint: CPU 0 failed to disable vector catch
+>>>>> [ 3.597991] hw-breakpoint: CPU 1 failed to disable vector catch
+>
+> Ok, so this means that we've taken an undefined instruction exception while
+> trying to reset the debug registers on the PM_EXIT path. Now, the code there
+> deals with CPUs that don't have the save/restore registers just fine, so
+> that shouldn't have anything to do with this problem, particularly if the
+> bit that is tripping us up is related to clearing vector catch.
+>
+Agree.
+
+> Furthermore, I was under the impression that hw_breakpoint did actually
+> work on panda, which implies that a cold boot *does* manage to reset the
+> registers (can you please confirm this by looking in your dmesg during
+> boot?). In that case, it seems as though a PM cycle is powering down a
+> bunch of debug logic that was powered up during boot, and then we trip over
+> because we can't access the register bank.
+>
+Actually it seems to be without PM. Thanks to analysis from Lokesh, the issue
+can be seen even with just suspend or cpu hotplug. So cold boot as such is
+fine.
+
+> The proper solution to this problem requires us to establish exactly what is
+> turning off the debug registers, and then having an OMAP PM notifier to
+> enable it again. Assuming this has always been the case, I expect hardware
+> debug across PM fails silently with older kernels.
+>
+This has been always the case it seems with CPU power cycle.
+After the CPU is power cycled, 'DBGAUTHSTATUS' reads '0xaa' rather
+than '0xaf' which means 'DBGEN = 0' and hence code fails to enable
+monitor mode. This happens on both secure and GP devices and it can not
+be patched since the secure code is ROM'ed. We didn't notice so far
+because hw_breakpoint support was not default enabled on OMAP till the
+multi-platform build.
+
+>> I was also wondering whether we should just warn once rather
+>> than continuous warnings in the notifier. Patch is end of the
+>> email.
+>
+> Could do, but I'd like to see a fix for the real issue before we simply hide
+> the warnings :)
+>
+Agree here too. As evident above, the feature won't work on OMAP4
+devices with PM and hence some solution is needed.
+
+What you think of below ?
+
+>From d74b4264f6a5967b0f7ada96aad77ab0ac30dbed Mon Sep 17 00:00:00 2001
+From: Santosh Shilimkar <santosh.shilimkar@ti.com>
+Date: Mon, 18 Mar 2013 11:59:04 +0530
+Subject: [PATCH] ARM: hw_breakpoints: Check for CPU debug availability before
+ enabling it
+
+CPU debug features like hardware break, watchpoints can be used only when
+the debug mode is enabled and available for non-secure mode.
+
+Hence check 'DBGAUTHSTATUS.DBGEN' before proceeding to enable the
+features.
+
+Thanks to Will for pointers and Lokesh for the analysis of the issue on
+OMAP4 where after a CPU power cycle, debug mode gets disabled.
+
+Cc: Will Deacon <Will.Deacon@arm.com>
+
+Tested-by: Lokesh Vutla <lokeshvutla@ti.com>
+Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
+---
+ arch/arm/kernel/hw_breakpoint.c |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
+index 96093b7..683a7cf 100644
+--- a/arch/arm/kernel/hw_breakpoint.c
++++ b/arch/arm/kernel/hw_breakpoint.c
+@@ -930,6 +930,14 @@ static void reset_ctrl_regs(void *unused)
+ 	int i, raw_num_brps, err = 0, cpu = smp_processor_id();
+ 	u32 val;
+ 
++	/* Check if we have access to CPU debug features */
++	ARM_DBG_READ(c7, c14, 6, val);
++	if ((val & 0x1) == 0) {
++		pr_warn_once("CPU %d debug is unavailable\n", cpu);
++		cpumask_or(&debug_err_mask, &debug_err_mask, cpumask_of(cpu));
++		return;
++	}
++
+ 	/*
+ 	 * v7 debug contains save and restore registers so that debug state
+ 	 * can be maintained across low-power modes without leaving the debug
+-- 
+1.7.10.4
+
diff --git a/patches/omap_sgx/0001-arm-Export-cache-flush-management-symbols-when-MULTI.patch b/patches/omap_sgx/0001-arm-Export-cache-flush-management-symbols-when-MULTI.patch
new file mode 100644
index 0000000000000000000000000000000000000000..1ca1e70ca901e1aeb836e074cb5da496dd599f4e
--- /dev/null
+++ b/patches/omap_sgx/0001-arm-Export-cache-flush-management-symbols-when-MULTI.patch
@@ -0,0 +1,34 @@
+From 29885f2f3d700341d322274db6ad085e601c0994 Mon Sep 17 00:00:00 2001
+From: Pantelis Antoniou <panto@antoniou-consulting.com>
+Date: Fri, 4 Jan 2013 00:32:33 +0200
+Subject: [PATCH 3/3] arm: Export cache flush management symbols when
+ !MULTI_CACHE
+
+When compiling a kernel without CONFIG_MULTI_CACHE enabled the
+dma access functions end up not being exported. Fix it.
+
+Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
+---
+ arch/arm/kernel/setup.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
+index da1d1aa..dcb678c 100644
+--- a/arch/arm/kernel/setup.c
++++ b/arch/arm/kernel/setup.c
+@@ -923,3 +923,12 @@ const struct seq_operations cpuinfo_op = {
+ 	.stop	= c_stop,
+ 	.show	= c_show
+ };
++
++/* export the cache management functions */
++#ifndef MULTI_CACHE
++
++EXPORT_SYMBOL(__glue(_CACHE,_dma_map_area));
++EXPORT_SYMBOL(__glue(_CACHE,_dma_unmap_area));
++EXPORT_SYMBOL(__glue(_CACHE,_dma_flush_range));
++
++#endif
+-- 
+1.7.10.4
+
diff --git a/patches/omap_sprz319-erratum-2.1/0001-hack-omap-clockk-dpll5-apply-sprz319e-2.1-erratum.patch b/patches/omap_sprz319-erratum-2.1/0001-hack-omap-clockk-dpll5-apply-sprz319e-2.1-erratum.patch
new file mode 100644
index 0000000000000000000000000000000000000000..c18e345d0cf7dd5bac9d11f38c502951dcbb5816
--- /dev/null
+++ b/patches/omap_sprz319-erratum-2.1/0001-hack-omap-clockk-dpll5-apply-sprz319e-2.1-erratum.patch
@@ -0,0 +1,179 @@
+From 894705d24f36132f4470302d9d878788f0dfd4de Mon Sep 17 00:00:00 2001
+From: "R. Lemos" <rslemos@gmail.com>
+Date: Tue, 16 Apr 2013 10:51:00 -0500
+Subject: [PATCH] hack: omap: clockk: dpll5: apply sprz319e 2.1 erratum
+
+Cleanup of: https://gist.github.com/rslemos/5392912
+
+Signed-off-by: R. Lemos <rslemos@gmail.com>
+Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
+---
+ arch/arm/mach-omap2/cclock3xxx_data.c |   19 ++++++++-
+ arch/arm/mach-omap2/clkt_dpll.c       |   68 +++++++++++++++++++++++++++++++++
+ arch/arm/mach-omap2/clock.h           |    2 +
+ arch/arm/mach-omap2/clock3xxx.c       |    9 ++++-
+ 4 files changed, 96 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
+index 4579c3c..dfbad0e 100644
+--- a/arch/arm/mach-omap2/cclock3xxx_data.c
++++ b/arch/arm/mach-omap2/cclock3xxx_data.c
+@@ -250,7 +250,9 @@ static struct dpll_data dpll1_dd = {
+ 
+ static struct clk dpll1_ck;
+ 
+-static const struct clk_ops dpll1_ck_ops = {
++static struct clk_ops dpll1_ck_ops;
++
++static struct clk_ops dpll1_ck_ops_34xx __initdata = {
+ 	.init		= &omap2_init_clk_clkdm,
+ 	.enable		= &omap3_noncore_dpll_enable,
+ 	.disable	= &omap3_noncore_dpll_disable,
+@@ -260,6 +262,16 @@ static const struct clk_ops dpll1_ck_ops = {
+ 	.round_rate	= &omap2_dpll_round_rate,
+ };
+ 
++static struct clk_ops dpll5_ck_ops_3630 __initdata = {
++	.init		= &omap2_init_clk_clkdm,
++	.enable		= &omap3_noncore_dpll_enable,
++	.disable	= &omap3_noncore_dpll_disable,
++	.get_parent	= &omap2_init_dpll_parent,
++	.recalc_rate	= &omap3_dpll_recalc,
++	.set_rate	= &omap3_noncore_dpll_set_rate,
++	.round_rate	= &omap2_dpll5_round_rate,
++};
++
+ static struct clk_hw_omap dpll1_ck_hw = {
+ 	.hw = {
+ 		.clk = &dpll1_ck,
+@@ -3571,6 +3583,11 @@ int __init omap3xxx_clk_init(void)
+ 	else
+ 		dpll4_dd = dpll4_dd_34xx;
+ 
++	if (cpu_is_omap3630())
++		dpll1_ck_ops = dpll5_ck_ops_3630;
++	else
++		dpll1_ck_ops = dpll1_ck_ops_34xx;
++
+ 	for (c = omap3xxx_clks; c < omap3xxx_clks + ARRAY_SIZE(omap3xxx_clks);
+ 	     c++)
+ 		if (c->cpu & cpu_clkflg) {
+diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c
+index 924c230..5100d46 100644
+--- a/arch/arm/mach-omap2/clkt_dpll.c
++++ b/arch/arm/mach-omap2/clkt_dpll.c
+@@ -63,6 +63,15 @@
+ #define DPLL_FINT_UNDERFLOW		-1
+ #define DPLL_FINT_INVALID		-2
+ 
++/* copied from clock3xxx.c */
++/*
++ * DPLL5_FREQ_FOR_USBHOST: USBHOST and USBTLL are the only clocks
++ * that are sourced by DPLL5, and both of these require this clock
++ * to be at 120 MHz for proper operation.
++ */
++#define DPLL5_FREQ_FOR_USBHOST		120000000
++
++
+ /* Private functions */
+ 
+ /*
+@@ -362,3 +371,62 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
+ 	return target_rate;
+ }
+ 
++struct sprz319e_2_1_values {
++	unsigned long sys_clk_rate;
++	int m, n, div120m;
++};
++
++/**
++ * omap2_dpll5_round_rate - round a target rate for OMAP DPLL5
++ * according to DM37xx sprz319e 2.1 erratum
++ *
++ * @clk: struct clk * for a DPLL (presumably DPLL5)
++ * @target_rate: desired DPLL clock rate
++ *
++ * The erratum applies only for DM37xx, desired clock rates of
++ * div120m times 120 MHz and specified sys_clks.
++ */
++long omap2_dpll5_round_rate(struct clk_hw *hw, unsigned long target_rate,
++		unsigned long *parent_rate)
++{
++	struct clk_hw_omap *clk = to_clk_hw_omap(hw);
++	struct dpll_data *dd;
++	const char *clk_name;
++	int i;
++
++	/* erratum tables */
++	const struct sprz319e_2_1_values sprz319e_2_1_table[] = {
++		/* table 35 */
++		{ 12000000,  80,  0, 8 },
++		{ 19200000,  50,  0, 8 },
++		{ 38400000,  25,  0, 8 },
++		/* table 36 */
++		{ 13000000, 443,  5, 8 },
++		{ 26000000, 443, 11, 8 },
++	};
++
++	if (!clk || !clk->dpll_data)
++		return ~0;
++
++	dd = clk->dpll_data;
++
++	clk_name = __clk_get_name(hw->clk);
++
++	for (i = 0; i < (sizeof(sprz319e_2_1_table)/sizeof(struct sprz319e_2_1_values)); i++) {
++		const struct sprz319e_2_1_values *v = &sprz319e_2_1_table[i];
++
++		if (*parent_rate == v->sys_clk_rate &&
++			target_rate == DPLL5_FREQ_FOR_USBHOST * v->div120m) {
++
++			pr_info("clock: dpll5: Applying SPRZ319E 2.1: %8lu, %3d, %3d, %3d\n",
++				v->sys_clk_rate, v->m, v->n, v->div120m);
++
++			dd->last_rounded_m = v->m;
++			dd->last_rounded_n = v->n + 1;
++			dd->last_rounded_rate = v->sys_clk_rate * v->m / (v->n + 1);
++
++			return dd->last_rounded_rate;
++		}
++	}
++	return target_rate;
++}
+diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
+index 60ddd86..0df6eeb 100644
+--- a/arch/arm/mach-omap2/clock.h
++++ b/arch/arm/mach-omap2/clock.h
+@@ -375,6 +375,8 @@ unsigned long omap_fixed_divisor_recalc(struct clk_hw *hw,
+ 
+ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
+ 			unsigned long *parent_rate);
++long omap2_dpll5_round_rate(struct clk_hw *hw, unsigned long target_rate,
++			unsigned long *parent_rate);
+ unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate);
+ int omap3_noncore_dpll_enable(struct clk_hw *hw);
+ void omap3_noncore_dpll_disable(struct clk_hw *hw);
+diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c
+index 0b02b41..8ccf7c6 100644
+--- a/arch/arm/mach-omap2/clock3xxx.c
++++ b/arch/arm/mach-omap2/clock3xxx.c
+@@ -60,7 +60,14 @@ void __init omap3_clk_lock_dpll5(void)
+ 	struct clk *dpll5_m2_clk;
+ 
+ 	dpll5_clk = clk_get(NULL, "dpll5_ck");
+-	clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST);
++
++	if (cpu_is_omap3630()) {
++		pr_info("clock: dpll5: dpll5_clk omap3630\n");
++		clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST * 8);
++	} else {
++		clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST);
++	}
++
+ 	clk_prepare_enable(dpll5_clk);
+ 
+ 	/* Program dpll5_m2_clk divider for no division */
+-- 
+1.7.10.4
+
diff --git a/patches/ref_omap2plus_defconfig b/patches/ref_omap2plus_defconfig
index f798189e45161458ea988e7910388ca70a33edfb..bcaed4eac8e3823beab4a2efa113f958a50d90fd 100644
--- a/patches/ref_omap2plus_defconfig
+++ b/patches/ref_omap2plus_defconfig
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/arm 3.9.0-rc5 Kernel Configuration
+# Linux/arm 3.9.0 Kernel Configuration
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -457,6 +457,7 @@ CONFIG_PL310_ERRATA_727915=y
 # CONFIG_ARM_ERRATA_764369 is not set
 # CONFIG_PL310_ERRATA_769419 is not set
 # CONFIG_ARM_ERRATA_775420 is not set
+# CONFIG_ARM_ERRATA_798181 is not set
 CONFIG_ICST=y
 CONFIG_TI_PRIV_EDMA=y
 
diff --git a/tools/install_kernel.sh b/tools/install_kernel.sh
index 1ebc4a7093afad368cf3e1ccdc8a59106968b42f..de24e569af76ad93765c1445d775067a259e0c9e 100755
--- a/tools/install_kernel.sh
+++ b/tools/install_kernel.sh
@@ -1,4 +1,4 @@
-#!/bin/bash -e
+#!/bin/sh -e
 #
 # Copyright (c) 2009-2013 Robert Nelson <robertcnelson@gmail.com>
 #
@@ -145,9 +145,8 @@ mmc_detect_n_mount () {
 	echo "-----------------------------"
 	num_partitions=$(LC_ALL=C sudo fdisk -l 2>/dev/null | grep "^${MMC}" | grep -v "DM6" | grep -v "Extended" | grep -v "swap" | wc -l)
 
-	for (( i=1; i<=${num_partitions}; i++ ))
-	do
-		partition=$(LC_ALL=C sudo fdisk -l 2>/dev/null | grep "^${MMC}" | grep -v "DM6" | grep -v "Extended" | grep -v "swap" | head -${c} | tail -1 | awk '{print $1}')
+	i=0 ; while test $i -le ${num_partitions} ; do
+		partition=$(LC_ALL=C sudo fdisk -l 2>/dev/null | grep "^${MMC}" | grep -v "DM6" | grep -v "Extended" | grep -v "swap" | head -${i} | tail -1 | awk '{print $1}')
 		echo "Trying ${partition}"
 
 		if [ ! -d "${DIR}/deploy/disk/" ] ; then
@@ -166,6 +165,7 @@ mmc_detect_n_mount () {
 			mmc_partition_discover
 			mmc_unmount
 		fi
+		i=$(($i+1))
 	done
 
 	echo "-----------------------------"
@@ -185,10 +185,10 @@ unmount_partitions () {
 
 	NUM_MOUNTS=$(mount | grep -v none | grep "${MMC}" | wc -l)
 
-	for (( i=1; i<=${NUM_MOUNTS}; i++ ))
-	do
+	i=0 ; while test $i -le ${NUM_MOUNTS} ; do
 		DRIVE=$(mount | grep -v none | grep "${MMC}" | tail -1 | awk '{print $1}')
 		sudo umount ${DRIVE} >/dev/null 2>&1 || true
+		i=$(($i+1)
 	done
 
 	mkdir -p "${DIR}/deploy/disk/"
diff --git a/version.sh b/version.sh
index e8c737bd8fa3b344347da820e21aa20f75106f2a..40e66f5a963a2a5f229cf75c59ca032fc7c85328 100644
--- a/version.sh
+++ b/version.sh
@@ -18,14 +18,14 @@ config="omap2plus_defconfig"
 
 #Kernel/Build
 KERNEL_REL=3.9
-KERNEL_TAG=${KERNEL_REL}-rc5
-BUILD=armv7-d5
+KERNEL_TAG=${KERNEL_REL}
+BUILD=armv7-d0
 
 #v3.X-rcX + upto SHA
 #KERNEL_SHA="9217cbb8df31c10efc96362227b2ebdbb9fe996c"
 
 #git branch
-#BRANCH="v3.9.x"
+#BRANCH="v3.10.x"
 
 BUILDREV=1.0
 DISTRO=cross