Merge tag 'cleanup2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 May 2012 19:31:49 +0000 (12:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 May 2012 19:31:49 +0000 (12:31 -0700)
Pull arm-soc cleanups (part 2) from Olof Johansson:
 "More cleanups, continuing an earlier set with omap and samsung
  specific cleanups.  These could not go into the first set because they
  have dependencies on various other series that in turn depend on the
  first cleanups."

Fixed up conflicts in arch/arm/plat-omap/counter_32k.c due to commit
bd0493eaaf5c: "move read_{boot,persistent}_clock to the architecture
level" that changed how the persistent clocks were handled.  And trivial
conflicts in arch/arm/mach-omap1/common.h due to just independent
changes close to each other.

* tag 'cleanup2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (35 commits)
  ARM: SAMSUNG: merge plat-s5p into plat-samsung
  ARM: SAMSUNG: move options for common s5p into plat-samsung/Kconfig
  ARM: SAMSUNG: move setup code for s5p mfc and mipiphy into plat-samsung
  ARM: SAMSUNG: move platform device for s5p uart into plat-samsung
  ARM: SAMSUNG: move hr timer for common s5p into plat-samsung
  ARM: SAMSUNG: move pm part for common s5p into plat-samsung
  ARM: SAMSUNG: move interrupt part for common s5p into plat-samsung
  ARM: SAMSUNG: move clock part for common s5p into plat-samsung
  ARM: S3C24XX: Use common macro to define resources on dev-uart.c
  ARM: S3C24XX: move common clock init into common.c
  ARM: S3C24XX: move common power-management code to mach-s3c24xx
  ARM: S3C24XX: move plat-s3c24xx/dev-uart.c into common.c
  ARM: S3C24XX: move plat-s3c24xx/cpu.c
  ARM: OMAP2+: Kconfig: convert SOC_OMAPAM33XX to SOC_AM33XX
  ARM: OMAP2+: Kconfig: convert SOC_OMAPTI81XX to SOC_TI81XX
  GPMC: add ECC control definitions
  ARM: OMAP2+: dmtimer: remove redundant sysconfig context restore
  ARM: OMAP: AM35xx: convert 3517 detection/flags to AM35xx
  ARM: OMAP: AM35xx: remove redunant cpu_is checks for AM3505
  ARM: OMAP1: Pass dma request lines in platform data to MMC driver
  ...

15 files changed:
1  2 
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/mach-omap1/common.h
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/common.h
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/gpmc.c
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/irq.c
arch/arm/plat-omap/counter_32k.c
arch/arm/plat-omap/dma.c
arch/arm/plat-omap/dmtimer.c
arch/arm/plat-omap/include/plat/common.h
arch/arm/plat-omap/include/plat/dma.h
arch/arm/plat-omap/include/plat/dmtimer.h

diff --combined arch/arm/Kconfig
@@@ -1,13 -1,9 +1,13 @@@
  config ARM
        bool
        default y
 +      select ARCH_HAVE_CUSTOM_GPIO_H
        select HAVE_AOUT
        select HAVE_DMA_API_DEBUG
        select HAVE_IDE if PCI || ISA || PCMCIA
 +      select HAVE_DMA_ATTRS
 +      select HAVE_DMA_CONTIGUOUS if (CPU_V6 || CPU_V6K || CPU_V7)
 +      select CMA if (CPU_V6 || CPU_V6K || CPU_V7)
        select HAVE_MEMBLOCK
        select RTC_LIB
        select SYS_SUPPORTS_APM_EMULATION
@@@ -15,7 -11,6 +15,7 @@@
        select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
        select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
        select HAVE_ARCH_KGDB
 +      select HAVE_ARCH_TRACEHOOK
        select HAVE_KPROBES if !XIP_KERNEL
        select HAVE_KRETPROBES if (HAVE_KPROBES)
        select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
        select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
        select HAVE_C_RECORDMCOUNT
        select HAVE_GENERIC_HARDIRQS
 +      select HARDIRQS_SW_RESEND
 +      select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
 +      select GENERIC_IRQ_PROBE
 +      select HARDIRQS_SW_RESEND
        select CPU_PM if (SUSPEND || CPU_IDLE)
        select GENERIC_PCI_IOMAP
 -      select HAVE_BPF_JIT if NET
 +      select HAVE_BPF_JIT
 +      select GENERIC_SMP_IDLE_THREAD
 +      select KTIME_SCALAR
 +      select GENERIC_CLOCKEVENTS_BROADCAST if SMP
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
  config ARM_HAS_SG_CHAIN
        bool
  
 -config HAVE_PWM
 +config NEED_SG_DMA_LENGTH
        bool
  
 -config MIGHT_HAVE_PCI
 +config ARM_DMA_USE_IOMMU
 +      select NEED_SG_DMA_LENGTH
 +      select ARM_HAS_SG_CHAIN
        bool
  
 -config SYS_SUPPORTS_APM_EMULATION
 -      bool
 -
 -config GENERIC_GPIO
 +config HAVE_PWM
        bool
  
 -config ARCH_USES_GETTIMEOFFSET
 +config MIGHT_HAVE_PCI
        bool
 -      default n
  
 -config GENERIC_CLOCKEVENTS
 +config SYS_SUPPORTS_APM_EMULATION
        bool
  
 -config GENERIC_CLOCKEVENTS_BROADCAST
 +config GENERIC_GPIO
        bool
 -      depends on GENERIC_CLOCKEVENTS
 -      default y if SMP
 -
 -config KTIME_SCALAR
 -      bool
 -      default y
  
  config HAVE_TCM
        bool
@@@ -105,6 -101,14 +105,6 @@@ config EIS
  config SBUS
        bool
  
 -config MCA
 -      bool
 -      help
 -        MicroChannel Architecture is found in some IBM PS/2 machines and
 -        laptops.  It is a bus system similar to PCI or ISA. See
 -        <file:Documentation/mca.txt> (and especially the web page given
 -        there) before attempting to build an MCA bus kernel.
 -
  config STACKTRACE_SUPPORT
        bool
        default y
@@@ -122,6 -126,14 +122,6 @@@ config TRACE_IRQFLAGS_SUPPOR
        bool
        default y
  
 -config HARDIRQS_SW_RESEND
 -      bool
 -      default y
 -
 -config GENERIC_IRQ_PROBE
 -      bool
 -      default y
 -
  config GENERIC_LOCKBREAK
        bool
        default y
@@@ -147,6 -159,9 +147,6 @@@ config ARCH_HAS_CPUFRE
          and that the relevant menu configurations are displayed for
          it.
  
 -config ARCH_HAS_CPU_IDLE_WAIT
 -       def_bool y
 -
  config GENERIC_HWEIGHT
        bool
        default y
@@@ -265,7 -280,6 +265,7 @@@ config ARCH_INTEGRATO
        select NEED_MACH_IO_H
        select NEED_MACH_MEMORY_H
        select SPARSE_IRQ
 +      select MULTI_IRQ_HANDLER
        help
          Support for ARM's Integrator platform.
  
@@@ -326,8 -340,8 +326,8 @@@ config ARCH_AT9
        select IRQ_DOMAIN
        select NEED_MACH_IO_H if PCCARD
        help
 -        This enables support for systems based on the Atmel AT91RM9200,
 -        AT91SAM9 processors.
 +        This enables support for systems based on Atmel
 +        AT91RM9200 and AT91SAM9* processors.
  
  config ARCH_BCMRING
        bool "Broadcom BCMRING"
@@@ -359,12 -373,12 +359,12 @@@ config ARCH_HIGHBAN
          Support for the Calxeda Highbank SoC based boards.
  
  config ARCH_CLPS711X
 -      bool "Cirrus Logic CLPS711x/EP721x-based"
 +      bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
        select CPU_ARM720T
        select ARCH_USES_GETTIMEOFFSET
        select NEED_MACH_MEMORY_H
        help
 -        Support for Cirrus Logic 711x/721x based boards.
 +        Support for Cirrus Logic 711x/721x/731x based boards.
  
  config ARCH_CNS3XXX
        bool "Cavium Networks CNS3XXX family"
@@@ -393,8 -407,6 +393,8 @@@ config ARCH_PRIMA
        select CLKDEV_LOOKUP
        select GENERIC_IRQ_CHIP
        select MIGHT_HAVE_CACHE_L2X0
 +      select PINCTRL
 +      select PINCTRL_SIRF
        select USE_OF
        select ZONE_DMA
        help
@@@ -457,7 -469,6 +457,7 @@@ config ARCH_MX
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select HAVE_CLK_PREPARE
 +      select PINCTRL
        help
          Support for Freescale MXS-based family of processors
  
@@@ -517,6 -528,28 +517,6 @@@ config ARCH_IOP33
        help
          Support for Intel's IOP33X (XScale) family of processors.
  
 -config ARCH_IXP23XX
 -      bool "IXP23XX-based"
 -      depends on MMU
 -      select CPU_XSC3
 -      select PCI
 -      select ARCH_USES_GETTIMEOFFSET
 -      select NEED_MACH_IO_H
 -      select NEED_MACH_MEMORY_H
 -      help
 -        Support for Intel's IXP23xx (XScale) family of processors.
 -
 -config ARCH_IXP2000
 -      bool "IXP2400/2800-based"
 -      depends on MMU
 -      select CPU_XSCALE
 -      select PCI
 -      select ARCH_USES_GETTIMEOFFSET
 -      select NEED_MACH_IO_H
 -      select NEED_MACH_MEMORY_H
 -      help
 -        Support for Intel's IXP2400/2800 (XScale) family of processors.
 -
  config ARCH_IXP4XX
        bool "IXP4xx-based"
        depends on MMU
@@@ -564,7 -597,6 +564,7 @@@ config ARCH_LPC32X
        select USB_ARCH_HAS_OHCI
        select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
 +      select USE_OF
        help
          Support for the NXP LPC32XX family of processors
  
@@@ -600,7 -632,7 +600,7 @@@ config ARCH_MM
        select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
        select GPIO_PXA
 -      select TICK_ONESHOT
 +      select IRQ_DOMAIN
        select PLAT_PXA
        select SPARSE_IRQ
        select GENERIC_ALLOCATOR
@@@ -684,6 -716,7 +684,6 @@@ config ARCH_PX
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
        select GPIO_PXA
 -      select TICK_ONESHOT
        select PLAT_PXA
        select SPARSE_IRQ
        select AUTO_ZRELADDR
@@@ -750,6 -783,7 +750,6 @@@ config ARCH_SA110
        select CPU_FREQ
        select GENERIC_CLOCKEVENTS
        select CLKDEV_LOOKUP
 -      select TICK_ONESHOT
        select ARCH_REQUIRE_GPIOLIB
        select HAVE_IDE
        select NEED_MACH_MEMORY_H
@@@ -912,7 -946,6 +912,7 @@@ config ARCH_NOMADI
        select CPU_ARM926T
        select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
 +      select PINCTRL
        select MIGHT_HAVE_CACHE_L2X0
        select ARCH_REQUIRE_GPIOLIB
        help
@@@ -1013,6 -1046,10 +1013,6 @@@ source "arch/arm/mach-iop13xx/Kconfig
  
  source "arch/arm/mach-ixp4xx/Kconfig"
  
 -source "arch/arm/mach-ixp2000/Kconfig"
 -
 -source "arch/arm/mach-ixp23xx/Kconfig"
 -
  source "arch/arm/mach-kirkwood/Kconfig"
  
  source "arch/arm/mach-ks8695/Kconfig"
@@@ -1051,7 -1088,6 +1051,6 @@@ source "arch/arm/mach-sa1100/Kconfig
  
  source "arch/arm/plat-samsung/Kconfig"
  source "arch/arm/plat-s3c24xx/Kconfig"
- source "arch/arm/plat-s5p/Kconfig"
  
  source "arch/arm/plat-spear/Kconfig"
  
@@@ -1436,6 -1472,8 +1435,6 @@@ endmen
  
  menu "Kernel Features"
  
 -source "kernel/time/Kconfig"
 -
  config HAVE_SMP
        bool
        help
@@@ -1513,15 -1551,10 +1512,15 @@@ config HAVE_ARM_SC
        help
          This option enables support for the ARM system coherency unit
  
 +config ARM_ARCH_TIMER
 +      bool "Architected timer support"
 +      depends on CPU_V7
 +      help
 +        This option enables support for the ARM architected timer
 +
  config HAVE_ARM_TWD
        bool
        depends on SMP
 -      select TICK_ONESHOT
        help
          This options enables support for the ARM timer and watchdog unit
  
@@@ -1902,10 -1935,10 +1901,10 @@@ choic
        default ZBOOT_ROM_NONE
        help
          Include experimental SD/MMC loading code in the ROM-able zImage.
 -        With this enabled it is possible to write the the ROM-able zImage
 +        With this enabled it is possible to write the ROM-able zImage
          kernel image to an MMC or SD card and boot the kernel straight
          from the reset vector. At reset the processor Mask ROM will load
 -        the first part of the the ROM-able zImage which in turn loads the
 +        the first part of the ROM-able zImage which in turn loads the
          rest the kernel image to RAM.
  
  config ZBOOT_ROM_NONE
@@@ -2247,9 -2280,9 +2246,9 @@@ menu "Power management options
  source "kernel/power/Kconfig"
  
  config ARCH_SUSPEND_POSSIBLE
 -      depends on !ARCH_S5PC100
 +      depends on !ARCH_S5PC100 && !ARCH_TEGRA
        depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \
 -              CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE
 +              CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK
        def_bool y
  
  config ARM_CPU_SUSPEND
diff --combined arch/arm/Makefile
@@@ -70,6 -70,8 +70,6 @@@ arch-$(CONFIG_CPU_32v4)               :=-D__LINUX_AR
  arch-$(CONFIG_CPU_32v3)               :=-D__LINUX_ARM_ARCH__=3 -march=armv3
  
  # This selects how we optimise for the processor.
 -tune-$(CONFIG_CPU_ARM610)     :=-mtune=arm610
 -tune-$(CONFIG_CPU_ARM710)     :=-mtune=arm710
  tune-$(CONFIG_CPU_ARM7TDMI)   :=-mtune=arm7tdmi
  tune-$(CONFIG_CPU_ARM720T)    :=-mtune=arm7tdmi
  tune-$(CONFIG_CPU_ARM740T)    :=-mtune=arm7tdmi
@@@ -117,7 -119,7 +117,7 @@@ KBUILD_AFLAGS      +=$(CFLAGS_ABI) $(AFLAGS_
  CHECKFLAGS    += -D__arm__
  
  #Default value
 -head-y                := arch/arm/kernel/head$(MMUEXT).o arch/arm/kernel/init_task.o
 +head-y                := arch/arm/kernel/head$(MMUEXT).o
  textofs-y     := 0x00008000
  textofs-$(CONFIG_ARCH_CLPS711X) := 0x00028000
  # We don't want the htc bootloader to corrupt kernel during resume
@@@ -147,6 -149,8 +147,6 @@@ machine-$(CONFIG_ARCH_INTEGRATOR)  := in
  machine-$(CONFIG_ARCH_IOP13XX)                := iop13xx
  machine-$(CONFIG_ARCH_IOP32X)         := iop32x
  machine-$(CONFIG_ARCH_IOP33X)         := iop33x
 -machine-$(CONFIG_ARCH_IXP2000)                := ixp2000
 -machine-$(CONFIG_ARCH_IXP23XX)                := ixp23xx
  machine-$(CONFIG_ARCH_IXP4XX)         := ixp4xx
  machine-$(CONFIG_ARCH_KIRKWOOD)               := kirkwood
  machine-$(CONFIG_ARCH_KS8695)         := ks8695
@@@ -160,9 -164,7 +160,7 @@@ machine-$(CONFIG_ARCH_MXS)         := mx
  machine-$(CONFIG_ARCH_NETX)           := netx
  machine-$(CONFIG_ARCH_NOMADIK)                := nomadik
  machine-$(CONFIG_ARCH_OMAP1)          := omap1
- machine-$(CONFIG_ARCH_OMAP2)          := omap2
- machine-$(CONFIG_ARCH_OMAP3)          := omap2
- machine-$(CONFIG_ARCH_OMAP4)          := omap2
+ machine-$(CONFIG_ARCH_OMAP2PLUS)      := omap2
  machine-$(CONFIG_ARCH_ORION5X)                := orion5x
  machine-$(CONFIG_ARCH_PICOXCELL)      := picoxcell
  machine-$(CONFIG_ARCH_PNX4008)                := pnx4008
@@@ -205,7 -207,7 +203,7 @@@ plat-$(CONFIG_PLAT_NOMADIK)        := nomadi
  plat-$(CONFIG_PLAT_ORION)     := orion
  plat-$(CONFIG_PLAT_PXA)               := pxa
  plat-$(CONFIG_PLAT_S3C24XX)   := s3c24xx samsung
- plat-$(CONFIG_PLAT_S5P)               := s5p samsung
+ plat-$(CONFIG_PLAT_S5P)               := samsung
  plat-$(CONFIG_PLAT_SPEAR)     := spear
  plat-$(CONFIG_PLAT_VERSATILE) := versatile
  
@@@ -27,7 -27,6 +27,7 @@@
  #define __ARCH_ARM_MACH_OMAP1_COMMON_H
  
  #include <plat/common.h>
 +#include <linux/mtd/mtd.h>
  
  #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
  void omap7xx_map_io(void);
@@@ -57,20 -56,15 +57,27 @@@ void omap1_init_early(void)
  void omap1_init_irq(void);
  void omap1_restart(char, const char *);
  
 +extern void __init omap_check_revision(void);
 +
 +extern void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd,
 +                             unsigned int ctrl);
 +
  extern struct sys_timer omap1_timer;
- extern bool omap_32k_timer_init(void);
+ #ifdef CONFIG_OMAP_32K_TIMER
+ extern int omap_32k_timer_init(void);
+ #else
+ static inline int __init omap_32k_timer_init(void)
+ {
+       return -ENODEV;
+ }
+ #endif
 -extern void __init omap_init_consistent_dma_size(void);
 +
 +extern u32 omap_irq_flags;
 +
 +#ifdef CONFIG_ARCH_OMAP16XX
 +extern int ocpi_enable(void);
 +#else
 +static inline int ocpi_enable(void) { return 0; }
 +#endif
  
  #endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
@@@ -17,7 -17,6 +17,7 @@@ config ARCH_OMAP2PLUS_TYPICA
        select MENELAUS if ARCH_OMAP2
        select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
        select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
 +      select HIGHMEM
        help
          Compile a kernel suitable for booting most boards
  
@@@ -78,12 -77,12 +78,12 @@@ config SOC_OMAP343
        default y
        select ARCH_OMAP_OTG
  
- config SOC_OMAPTI81XX
+ config SOC_TI81XX
        bool "TI81XX support"
        depends on ARCH_OMAP3
        default y
  
- config SOC_OMAPAM33XX
+ config SOC_AM33XX
        bool "AM33XX support"
        depends on ARCH_OMAP3
        default y
@@@ -320,12 -319,12 +320,12 @@@ config MACH_OMAP_3630SD
  
  config MACH_TI8168EVM
        bool "TI8168 Evaluation Module"
-       depends on SOC_OMAPTI81XX
+       depends on SOC_TI81XX
        default y
  
  config MACH_TI8148EVM
        bool "TI8148 Evaluation Module"
-       depends on SOC_OMAPTI81XX
+       depends on SOC_TI81XX
        default y
  
  config MACH_OMAP_4430SDP
@@@ -55,7 -55,7 +55,7 @@@ static inline void omap34xx_map_common_
  }
  #endif
  
- #ifdef CONFIG_SOC_OMAPTI81XX
+ #ifdef CONFIG_SOC_TI81XX
  extern void omapti81xx_map_common_io(void);
  #else
  static inline void omapti81xx_map_common_io(void)
@@@ -63,7 -63,7 +63,7 @@@
  }
  #endif
  
- #ifdef CONFIG_SOC_OMAPAM33XX
+ #ifdef CONFIG_SOC_AM33XX
  extern void omapam33xx_map_common_io(void);
  #else
  static inline void omapam33xx_map_common_io(void)
@@@ -136,6 -136,8 +136,6 @@@ void omap4_map_io(void)
  void ti81xx_map_io(void);
  void omap_barriers_init(void);
  
 -extern void __init omap_init_consistent_dma_size(void);
 -
  /**
   * omap_test_timeout - busy-loop, testing a condition
   * @cond: condition to test until it evaluates to true
@@@ -42,6 -42,7 +42,6 @@@
  
  static int __init omap3_l3_init(void)
  {
 -      int l;
        struct omap_hwmod *oh;
        struct platform_device *pdev;
        char oh_name[L3_MODULES_MAX_LEN];
@@@ -53,7 -54,7 +53,7 @@@
        if (!(cpu_is_omap34xx()))
                return -ENODEV;
  
 -      l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main");
 +      snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main");
  
        oh = omap_hwmod_lookup(oh_name);
  
@@@ -71,7 -72,7 +71,7 @@@ postcore_initcall(omap3_l3_init)
  
  static int __init omap4_l3_init(void)
  {
 -      int l, i;
 +      int i;
        struct omap_hwmod *oh[3];
        struct platform_device *pdev;
        char oh_name[L3_MODULES_MAX_LEN];
@@@ -88,7 -89,7 +88,7 @@@
                return -ENODEV;
  
        for (i = 0; i < L3_MODULES; i++) {
 -              l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main_%d", i+1);
 +              snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main_%d", i+1);
  
                oh[i] = omap_hwmod_lookup(oh_name);
                if (!(oh[i]))
@@@ -354,36 -355,6 +354,36 @@@ static void __init omap_init_dmic(void
  static inline void omap_init_dmic(void) {}
  #endif
  
 +#if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI) || \
 +              defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE)
 +
 +static struct platform_device omap_hdmi_audio = {
 +      .name   = "omap-hdmi-audio",
 +      .id     = -1,
 +};
 +
 +static void __init omap_init_hdmi_audio(void)
 +{
 +      struct omap_hwmod *oh;
 +      struct platform_device *pdev;
 +
 +      oh = omap_hwmod_lookup("dss_hdmi");
 +      if (!oh) {
 +              printk(KERN_ERR "Could not look up dss_hdmi hw_mod\n");
 +              return;
 +      }
 +
 +      pdev = omap_device_build("omap-hdmi-audio-dai",
 +              -1, oh, NULL, 0, NULL, 0, 0);
 +      WARN(IS_ERR(pdev),
 +           "Can't build omap_device for omap-hdmi-audio-dai.\n");
 +
 +      platform_device_register(&omap_hdmi_audio);
 +}
 +#else
 +static inline void omap_init_hdmi_audio(void) {}
 +#endif
 +
  #if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
  
  #include <plat/mcspi.h>
@@@ -645,7 -616,11 +645,11 @@@ static inline void omap242x_mmc_mux(str
  
  void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
  {
-       char *name = "mmci-omap";
+       struct platform_device *pdev;
+       struct omap_hwmod *oh;
+       int id = 0;
+       char *oh_name = "msdi1";
+       char *dev_name = "mmci-omap";
  
        if (!mmc_data[0]) {
                pr_err("%s fails: Incomplete platform data\n", __func__);
        }
  
        omap242x_mmc_mux(mmc_data[0]);
-       omap_mmc_add(name, 0, OMAP2_MMC1_BASE, OMAP2420_MMC_SIZE,
-                                       INT_24XX_MMC_IRQ, mmc_data[0]);
+       oh = omap_hwmod_lookup(oh_name);
+       if (!oh) {
+               pr_err("Could not look up %s\n", oh_name);
+               return;
+       }
+       pdev = omap_device_build(dev_name, id, oh, mmc_data[0],
+                                sizeof(struct omap_mmc_platform_data), NULL, 0, 0);
+       if (IS_ERR(pdev))
+               WARN(1, "Can'd build omap_device for %s:%s.\n",
+                                       dev_name, oh->name);
  }
  
  #endif
@@@ -730,15 -714,11 +743,15 @@@ static int __init omap2_init_devices(vo
         * in alphabetical order so they're easier to sort through.
         */
        omap_init_audio();
 -      omap_init_mcpdm();
 -      omap_init_dmic();
        omap_init_camera();
 +      omap_init_hdmi_audio();
        omap_init_mbox();
 -      omap_init_mcspi();
 +      /* If dtb is there, the devices will be created dynamically */
 +      if (!of_have_populated_dt()) {
 +              omap_init_dmic();
 +              omap_init_mcpdm();
 +              omap_init_mcspi();
 +      }
        omap_init_pmu();
        omap_hdq_init();
        omap_init_sti();
  #define GPMC_ECC_SIZE_CONFIG  0x1fc
  #define GPMC_ECC1_RESULT        0x200
  
+ /* GPMC ECC control settings */
+ #define GPMC_ECC_CTRL_ECCCLEAR                0x100
+ #define GPMC_ECC_CTRL_ECCDISABLE      0x000
+ #define GPMC_ECC_CTRL_ECCREG1         0x001
+ #define GPMC_ECC_CTRL_ECCREG2         0x002
+ #define GPMC_ECC_CTRL_ECCREG3         0x003
+ #define GPMC_ECC_CTRL_ECCREG4         0x004
+ #define GPMC_ECC_CTRL_ECCREG5         0x005
+ #define GPMC_ECC_CTRL_ECCREG6         0x006
+ #define GPMC_ECC_CTRL_ECCREG7         0x007
+ #define GPMC_ECC_CTRL_ECCREG8         0x008
+ #define GPMC_ECC_CTRL_ECCREG9         0x009
  #define GPMC_CS0_OFFSET               0x60
  #define GPMC_CS_SIZE          0x30
  
@@@ -755,7 -768,8 +768,7 @@@ static int __init gpmc_init(void
                irq++;
        }
  
 -      ret = request_irq(gpmc_irq,
 -                      gpmc_handle_irq, IRQF_SHARED, "gpmc", gpmc_base);
 +      ret = request_irq(gpmc_irq, gpmc_handle_irq, IRQF_SHARED, "gpmc", NULL);
        if (ret)
                pr_err("gpmc: irq-%d could not claim: err %d\n",
                                                gpmc_irq, ret);
@@@ -860,8 -874,9 +873,9 @@@ int gpmc_enable_hwecc(int cs, int mode
        gpmc_ecc_used = cs;
  
        /* clear ecc and enable bits */
-       val = ((0x00000001<<8) | 0x00000001);
-       gpmc_write_reg(GPMC_ECC_CONTROL, val);
+       gpmc_write_reg(GPMC_ECC_CONTROL,
+                       GPMC_ECC_CTRL_ECCCLEAR |
+                       GPMC_ECC_CTRL_ECCREG1);
  
        /* program ecc and result sizes */
        val = ((((ecc_size >> 1) - 1) << 22) | (0x0000000F));
  
        switch (mode) {
        case GPMC_ECC_READ:
-               gpmc_write_reg(GPMC_ECC_CONTROL, 0x101);
+       case GPMC_ECC_WRITE:
+               gpmc_write_reg(GPMC_ECC_CONTROL,
+                               GPMC_ECC_CTRL_ECCCLEAR |
+                               GPMC_ECC_CTRL_ECCREG1);
                break;
        case GPMC_ECC_READSYN:
-                gpmc_write_reg(GPMC_ECC_CONTROL, 0x100);
-               break;
-       case GPMC_ECC_WRITE:
-               gpmc_write_reg(GPMC_ECC_CONTROL, 0x101);
+               gpmc_write_reg(GPMC_ECC_CONTROL,
+                               GPMC_ECC_CTRL_ECCCLEAR |
+                               GPMC_ECC_CTRL_ECCDISABLE);
                break;
        default:
                printk(KERN_INFO "Error: Unrecognized Mode[%d]!\n", mode);
diff --combined arch/arm/mach-omap2/io.c
@@@ -31,7 -31,6 +31,7 @@@
  #include <plat/omap-pm.h>
  #include <plat/omap_hwmod.h>
  #include <plat/multi.h>
 +#include <plat/dma.h>
  
  #include "iomap.h"
  #include "voltage.h"
@@@ -173,7 -172,7 +173,7 @@@ static struct map_desc omap34xx_io_desc
  };
  #endif
  
- #ifdef CONFIG_SOC_OMAPTI81XX
+ #ifdef CONFIG_SOC_TI81XX
  static struct map_desc omapti81xx_io_desc[] __initdata = {
        {
                .virtual        = L4_34XX_VIRT,
  };
  #endif
  
- #ifdef CONFIG_SOC_OMAPAM33XX
+ #ifdef CONFIG_SOC_AM33XX
  static struct map_desc omapam33xx_io_desc[] __initdata = {
        {
                .virtual        = L4_34XX_VIRT,
@@@ -215,42 -214,12 +215,12 @@@ static struct map_desc omap44xx_io_desc
                .length         = L4_44XX_SIZE,
                .type           = MT_DEVICE,
        },
-       {
-               .virtual        = OMAP44XX_GPMC_VIRT,
-               .pfn            = __phys_to_pfn(OMAP44XX_GPMC_PHYS),
-               .length         = OMAP44XX_GPMC_SIZE,
-               .type           = MT_DEVICE,
-       },
-       {
-               .virtual        = OMAP44XX_EMIF1_VIRT,
-               .pfn            = __phys_to_pfn(OMAP44XX_EMIF1_PHYS),
-               .length         = OMAP44XX_EMIF1_SIZE,
-               .type           = MT_DEVICE,
-       },
-       {
-               .virtual        = OMAP44XX_EMIF2_VIRT,
-               .pfn            = __phys_to_pfn(OMAP44XX_EMIF2_PHYS),
-               .length         = OMAP44XX_EMIF2_SIZE,
-               .type           = MT_DEVICE,
-       },
-       {
-               .virtual        = OMAP44XX_DMM_VIRT,
-               .pfn            = __phys_to_pfn(OMAP44XX_DMM_PHYS),
-               .length         = OMAP44XX_DMM_SIZE,
-               .type           = MT_DEVICE,
-       },
        {
                .virtual        = L4_PER_44XX_VIRT,
                .pfn            = __phys_to_pfn(L4_PER_44XX_PHYS),
                .length         = L4_PER_44XX_SIZE,
                .type           = MT_DEVICE,
        },
-       {
-               .virtual        = L4_EMU_44XX_VIRT,
-               .pfn            = __phys_to_pfn(L4_EMU_44XX_PHYS),
-               .length         = L4_EMU_44XX_SIZE,
-               .type           = MT_DEVICE,
-       },
  #ifdef CONFIG_OMAP4_ERRATA_I688
        {
                .virtual        = OMAP4_SRAM_VA,
@@@ -286,14 -255,14 +256,14 @@@ void __init omap34xx_map_common_io(void
  }
  #endif
  
- #ifdef CONFIG_SOC_OMAPTI81XX
+ #ifdef CONFIG_SOC_TI81XX
  void __init omapti81xx_map_common_io(void)
  {
        iotable_init(omapti81xx_io_desc, ARRAY_SIZE(omapti81xx_io_desc));
  }
  #endif
  
- #ifdef CONFIG_SOC_OMAPAM33XX
+ #ifdef CONFIG_SOC_AM33XX
  void __init omapam33xx_map_common_io(void)
  {
        iotable_init(omapam33xx_io_desc, ARRAY_SIZE(omapam33xx_io_desc));
@@@ -25,7 -25,6 +25,7 @@@
  #include <mach/hardware.h>
  
  #include "iomap.h"
 +#include "common.h"
  
  /* selected INTC register offsets */
  
@@@ -231,7 -230,7 +231,7 @@@ static inline void omap_intc_handle_irq
                        goto out;
  
                irqnr = readl_relaxed(base_addr + 0xd8);
- #ifdef CONFIG_SOC_OMAPTI81XX
+ #ifdef CONFIG_SOC_TI81XX
                if (irqnr)
                        goto out;
                irqnr = readl_relaxed(base_addr + 0xf8);
@@@ -334,7 -333,7 +334,7 @@@ void omap_intc_restore_context(void
  void omap3_intc_suspend(void)
  {
        /* A pending interrupt would prevent OMAP from entering suspend */
 -      omap_ack_irq(0);
 +      omap_ack_irq(NULL);
  }
  
  void omap3_intc_prepare_idle(void)
@@@ -19,7 -19,6 +19,7 @@@
  #include <linux/io.h>
  #include <linux/clocksource.h>
  
 +#include <asm/mach/time.h>
  #include <asm/sched_clock.h>
  
  #include <plat/hardware.h>
  
  #include <plat/clock.h>
  
+ /* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */
+ #define OMAP2_32KSYNCNT_CR_OFF                0x10
  /*
   * 32KHz clocksource ... always available, on pretty most chips except
   * OMAP 730 and 1510.  Other timers could be used as clocksources, with
   * higher resolution in free-running counter modes (e.g. 12 MHz xtal),
   * but systems won't necessarily want to spend resources that way.
   */
- static void __iomem *timer_32k_base;
- #define OMAP16XX_TIMER_32K_SYNCHRONIZED               0xfffbc410
+ static void __iomem *sync32k_cnt_reg;
  
  static u32 notrace omap_32k_read_sched_clock(void)
  {
-       return timer_32k_base ? __raw_readl(timer_32k_base) : 0;
+       return sync32k_cnt_reg ? __raw_readl(sync32k_cnt_reg) : 0;
  }
  
  /**
 - * read_persistent_clock -  Return time from a persistent clock.
 + * omap_read_persistent_clock -  Return time from a persistent clock.
   *
   * Reads the time from a source which isn't disabled during PM, the
   * 32k sync timer.  Convert the cycles elapsed since last read into
  static struct timespec persistent_ts;
  static cycles_t cycles, last_cycles;
  static unsigned int persistent_mult, persistent_shift;
 -void read_persistent_clock(struct timespec *ts)
 +static void omap_read_persistent_clock(struct timespec *ts)
  {
        unsigned long long nsecs;
        cycles_t delta;
        struct timespec *tsp = &persistent_ts;
  
        last_cycles = cycles;
-       cycles = timer_32k_base ? __raw_readl(timer_32k_base) : 0;
+       cycles = sync32k_cnt_reg ? __raw_readl(sync32k_cnt_reg) : 0;
        delta = cycles - last_cycles;
  
        nsecs = clocksource_cyc2ns(delta, persistent_mult, persistent_shift);
        *ts = *tsp;
  }
  
- int __init omap_init_clocksource_32k(void)
+ /**
+  * omap_init_clocksource_32k - setup and register counter 32k as a
+  * kernel clocksource
+  * @pbase: base addr of counter_32k module
+  * @size: size of counter_32k to map
+  *
+  * Returns 0 upon success or negative error code upon failure.
+  *
+  */
+ int __init omap_init_clocksource_32k(void __iomem *vbase)
  {
-       static char err[] __initdata = KERN_ERR
-                       "%s: can't register clocksource!\n";
-       if (cpu_is_omap16xx() || cpu_class_is_omap2()) {
-               u32 pbase;
-               unsigned long size = SZ_4K;
-               void __iomem *base;
-               struct clk *sync_32k_ick;
-               if (cpu_is_omap16xx()) {
-                       pbase = OMAP16XX_TIMER_32K_SYNCHRONIZED;
-                       size = SZ_1K;
-               } else if (cpu_is_omap2420())
-                       pbase = OMAP2420_32KSYNCT_BASE + 0x10;
-               else if (cpu_is_omap2430())
-                       pbase = OMAP2430_32KSYNCT_BASE + 0x10;
-               else if (cpu_is_omap34xx())
-                       pbase = OMAP3430_32KSYNCT_BASE + 0x10;
-               else if (cpu_is_omap44xx())
-                       pbase = OMAP4430_32KSYNCT_BASE + 0x10;
-               else
-                       return -ENODEV;
-               /* For this to work we must have a static mapping in io.c for this area */
-               base = ioremap(pbase, size);
-               if (!base)
-                       return -ENODEV;
-               sync_32k_ick = clk_get(NULL, "omap_32ksync_ick");
-               if (!IS_ERR(sync_32k_ick))
-                       clk_enable(sync_32k_ick);
-               timer_32k_base = base;
-               /*
-                * 120000 rough estimate from the calculations in
-                * __clocksource_updatefreq_scale.
-                */
-               clocks_calc_mult_shift(&persistent_mult, &persistent_shift,
-                               32768, NSEC_PER_SEC, 120000);
-               if (clocksource_mmio_init(base, "32k_counter", 32768, 250, 32,
-                                         clocksource_mmio_readl_up))
-                       printk(err, "32k_counter");
-               setup_sched_clock(omap_32k_read_sched_clock, 32, 32768);
-               register_persistent_clock(NULL, omap_read_persistent_clock);
+       int ret;
+       /*
+        * 32k sync Counter register offset is at 0x10
+        */
+       sync32k_cnt_reg = vbase + OMAP2_32KSYNCNT_CR_OFF;
+       /*
+        * 120000 rough estimate from the calculations in
+        * __clocksource_updatefreq_scale.
+        */
+       clocks_calc_mult_shift(&persistent_mult, &persistent_shift,
+                       32768, NSEC_PER_SEC, 120000);
+       ret = clocksource_mmio_init(sync32k_cnt_reg, "32k_counter", 32768,
+                               250, 32, clocksource_mmio_readl_up);
+       if (ret) {
+               pr_err("32k_counter: can't register clocksource\n");
+               return ret;
        }
+       setup_sched_clock(omap_32k_read_sched_clock, 32, 32768);
++      register_persistent_clock(NULL, omap_read_persistent_clock);
+       pr_info("OMAP clocksource: 32k_counter at 32768 Hz\n");
        return 0;
  }
diff --combined arch/arm/plat-omap/dma.c
  
  #include <plat/tc.h>
  
 +/*
 + * MAX_LOGICAL_DMA_CH_COUNT: the maximum number of logical DMA
 + * channels that an instance of the SDMA IP block can support.  Used
 + * to size arrays.  (The actual maximum on a particular SoC may be less
 + * than this -- for example, OMAP1 SDMA instances only support 17 logical
 + * DMA channels.)
 + */
 +#define MAX_LOGICAL_DMA_CH_COUNT              32
 +
  #undef DEBUG
  
  #ifndef CONFIG_ARCH_OMAP1
@@@ -852,7 -843,7 +852,7 @@@ omap_dma_set_prio_lch(int lch, unsigne
        }
        l = p->dma_read(CCR, lch);
        l &= ~((1 << 6) | (1 << 26));
-       if (cpu_is_omap2430() || cpu_is_omap34xx() ||  cpu_is_omap44xx())
+       if (cpu_class_is_omap2() && !cpu_is_omap242x())
                l |= ((read_prio & 0x1) << 6) | ((write_prio & 0x1) << 26);
        else
                l |= ((read_prio & 0x1) << 6);
@@@ -892,7 -883,7 +892,7 @@@ void omap_start_dma(int lch
  
        if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
                int next_lch, cur_lch;
 -              char dma_chan_link_map[dma_lch_count];
 +              char dma_chan_link_map[MAX_LOGICAL_DMA_CH_COUNT];
  
                dma_chan_link_map[lch] = 1;
                /* Set the link register of the first channel */
@@@ -990,7 -981,7 +990,7 @@@ void omap_stop_dma(int lch
  
        if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
                int next_lch, cur_lch = lch;
 -              char dma_chan_link_map[dma_lch_count];
 +              char dma_chan_link_map[MAX_LOGICAL_DMA_CH_COUNT];
  
                memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map));
                do {
@@@ -2080,7 -2071,7 +2080,7 @@@ static int __devinit omap_system_dma_pr
                }
        }
  
-       if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx())
+       if (cpu_class_is_omap2() && !cpu_is_omap242x())
                omap_dma_set_global_params(DMA_DEFAULT_ARB_RATE,
                                DMA_DEFAULT_FIFO_DEPTH, 0);
  
@@@ -82,8 -82,6 +82,6 @@@ static void omap_dm_timer_write_reg(str
  
  static void omap_timer_restore_context(struct omap_dm_timer *timer)
  {
-       __raw_writel(timer->context.tiocp_cfg,
-                       timer->io_base + OMAP_TIMER_OCP_CFG_OFFSET);
        if (timer->revision == 1)
                __raw_writel(timer->context.tistat, timer->sys_stat);
  
@@@ -349,12 -347,11 +347,12 @@@ EXPORT_SYMBOL_GPL(omap_dm_timer_start)
  int omap_dm_timer_stop(struct omap_dm_timer *timer)
  {
        unsigned long rate = 0;
 -      struct dmtimer_platform_data *pdata = timer->pdev->dev.platform_data;
 +      struct dmtimer_platform_data *pdata;
  
        if (unlikely(!timer))
                return -EINVAL;
  
 +      pdata = timer->pdev->dev.platform_data;
        if (!pdata->needs_manual_reset)
                rate = clk_get_rate(timer->fclk);
  
  #include <plat/i2c.h>
  #include <plat/omap_hwmod.h>
  
- extern int __init omap_init_clocksource_32k(void);
+ extern int __init omap_init_clocksource_32k(void __iomem *vbase);
  
 +extern void __init omap_check_revision(void);
 +
  extern void omap_reserve(void);
  extern int omap_dss_reset(struct omap_hwmod *);
  
  #define CLEAR_CSR_ON_READ             BIT(0xC)
  #define IS_WORD_16                    BIT(0xD)
  
+ /* Defines for DMA Capabilities */
+ #define DMA_HAS_TRANSPARENT_CAPS      (0x1 << 18)
+ #define DMA_HAS_CONSTANT_FILL_CAPS    (0x1 << 19)
+ #define DMA_HAS_DESCRIPTOR_CAPS               (0x3 << 20)
  enum omap_reg_offsets {
  
  GCR,          GSCR,           GRST1,          HW_ID,
@@@ -442,7 -447,6 +447,7 @@@ struct omap_system_dma_plat_info 
        u32 (*dma_read)(int reg, int lch);
  };
  
 +extern void __init omap_init_consistent_dma_size(void);
  extern void omap_set_dma_priority(int lch, int dst_port, int priority);
  extern int omap_request_dma(int dev_id, const char *dev_name,
                        void (*callback)(int lch, u16 ch_status, void *data),
@@@ -75,7 -75,6 +75,6 @@@ struct clk
  
  struct timer_regs {
        u32 tidr;
-       u32 tiocp_cfg;
        u32 tistat;
        u32 tisr;
        u32 tier;
@@@ -316,12 -315,12 +315,12 @@@ static inline void __omap_dm_timer_init
                                OMAP_TIMER_V1_SYS_STAT_OFFSET;
                timer->irq_stat = timer->io_base + OMAP_TIMER_V1_STAT_OFFSET;
                timer->irq_ena = timer->io_base + OMAP_TIMER_V1_INT_EN_OFFSET;
 -              timer->irq_dis = 0;
 +              timer->irq_dis = NULL;
                timer->pend = timer->io_base + _OMAP_TIMER_WRITE_PEND_OFFSET;
                timer->func_base = timer->io_base;
        } else {
                timer->revision = 2;
 -              timer->sys_stat = 0;
 +              timer->sys_stat = NULL;
                timer->irq_stat = timer->io_base + OMAP_TIMER_V2_IRQSTATUS;
                timer->irq_ena = timer->io_base + OMAP_TIMER_V2_IRQENABLE_SET;
                timer->irq_dis = timer->io_base + OMAP_TIMER_V2_IRQENABLE_CLR;