]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Feb 2013 23:20:41 +0000 (15:20 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Feb 2013 23:20:41 +0000 (15:20 -0800)
Pull ARM SoC multiplatform support from Arnd Bergmann:
 "Converting more ARM platforms to multiplatform support.  This time,
  OMAP gets converted, which is a major step since this is by far the
  largest platform in terms of code size.  The same thing happens to the
  vt8500 platform."

* tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  net: cwdavinci_cpdma: export symbols for cpsw
  remoteproc: omap: depend on OMAP_MBOX_FWK
  [media] davinci: do not include mach/hardware.h
  ARM: OMAP2+: Make sure files with omap initcalls include soc.h
  ARM: OMAP2+: Include soc.h to drm.c to fix compiling
  ARM: OMAP2+: Fix warning for hwspinlock omap_postcore_initcall
  ARM: multi_v7_defconfig: add ARCH_ZYNQ
  ARM: multi_v7_defconfig: remove unnecessary CONFIG_GPIOLIB
  arm: vt8500: Remove remaining mach includes
  arm: vt8500: Convert debug-macro.S to be multiplatform friendly
  arm: vt8500: Remove single platform Kconfig options
  ARM: OMAP2+: Remove now obsolete uncompress.h and debug-macro.S
  ARM: OMAP2+: Add minimal support for booting vexpress
  ARM: OMAP2+: Enable ARCH_MULTIPLATFORM support
  ARM: OMAP2+: Disable code that currently does not work with multiplaform
  ARM: OMAP2+: Add multiplatform debug_ll support
  ARM: OMAP: Fix dmaengine init for multiplatform
  ARM: OMAP: Fix i2c cmdline initcall for multiplatform
  ARM: OMAP2+: Use omap initcalls
  ARM: OMAP2+: Limit omap initcalls to omap only on multiplatform kernels

1  2 
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/gpmc.c
arch/arm/mach-omap2/omap4-common.c
arch/arm/mach-omap2/timer.c
arch/arm/mach-vt8500/Kconfig
drivers/net/ethernet/ti/davinci_cpdma.c
drivers/remoteproc/Kconfig

diff --combined arch/arm/Kconfig
index 482ba91e73a7d33e06b53c78d8d8c26d1089be2f,7a0c31a6669ec11cf854cc352320a4a36e2d3cf2..bfd7c69c85a5dd5faf4fa44461dcaff9d6a0804e
@@@ -36,6 -36,7 +36,6 @@@ config AR
        select HAVE_GENERIC_HARDIRQS
        select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
        select HAVE_IDE if PCI || ISA || PCMCIA
 -      select HAVE_IRQ_WORK
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_LZMA
        select HAVE_KERNEL_LZO
@@@ -260,8 -261,7 +260,8 @@@ config MM
  #
  choice
        prompt "ARM system type"
 -      default ARCH_MULTIPLATFORM
 +      default ARCH_VERSATILE if !MMU
 +      default ARCH_MULTIPLATFORM if MMU
  
  config ARCH_MULTIPLATFORM
        bool "Allow multiple platforms to be selected"
@@@ -344,10 -344,10 +344,10 @@@ config ARCH_BCM283
        select ARM_ERRATA_411920
        select ARM_TIMER_SP804
        select CLKDEV_LOOKUP
 +      select CLKSRC_OF
        select COMMON_CLK
        select CPU_V6
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select MULTI_IRQ_HANDLER
        select PINCTRL
        select PINCTRL_BCM2835
@@@ -642,9 -642,9 +642,9 @@@ config ARCH_TEGR
        select ARCH_HAS_CPUFREQ
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
 +      select CLKSRC_OF
        select COMMON_CLK
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
@@@ -698,7 -698,6 +698,7 @@@ config ARCH_SHMOBIL
        select MULTI_IRQ_HANDLER
        select NEED_MACH_MEMORY_H
        select NO_IOPORT
 +      select PINCTRL
        select PM_GENERIC_DOMAINS if PM
        select SPARSE_IRQ
        help
@@@ -745,6 -744,7 +745,6 @@@ config ARCH_S3C24X
        select ARCH_HAS_CPUFREQ
        select ARCH_USES_GETTIMEOFFSET
        select CLKDEV_LOOKUP
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -787,6 -787,7 +787,6 @@@ config ARCH_S5P64X
        select CLKSRC_MMIO
        select CPU_V6
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -801,6 -802,7 +801,6 @@@ config ARCH_S5PC10
        select ARCH_USES_GETTIMEOFFSET
        select CLKDEV_LOOKUP
        select CPU_V7
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -818,6 -820,7 +818,6 @@@ config ARCH_S5PV21
        select CLKSRC_MMIO
        select CPU_V7
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -835,6 -838,7 +835,6 @@@ config ARCH_EXYNO
        select CLKDEV_LOOKUP
        select CPU_V7
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -869,6 -873,7 +869,6 @@@ config ARCH_U30
        select COMMON_CLK
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_TCM
        select SPARSE_IRQ
        help
@@@ -932,32 -937,24 +932,24 @@@ config ARCH_DAVINC
        help
          Support for TI's DaVinci platform.
  
- config ARCH_OMAP
-       bool "TI OMAP"
+ config ARCH_OMAP1
+       bool "TI OMAP1"
        depends on MMU
        select ARCH_HAS_CPUFREQ
        select ARCH_HAS_HOLES_MEMORYMODEL
-       select ARCH_REQUIRE_GPIOLIB
-       select CLKSRC_MMIO
-       select GENERIC_CLOCKEVENTS
-       select HAVE_CLK
-       help
-         Support for TI's OMAP platform (OMAP1/2/3/4).
- config ARCH_VT8500_SINGLE
-       bool "VIA/WonderMedia 85xx"
-       select ARCH_HAS_CPUFREQ
+       select ARCH_OMAP
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
-       select COMMON_CLK
-       select CPU_ARM926T
+       select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
+       select GENERIC_IRQ_CHIP
        select HAVE_CLK
-       select MULTI_IRQ_HANDLER
-       select SPARSE_IRQ
-       select USE_OF
+       select HAVE_IDE
+       select IRQ_DOMAIN
+       select NEED_MACH_IO_H if PCCARD
+       select NEED_MACH_MEMORY_H
        help
-         Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
+         Support for older TI OMAP1 (omap7xx, omap15xx or omap16xx)
  
  endchoice
  
@@@ -1080,12 -1077,17 +1072,12 @@@ source "arch/arm/mach-realview/Kconfig
  source "arch/arm/mach-sa1100/Kconfig"
  
  source "arch/arm/plat-samsung/Kconfig"
 -source "arch/arm/plat-s3c24xx/Kconfig"
  
  source "arch/arm/mach-socfpga/Kconfig"
  
  source "arch/arm/plat-spear/Kconfig"
  
  source "arch/arm/mach-s3c24xx/Kconfig"
 -if ARCH_S3C24XX
 -source "arch/arm/mach-s3c2412/Kconfig"
 -source "arch/arm/mach-s3c2440/Kconfig"
 -endif
  
  if ARCH_S3C64XX
  source "arch/arm/mach-s3c64xx/Kconfig"
@@@ -1439,10 -1441,6 +1431,10 @@@ config ISA_DM
        bool
        select ISA_DMA_API
  
 +config ARCH_NO_VIRT_TO_BUS
 +      def_bool y
 +      depends on !ARCH_RPC && !ARCH_NETWINDER && !ARCH_SHARK
 +
  # Select ISA DMA interface
  config ISA_DMA_API
        bool
@@@ -1524,6 -1522,7 +1516,6 @@@ config SM
  
  config SMP_ON_UP
        bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
        depends on SMP && !XIP_KERNEL
        default y
        help
@@@ -1612,16 -1611,6 +1604,16 @@@ config HOTPLUG_CP
          Say Y here to experiment with turning CPUs off and on.  CPUs
          can be controlled through /sys/devices/system/cpu.
  
 +config ARM_PSCI
 +      bool "Support for the ARM Power State Coordination Interface (PSCI)"
 +      depends on CPU_V7
 +      help
 +        Say Y here if you want Linux to communicate with system firmware
 +        implementing the PSCI specification for CPU-centric power
 +        management operations described in ARM document number ARM DEN
 +        0022A ("Power State Coordination Interface System Software on
 +        ARM processors").
 +
  config LOCAL_TIMERS
        bool "Use local timer interrupts"
        depends on SMP
@@@ -1639,7 -1628,7 +1631,7 @@@ config ARCH_NR_GPI
        default 355 if ARCH_U8500
        default 264 if MACH_H4700
        default 512 if SOC_OMAP5
 -      default 288 if ARCH_VT8500
 +      default 288 if ARCH_VT8500 || ARCH_SUNXI
        default 0
        help
          Maximum number of GPIOs in the system.
@@@ -1657,9 -1646,6 +1649,9 @@@ config H
        default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE
        default 100
  
 +config SCHED_HRTICK
 +      def_bool HIGH_RES_TIMERS
 +
  config THUMB2_KERNEL
        bool "Compile the kernel in Thumb-2 mode"
        depends on CPU_V7 && !CPU_V6 && !CPU_V6K
@@@ -1724,7 -1710,7 +1716,7 @@@ config AEAB
  
  config OABI_COMPAT
        bool "Allow old ABI binaries to run with this kernel (EXPERIMENTAL)"
 -      depends on AEABI && EXPERIMENTAL && !THUMB2_KERNEL
 +      depends on AEABI && !THUMB2_KERNEL
        default y
        help
          This option preserves the old syscall interface along with the
@@@ -1848,6 -1834,7 +1840,6 @@@ config SECCOM
  
  config CC_STACKPROTECTOR
        bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
        help
          This option turns on the -fstack-protector GCC feature. This
          feature puts, at the beginning of functions, a canary value on
@@@ -1864,7 -1851,7 +1856,7 @@@ config XEN_DOM
  
  config XEN
        bool "Xen guest support on ARM (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL && ARM && OF
 +      depends on ARM && OF
        depends on CPU_V7 && !CPU_V6
        help
          Say Y if you want to run Linux in a Virtual Machine on Xen on ARM.
@@@ -1933,7 -1920,7 +1925,7 @@@ config ZBOOT_RO
  
  choice
        prompt "Include SD/MMC loader in zImage (EXPERIMENTAL)"
 -      depends on ZBOOT_ROM && ARCH_SH7372 && EXPERIMENTAL
 +      depends on ZBOOT_ROM && ARCH_SH7372
        default ZBOOT_ROM_NONE
        help
          Include experimental SD/MMC loading code in the ROM-able zImage.
@@@ -1962,7 -1949,7 +1954,7 @@@ endchoic
  
  config ARM_APPENDED_DTB
        bool "Use appended device tree blob to zImage (EXPERIMENTAL)"
 -      depends on OF && !ZBOOT_ROM && EXPERIMENTAL
 +      depends on OF && !ZBOOT_ROM
        help
          With this option, the boot code will look for a device tree binary
          (DTB) appended to zImage
@@@ -2080,7 -2067,7 +2072,7 @@@ config XIP_PHYS_ADD
  
  config KEXEC
        bool "Kexec system call (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL && (!SMP || HOTPLUG_CPU)
 +      depends on (!SMP || HOTPLUG_CPU)
        help
          kexec is a system call that implements the ability to shutdown your
          current kernel, and to start another kernel.  It is like a reboot
@@@ -2102,6 -2089,7 +2094,6 @@@ config ATAGS_PRO
  
  config CRASH_DUMP
        bool "Build kdump crash kernel (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
        help
          Generate crash dump after being started by kexec. This should
          be normally only set in special crash dump kernels which are
@@@ -2168,7 -2156,7 +2160,7 @@@ config CPU_FREQ_S3
  
  config CPU_FREQ_S3C24XX
        bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)"
 -      depends on ARCH_S3C24XX && CPU_FREQ && EXPERIMENTAL
 +      depends on ARCH_S3C24XX && CPU_FREQ
        select CPU_FREQ_S3C
        help
          This enables the CPUfreq driver for the Samsung S3C24XX family
  
  config CPU_FREQ_S3C24XX_PLL
        bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)"
 -      depends on CPU_FREQ_S3C24XX && EXPERIMENTAL
 +      depends on CPU_FREQ_S3C24XX
        help
          Compile in support for changing the PLL frequency from the
          S3C24XX series CPUfreq driver. The PLL takes time to settle
@@@ -2243,7 -2231,7 +2235,7 @@@ config FPE_NWFPE_X
  
  config FPE_FASTFPE
        bool "FastFPE math emulation (EXPERIMENTAL)"
 -      depends on (!AEABI || OABI_COMPAT) && !CPU_32v3 && EXPERIMENTAL
 +      depends on (!AEABI || OABI_COMPAT) && !CPU_32v3
        ---help---
          Say Y here to include the FAST floating point emulator in the kernel.
          This is an experimental much faster emulator which now also has full
@@@ -2325,5 -2313,3 +2317,5 @@@ source "security/Kconfig
  source "crypto/Kconfig"
  
  source "lib/Kconfig"
 +
 +source "arch/arm/kvm/Kconfig"
diff --combined arch/arm/Kconfig.debug
index ad375a51a7d2713b9b4c4a962d4e1302ff8bfbf5,6472a573742772c3bca458038a9932adb0a0c670..5f0cdf28c22748d2f9e67e6881a054d2cc6647c1
@@@ -32,7 -32,7 +32,7 @@@ config FRAME_POINTE
  
  config ARM_UNWIND
        bool "Enable stack unwinding support (EXPERIMENTAL)"
 -      depends on AEABI && EXPERIMENTAL
 +      depends on AEABI
        default y
        help
          This option enables stack unwinding support in the kernel
@@@ -219,12 -219,12 +219,12 @@@ choic
                  Say Y here if you want kernel low-level debugging support
                  on i.MX51.
  
 -      config DEBUG_IMX50_IMX53_UART
 -              bool "i.MX50 and i.MX53 Debug UART"
 -              depends on SOC_IMX50 || SOC_IMX53
 +      config DEBUG_IMX53_UART
 +              bool "i.MX53 Debug UART"
 +              depends on SOC_IMX53
                help
                  Say Y here if you want kernel low-level debugging support
 -                on i.MX50 or i.MX53.
 +                on i.MX53.
  
        config DEBUG_IMX6Q_UART
                bool "i.MX6Q Debug UART"
                  Say Y here if you want kernel low-level debugging support
                  on MVEBU based platforms.
  
+       config DEBUG_OMAP2PLUS_UART
+               bool "Kernel low-level debugging messages via OMAP2PLUS UART"
+               depends on ARCH_OMAP2PLUS
+               help
+                 Say Y here if you want kernel low-level debugging support
+                 on OMAP2PLUS based platforms.
        config DEBUG_PICOXCELL_UART
                depends on ARCH_PICOXCELL
                bool "Use PicoXcell UART for low-level debug"
                  of the tiles using the RS1 memory map, including all new A-class
                  core tiles, FPGA-based SMMs and software models.
  
+       config DEBUG_VT8500_UART0
+               bool "Use UART0 on VIA/Wondermedia SoCs"
+               depends on ARCH_VT8500
+               help
+                 This option selects UART0 on VIA/Wondermedia System-on-a-chip
+                 devices, including VT8500, WM8505, WM8650 and WM8850.
        config DEBUG_LL_UART_NONE
                bool "No low-level debugging UART"
                depends on !ARCH_MULTIPLATFORM
@@@ -459,6 -473,54 +473,54 @@@ config DEBUG_IMX6Q_UART_POR
          Choose UART port on which kernel low-level debug messages
          should be output.
  
+ choice
+       prompt "Low-level debug console UART"
+       depends on DEBUG_OMAP2PLUS_UART
+       config DEBUG_OMAP2UART1
+               bool "OMAP2/3/4 UART1 (omap2/3 sdp boards and some omap3 boards)"
+               help
+                 This covers at least h4, 2430sdp, 3430sdp, 3630sdp,
+                 omap3 torpedo and 3530 lv som.
+       config DEBUG_OMAP2UART2
+               bool "OMAP2/3/4 UART2"
+       config DEBUG_OMAP2UART3
+               bool "OMAP2 UART3 (n8x0)"
+       config DEBUG_OMAP3UART3
+               bool "OMAP3 UART3 (most omap3 boards)"
+               help
+                 This covers at least cm_t3x, beagle, crane, devkit8000,
+                 igep00x0, ldp, n900, n9(50), pandora, overo, touchbook,
+                 and 3517evm.
+       config DEBUG_OMAP4UART3
+               bool "OMAP4/5 UART3 (omap4 blaze, panda, omap5 sevm)"
+       config DEBUG_OMAP3UART4
+               bool "OMAP36XX UART4"
+       config DEBUG_OMAP4UART4
+               bool "OMAP4/5 UART4"
+       config DEBUG_TI81XXUART1
+               bool "TI81XX UART1 (ti8148evm)"
+       config DEBUG_TI81XXUART2
+               bool "TI81XX UART2"
+       config DEBUG_TI81XXUART3
+               bool "TI81XX UART3 (ti8168evm)"
+       config DEBUG_AM33XXUART1
+               bool "AM33XX UART1"
+       config DEBUG_ZOOM_UART
+               bool "Zoom2/3 UART"
+ endchoice
  choice
        prompt "Low-level debug console UART"
        depends on DEBUG_LL && DEBUG_TEGRA_UART
@@@ -497,15 -559,17 +559,17 @@@ config DEBUG_LL_INCLUD
                                 DEBUG_IMX21_IMX27_UART || \
                                 DEBUG_IMX31_IMX35_UART || \
                                 DEBUG_IMX51_UART || \
 -                               DEBUG_IMX50_IMX53_UART ||\
 +                               DEBUG_IMX53_UART ||\
                                 DEBUG_IMX6Q_UART
        default "debug/highbank.S" if DEBUG_HIGHBANK_UART
        default "debug/mvebu.S" if DEBUG_MVEBU_UART
+       default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
        default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
        default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
        default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
        default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
                DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1
+       default "debug/vt8500.S" if DEBUG_VT8500_UART0
        default "debug/tegra.S" if DEBUG_TEGRA_UART
        default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
        default "mach/debug-macro.S"
index d07058b9c2840c9b940e0122213b89eb17ca47a3,5c68009a97955d29a6867407e4f16470452cc8f5..284500ddacdb39020547f57980e23b70fab19cd8
@@@ -30,7 -30,6 +30,7 @@@
  #include <linux/mtd/partitions.h>
  #include <linux/mtd/nand.h>
  #include <linux/mmc/host.h>
 +#include <linux/usb/phy.h>
  
  #include <linux/regulator/machine.h>
  #include <linux/i2c/twl.h>
@@@ -495,7 -494,7 +495,7 @@@ static int __init beagle_opp_init(void
        }
        return 0;
  }
- device_initcall(beagle_opp_init);
omap_device_initcall(beagle_opp_init);
  
  static void __init omap3_beagle_init(void)
  {
        omap_sdrc_init(mt46h32m32lf6_sdrc_params,
                                  mt46h32m32lf6_sdrc_params);
  
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
        board_nand_init(omap3beagle_nand_partitions,
@@@ -546,6 -544,6 +546,6 @@@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beag
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3_beagle_init,
        .init_late      = omap3_init_late,
 -      .timer          = &omap3_secure_timer,
 +      .init_time      = omap3_secure_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index b6cc233214d75fee1bcf37ab47a68e692cd4b33d,ac6faf1d9ca000712017c4f358a68a39ac5d958e..342d69399ec700fa4117d409d60a1aed91b56fbf
@@@ -20,7 -20,6 +20,7 @@@
  #include <linux/pinctrl/machine.h>
  #include <linux/platform_data/omap4-keypad.h>
  #include <linux/platform_data/omap_ocp2scp.h>
 +#include <linux/usb/omap_control_usb.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/map.h>
@@@ -69,7 -68,7 +69,7 @@@ static int __init omap3_l3_init(void
  
        return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
  }
- postcore_initcall(omap3_l3_init);
omap_postcore_initcall(omap3_l3_init);
  
  static int __init omap4_l3_init(void)
  {
  
        return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
  }
- postcore_initcall(omap4_l3_init);
omap_postcore_initcall(omap4_l3_init);
  
  #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
  
@@@ -255,49 -254,6 +255,49 @@@ static inline void omap_init_camera(voi
  #endif
  }
  
 +#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB)
 +static struct omap_control_usb_platform_data omap4_control_usb_pdata = {
 +      .type = 1,
 +};
 +
 +struct resource omap4_control_usb_res[] = {
 +      {
 +              .name   = "control_dev_conf",
 +              .start  = 0x4a002300,
 +              .end    = 0x4a002303,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      {
 +              .name   = "otghs_control",
 +              .start  = 0x4a00233c,
 +              .end    = 0x4a00233f,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +};
 +
 +static struct platform_device omap4_control_usb = {
 +      .name = "omap-control-usb",
 +      .id = -1,
 +      .dev = {
 +              .platform_data = &omap4_control_usb_pdata,
 +      },
 +      .num_resources = 2,
 +      .resource = omap4_control_usb_res,
 +};
 +
 +static inline void __init omap_init_control_usb(void)
 +{
 +      if (!cpu_is_omap44xx())
 +              return;
 +
 +      if (platform_device_register(&omap4_control_usb))
 +              pr_err("Error registering omap_control_usb device\n");
 +}
 +
 +#else
 +static inline void omap_init_control_usb(void) { }
 +#endif /* CONFIG_OMAP_CONTROL_USB */
 +
  int __init omap4_keyboard_init(struct omap4_keypad_platform_data
                        *sdp4430_keypad_data, struct omap_board_data *bdata)
  {
@@@ -765,7 -721,6 +765,7 @@@ static int __init omap2_init_devices(vo
        omap_init_mbox();
        /* If dtb is there, the devices will be created dynamically */
        if (!of_have_populated_dt()) {
 +              omap_init_control_usb();
                omap_init_dmic();
                omap_init_mcpdm();
                omap_init_mcspi();
  
        return 0;
  }
- arch_initcall(omap2_init_devices);
omap_arch_initcall(omap2_init_devices);
index 03d771349be6e058966bdfdcca35f28336e3eabf,972a6fc466caefc420f8a4cba6784debeadc4a1b..7911e2824899f0e27023ca935eb3d4db7e30b3f9
  #include <linux/module.h>
  #include <linux/interrupt.h>
  #include <linux/platform_device.h>
 +#include <linux/of.h>
 +#include <linux/of_mtd.h>
 +#include <linux/of_device.h>
 +#include <linux/mtd/nand.h>
  
  #include <linux/platform_data/mtd-nand-omap2.h>
  
@@@ -38,8 -34,6 +38,8 @@@
  #include "common.h"
  #include "omap_device.h"
  #include "gpmc.h"
 +#include "gpmc-nand.h"
 +#include "gpmc-onenand.h"
  
  #define       DEVICE_NAME             "omap-gpmc"
  
@@@ -151,8 -145,7 +151,8 @@@ static unsigned gpmc_irq_start
  static struct resource        gpmc_mem_root;
  static struct resource        gpmc_cs_mem[GPMC_CS_NUM];
  static DEFINE_SPINLOCK(gpmc_mem_lock);
 -static unsigned int gpmc_cs_map;      /* flag for cs which are initialized */
 +/* Define chip-selects as reserved by default until probe completes */
 +static unsigned int gpmc_cs_map = ((1 << GPMC_CS_NUM) - 1);
  static struct device *gpmc_dev;
  static int gpmc_irq;
  static resource_size_t phys_base, mem_size;
@@@ -1125,215 -1118,8 +1125,215 @@@ int gpmc_calc_timings(struct gpmc_timin
        /* TODO: remove, see function definition */
        gpmc_convert_ps_to_ns(gpmc_t);
  
 +      /* Now the GPMC is initialised, unreserve the chip-selects */
 +      gpmc_cs_map = 0;
 +
 +      return 0;
 +}
 +
 +#ifdef CONFIG_OF
 +static struct of_device_id gpmc_dt_ids[] = {
 +      { .compatible = "ti,omap2420-gpmc" },
 +      { .compatible = "ti,omap2430-gpmc" },
 +      { .compatible = "ti,omap3430-gpmc" },   /* omap3430 & omap3630 */
 +      { .compatible = "ti,omap4430-gpmc" },   /* omap4430 & omap4460 & omap543x */
 +      { .compatible = "ti,am3352-gpmc" },     /* am335x devices */
 +      { }
 +};
 +MODULE_DEVICE_TABLE(of, gpmc_dt_ids);
 +
 +static void __maybe_unused gpmc_read_timings_dt(struct device_node *np,
 +                                              struct gpmc_timings *gpmc_t)
 +{
 +      u32 val;
 +
 +      memset(gpmc_t, 0, sizeof(*gpmc_t));
 +
 +      /* minimum clock period for syncronous mode */
 +      if (!of_property_read_u32(np, "gpmc,sync-clk", &val))
 +              gpmc_t->sync_clk = val;
 +
 +      /* chip select timtings */
 +      if (!of_property_read_u32(np, "gpmc,cs-on", &val))
 +              gpmc_t->cs_on = val;
 +
 +      if (!of_property_read_u32(np, "gpmc,cs-rd-off", &val))
 +              gpmc_t->cs_rd_off = val;
 +
 +      if (!of_property_read_u32(np, "gpmc,cs-wr-off", &val))
 +              gpmc_t->cs_wr_off = val;
 +
 +      /* ADV signal timings */
 +      if (!of_property_read_u32(np, "gpmc,adv-on", &val))
 +              gpmc_t->adv_on = val;
 +
 +      if (!of_property_read_u32(np, "gpmc,adv-rd-off", &val))
 +              gpmc_t->adv_rd_off = val;
 +
 +      if (!of_property_read_u32(np, "gpmc,adv-wr-off", &val))
 +              gpmc_t->adv_wr_off = val;
 +
 +      /* WE signal timings */
 +      if (!of_property_read_u32(np, "gpmc,we-on", &val))
 +              gpmc_t->we_on = val;
 +
 +      if (!of_property_read_u32(np, "gpmc,we-off", &val))
 +              gpmc_t->we_off = val;
 +
 +      /* OE signal timings */
 +      if (!of_property_read_u32(np, "gpmc,oe-on", &val))
 +              gpmc_t->oe_on = val;
 +
 +      if (!of_property_read_u32(np, "gpmc,oe-off", &val))
 +              gpmc_t->oe_off = val;
 +
 +      /* access and cycle timings */
 +      if (!of_property_read_u32(np, "gpmc,page-burst-access", &val))
 +              gpmc_t->page_burst_access = val;
 +
 +      if (!of_property_read_u32(np, "gpmc,access", &val))
 +              gpmc_t->access = val;
 +
 +      if (!of_property_read_u32(np, "gpmc,rd-cycle", &val))
 +              gpmc_t->rd_cycle = val;
 +
 +      if (!of_property_read_u32(np, "gpmc,wr-cycle", &val))
 +              gpmc_t->wr_cycle = val;
 +
 +      /* only for OMAP3430 */
 +      if (!of_property_read_u32(np, "gpmc,wr-access", &val))
 +              gpmc_t->wr_access = val;
 +
 +      if (!of_property_read_u32(np, "gpmc,wr-data-mux-bus", &val))
 +              gpmc_t->wr_data_mux_bus = val;
 +}
 +
 +#ifdef CONFIG_MTD_NAND
 +
 +static const char * const nand_ecc_opts[] = {
 +      [OMAP_ECC_HAMMING_CODE_DEFAULT]         = "sw",
 +      [OMAP_ECC_HAMMING_CODE_HW]              = "hw",
 +      [OMAP_ECC_HAMMING_CODE_HW_ROMCODE]      = "hw-romcode",
 +      [OMAP_ECC_BCH4_CODE_HW]                 = "bch4",
 +      [OMAP_ECC_BCH8_CODE_HW]                 = "bch8",
 +};
 +
 +static int gpmc_probe_nand_child(struct platform_device *pdev,
 +                               struct device_node *child)
 +{
 +      u32 val;
 +      const char *s;
 +      struct gpmc_timings gpmc_t;
 +      struct omap_nand_platform_data *gpmc_nand_data;
 +
 +      if (of_property_read_u32(child, "reg", &val) < 0) {
 +              dev_err(&pdev->dev, "%s has no 'reg' property\n",
 +                      child->full_name);
 +              return -ENODEV;
 +      }
 +
 +      gpmc_nand_data = devm_kzalloc(&pdev->dev, sizeof(*gpmc_nand_data),
 +                                    GFP_KERNEL);
 +      if (!gpmc_nand_data)
 +              return -ENOMEM;
 +
 +      gpmc_nand_data->cs = val;
 +      gpmc_nand_data->of_node = child;
 +
 +      if (!of_property_read_string(child, "ti,nand-ecc-opt", &s))
 +              for (val = 0; val < ARRAY_SIZE(nand_ecc_opts); val++)
 +                      if (!strcasecmp(s, nand_ecc_opts[val])) {
 +                              gpmc_nand_data->ecc_opt = val;
 +                              break;
 +                      }
 +
 +      val = of_get_nand_bus_width(child);
 +      if (val == 16)
 +              gpmc_nand_data->devsize = NAND_BUSWIDTH_16;
 +
 +      gpmc_read_timings_dt(child, &gpmc_t);
 +      gpmc_nand_init(gpmc_nand_data, &gpmc_t);
 +
 +      return 0;
 +}
 +#else
 +static int gpmc_probe_nand_child(struct platform_device *pdev,
 +                               struct device_node *child)
 +{
        return 0;
  }
 +#endif
 +
 +#ifdef CONFIG_MTD_ONENAND
 +static int gpmc_probe_onenand_child(struct platform_device *pdev,
 +                               struct device_node *child)
 +{
 +      u32 val;
 +      struct omap_onenand_platform_data *gpmc_onenand_data;
 +
 +      if (of_property_read_u32(child, "reg", &val) < 0) {
 +              dev_err(&pdev->dev, "%s has no 'reg' property\n",
 +                      child->full_name);
 +              return -ENODEV;
 +      }
 +
 +      gpmc_onenand_data = devm_kzalloc(&pdev->dev, sizeof(*gpmc_onenand_data),
 +                                       GFP_KERNEL);
 +      if (!gpmc_onenand_data)
 +              return -ENOMEM;
 +
 +      gpmc_onenand_data->cs = val;
 +      gpmc_onenand_data->of_node = child;
 +      gpmc_onenand_data->dma_channel = -1;
 +
 +      if (!of_property_read_u32(child, "dma-channel", &val))
 +              gpmc_onenand_data->dma_channel = val;
 +
 +      gpmc_onenand_init(gpmc_onenand_data);
 +
 +      return 0;
 +}
 +#else
 +static int gpmc_probe_onenand_child(struct platform_device *pdev,
 +                                  struct device_node *child)
 +{
 +      return 0;
 +}
 +#endif
 +
 +static int gpmc_probe_dt(struct platform_device *pdev)
 +{
 +      int ret;
 +      struct device_node *child;
 +      const struct of_device_id *of_id =
 +              of_match_device(gpmc_dt_ids, &pdev->dev);
 +
 +      if (!of_id)
 +              return 0;
 +
 +      for_each_node_by_name(child, "nand") {
 +              ret = gpmc_probe_nand_child(pdev, child);
 +              if (ret < 0) {
 +                      of_node_put(child);
 +                      return ret;
 +              }
 +      }
 +
 +      for_each_node_by_name(child, "onenand") {
 +              ret = gpmc_probe_onenand_child(pdev, child);
 +              if (ret < 0) {
 +                      of_node_put(child);
 +                      return ret;
 +              }
 +      }
 +      return 0;
 +}
 +#else
 +static int gpmc_probe_dt(struct platform_device *pdev)
 +{
 +      return 0;
 +}
 +#endif
  
  static int gpmc_probe(struct platform_device *pdev)
  {
        phys_base = res->start;
        mem_size = resource_size(res);
  
 -      gpmc_base = devm_request_and_ioremap(&pdev->dev, res);
 -      if (!gpmc_base) {
 -              dev_err(&pdev->dev, "error: request memory / ioremap\n");
 -              return -EADDRNOTAVAIL;
 -      }
 +      gpmc_base = devm_ioremap_resource(&pdev->dev, res);
 +      if (IS_ERR(gpmc_base))
 +              return PTR_ERR(gpmc_base);
  
        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
        if (res == NULL)
        if (IS_ERR_VALUE(gpmc_setup_irq()))
                dev_warn(gpmc_dev, "gpmc_setup_irq failed\n");
  
 +      rc = gpmc_probe_dt(pdev);
 +      if (rc < 0) {
 +              clk_disable_unprepare(gpmc_l3_clk);
 +              clk_put(gpmc_l3_clk);
 +              dev_err(gpmc_dev, "failed to probe DT parameters\n");
 +              return rc;
 +      }
 +
        return 0;
  }
  
@@@ -1411,7 -1191,6 +1411,7 @@@ static struct platform_driver gpmc_driv
        .driver         = {
                .name   = DEVICE_NAME,
                .owner  = THIS_MODULE,
 +              .of_match_table = of_match_ptr(gpmc_dt_ids),
        },
  };
  
@@@ -1426,7 -1205,7 +1426,7 @@@ static __exit void gpmc_exit(void
  
  }
  
- postcore_initcall(gpmc_init);
omap_postcore_initcall(gpmc_init);
  module_exit(gpmc_exit);
  
  static int __init omap_gpmc_init(void)
        struct platform_device *pdev;
        char *oh_name = "gpmc";
  
 +      /*
 +       * if the board boots up with a populated DT, do not
 +       * manually add the device from this initcall
 +       */
 +      if (of_have_populated_dt())
 +              return -ENODEV;
 +
        oh = omap_hwmod_lookup(oh_name);
        if (!oh) {
                pr_err("Could not look up %s\n", oh_name);
  
        return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
  }
- postcore_initcall(omap_gpmc_init);
omap_postcore_initcall(omap_gpmc_init);
  
  static irqreturn_t gpmc_handle_irq(int irq, void *dev)
  {
index 5470948836060d4dfa8cf72f11d4b5c5af4d42e6,ec11e49e08e5b4542bde67442189aaf227ba6748..708bb115a27ff8e54f0e760eaebaf2c10c9f4af1
  #include <linux/init.h>
  #include <linux/io.h>
  #include <linux/irq.h>
 +#include <linux/irqchip.h>
  #include <linux/platform_device.h>
  #include <linux/memblock.h>
  #include <linux/of_irq.h>
  #include <linux/of_platform.h>
  #include <linux/export.h>
 +#include <linux/irqchip/arm-gic.h>
  
 -#include <asm/hardware/gic.h>
  #include <asm/hardware/cache-l2x0.h>
  #include <asm/mach/map.h>
  #include <asm/memblock.h>
@@@ -226,7 -225,7 +226,7 @@@ static int __init omap_l2_cache_init(vo
  
        return 0;
  }
- early_initcall(omap_l2_cache_init);
omap_early_initcall(omap_l2_cache_init);
  #endif
  
  void __iomem *omap4_get_sar_ram_base(void)
@@@ -254,12 -253,18 +254,12 @@@ static int __init omap4_sar_ram_init(vo
  
        return 0;
  }
- early_initcall(omap4_sar_ram_init);
omap_early_initcall(omap4_sar_ram_init);
  
 -static struct of_device_id irq_match[] __initdata = {
 -      { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
 -      { .compatible = "arm,cortex-a15-gic", .data = gic_of_init, },
 -      { }
 -};
 -
  void __init omap_gic_of_init(void)
  {
        omap_wakeupgen_init();
 -      of_irq_init(irq_match);
 +      irqchip_init();
  }
  
  #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
index 71729888ff03ed5e9f77bb003e89b0cd047e4945,76419383f7d3eda5aee1809817c94ac0aca6ef72..72c2ca1e3f7039a6efe76e3d46ed2697748b7439
@@@ -131,6 -131,7 +131,6 @@@ static void omap2_gp_timer_set_mode(enu
  static struct clock_event_device clockevent_gpt = {
        .name           = "gp_timer",
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
 -      .shift          = 32,
        .rating         = 300,
        .set_next_event = omap2_gp_timer_set_next_event,
        .set_mode       = omap2_gp_timer_set_mode,
@@@ -227,7 -228,7 +227,7 @@@ static int __init omap_dm_timer_init_on
        int r = 0;
  
        if (of_have_populated_dt()) {
 -              np = omap_get_timer_dt(omap_timer_match, NULL);
 +              np = omap_get_timer_dt(omap_timer_match, property);
                if (!np)
                        return -ENODEV;
  
@@@ -335,11 -336,17 +335,11 @@@ static void __init omap2_gp_clockevent_
  
        __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW);
  
 -      clockevent_gpt.mult = div_sc(clkev.rate, NSEC_PER_SEC,
 -                                   clockevent_gpt.shift);
 -      clockevent_gpt.max_delta_ns =
 -              clockevent_delta2ns(0xffffffff, &clockevent_gpt);
 -      clockevent_gpt.min_delta_ns =
 -              clockevent_delta2ns(3, &clockevent_gpt);
 -              /* Timer internal resynch latency. */
 -
        clockevent_gpt.cpumask = cpu_possible_mask;
        clockevent_gpt.irq = omap_dm_timer_get_irq(&clkev);
 -      clockevents_register_device(&clockevent_gpt);
 +      clockevents_config_and_register(&clockevent_gpt, clkev.rate,
 +                                      3, /* Timer internal resynch latency */
 +                                      0xffffffff);
  
        pr_info("OMAP clockevent source: GPTIMER%d at %lu Hz\n",
                gptimer_id, clkev.rate);
@@@ -545,7 -552,7 +545,7 @@@ static inline void __init realtime_coun
  
  #define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \
                               clksrc_nr, clksrc_src)                   \
 -static void __init omap##name##_gptimer_timer_init(void)              \
 +void __init omap##name##_gptimer_timer_init(void)                     \
  {                                                                     \
        omap_dmtimer_init();                                            \
        omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop);    \
  
  #define OMAP_SYS_32K_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop,        \
                                clksrc_nr, clksrc_src)                  \
 -static void __init omap##name##_sync32k_timer_init(void)              \
 +void __init omap##name##_sync32k_timer_init(void)             \
  {                                                                     \
        omap_dmtimer_init();                                            \
        omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop);    \
                omap2_sync32k_clocksource_init();                       \
  }
  
 -#define OMAP_SYS_TIMER(name, clksrc)                                  \
 -struct sys_timer omap##name##_timer = {                                       \
 -      .init   = omap##name##_##clksrc##_timer_init,                   \
 -};
 -
  #ifdef CONFIG_ARCH_OMAP2
  OMAP_SYS_32K_TIMER_INIT(2, 1, OMAP2_32K_SOURCE, "ti,timer-alwon",
                        2, OMAP2_MPU_SOURCE);
 -OMAP_SYS_TIMER(2, sync32k);
  #endif /* CONFIG_ARCH_OMAP2 */
  
  #ifdef CONFIG_ARCH_OMAP3
  OMAP_SYS_32K_TIMER_INIT(3, 1, OMAP3_32K_SOURCE, "ti,timer-alwon",
                        2, OMAP3_MPU_SOURCE);
 -OMAP_SYS_TIMER(3, sync32k);
  OMAP_SYS_32K_TIMER_INIT(3_secure, 12, OMAP3_32K_SOURCE, "ti,timer-secure",
                        2, OMAP3_MPU_SOURCE);
 -OMAP_SYS_TIMER(3_secure, sync32k);
  OMAP_SYS_GP_TIMER_INIT(3_gp, 1, OMAP3_MPU_SOURCE, "ti,timer-alwon",
                       2, OMAP3_MPU_SOURCE);
 -OMAP_SYS_TIMER(3_gp, gptimer);
  #endif /* CONFIG_ARCH_OMAP3 */
  
  #ifdef CONFIG_SOC_AM33XX
  OMAP_SYS_GP_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, "ti,timer-alwon",
                       2, OMAP4_MPU_SOURCE);
 -OMAP_SYS_TIMER(3_am33xx, gptimer);
  #endif /* CONFIG_SOC_AM33XX */
  
  #ifdef CONFIG_ARCH_OMAP4
@@@ -589,7 -606,7 +589,7 @@@ OMAP_SYS_32K_TIMER_INIT(4, 1, OMAP4_32K
                        2, OMAP4_MPU_SOURCE);
  #ifdef CONFIG_LOCAL_TIMERS
  static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, OMAP44XX_LOCAL_TWD_BASE, 29);
 -static void __init omap4_local_timer_init(void)
 +void __init omap4_local_timer_init(void)
  {
        omap4_sync32k_timer_init();
        /* Local timers are not supprted on OMAP4430 ES1.0 */
        }
  }
  #else /* CONFIG_LOCAL_TIMERS */
 -static void __init omap4_local_timer_init(void)
 +void __init omap4_local_timer_init(void)
  {
        omap4_sync32k_timer_init();
  }
  #endif /* CONFIG_LOCAL_TIMERS */
 -OMAP_SYS_TIMER(4, local);
  #endif /* CONFIG_ARCH_OMAP4 */
  
  #ifdef CONFIG_SOC_OMAP5
  OMAP_SYS_32K_TIMER_INIT(5, 1, OMAP4_32K_SOURCE, "ti,timer-alwon",
                        2, OMAP4_MPU_SOURCE);
 -static void __init omap5_realtime_timer_init(void)
 +void __init omap5_realtime_timer_init(void)
  {
        int err;
  
        if (err)
                pr_err("%s: arch_timer_register failed %d\n", __func__, err);
  }
 -OMAP_SYS_TIMER(5, realtime);
  #endif /* CONFIG_SOC_OMAP5 */
  
  /**
@@@ -719,7 -738,7 +719,7 @@@ static int __init omap2_dm_timer_init(v
  
        return 0;
  }
- arch_initcall(omap2_dm_timer_init);
omap_arch_initcall(omap2_dm_timer_init);
  
  /**
   * omap2_override_clocksource - clocksource override with user configuration
index 9adcb9e76f5445d040848817954d86b065856e0c,cdcc4329b4a88d26dbeb1048eb923bf49980c02a..7a602069bab99d334eecf147a5abb82e1bec5d4e
@@@ -1,13 -1,17 +1,18 @@@
  config ARCH_VT8500
-       bool "VIA/WonderMedia 85xx" if ARCH_MULTI_V5
-       default ARCH_VT8500_SINGLE
+       bool
        select ARCH_HAS_CPUFREQ
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
-       select CPU_ARM926T
 +      select CLKSRC_OF
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
 +      select VT8500_TIMER
        help
          Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
+ config ARCH_WM8505
+       bool "VIA/Wondermedia 85xx and WM8650"
+       depends on ARCH_MULTI_V5
+       select ARCH_VT8500
+       select CPU_ARM926T
+       help
index 68c3418160baa20a8325d4faeb1e1058d4c83f58,1abe0964a5ab832c1b9aec65ab608d798c0acc4d..ee13dc78430c18f542d4a59dad5d9d09a8256b8c
@@@ -60,9 -60,6 +60,9 @@@
  #define CPDMA_DESC_EOQ                BIT(28)
  #define CPDMA_DESC_TD_COMPLETE        BIT(27)
  #define CPDMA_DESC_PASS_CRC   BIT(26)
 +#define CPDMA_DESC_TO_PORT_EN BIT(20)
 +#define CPDMA_TO_PORT_SHIFT   16
 +#define CPDMA_DESC_PORT_MASK  (BIT(18) | BIT(17) | BIT(16))
  
  #define CPDMA_TEARDOWN_VALUE  0xfffffffc
  
@@@ -108,13 -105,13 +108,13 @@@ struct cpdma_ctlr 
  };
  
  struct cpdma_chan {
 +      struct cpdma_desc __iomem       *head, *tail;
 +      void __iomem                    *hdp, *cp, *rxfree;
        enum cpdma_state                state;
        struct cpdma_ctlr               *ctlr;
        int                             chan_num;
        spinlock_t                      lock;
 -      struct cpdma_desc __iomem       *head, *tail;
        int                             count;
 -      void __iomem                    *hdp, *cp, *rxfree;
        u32                             mask;
        cpdma_handler_fn                handler;
        enum dma_data_direction         dir;
  #define chan_write(chan, fld, v)      __raw_writel(v, (chan)->fld)
  #define desc_write(desc, fld, v)      __raw_writel((u32)(v), &(desc)->fld)
  
 +#define cpdma_desc_to_port(chan, mode, directed)                      \
 +      do {                                                            \
 +              if (!is_rx_chan(chan) && ((directed == 1) ||            \
 +                                        (directed == 2)))             \
 +                      mode |= (CPDMA_DESC_TO_PORT_EN |                \
 +                               (directed << CPDMA_TO_PORT_SHIFT));    \
 +      } while (0)
 +
  /*
   * Utility constructs for a cpdma descriptor pool.  Some devices (e.g. davinci
   * emac) have dedicated on-chip memory for these descriptors.  Some other
@@@ -228,27 -217,17 +228,27 @@@ desc_from_phys(struct cpdma_desc_pool *
  }
  
  static struct cpdma_desc __iomem *
 -cpdma_desc_alloc(struct cpdma_desc_pool *pool, int num_desc)
 +cpdma_desc_alloc(struct cpdma_desc_pool *pool, int num_desc, bool is_rx)
  {
        unsigned long flags;
        int index;
 +      int desc_start;
 +      int desc_end;
        struct cpdma_desc __iomem *desc = NULL;
  
        spin_lock_irqsave(&pool->lock, flags);
  
 -      index = bitmap_find_next_zero_area(pool->bitmap, pool->num_desc, 0,
 -                                         num_desc, 0);
 -      if (index < pool->num_desc) {
 +      if (is_rx) {
 +              desc_start = 0;
 +              desc_end = pool->num_desc/2;
 +       } else {
 +              desc_start = pool->num_desc/2;
 +              desc_end = pool->num_desc;
 +      }
 +
 +      index = bitmap_find_next_zero_area(pool->bitmap,
 +                              desc_end, desc_start, num_desc, 0);
 +      if (index < desc_end) {
                bitmap_set(pool->bitmap, index, num_desc);
                desc = pool->iomap + pool->desc_size * index;
                pool->used_desc++;
@@@ -460,8 -439,10 +460,8 @@@ int cpdma_ctlr_destroy(struct cpdma_ctl
        if (ctlr->state != CPDMA_STATE_IDLE)
                cpdma_ctlr_stop(ctlr);
  
 -      for (i = 0; i < ARRAY_SIZE(ctlr->channels); i++) {
 -              if (ctlr->channels[i])
 -                      cpdma_chan_destroy(ctlr->channels[i]);
 -      }
 +      for (i = 0; i < ARRAY_SIZE(ctlr->channels); i++)
 +              cpdma_chan_destroy(ctlr->channels[i]);
  
        cpdma_desc_pool_destroy(ctlr->pool);
        spin_unlock_irqrestore(&ctlr->lock, flags);
@@@ -492,11 -473,13 +492,13 @@@ int cpdma_ctlr_int_ctrl(struct cpdma_ct
        spin_unlock_irqrestore(&ctlr->lock, flags);
        return 0;
  }
+ EXPORT_SYMBOL_GPL(cpdma_ctlr_int_ctrl);
  
 -void cpdma_ctlr_eoi(struct cpdma_ctlr *ctlr)
 +void cpdma_ctlr_eoi(struct cpdma_ctlr *ctlr, u32 value)
  {
 -      dma_reg_write(ctlr, CPDMA_MACEOIVECTOR, 0);
 +      dma_reg_write(ctlr, CPDMA_MACEOIVECTOR, value);
  }
+ EXPORT_SYMBOL_GPL(cpdma_ctlr_eoi);
  
  struct cpdma_chan *cpdma_chan_create(struct cpdma_ctlr *ctlr, int chan_num,
                                     cpdma_handler_fn handler)
@@@ -671,7 -654,7 +673,7 @@@ static void __cpdma_chan_submit(struct 
  }
  
  int cpdma_chan_submit(struct cpdma_chan *chan, void *token, void *data,
 -                    int len, gfp_t gfp_mask)
 +                    int len, int directed, gfp_t gfp_mask)
  {
        struct cpdma_ctlr               *ctlr = chan->ctlr;
        struct cpdma_desc __iomem       *desc;
                goto unlock_ret;
        }
  
 -      desc = cpdma_desc_alloc(ctlr->pool, 1);
 +      desc = cpdma_desc_alloc(ctlr->pool, 1, is_rx_chan(chan));
        if (!desc) {
                chan->stats.desc_alloc_fail++;
                ret = -ENOMEM;
  
        buffer = dma_map_single(ctlr->dev, data, len, chan->dir);
        mode = CPDMA_DESC_OWNER | CPDMA_DESC_SOP | CPDMA_DESC_EOP;
 +      cpdma_desc_to_port(chan, mode, directed);
  
        desc_write(desc, hw_next,   0);
        desc_write(desc, hw_buffer, buffer);
@@@ -724,29 -706,6 +726,29 @@@ unlock_ret
  }
  EXPORT_SYMBOL_GPL(cpdma_chan_submit);
  
 +bool cpdma_check_free_tx_desc(struct cpdma_chan *chan)
 +{
 +      unsigned long flags;
 +      int index;
 +      bool ret;
 +      struct cpdma_ctlr       *ctlr = chan->ctlr;
 +      struct cpdma_desc_pool  *pool = ctlr->pool;
 +
 +      spin_lock_irqsave(&pool->lock, flags);
 +
 +      index = bitmap_find_next_zero_area(pool->bitmap,
 +                              pool->num_desc, pool->num_desc/2, 1, 0);
 +
 +      if (index < pool->num_desc)
 +              ret = true;
 +      else
 +              ret = false;
 +
 +      spin_unlock_irqrestore(&pool->lock, flags);
 +      return ret;
 +}
 +EXPORT_SYMBOL_GPL(cpdma_check_free_tx_desc);
 +
  static void __cpdma_chan_free(struct cpdma_chan *chan,
                              struct cpdma_desc __iomem *desc,
                              int outlen, int status)
@@@ -792,8 -751,7 +794,8 @@@ static int __cpdma_chan_process(struct 
                status = -EBUSY;
                goto unlock_ret;
        }
 -      status  = status & (CPDMA_DESC_EOQ | CPDMA_DESC_TD_COMPLETE);
 +      status  = status & (CPDMA_DESC_EOQ | CPDMA_DESC_TD_COMPLETE |
 +                          CPDMA_DESC_PORT_MASK);
  
        chan->head = desc_from_phys(pool, desc_read(desc, hw_next));
        chan_write(chan, cp, desc_dma);
@@@ -1028,3 -986,4 +1030,4 @@@ unlock_ret
        spin_unlock_irqrestore(&ctlr->lock, flags);
        return ret;
  }
+ EXPORT_SYMBOL_GPL(cpdma_control_set);
index 0b24108d1e1b8ca31b3f45b1a45027a2a8a730d9,c0c37b5253037f9c86436e5230d57b8d5c3f7e34..cc1f7bf53fd07c1c1788d0183b19e4ce41de8c1b
@@@ -1,19 -1,21 +1,19 @@@
 -menu "Remoteproc drivers (EXPERIMENTAL)"
 +menu "Remoteproc drivers"
  
  # REMOTEPROC gets selected by whoever wants it
  config REMOTEPROC
        tristate
 -      depends on EXPERIMENTAL
        depends on HAS_DMA
        select FW_CONFIG
        select VIRTIO
  
  config OMAP_REMOTEPROC
        tristate "OMAP remoteproc support"
 -      depends on EXPERIMENTAL
        depends on HAS_DMA
        depends on ARCH_OMAP4
        depends on OMAP_IOMMU
+       depends on OMAP_MBOX_FWK
        select REMOTEPROC
-       select OMAP_MBOX_FWK
        select RPMSG
        help
          Say y here to support OMAP's remote processors (dual M3
@@@ -30,6 -32,7 +30,6 @@@
  
  config STE_MODEM_RPROC
        tristate "STE-Modem remoteproc support"
 -      depends on EXPERIMENTAL
        depends on HAS_DMA
        select REMOTEPROC
        default n