Merge branch 'next/devel' of git://git.linaro.org/people/arnd/arm-soc
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Nov 2011 03:31:25 +0000 (20:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 2 Nov 2011 03:31:25 +0000 (20:31 -0700)
* 'next/devel' of git://git.linaro.org/people/arnd/arm-soc: (50 commits)
  ARM: tegra: update defconfig
  arm/tegra: Harmony: Configure PMC for low-level interrupts
  arm/tegra: device tree support for ventana board
  arm/tegra: add support for ventana pinmuxing
  arm/tegra: prepare Seaboard pinmux code for derived boards
  arm/tegra: pinmux: ioremap registers
  gpio/tegra: Convert to a platform device
  arm/tegra: Convert pinmux driver to a platform device
  arm/dt: Tegra: Add pinmux node to tegra20.dtsi
  arm/tegra: Prep boards for gpio/pinmux conversion to pdevs
  ARM: mx5: fix clock usage for suspend
  ARM i.MX entry-macro.S: remove now unused code
  ARM i.MX boards: use CONFIG_MULTI_IRQ_HANDLER
  ARM i.MX tzic: add handle_irq function
  ARM i.MX avic: add handle_irq function
  ARM: mx25: Add the missing IIM base definition
  ARM i.MX avic: convert to use generic irq chip
  mx31moboard: Add poweroff support
  ARM: mach-qong: Add watchdog support
  ARM: davinci: AM18x: Add wl1271/wlan support
  ...

Fix up conflicts in:
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-mx5/devices-imx53.h
arch/arm/plat-mxc/include/mach/memory.h

48 files changed:
1  2 
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9g45_devices.c
arch/arm/mach-davinci/board-da850-evm.c
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/mach-armadillo5x0.c
arch/arm/mach-imx/mach-cpuimx27.c
arch/arm/mach-imx/mach-cpuimx35.c
arch/arm/mach-imx/mach-eukrea_cpuimx25.c
arch/arm/mach-imx/mach-imx27_visstrim_m10.c
arch/arm/mach-imx/mach-imx27ipcam.c
arch/arm/mach-imx/mach-imx27lite.c
arch/arm/mach-imx/mach-kzm_arm11_01.c
arch/arm/mach-imx/mach-mx1ads.c
arch/arm/mach-imx/mach-mx21ads.c
arch/arm/mach-imx/mach-mx25_3ds.c
arch/arm/mach-imx/mach-mx27_3ds.c
arch/arm/mach-imx/mach-mx27ads.c
arch/arm/mach-imx/mach-mx31_3ds.c
arch/arm/mach-imx/mach-mx31ads.c
arch/arm/mach-imx/mach-mx31lilly.c
arch/arm/mach-imx/mach-mx31lite.c
arch/arm/mach-imx/mach-mx31moboard.c
arch/arm/mach-imx/mach-mx35_3ds.c
arch/arm/mach-imx/mach-mxt_td60.c
arch/arm/mach-imx/mach-pca100.c
arch/arm/mach-imx/mach-pcm037.c
arch/arm/mach-imx/mach-pcm038.c
arch/arm/mach-imx/mach-pcm043.c
arch/arm/mach-imx/mach-qong.c
arch/arm/mach-imx/mach-scb9328.c
arch/arm/mach-mx5/board-cpuimx51.c
arch/arm/mach-mx5/board-cpuimx51sd.c
arch/arm/mach-mx5/board-mx51_3ds.c
arch/arm/mach-mx5/board-mx51_babbage.c
arch/arm/mach-mx5/board-mx51_efikamx.c
arch/arm/mach-mx5/board-mx51_efikasb.c
arch/arm/mach-mxs/clock-mx28.c
arch/arm/mach-mxs/mach-mx23evk.c
arch/arm/mach-mxs/mach-mx28evk.c
arch/arm/mach-mxs/mach-tx28.c
arch/arm/mach-tegra/Makefile.boot
arch/arm/mach-tegra/board-paz00-pinmux.c
arch/arm/mach-tegra/board-seaboard-pinmux.c
arch/arm/mach-tegra/devices.c
arch/arm/plat-mxc/Kconfig

diff --combined arch/arm/Kconfig
@@@ -3,7 -3,7 +3,7 @@@ config AR
        default y
        select HAVE_AOUT
        select HAVE_DMA_API_DEBUG
 -      select HAVE_IDE
 +      select HAVE_IDE if PCI || ISA || PCMCIA
        select HAVE_MEMBLOCK
        select RTC_LIB
        select SYS_SUPPORTS_APM_EMULATION
@@@ -29,7 -29,6 +29,7 @@@
        select HAVE_GENERIC_HARDIRQS
        select HAVE_SPARSE_IRQ
        select GENERIC_IRQ_SHOW
 +      select CPU_PM if (SUSPEND || CPU_IDLE)
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
@@@ -196,8 -195,7 +196,8 @@@ config VECTORS_BAS
          The base address of exception vectors.
  
  config ARM_PATCH_PHYS_VIRT
 -      bool "Patch physical to virtual translations at runtime"
 +      bool "Patch physical to virtual translations at runtime" if EMBEDDED
 +      default y
        depends on !XIP_KERNEL && MMU
        depends on !ARCH_REALVIEW || !SPARSEMEM
        help
          kernel in system memory.
  
          This can only be used with non-XIP MMU kernels where the base
 -        of physical memory is at a 16MB boundary, or theoretically 64K
 -        for the MSM machine class.
 +        of physical memory is at a 16MB boundary.
  
 -config ARM_PATCH_PHYS_VIRT_16BIT
 -      def_bool y
 -      depends on ARM_PATCH_PHYS_VIRT && ARCH_MSM
 +        Only disable this option if you know that you do not require
 +        this feature (eg, building a kernel for a single machine) and
 +        you need to shrink the kernel to the minimal size.
 +
 +config NEED_MACH_MEMORY_H
 +      bool
 +      help
 +        Select this when mach/memory.h is required to provide special
 +        definitions for this platform.  The need for mach/memory.h should
 +        be avoided when possible.
 +
 +config PHYS_OFFSET
 +      hex "Physical address of main memory"
 +      depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
        help
 -        This option extends the physical to virtual translation patching
 -        to allow physical memory down to a theoretical minimum of 64K
 -        boundaries.
 +        Please provide the physical address corresponding to the
 +        location of main memory in your system.
 +
 +config GENERIC_BUG
 +      def_bool y
 +      depends on BUG
  
  source "init/Kconfig"
  
@@@ -261,7 -246,6 +261,7 @@@ config ARCH_INTEGRATO
        select GENERIC_CLOCKEVENTS
        select PLAT_VERSATILE
        select PLAT_VERSATILE_FPGA_IRQ
 +      select NEED_MACH_MEMORY_H
        help
          Support for ARM's Integrator platform.
  
@@@ -277,7 -261,6 +277,7 @@@ config ARCH_REALVIE
        select PLAT_VERSATILE_CLCD
        select ARM_TIMER_SP804
        select GPIO_PL061 if GPIOLIB
 +      select NEED_MACH_MEMORY_H
        help
          This enables support for ARM Ltd RealView boards.
  
@@@ -318,6 -301,7 +318,6 @@@ config ARCH_AT9
        select ARCH_REQUIRE_GPIOLIB
        select HAVE_CLK
        select CLKDEV_LOOKUP
 -      select ARM_PATCH_PHYS_VIRT if MMU
        help
          This enables support for systems based on the Atmel AT91RM9200,
          AT91SAM9 and AT91CAP9 processors.
@@@ -338,7 -322,6 +338,7 @@@ config ARCH_CLPS711
        bool "Cirrus Logic CLPS711x/EP721x-based"
        select CPU_ARM720T
        select ARCH_USES_GETTIMEOFFSET
 +      select NEED_MACH_MEMORY_H
        help
          Support for Cirrus Logic 711x/721x based boards.
  
@@@ -363,6 -346,7 +363,6 @@@ config ARCH_GEMIN
  config ARCH_PRIMA2
        bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
        select CPU_V7
 -      select GENERIC_TIME
        select NO_IOPORT
        select GENERIC_CLOCKEVENTS
        select CLKDEV_LOOKUP
@@@ -378,7 -362,6 +378,7 @@@ config ARCH_EBSA11
        select ISA
        select NO_IOPORT
        select ARCH_USES_GETTIMEOFFSET
 +      select NEED_MACH_MEMORY_H
        help
          This is an evaluation board for the StrongARM processor available
          from Digital. It has limited hardware on-board, including an
@@@ -394,7 -377,6 +394,7 @@@ config ARCH_EP93X
        select ARCH_REQUIRE_GPIOLIB
        select ARCH_HAS_HOLES_MEMORYMODEL
        select ARCH_USES_GETTIMEOFFSET
 +      select NEED_MACH_MEMORY_H
        help
          This enables support for the Cirrus EP93xx series of CPUs.
  
@@@ -403,8 -385,6 +403,8 @@@ config ARCH_FOOTBRIDG
        select CPU_SA110
        select FOOTBRIDGE
        select GENERIC_CLOCKEVENTS
 +      select HAVE_IDE
 +      select NEED_MACH_MEMORY_H
        help
          Support for systems based on the DC21285 companion chip
          ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
@@@ -417,6 -397,7 +417,7 @@@ config ARCH_MX
        select CLKSRC_MMIO
        select GENERIC_IRQ_CHIP
        select HAVE_SCHED_CLOCK
+       select MULTI_IRQ_HANDLER
        help
          Support for Freescale MXC/iMX-based family of processors
  
@@@ -454,7 -435,6 +455,7 @@@ config ARCH_IOP13X
        select PCI
        select ARCH_SUPPORTS_MSI
        select VMSPLIT_1G
 +      select NEED_MACH_MEMORY_H
        help
          Support for Intel's IOP13XX (XScale) family of processors.
  
@@@ -485,7 -465,6 +486,7 @@@ config ARCH_IXP23X
        select CPU_XSC3
        select PCI
        select ARCH_USES_GETTIMEOFFSET
 +      select NEED_MACH_MEMORY_H
        help
          Support for Intel's IXP23xx (XScale) family of processors.
  
@@@ -495,7 -474,6 +496,7 @@@ config ARCH_IXP200
        select CPU_XSCALE
        select PCI
        select ARCH_USES_GETTIMEOFFSET
 +      select NEED_MACH_MEMORY_H
        help
          Support for Intel's IXP2400/2800 (XScale) family of processors.
  
@@@ -542,6 -520,7 +543,6 @@@ config ARCH_LPC32X
        select ARM_AMBA
        select USB_ARCH_HAS_OHCI
        select CLKDEV_LOOKUP
 -      select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        help
          Support for the NXP LPC32XX family of processors
@@@ -588,7 -567,6 +589,7 @@@ config ARCH_KS869
        select CPU_ARM922T
        select ARCH_REQUIRE_GPIOLIB
        select ARCH_USES_GETTIMEOFFSET
 +      select NEED_MACH_MEMORY_H
        help
          Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
          System-on-Chip devices.
@@@ -609,10 -587,19 +610,10 @@@ config ARCH_W90X90
          <http://www.nuvoton.com/hq/enu/ProductAndSales/ProductLines/
                ConsumerElectronicsIC/ARMMicrocontroller/ARMMicrocontroller>
  
 -config ARCH_NUC93X
 -      bool "Nuvoton NUC93X CPU"
 -      select CPU_ARM926T
 -      select CLKDEV_LOOKUP
 -      help
 -        Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a
 -        low-power and high performance MPEG-4/JPEG multimedia controller chip.
 -
  config ARCH_TEGRA
        bool "NVIDIA Tegra"
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
 -      select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        select GENERIC_GPIO
        select HAVE_CLK
@@@ -645,8 -632,6 +646,8 @@@ config ARCH_PX
        select SPARSE_IRQ
        select AUTO_ZRELADDR
        select MULTI_IRQ_HANDLER
 +      select ARM_CPU_SUSPEND if PM
 +      select HAVE_IDE
        help
          Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
  
@@@ -673,7 -658,6 +674,7 @@@ config ARCH_SHMOBIL
        select SPARSE_IRQ
        select MULTI_IRQ_HANDLER
        select PM_GENERIC_DOMAINS if PM
 +      select NEED_MACH_MEMORY_H
        help
          Support for Renesas's SH-Mobile and R-Mobile ARM platforms.
  
@@@ -688,8 -672,6 +689,8 @@@ config ARCH_RP
        select NO_IOPORT
        select ARCH_SPARSEMEM_ENABLE
        select ARCH_USES_GETTIMEOFFSET
 +      select HAVE_IDE
 +      select NEED_MACH_MEMORY_H
        help
          On the Acorn Risc-PC, Linux can support the internal IDE disk and
          CD-ROM interface, serial and parallel port, and the floppy drive.
@@@ -708,8 -690,6 +709,8 @@@ config ARCH_SA110
        select HAVE_SCHED_CLOCK
        select TICK_ONESHOT
        select ARCH_REQUIRE_GPIOLIB
 +      select HAVE_IDE
 +      select NEED_MACH_MEMORY_H
        help
          Support for StrongARM 11x0 based boards.
  
@@@ -743,6 -723,7 +744,6 @@@ config ARCH_S3C64X
        select ARCH_REQUIRE_GPIOLIB
        select SAMSUNG_CLKSRC
        select SAMSUNG_IRQ_VIC_TIMER
 -      select SAMSUNG_IRQ_UART
        select S3C_GPIO_TRACK
        select S3C_GPIO_PULL_UPDOWN
        select S3C_GPIO_CFG_S3C24XX
@@@ -801,7 -782,6 +802,7 @@@ config ARCH_S5PV21
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C_RTC if RTC_CLASS
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
 +      select NEED_MACH_MEMORY_H
        help
          Samsung S5PV210/S5PC110 series based systems
  
@@@ -818,7 -798,6 +819,7 @@@ config ARCH_EXYNOS
        select HAVE_S3C_RTC if RTC_CLASS
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
 +      select NEED_MACH_MEMORY_H
        help
          Samsung EXYNOS4 series based systems
  
@@@ -830,7 -809,6 +831,7 @@@ config ARCH_SHAR
        select ZONE_DMA
        select PCI
        select ARCH_USES_GETTIMEOFFSET
 +      select NEED_MACH_MEMORY_H
        help
          Support for the StrongARM based Digital DNARD machine, also known
          as "Shark" (<http://www.shark-linux.de/shark.html>).
@@@ -853,14 -831,12 +854,14 @@@ config ARCH_U30
        select HAVE_SCHED_CLOCK
        select HAVE_TCM
        select ARM_AMBA
 +      select ARM_PATCH_PHYS_VIRT
        select ARM_VIC
        select GENERIC_CLOCKEVENTS
        select CLKDEV_LOOKUP
        select HAVE_MACH_CLKDEV
        select GENERIC_GPIO
        select ARCH_REQUIRE_GPIOLIB
 +      select NEED_MACH_MEMORY_H
        help
          Support for ST-Ericsson U300 series mobile platforms.
  
@@@ -936,6 -912,7 +937,6 @@@ config ARCH_VT850
  config ARCH_ZYNQ
        bool "Xilinx Zynq ARM Cortex A9 Platform"
        select CPU_V7
 -      select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        select CLKDEV_LOOKUP
        select ARM_GIC
@@@ -1004,6 -981,8 +1005,6 @@@ source "arch/arm/mach-netx/Kconfig
  source "arch/arm/mach-nomadik/Kconfig"
  source "arch/arm/plat-nomadik/Kconfig"
  
 -source "arch/arm/mach-nuc93x/Kconfig"
 -
  source "arch/arm/plat-omap/Kconfig"
  
  source "arch/arm/mach-omap1/Kconfig"
@@@ -1398,7 -1377,6 +1399,7 @@@ config SM
                 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \
                 ARCH_EXYNOS4 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \
                 ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE
 +      depends on MMU
        select USE_GENERIC_SMP_HELPERS
        select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
        help
          processor machines. On a single processor machine, the kernel will
          run faster if you say N here.
  
 -        See also <file:Documentation/i386/IO-APIC.txt>,
 +        See also <file:Documentation/x86/i386/IO-APIC.txt>,
          <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
          <http://tldp.org/HOWTO/SMP-HOWTO.html>.
  
@@@ -1431,31 -1409,6 +1432,31 @@@ config SMP_ON_U
  
          If you don't know what to do here, say Y.
  
 +config ARM_CPU_TOPOLOGY
 +      bool "Support cpu topology definition"
 +      depends on SMP && CPU_V7
 +      default y
 +      help
 +        Support ARM cpu topology definition. The MPIDR register defines
 +        affinity between processors which is then used to describe the cpu
 +        topology of an ARM System.
 +
 +config SCHED_MC
 +      bool "Multi-core scheduler support"
 +      depends on ARM_CPU_TOPOLOGY
 +      help
 +        Multi-core scheduler support improves the CPU scheduler's decision
 +        making when dealing with multi-core CPU chips at a cost of slightly
 +        increased overhead in some places. If unsure say N here.
 +
 +config SCHED_SMT
 +      bool "SMT scheduler support"
 +      depends on ARM_CPU_TOPOLOGY
 +      help
 +        Improves the CPU scheduler's decision making when dealing with
 +        MultiThreading at a cost of slightly increased overhead in some
 +        places. If unsure say N here.
 +
  config HAVE_ARM_SCU
        bool
        help
@@@ -1531,7 -1484,6 +1532,7 @@@ config THUMB2_KERNE
        depends on CPU_V7 && !CPU_V6 && !CPU_V6K && EXPERIMENTAL
        select AEABI
        select ARM_ASM_UNIFIED
 +      select ARM_UNWIND
        help
          By enabling this option, the kernel will be compiled in
          Thumb-2 mode. A compiler/assembler that understand the unified
@@@ -1857,38 -1809,6 +1858,38 @@@ config ZBOOT_ROM_SH_MOBILE_SDH
  
  endchoice
  
 +config ARM_APPENDED_DTB
 +      bool "Use appended device tree blob to zImage (EXPERIMENTAL)"
 +      depends on OF && !ZBOOT_ROM && EXPERIMENTAL
 +      help
 +        With this option, the boot code will look for a device tree binary
 +        (DTB) appended to zImage
 +        (e.g. cat zImage <filename>.dtb > zImage_w_dtb).
 +
 +        This is meant as a backward compatibility convenience for those
 +        systems with a bootloader that can't be upgraded to accommodate
 +        the documented boot protocol using a device tree.
 +
 +        Beware that there is very little in terms of protection against
 +        this option being confused by leftover garbage in memory that might
 +        look like a DTB header after a reboot if no actual DTB is appended
 +        to zImage.  Do not leave this option active in a production kernel
 +        if you don't intend to always append a DTB.  Proper passing of the
 +        location into r2 of a bootloader provided DTB is always preferable
 +        to this option.
 +
 +config ARM_ATAG_DTB_COMPAT
 +      bool "Supplement the appended DTB with traditional ATAG information"
 +      depends on ARM_APPENDED_DTB
 +      help
 +        Some old bootloaders can't be updated to a DTB capable one, yet
 +        they provide ATAGs with memory configuration, the ramdisk address,
 +        the kernel cmdline string, etc.  Such information is dynamically
 +        provided by the bootloader and can't always be stored in a static
 +        DTB.  To allow a device tree enabled kernel to be used with such
 +        bootloaders, this option allows zImage to extract the information
 +        from the ATAG list and store it at run time into the appended DTB.
 +
  config CMDLINE
        string "Default kernel command string"
        default ""
@@@ -2035,7 -1955,6 +2036,7 @@@ config CPU_FREQ_PX
        bool
        depends on CPU_FREQ && ARCH_PXA && PXA25x
        default y
 +      select CPU_FREQ_TABLE
        select CPU_FREQ_DEFAULT_GOV_USERSPACE
  
  config CPU_FREQ_S3C
@@@ -2184,9 -2103,6 +2185,9 @@@ config ARCH_SUSPEND_POSSIBL
                CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE
        def_bool y
  
 +config ARM_CPU_SUSPEND
 +      def_bool PM_SLEEP
 +
  endmenu
  
  source "net/Kconfig"
diff --combined arch/arm/Makefile
@@@ -128,9 -128,6 +128,9 @@@ textofs-$(CONFIG_PM_H1940)      := 0x00
  ifeq ($(CONFIG_ARCH_SA1100),y)
  textofs-$(CONFIG_SA1111) := 0x00208000
  endif
 +textofs-$(CONFIG_ARCH_MSM7X30) := 0x00208000
 +textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000
 +textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000
  
  # Machine directory name.  This list is sorted alphanumerically
  # by CONFIG_* macro name.
@@@ -157,9 -154,7 +157,7 @@@ machine-$(CONFIG_ARCH_LPC32XX)             := lpc3
  machine-$(CONFIG_ARCH_MMP)            := mmp
  machine-$(CONFIG_ARCH_MSM)            := msm
  machine-$(CONFIG_ARCH_MV78XX0)                := mv78xx0
- machine-$(CONFIG_ARCH_MX1)            := imx
- machine-$(CONFIG_ARCH_MX2)            := imx
- machine-$(CONFIG_ARCH_MX25)           := imx
+ machine-$(CONFIG_ARCH_IMX_V4_V5)      := imx
  machine-$(CONFIG_ARCH_MX3)            := imx
  machine-$(CONFIG_ARCH_MX5)            := mx5
  machine-$(CONFIG_ARCH_MXS)            := mxs
@@@ -192,6 -187,7 +190,6 @@@ machine-$(CONFIG_ARCH_VERSATILE)   := ver
  machine-$(CONFIG_ARCH_VEXPRESS)               := vexpress
  machine-$(CONFIG_ARCH_VT8500)         := vt8500
  machine-$(CONFIG_ARCH_W90X900)                := w90x900
 -machine-$(CONFIG_ARCH_NUC93X)         := nuc93x
  machine-$(CONFIG_FOOTBRIDGE)          := footbridge
  machine-$(CONFIG_MACH_SPEAR300)               := spear3xx
  machine-$(CONFIG_MACH_SPEAR310)               := spear3xx
@@@ -61,9 -61,17 +61,17 @@@ static struct platform_device at91_usbh
  
  void __init at91_add_device_usbh(struct at91_usbh_data *data)
  {
+       int i;
        if (!data)
                return;
  
+       /* Enable overcurrent notification */
+       for (i = 0; i < data->ports; i++) {
+               if (data->overcurrent_pin[i])
+                       at91_set_gpio_input(data->overcurrent_pin[i], 1);
+       }
        usbh_data = *data;
        platform_device_register(&at91_usbh_device);
  }
@@@ -319,7 -327,7 +327,7 @@@ void __init at91_add_device_mci(short m
        if (!data)
                return;
  
 -      for (i = 0; i < ATMEL_MCI_MAX_NR_SLOTS; i++) {
 +      for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
                if (data->slot[i].bus_width) {
                        /* input/irq */
                        if (data->slot[i].detect_pin) {
@@@ -12,7 -12,6 +12,7 @@@
  
  #include <linux/module.h>
  #include <linux/pm.h>
 +#include <linux/dma-mapping.h>
  
  #include <asm/irq.h>
  #include <asm/mach/arch.h>
@@@ -54,11 -53,6 +54,11 @@@ static struct clk pioDE_clk = 
        .pmc_mask       = 1 << AT91SAM9G45_ID_PIODE,
        .type           = CLK_TYPE_PERIPHERAL,
  };
 +static struct clk trng_clk = {
 +      .name           = "trng_clk",
 +      .pmc_mask       = 1 << AT91SAM9G45_ID_TRNG,
 +      .type           = CLK_TYPE_PERIPHERAL,
 +};
  static struct clk usart0_clk = {
        .name           = "usart0_clk",
        .pmc_mask       = 1 << AT91SAM9G45_ID_US0,
@@@ -182,7 -176,6 +182,7 @@@ static struct clk *periph_clocks[] __in
        &pioB_clk,
        &pioC_clk,
        &pioDE_clk,
 +      &trng_clk,
        &usart0_clk,
        &usart1_clk,
        &usart2_clk,
@@@ -222,7 -215,8 +222,9 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk),
        CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
        CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk),
+       /* fake hclk clock */
+       CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk),
  };
  
  static struct clk_lookup usart_clocks_lookups[] = {
@@@ -327,7 -321,6 +329,7 @@@ static void at91sam9g45_poweroff(void
  static void __init at91sam9g45_map_io(void)
  {
        at91_init_sram(0, AT91SAM9G45_SRAM_BASE, AT91SAM9G45_SRAM_SIZE);
 +      init_consistent_dma_size(SZ_4M);
  }
  
  static void __init at91sam9g45_initialize(void)
@@@ -124,6 -124,12 +124,12 @@@ void __init at91_add_device_usbh_ohci(s
                        at91_set_gpio_output(data->vbus_pin[i], 0);
        }
  
+       /* Enable overcurrent notification */
+       for (i = 0; i < data->ports; i++) {
+               if (data->overcurrent_pin[i])
+                       at91_set_gpio_input(data->overcurrent_pin[i], 1);
+       }
        usbh_ohci_data = *data;
        platform_device_register(&at91_usbh_ohci_device);
  }
@@@ -1094,34 -1100,6 +1100,34 @@@ static void __init at91_add_device_rtt(
  }
  
  
 +/* --------------------------------------------------------------------
 + *  TRNG
 + * -------------------------------------------------------------------- */
 +
 +#if defined(CONFIG_HW_RANDOM_ATMEL) || defined(CONFIG_HW_RANDOM_ATMEL_MODULE)
 +static struct resource trng_resources[] = {
 +      {
 +              .start  = AT91SAM9G45_BASE_TRNG,
 +              .end    = AT91SAM9G45_BASE_TRNG + SZ_16K - 1,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +};
 +
 +static struct platform_device at91sam9g45_trng_device = {
 +      .name           = "atmel-trng",
 +      .id             = -1,
 +      .resource       = trng_resources,
 +      .num_resources  = ARRAY_SIZE(trng_resources),
 +};
 +
 +static void __init at91_add_device_trng(void)
 +{
 +      platform_device_register(&at91sam9g45_trng_device);
 +}
 +#else
 +static void __init at91_add_device_trng(void) {}
 +#endif
 +
  /* --------------------------------------------------------------------
   *  Watchdog
   * -------------------------------------------------------------------- */
@@@ -1611,7 -1589,6 +1617,7 @@@ static int __init at91_add_standard_dev
        at91_add_device_hdmac();
        at91_add_device_rtc();
        at91_add_device_rtt();
 +      at91_add_device_trng();
        at91_add_device_watchdog();
        at91_add_device_tc();
        return 0;
@@@ -31,6 -31,8 +31,8 @@@
  #include <linux/input/tps6507x-ts.h>
  #include <linux/spi/spi.h>
  #include <linux/spi/flash.h>
+ #include <linux/delay.h>
+ #include <linux/wl12xx.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -49,6 -51,9 +51,9 @@@
  #define DA850_MMCSD_CD_PIN            GPIO_TO_PIN(4, 0)
  #define DA850_MMCSD_WP_PIN            GPIO_TO_PIN(4, 1)
  
+ #define DA850_WLAN_EN                 GPIO_TO_PIN(6, 9)
+ #define DA850_WLAN_IRQ                        GPIO_TO_PIN(6, 10)
  #define DA850_MII_MDIO_CLKEN_PIN      GPIO_TO_PIN(2, 6)
  
  static struct mtd_partition da850evm_spiflash_part[] = {
@@@ -1143,6 -1148,110 +1148,110 @@@ static __init int da850_evm_init_cpufre
  static __init int da850_evm_init_cpufreq(void) { return 0; }
  #endif
  
+ #ifdef CONFIG_DA850_WL12XX
+ static void wl12xx_set_power(int index, bool power_on)
+ {
+       static bool power_state;
+       pr_debug("Powering %s wl12xx", power_on ? "on" : "off");
+       if (power_on == power_state)
+               return;
+       power_state = power_on;
+       if (power_on) {
+               /* Power up sequence required for wl127x devices */
+               gpio_set_value(DA850_WLAN_EN, 1);
+               usleep_range(15000, 15000);
+               gpio_set_value(DA850_WLAN_EN, 0);
+               usleep_range(1000, 1000);
+               gpio_set_value(DA850_WLAN_EN, 1);
+               msleep(70);
+       } else {
+               gpio_set_value(DA850_WLAN_EN, 0);
+       }
+ }
+ static struct davinci_mmc_config da850_wl12xx_mmc_config = {
+       .set_power      = wl12xx_set_power,
+       .wires          = 4,
+       .max_freq       = 25000000,
+       .caps           = MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
+                         MMC_CAP_POWER_OFF_CARD,
+       .version        = MMC_CTLR_VERSION_2,
+ };
+ static const short da850_wl12xx_pins[] __initconst = {
+       DA850_MMCSD1_DAT_0, DA850_MMCSD1_DAT_1, DA850_MMCSD1_DAT_2,
+       DA850_MMCSD1_DAT_3, DA850_MMCSD1_CLK, DA850_MMCSD1_CMD,
+       DA850_GPIO6_9, DA850_GPIO6_10,
+       -1
+ };
+ static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
+       .irq                    = -1,
+       .board_ref_clock        = WL12XX_REFCLOCK_38,
+       .platform_quirks        = WL12XX_PLATFORM_QUIRK_EDGE_IRQ,
+ };
+ static __init int da850_wl12xx_init(void)
+ {
+       int ret;
+       ret = davinci_cfg_reg_list(da850_wl12xx_pins);
+       if (ret) {
+               pr_err("wl12xx/mmc mux setup failed: %d\n", ret);
+               goto exit;
+       }
+       ret = da850_register_mmcsd1(&da850_wl12xx_mmc_config);
+       if (ret) {
+               pr_err("wl12xx/mmc registration failed: %d\n", ret);
+               goto exit;
+       }
+       ret = gpio_request_one(DA850_WLAN_EN, GPIOF_OUT_INIT_LOW, "wl12xx_en");
+       if (ret) {
+               pr_err("Could not request wl12xx enable gpio: %d\n", ret);
+               goto exit;
+       }
+       ret = gpio_request_one(DA850_WLAN_IRQ, GPIOF_IN, "wl12xx_irq");
+       if (ret) {
+               pr_err("Could not request wl12xx irq gpio: %d\n", ret);
+               goto free_wlan_en;
+       }
+       da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
+       ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
+       if (ret) {
+               pr_err("Could not set wl12xx data: %d\n", ret);
+               goto free_wlan_irq;
+       }
+       return 0;
+ free_wlan_irq:
+       gpio_free(DA850_WLAN_IRQ);
+ free_wlan_en:
+       gpio_free(DA850_WLAN_EN);
+ exit:
+       return ret;
+ }
+ #else /* CONFIG_DA850_WL12XX */
+ static __init int da850_wl12xx_init(void)
+ {
+       return 0;
+ }
+ #endif /* CONFIG_DA850_WL12XX */
  #define DA850EVM_SATA_REFCLKPN_RATE   (100 * 1000 * 1000)
  
  static __init void da850_evm_init(void)
                if (ret)
                        pr_warning("da850_evm_init: mmcsd0 registration failed:"
                                        " %d\n", ret);
+               ret = da850_wl12xx_init();
+               if (ret)
+                       pr_warning("da850_evm_init: wl12xx initialization"
+                                  " failed: %d\n", ret);
        }
  
        davinci_serial_init(&da850_evm_uart_config);
@@@ -1291,7 -1405,7 +1405,7 @@@ static void __init da850_evm_map_io(voi
  }
  
  MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
 -      .boot_params    = (DA8XX_DDR_BASE + 0x100),
 +      .atag_offset    = 0x100,
        .map_io         = da850_evm_map_io,
        .init_irq       = cp_intc_init,
        .timer          = &davinci_timer,
@@@ -5,6 -5,18 +5,18 @@@ config IMX_HAVE_DMA_V
  # Some usages assume that having one of them implies not having (e.g.) ARCH_MX2.
  # To easily distinguish good and reviewed from unreviewed usages new (and IMHO
  # more sensible) names are used: SOC_IMX31 and SOC_IMX35
+ config ARCH_MX1
+       bool
+ config MACH_MX21
+       bool
+ config ARCH_MX25
+       bool
+ config MACH_MX27
+       bool
  config ARCH_MX31
        bool
  
@@@ -13,6 -25,7 +25,7 @@@ config ARCH_MX3
  
  config SOC_IMX1
        bool
+       select ARCH_MX1
        select CPU_ARM920T
        select IMX_HAVE_DMA_V1
        select IMX_HAVE_IOMUX_V1
@@@ -20,6 -33,7 +33,7 @@@
  
  config SOC_IMX21
        bool
+       select MACH_MX21
        select CPU_ARM926T
        select ARCH_MXC_AUDMUX_V1
        select IMX_HAVE_DMA_V1
@@@ -28,6 -42,7 +42,7 @@@
  
  config SOC_IMX25
        bool
+       select ARCH_MX25
        select CPU_ARM926T
        select ARCH_MXC_AUDMUX_V2
        select ARCH_MXC_IOMUX_V3
@@@ -35,6 -50,7 +50,7 @@@
  
  config SOC_IMX27
        bool
+       select MACH_MX27
        select CPU_ARM926T
        select ARCH_MXC_AUDMUX_V1
        select IMX_HAVE_DMA_V1
@@@ -59,7 -75,7 +75,7 @@@ config SOC_IMX3
        select MXC_AVIC
  
  
- if ARCH_MX1
+ if ARCH_IMX_V4_V5
  
  comment "MX1 platforms:"
  config MACH_MXLADS
@@@ -87,30 -103,6 +103,6 @@@ config MACH_APF932
        help
          Say Yes here if you are using the Armadeus APF9328 development board
  
- endif
- if ARCH_MX2
- choice
-       prompt "CPUs:"
-       default MACH_MX21
- config MACH_MX21
-       bool "i.MX21 support"
-       help
-         This enables support for Freescale's MX2 based i.MX21 processor.
- config MACH_MX27
-       bool "i.MX27 support"
-       help
-         This enables support for Freescale's MX2 based i.MX27 processor.
- endchoice
- endif
- if MACH_MX21
  comment "MX21 platforms:"
  
  config MACH_MX21ADS
          Include support for MX21ADS platform. This includes specific
          configurations for the board and its peripherals.
  
- endif
- if ARCH_MX25
  comment "MX25 platforms:"
  
  config MACH_MX25_3DS
        bool "Support MX25PDK (3DS) Platform"
        select SOC_IMX25
+       select IMX_HAVE_PLATFORM_FLEXCAN
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMXDI_RTC
@@@ -174,10 -163,6 +163,6 @@@ config MACH_EUKREA_MBIMXSD25_BASEBOAR
  
  endchoice
  
- endif
- if MACH_MX27
  comment "MX27 platforms:"
  
  config MACH_MX27ADS
@@@ -449,7 -434,6 +434,7 @@@ config MACH_MX31_3D
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_IPU_CORE
        select IMX_HAVE_PLATFORM_MXC_EHCI
 +      select IMX_HAVE_PLATFORM_MXC_MMC
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_SPI_IMX
        select MXC_ULPI if USB_ULPI
@@@ -486,6 -470,7 +471,7 @@@ config MACH_QON
        bool "Support Dave/DENX QongEVB-LITE platform"
        select SOC_IMX31
        select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_IMX2_WDT
        help
          Include support for Dave/DENX QongEVB-LITE platform. This includes
          specific configurations for the board and its peripherals.
@@@ -554,10 -554,11 +554,11 @@@ static struct sys_timer armadillo5x0_ti
  
  MACHINE_START(ARMADILLO5X0, "Armadillo-500")
        /* Maintainer: Alberto Panizzo  */
 -      .boot_params = MX3x_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx31_map_io,
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
+       .handle_irq = imx31_handle_irq,
        .timer = &armadillo5x0_timer,
        .init_machine = armadillo5x0_init,
  MACHINE_END
@@@ -311,10 -311,11 +311,11 @@@ static struct sys_timer eukrea_cpuimx27
  };
  
  MACHINE_START(EUKREA_CPUIMX27, "EUKREA CPUIMX27")
 -      .boot_params = MX27_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx27_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
+       .handle_irq = imx27_handle_irq,
        .timer = &eukrea_cpuimx27_timer,
        .init_machine = eukrea_cpuimx27_init,
  MACHINE_END
@@@ -194,10 -194,11 +194,11 @@@ struct sys_timer eukrea_cpuimx35_timer 
  
  MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35")
        /* Maintainer: Eukrea Electromatique */
 -      .boot_params = MX3x_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx35_map_io,
        .init_early = imx35_init_early,
        .init_irq = mx35_init_irq,
+       .handle_irq = imx35_handle_irq,
        .timer = &eukrea_cpuimx35_timer,
        .init_machine = eukrea_cpuimx35_init,
  MACHINE_END
@@@ -163,10 -163,11 +163,11 @@@ static struct sys_timer eukrea_cpuimx25
  
  MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25")
        /* Maintainer: Eukrea Electromatique */
 -      .boot_params = MX25_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx25_map_io,
        .init_early = imx25_init_early,
        .init_irq = mx25_init_irq,
+       .handle_irq = imx25_handle_irq,
        .timer = &eukrea_cpuimx25_timer,
        .init_machine = eukrea_cpuimx25_init,
  MACHINE_END
@@@ -275,10 -275,11 +275,11 @@@ static struct sys_timer visstrim_m10_ti
  };
  
  MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10")
 -      .boot_params = MX27_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx27_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
+       .handle_irq = imx27_handle_irq,
        .timer = &visstrim_m10_timer,
        .init_machine = visstrim_m10_board_init,
  MACHINE_END
@@@ -71,10 -71,11 +71,11 @@@ static struct sys_timer mx27ipcam_time
  
  MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM")
        /* maintainer: Freescale Semiconductor, Inc. */
 -      .boot_params = MX27_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx27_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
+       .handle_irq = imx27_handle_irq,
        .timer = &mx27ipcam_timer,
        .init_machine = mx27ipcam_init,
  MACHINE_END
@@@ -77,10 -77,11 +77,11 @@@ static struct sys_timer mx27lite_timer 
  };
  
  MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE")
 -      .boot_params = MX27_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx27_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
+       .handle_irq = imx27_handle_irq,
        .timer = &mx27lite_timer,
        .init_machine = mx27lite_init,
  MACHINE_END
@@@ -36,7 -36,6 +36,7 @@@
  
  #include <mach/clock.h>
  #include <mach/common.h>
 +#include <mach/hardware.h>
  #include <mach/iomux-mx3.h>
  
  #include "devices-imx31.h"
@@@ -272,10 -271,11 +272,11 @@@ static struct sys_timer kzm_timer = 
  };
  
  MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01")
 -      .boot_params = MX3x_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = kzm_map_io,
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
+       .handle_irq = imx31_handle_irq,
        .timer = &kzm_timer,
        .init_machine = kzm_board_init,
  MACHINE_END
@@@ -140,19 -140,21 +140,21 @@@ struct sys_timer mx1ads_timer = 
  
  MACHINE_START(MX1ADS, "Freescale MX1ADS")
        /* Maintainer: Sascha Hauer, Pengutronix */
 -      .boot_params = MX1_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx1_map_io,
        .init_early = imx1_init_early,
        .init_irq = mx1_init_irq,
+       .handle_irq = imx1_handle_irq,
        .timer = &mx1ads_timer,
        .init_machine = mx1ads_init,
  MACHINE_END
  
  MACHINE_START(MXLADS, "Freescale MXLADS")
 -      .boot_params = MX1_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx1_map_io,
        .init_early = imx1_init_early,
        .init_irq = mx1_init_irq,
+       .handle_irq = imx1_handle_irq,
        .timer = &mx1ads_timer,
        .init_machine = mx1ads_init,
  MACHINE_END
@@@ -305,10 -305,11 +305,11 @@@ static struct sys_timer mx21ads_timer 
  
  MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
        /* maintainer: Freescale Semiconductor, Inc. */
 -      .boot_params = MX21_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx21ads_map_io,
        .init_early = imx21_init_early,
        .init_irq = mx21_init_irq,
+       .handle_irq = imx21_handle_irq,
        .timer = &mx21ads_timer,
        .init_machine = mx21ads_board_init,
  MACHINE_END
@@@ -43,6 -43,8 +43,8 @@@
  
  #include "devices-imx25.h"
  
+ #define MX25PDK_CAN_PWDN      IMX_GPIO_NR(4, 6)
  static const struct imxuart_platform_data uart_pdata __initconst = {
        .flags = IMXUART_HAVE_RTSCTS,
  };
@@@ -108,6 -110,11 +110,11 @@@ static iomux_v3_cfg_t mx25pdk_pads[] = 
        /* I2C1 */
        MX25_PAD_I2C1_CLK__I2C1_CLK,
        MX25_PAD_I2C1_DAT__I2C1_DAT,
+       /* CAN1 */
+       MX25_PAD_GPIO_A__CAN1_TX,
+       MX25_PAD_GPIO_B__CAN1_RX,
+       MX25_PAD_D14__GPIO_4_6, /* CAN_PWDN */
  };
  
  static const struct fec_platform_data mx25_fec_pdata __initconst = {
@@@ -240,6 -247,9 +247,9 @@@ static void __init mx25pdk_init(void
  
        imx25_add_sdhci_esdhc_imx(0, &mx25pdk_esdhc_pdata);
        imx25_add_imx_i2c0(&mx25_3ds_i2c0_data);
+       gpio_request_one(MX25PDK_CAN_PWDN, GPIOF_OUT_INIT_LOW, "can-pwdn");
+       imx25_add_flexcan0(NULL);
  }
  
  static void __init mx25pdk_timer_init(void)
@@@ -253,10 -263,11 +263,11 @@@ static struct sys_timer mx25pdk_timer 
  
  MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)")
        /* Maintainer: Freescale Semiconductor, Inc. */
 -      .boot_params = MX25_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx25_map_io,
        .init_early = imx25_init_early,
        .init_irq = mx25_init_irq,
+       .handle_irq = imx25_handle_irq,
        .timer = &mx25pdk_timer,
        .init_machine = mx25pdk_init,
  MACHINE_END
@@@ -241,7 -241,7 +241,7 @@@ static struct regulator_init_data gpo_i
  };
  
  static struct regulator_consumer_supply vmmc1_consumers[] = {
 -      REGULATOR_SUPPLY("lcd_2v8", NULL),
 +      REGULATOR_SUPPLY("vcore", "spi0.0"),
  };
  
  static struct regulator_init_data vmmc1_init = {
  };
  
  static struct regulator_consumer_supply vgen_consumers[] = {
 -      REGULATOR_SUPPLY("vdd_lcdio", NULL),
 +      REGULATOR_SUPPLY("vdd", "spi0.0"),
  };
  
  static struct regulator_init_data vgen_init = {
@@@ -348,6 -348,8 +348,6 @@@ static const struct imx_fb_platform_dat
  static struct l4f00242t03_pdata mx27_3ds_lcd_pdata = {
        .reset_gpio             = LCD_RESET,
        .data_enable_gpio       = LCD_ENABLE,
 -      .core_supply            = "lcd_2v8",
 -      .io_supply              = "vdd_lcdio",
  };
  
  static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
@@@ -419,10 -421,11 +419,11 @@@ static struct sys_timer mx27pdk_timer 
  
  MACHINE_START(MX27_3DS, "Freescale MX27PDK")
        /* maintainer: Freescale Semiconductor, Inc. */
 -      .boot_params = MX27_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx27_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
+       .handle_irq = imx27_handle_irq,
        .timer = &mx27pdk_timer,
        .init_machine = mx27pdk_init,
  MACHINE_END
@@@ -344,10 -344,11 +344,11 @@@ static void __init mx27ads_map_io(void
  
  MACHINE_START(MX27ADS, "Freescale i.MX27ADS")
        /* maintainer: Freescale Semiconductor, Inc. */
 -      .boot_params = MX27_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx27ads_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
+       .handle_irq = imx27_handle_irq,
        .timer = &mx27ads_timer,
        .init_machine = mx27ads_board_init,
  MACHINE_END
@@@ -285,6 -285,8 +285,6 @@@ static struct mx3fb_platform_data mx3fb
  static struct l4f00242t03_pdata mx31_3ds_l4f00242t03_pdata = {
        .reset_gpio             = IOMUX_TO_GPIO(MX31_PIN_LCS1),
        .data_enable_gpio       = IOMUX_TO_GPIO(MX31_PIN_SER_RS),
 -      .core_supply            = "lcd_2v8",
 -      .io_supply              = "vdd_lcdio",
  };
  
  /*
@@@ -409,7 -411,7 +409,7 @@@ static struct regulator_init_data vmmc2
  };
  
  static struct regulator_consumer_supply vmmc1_consumers[] = {
 -      REGULATOR_SUPPLY("lcd_2v8", NULL),
 +      REGULATOR_SUPPLY("vcore", "spi0.0"),
        REGULATOR_SUPPLY("cmos_2v8", "soc-camera-pdrv.0"),
  };
  
@@@ -426,7 -428,7 +426,7 @@@ static struct regulator_init_data vmmc1
  };
  
  static struct regulator_consumer_supply vgen_consumers[] = {
 -      REGULATOR_SUPPLY("vdd_lcdio", NULL),
 +      REGULATOR_SUPPLY("vdd", "spi0.0"),
  };
  
  static struct regulator_init_data vgen_init = {
@@@ -540,7 -542,7 +540,7 @@@ static const struct mxc_nand_platform_d
  mx31_3ds_nand_board_info __initconst = {
        .width          = 1,
        .hw_ecc         = 1,
 -#ifdef MACH_MX31_3DS_MXC_NAND_USE_BBT
 +#ifdef CONFIG_MACH_MX31_3DS_MXC_NAND_USE_BBT
        .flash_bbt      = 1,
  #endif
  };
@@@ -762,10 -764,11 +762,11 @@@ static void __init mx31_3ds_reserve(voi
  
  MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
        /* Maintainer: Freescale Semiconductor, Inc. */
 -      .boot_params = MX3x_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx31_map_io,
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
+       .handle_irq = imx31_handle_irq,
        .timer = &mx31_3ds_timer,
        .init_machine = mx31_3ds_init,
        .reserve = mx31_3ds_reserve,
@@@ -535,10 -535,11 +535,11 @@@ static struct sys_timer mx31ads_timer 
  
  MACHINE_START(MX31ADS, "Freescale MX31ADS")
        /* Maintainer: Freescale Semiconductor, Inc. */
 -      .boot_params = MX3x_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx31ads_map_io,
        .init_early = imx31_init_early,
        .init_irq = mx31ads_init_irq,
+       .handle_irq = imx31_handle_irq,
        .timer = &mx31ads_timer,
        .init_machine = mx31ads_init,
  MACHINE_END
@@@ -295,10 -295,11 +295,11 @@@ static struct sys_timer mx31lilly_time
  };
  
  MACHINE_START(LILLY1131, "INCO startec LILLY-1131")
 -      .boot_params = MX3x_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx31_map_io,
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
+       .handle_irq = imx31_handle_irq,
        .timer = &mx31lilly_timer,
        .init_machine = mx31lilly_board_init,
  MACHINE_END
@@@ -280,10 -280,11 +280,11 @@@ struct sys_timer mx31lite_timer = 
  
  MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM")
        /* Maintainer: Freescale Semiconductor, Inc. */
 -      .boot_params = MX3x_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx31lite_map_io,
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
+       .handle_irq = imx31_handle_irq,
        .timer = &mx31lite_timer,
        .init_machine = mx31lite_init,
  MACHINE_END
@@@ -28,6 -28,9 +28,9 @@@
  #include <linux/spi/spi.h>
  #include <linux/types.h>
  #include <linux/memblock.h>
+ #include <linux/clk.h>
+ #include <linux/io.h>
+ #include <linux/err.h>
  
  #include <linux/usb/otg.h>
  #include <linux/usb/ulpi.h>
@@@ -490,6 -493,18 +493,18 @@@ err
  
  }
  
+ static void mx31moboard_poweroff(void)
+ {
+       struct clk *clk = clk_get_sys("imx2-wdt.0", NULL);
+       if (!IS_ERR(clk))
+               clk_enable(clk);
+       mxc_iomux_mode(MX31_PIN_WATCHDOG_RST__WATCHDOG_RST);
+       __raw_writew(1 << 6 | 1 << 2, MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR));
+ }
  static int mx31moboard_baseboard;
  core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444);
  
@@@ -528,6 -543,8 +543,8 @@@ static void __init mx31moboard_init(voi
  
        moboard_usbh2_init();
  
+       pm_power_off = mx31moboard_poweroff;
        switch (mx31moboard_baseboard) {
        case MX31NOBOARD:
                break;
@@@ -567,11 -584,12 +584,12 @@@ static void __init mx31moboard_reserve(
  
  MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
        /* Maintainer: Valentin Longchamp, EPFL Mobots group */
 -      .boot_params = MX3x_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .reserve = mx31moboard_reserve,
        .map_io = mx31_map_io,
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
+       .handle_irq = imx31_handle_irq,
        .timer = &mx31moboard_timer,
        .init_machine = mx31moboard_init,
  MACHINE_END
@@@ -217,10 -217,11 +217,11 @@@ struct sys_timer mx35pdk_timer = 
  
  MACHINE_START(MX35_3DS, "Freescale MX35PDK")
        /* Maintainer: Freescale Semiconductor, Inc */
 -      .boot_params = MX3x_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx35_map_io,
        .init_early = imx35_init_early,
        .init_irq = mx35_init_irq,
+       .handle_irq = imx35_handle_irq,
        .timer = &mx35pdk_timer,
        .init_machine = mx35_3ds_init,
  MACHINE_END
@@@ -267,10 -267,11 +267,11 @@@ static struct sys_timer mxt_td60_timer 
  
  MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60")
        /* maintainer: Maxtrack Industrial */
 -      .boot_params = MX27_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx27_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
+       .handle_irq = imx27_handle_irq,
        .timer = &mxt_td60_timer,
        .init_machine = mxt_td60_board_init,
  MACHINE_END
@@@ -435,10 -435,11 +435,11 @@@ static struct sys_timer pca100_timer = 
  };
  
  MACHINE_START(PCA100, "phyCARD-i.MX27")
 -      .boot_params = MX27_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx27_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
+       .handle_irq = imx27_handle_irq,
        .init_machine = pca100_init,
        .timer = &pca100_timer,
  MACHINE_END
@@@ -688,11 -688,12 +688,12 @@@ static void __init pcm037_reserve(void
  
  MACHINE_START(PCM037, "Phytec Phycore pcm037")
        /* Maintainer: Pengutronix */
 -      .boot_params = MX3x_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .reserve = pcm037_reserve,
        .map_io = mx31_map_io,
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
+       .handle_irq = imx31_handle_irq,
        .timer = &pcm037_timer,
        .init_machine = pcm037_init,
  MACHINE_END
@@@ -176,9 -176,7 +176,9 @@@ static struct platform_device *platform
   * setup other stuffs to access the sram. */
  static void __init pcm038_init_sram(void)
  {
 -      mx27_setup_weimcs(1, 0x0000d843, 0x22252521, 0x22220a00);
 +      __raw_writel(0x0000d843, MX27_IO_ADDRESS(MX27_WEIM_CSCRxU(1)));
 +      __raw_writel(0x22252521, MX27_IO_ADDRESS(MX27_WEIM_CSCRxL(1)));
 +      __raw_writel(0x22220a00, MX27_IO_ADDRESS(MX27_WEIM_CSCRxA(1)));
  }
  
  static const struct imxi2c_platform_data pcm038_i2c1_data __initconst = {
@@@ -351,10 -349,11 +351,11 @@@ static struct sys_timer pcm038_timer = 
  };
  
  MACHINE_START(PCM038, "phyCORE-i.MX27")
 -      .boot_params = MX27_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx27_map_io,
        .init_early = imx27_init_early,
        .init_irq = mx27_init_irq,
+       .handle_irq = imx27_handle_irq,
        .timer = &pcm038_timer,
        .init_machine = pcm038_init,
  MACHINE_END
@@@ -418,10 -418,11 +418,11 @@@ struct sys_timer pcm043_timer = 
  
  MACHINE_START(PCM043, "Phytec Phycore pcm043")
        /* Maintainer: Pengutronix */
 -      .boot_params = MX3x_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx35_map_io,
        .init_early = imx35_init_early,
        .init_irq = mx35_init_irq,
+       .handle_irq = imx35_handle_irq,
        .timer = &pcm043_timer,
        .init_machine = pcm043_init,
  MACHINE_END
@@@ -190,10 -190,7 +190,10 @@@ static struct platform_device qong_nand
  static void __init qong_init_nand_mtd(void)
  {
        /* init CS */
 -      mx31_setup_weimcs(3, 0x00004f00, 0x20013b31, 0x00020800);
 +      __raw_writel(0x00004f00, MX31_IO_ADDRESS(MX31_WEIM_CSCRxU(3)));
 +      __raw_writel(0x20013b31, MX31_IO_ADDRESS(MX31_WEIM_CSCRxL(3)));
 +      __raw_writel(0x00020800, MX31_IO_ADDRESS(MX31_WEIM_CSCRxA(3)));
 +
        mxc_iomux_set_gpr(MUX_SDCTL_CSD1_SEL, true);
  
        /* enable pin */
@@@ -252,6 -249,7 +252,7 @@@ static void __init qong_init(void
        mxc_init_imx_uart();
        qong_init_nor_mtd();
        qong_init_fpga();
+       imx31_add_imx2_wdt(NULL);
  }
  
  static void __init qong_timer_init(void)
@@@ -265,10 -263,11 +266,11 @@@ static struct sys_timer qong_timer = 
  
  MACHINE_START(QONG, "Dave/DENX QongEVB-LITE")
        /* Maintainer: DENX Software Engineering GmbH */
 -      .boot_params = MX3x_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx31_map_io,
        .init_early = imx31_init_early,
        .init_irq = mx31_init_irq,
+       .handle_irq = imx31_handle_irq,
        .timer = &qong_timer,
        .init_machine = qong_init,
  MACHINE_END
@@@ -137,10 -137,11 +137,11 @@@ static struct sys_timer scb9328_timer 
  
  MACHINE_START(SCB9328, "Synertronixx scb9328")
        /* Sascha Hauer */
 -      .boot_params = 0x08000100,
 +      .atag_offset = 100,
        .map_io = mx1_map_io,
        .init_early = imx1_init_early,
        .init_irq = mx1_init_irq,
+       .handle_irq = imx1_handle_irq,
        .timer = &scb9328_timer,
        .init_machine = scb9328_init,
  MACHINE_END
@@@ -290,10 -290,11 +290,11 @@@ static struct sys_timer mxc_timer = 
  
  MACHINE_START(EUKREA_CPUIMX51, "Eukrea CPUIMX51 Module")
        /* Maintainer: Eric Bénard <eric@eukrea.com> */
 -      .boot_params = MX51_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx51_map_io,
        .init_early = imx51_init_early,
        .init_irq = mx51_init_irq,
+       .handle_irq = imx51_handle_irq,
        .timer = &mxc_timer,
        .init_machine = eukrea_cpuimx51_init,
  MACHINE_END
@@@ -328,10 -328,11 +328,11 @@@ static struct sys_timer mxc_timer = 
  
  MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD")
        /* Maintainer: Eric Bénard <eric@eukrea.com> */
 -      .boot_params = MX51_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx51_map_io,
        .init_early = imx51_init_early,
        .init_irq = mx51_init_irq,
+       .handle_irq = imx51_handle_irq,
        .timer = &mxc_timer,
        .init_machine = eukrea_cpuimx51sd_init,
  MACHINE_END
@@@ -168,10 -168,11 +168,11 @@@ static struct sys_timer mx51_3ds_timer 
  
  MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board")
        /* Maintainer: Freescale Semiconductor, Inc. */
 -      .boot_params = MX51_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx51_map_io,
        .init_early = imx51_init_early,
        .init_irq = mx51_init_irq,
+       .handle_irq = imx51_handle_irq,
        .timer = &mx51_3ds_timer,
        .init_machine = mx51_3ds_init,
  MACHINE_END
@@@ -414,10 -414,11 +414,11 @@@ static struct sys_timer mx51_babbage_ti
  
  MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board")
        /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */
 -      .boot_params = MX51_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx51_map_io,
        .init_early = imx51_init_early,
        .init_irq = mx51_init_irq,
+       .handle_irq = imx51_handle_irq,
        .timer = &mx51_babbage_timer,
        .init_machine = mx51_babbage_init,
  MACHINE_END
@@@ -161,6 -161,11 +161,11 @@@ static const struct gpio_led_platform_d
        .num_leds = ARRAY_SIZE(mx51_efikamx_leds),
  };
  
+ static struct esdhc_platform_data sd_pdata = {
+       .cd_type = ESDHC_CD_CONTROLLER,
+       .wp_type = ESDHC_WP_CONTROLLER,
+ };
  static struct gpio_keys_button mx51_efikamx_powerkey[] = {
        {
                .code = KEY_POWER,
@@@ -237,9 -242,11 +242,11 @@@ static void __init mx51_efikamx_init(vo
  
        /* on < 1.2 boards both SD controllers are used */
        if (system_rev < 0x12) {
-               imx51_add_sdhci_esdhc_imx(1, NULL);
+               imx51_add_sdhci_esdhc_imx(0, NULL);
+               imx51_add_sdhci_esdhc_imx(1, &sd_pdata);
                mx51_efikamx_leds[2].default_trigger = "mmc1";
-       }
+       } else
+               imx51_add_sdhci_esdhc_imx(0, &sd_pdata);
  
        gpio_led_register_device(-1, &mx51_efikamx_leds_data);
        imx_add_gpio_keys(&mx51_efikamx_powerkey_data);
@@@ -278,10 -285,11 +285,11 @@@ static struct sys_timer mx51_efikamx_ti
  
  MACHINE_START(MX51_EFIKAMX, "Genesi EfikaMX nettop")
        /* Maintainer: Amit Kucheria <amit.kucheria@linaro.org> */
 -      .boot_params = MX51_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx51_map_io,
        .init_early = imx51_init_early,
        .init_irq = mx51_init_irq,
+       .handle_irq = imx51_handle_irq,
        .timer = &mx51_efikamx_timer,
        .init_machine = mx51_efikamx_init,
  MACHINE_END
@@@ -54,6 -54,7 +54,7 @@@
  #define EFIKASB_RFKILL                IMX_GPIO_NR(3, 1)
  
  #define MX51_PAD_PWRKEY IOMUX_PAD(0x48c, 0x0f8, 1, 0x0,   0, PAD_CTL_PUS_100K_UP | PAD_CTL_PKE)
+ #define MX51_PAD_SD1_CD       IOMUX_PAD(0x47c, 0x0e8, 1, __NA_, 0, MX51_ESDHC_PAD_CTRL)
  
  static iomux_v3_cfg_t mx51efikasb_pads[] = {
        /* USB HOST2 */
@@@ -95,6 -96,8 +96,8 @@@
  
        /* BT */
        MX51_PAD_EIM_A17__GPIO2_11,
+       MX51_PAD_SD1_CD,
  };
  
  static int initialize_usbh2_port(struct platform_device *pdev)
@@@ -180,6 -183,18 +183,18 @@@ static const struct gpio_keys_platform_
        .nbuttons = ARRAY_SIZE(mx51_efikasb_keys),
  };
  
+ static struct esdhc_platform_data sd0_pdata = {
+ #define EFIKASB_SD1_CD        IMX_GPIO_NR(2, 27)
+       .cd_gpio = EFIKASB_SD1_CD,
+       .cd_type = ESDHC_CD_GPIO,
+       .wp_type = ESDHC_WP_CONTROLLER,
+ };
+ static struct esdhc_platform_data sd1_pdata = {
+       .cd_type = ESDHC_CD_CONTROLLER,
+       .wp_type = ESDHC_WP_CONTROLLER,
+ };
  static struct regulator *pwgt1, *pwgt2;
  
  static void mx51_efikasb_power_off(void)
@@@ -248,7 -263,8 +263,8 @@@ static void __init efikasb_board_init(v
  
        mx51_efikasb_board_id();
        mx51_efikasb_usb();
-       imx51_add_sdhci_esdhc_imx(1, NULL);
+       imx51_add_sdhci_esdhc_imx(0, &sd0_pdata);
+       imx51_add_sdhci_esdhc_imx(1, &sd1_pdata);
  
        gpio_led_register_device(-1, &mx51_efikasb_leds_data);
        imx_add_gpio_keys(&mx51_efikasb_keys_data);
@@@ -264,10 -280,11 +280,11 @@@ static struct sys_timer mx51_efikasb_ti
  };
  
  MACHINE_START(MX51_EFIKASB, "Genesi Efika Smartbook")
 -      .boot_params = MX51_PHYS_OFFSET + 0x100,
 +      .atag_offset = 0x100,
        .map_io = mx51_map_io,
        .init_early = imx51_init_early,
        .init_irq = mx51_init_irq,
+       .handle_irq = imx51_handle_irq,
        .init_machine =  efikasb_board_init,
        .timer = &mx51_efikasb_timer,
  MACHINE_END
@@@ -349,7 -349,7 +349,7 @@@ static int name##_set_rate(struct clk *
                                                                        \
                reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##fr); \
                reg &= ~BM_CLKCTRL_##fr##_##fs##FRAC;                   \
 -              reg |= frac;                                            \
 +              reg |= frac << BP_CLKCTRL_##fr##_##fs##FRAC;            \
                __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##fr); \
        }                                                               \
                                                                        \
@@@ -640,6 -640,8 +640,8 @@@ static struct clk_lookup lookups[] = 
        _REGISTER_CLOCK(NULL, "lradc", lradc_clk)
        _REGISTER_CLOCK(NULL, "spdif", spdif_clk)
        _REGISTER_CLOCK("imx28-fb", NULL, lcdif_clk)
+       _REGISTER_CLOCK("mxs-saif.0", NULL, saif0_clk)
+       _REGISTER_CLOCK("mxs-saif.1", NULL, saif1_clk)
  };
  
  static int clk_misc_init(void)
  
        /* SAIF has to use frac div for functional operation */
        reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SAIF0);
-       reg &= ~BM_CLKCTRL_SAIF0_DIV_FRAC_EN;
+       reg |= BM_CLKCTRL_SAIF0_DIV_FRAC_EN;
        __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SAIF0);
  
        reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_SAIF1);
-       reg &= ~BM_CLKCTRL_SAIF1_DIV_FRAC_EN;
+       reg |= BM_CLKCTRL_SAIF1_DIV_FRAC_EN;
        __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_SAIF1);
  
        /*
@@@ -780,6 -782,8 +782,8 @@@ int __init mx28_clocks_init(void
        clk_enable(&uart_clk);
  
        clk_set_parent(&lcdif_clk, &ref_pix_clk);
+       clk_set_parent(&saif0_clk, &pll0_clk);
+       clk_set_parent(&saif1_clk, &pll0_clk);
  
        clkdev_add_table(lookups, ARRAY_SIZE(lookups));
  
@@@ -166,6 -166,7 +166,7 @@@ static void __init mx23evk_init(void
                gpio_set_value(MX23EVK_BL_ENABLE, 1);
  
        mx23_add_mxsfb(&mx23evk_mxsfb_pdata);
+       mx23_add_rtc_stmp3xxx();
  }
  
  static void __init mx23evk_timer_init(void)
@@@ -181,6 -182,6 +182,6 @@@ MACHINE_START(MX23EVK, "Freescale MX23 
        /* Maintainer: Freescale Semiconductor, Inc. */
        .map_io         = mx23_map_io,
        .init_irq       = mx23_init_irq,
 -      .init_machine   = mx23evk_init,
        .timer          = &mx23evk_timer,
 +      .init_machine   = mx23evk_init,
  MACHINE_END
@@@ -17,6 -17,9 +17,9 @@@
  #include <linux/gpio.h>
  #include <linux/leds.h>
  #include <linux/clk.h>
+ #include <linux/i2c.h>
+ #include <linux/regulator/machine.h>
+ #include <linux/regulator/fixed.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -182,6 -185,24 +185,24 @@@ static const iomux_cfg_t mx28evk_pads[
  
        /* led */
        MX28_PAD_AUART1_TX__GPIO_3_5 | MXS_PAD_CTRL,
+       /* I2C */
+       MX28_PAD_I2C0_SCL__I2C0_SCL |
+               (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
+       MX28_PAD_I2C0_SDA__I2C0_SDA |
+               (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
+       /* saif0 & saif1 */
+       MX28_PAD_SAIF0_MCLK__SAIF0_MCLK |
+               (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
+       MX28_PAD_SAIF0_LRCLK__SAIF0_LRCLK |
+               (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
+       MX28_PAD_SAIF0_BITCLK__SAIF0_BITCLK |
+               (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
+       MX28_PAD_SAIF0_SDATA0__SAIF0_SDATA0 |
+               (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
+       MX28_PAD_SAIF1_SDATA0__SAIF1_SDATA0 |
+               (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
  };
  
  /* led */
@@@ -351,6 -372,50 +372,50 @@@ static struct mxs_mmc_platform_data mx2
        },
  };
  
+ static struct i2c_board_info mxs_i2c0_board_info[] __initdata = {
+       {
+               I2C_BOARD_INFO("sgtl5000", 0x0a),
+       },
+ };
+ #if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE)
+ static struct regulator_consumer_supply mx28evk_audio_consumer_supplies[] = {
+       REGULATOR_SUPPLY("VDDA", "0-000a"),
+       REGULATOR_SUPPLY("VDDIO", "0-000a"),
+ };
+ static struct regulator_init_data mx28evk_vdd_reg_init_data = {
+       .constraints    = {
+               .name   = "3V3",
+               .always_on = 1,
+       },
+       .consumer_supplies = mx28evk_audio_consumer_supplies,
+       .num_consumer_supplies = ARRAY_SIZE(mx28evk_audio_consumer_supplies),
+ };
+ static struct fixed_voltage_config mx28evk_vdd_pdata = {
+       .supply_name    = "board-3V3",
+       .microvolts     = 3300000,
+       .gpio           = -EINVAL,
+       .enabled_at_boot = 1,
+       .init_data      = &mx28evk_vdd_reg_init_data,
+ };
+ static struct platform_device mx28evk_voltage_regulator = {
+       .name           = "reg-fixed-voltage",
+       .id             = -1,
+       .num_resources  = 0,
+       .dev            = {
+               .platform_data  = &mx28evk_vdd_pdata,
+       },
+ };
+ static void __init mx28evk_add_regulators(void)
+ {
+       platform_device_register(&mx28evk_voltage_regulator);
+ }
+ #else
+ static void __init mx28evk_add_regulators(void) {}
+ #endif
  static struct gpio mx28evk_lcd_gpios[] = {
        { MX28EVK_LCD_ENABLE, GPIOF_OUT_INIT_HIGH, "lcd-enable" },
        { MX28EVK_BL_ENABLE, GPIOF_OUT_INIT_HIGH, "bl-enable" },
@@@ -389,6 -454,18 +454,18 @@@ static void __init mx28evk_init(void
        else
                mx28_add_mxsfb(&mx28evk_mxsfb_pdata);
  
+       mx28_add_saif(0);
+       mx28_add_saif(1);
+       mx28_add_mxs_i2c(0);
+       i2c_register_board_info(0, mxs_i2c0_board_info,
+                               ARRAY_SIZE(mxs_i2c0_board_info));
+       mx28evk_add_regulators();
+       mxs_add_platform_device("mxs-sgtl5000", 0, NULL, 0,
+                       NULL, 0);
        /* power on mmc slot by writing 0 to the gpio */
        ret = gpio_request_one(MX28EVK_MMC0_SLOT_POWER, GPIOF_OUT_INIT_LOW,
                               "mmc0-slot-power");
        else
                mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]);
  
+       mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]);
+       mx28_add_rtc_stmp3xxx();
        gpio_led_register_device(0, &mx28evk_led_data);
  }
  
@@@ -419,6 -499,6 +499,6 @@@ MACHINE_START(MX28EVK, "Freescale MX28 
        /* Maintainer: Freescale Semiconductor, Inc. */
        .map_io         = mx28_map_io,
        .init_irq       = mx28_init_irq,
 -      .init_machine   = mx28evk_init,
        .timer          = &mx28evk_timer,
 +      .init_machine   = mx28evk_init,
  MACHINE_END
@@@ -161,6 -161,7 +161,7 @@@ static void __init tx28_stk5v3_init(voi
        i2c_register_board_info(0, tx28_stk5v3_i2c_boardinfo,
                        ARRAY_SIZE(tx28_stk5v3_i2c_boardinfo));
        mx28_add_mxs_mmc(0, &tx28_mmc0_pdata);
+       mx28_add_rtc_stmp3xxx();
  }
  
  static void __init tx28_timer_init(void)
@@@ -175,6 -176,6 +176,6 @@@ static struct sys_timer tx28_timer = 
  MACHINE_START(TX28, "Ka-Ro electronics TX28 module")
        .map_io = mx28_map_io,
        .init_irq = mx28_init_irq,
 -      .init_machine = tx28_stk5v3_init,
        .timer = &tx28_timer,
 +      .init_machine = tx28_stk5v3_init,
  MACHINE_END
@@@ -1,6 -1,7 +1,7 @@@
 -zreladdr-$(CONFIG_ARCH_TEGRA_2x_SOC)  := 0x00008000
 +zreladdr-$(CONFIG_ARCH_TEGRA_2x_SOC)  += 0x00008000
  params_phys-$(CONFIG_ARCH_TEGRA_2x_SOC)       := 0x00000100
  initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC)       := 0x00800000
  
  dtb-$(CONFIG_MACH_HARMONY) += tegra-harmony.dtb
  dtb-$(CONFIG_MACH_SEABOARD) += tegra-seaboard.dtb
+ dtb-$(CONFIG_MACH_VENTANA) += tegra-ventana.dtb
@@@ -20,6 -20,7 +20,7 @@@
  
  #include "gpio-names.h"
  #include "board-paz00.h"
+ #include "devices.h"
  
  static struct tegra_pingroup_config paz00_pinmux[] = {
        {TEGRA_PINGROUP_ATA,   TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_XM2D,  TEGRA_MUX_NONE,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
  };
  
+ static struct platform_device *pinmux_devices[] = {
+       &tegra_gpio_device,
+       &tegra_pinmux_device,
+ };
  static struct tegra_gpio_table gpio_table[] = {
        { .gpio = TEGRA_GPIO_SD1_CD,    .enable = true },
        { .gpio = TEGRA_GPIO_SD1_WP,    .enable = true },
        { .gpio = TEGRA_GPIO_SD1_POWER, .enable = true },
        { .gpio = TEGRA_ULPI_RST,       .enable = true },
 +      { .gpio = TEGRA_WIFI_PWRN,      .enable = true },
 +      { .gpio = TEGRA_WIFI_RST,       .enable = true },
 +      { .gpio = TEGRA_WIFI_LED,       .enable = true },
  };
  
  void paz00_pinmux_init(void)
  {
+       platform_add_devices(pinmux_devices, ARRAY_SIZE(pinmux_devices));
        tegra_pinmux_config_table(paz00_pinmux, ARRAY_SIZE(paz00_pinmux));
  
        tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table));
@@@ -1,5 -1,6 +1,6 @@@
  /*
-  * Copyright (C) 2010 NVIDIA Corporation
+  * Copyright (C) 2010,2011 NVIDIA Corporation
+  * Copyright (C) 2011 Google, Inc.
   *
   * This software is licensed under the terms of the GNU General Public
   * License version 2, as published by the Free Software Foundation, and
@@@ -21,6 -22,7 +22,7 @@@
  
  #include "gpio-names.h"
  #include "board-seaboard.h"
+ #include "devices.h"
  
  #define DEFAULT_DRIVE(_name)                                  \
        {                                                       \
@@@ -49,7 -51,7 +51,7 @@@ static __initdata struct tegra_pingroup
        {TEGRA_PINGROUP_CRTP,  TEGRA_MUX_CRT,           TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_CSUS,  TEGRA_MUX_VI_SENSOR_CLK, TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_DAP1,  TEGRA_MUX_DAP1,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
 -      {TEGRA_PINGROUP_DAP2,  TEGRA_MUX_DAP2,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
 +      {TEGRA_PINGROUP_DAP2,  TEGRA_MUX_DAP2,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_DAP3,  TEGRA_MUX_DAP3,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_DAP4,  TEGRA_MUX_DAP4,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_DDC,   TEGRA_MUX_RSVD2,         TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_SPDO,  TEGRA_MUX_RSVD2,         TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_SPIA,  TEGRA_MUX_GMI,           TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_SPIB,  TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
 -      {TEGRA_PINGROUP_SPIC,  TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
 +      {TEGRA_PINGROUP_SPIC,  TEGRA_MUX_GMI,           TEGRA_PUPD_PULL_UP,   TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_SPID,  TEGRA_MUX_SPI1,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_SPIE,  TEGRA_MUX_SPI1,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_SPIF,  TEGRA_MUX_SPI1,          TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_XM2D,  TEGRA_MUX_NONE,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
  };
  
+ static __initdata struct tegra_pingroup_config ventana_pinmux[] = {
+       {TEGRA_PINGROUP_DAP3, TEGRA_MUX_DAP3,     TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
+       {TEGRA_PINGROUP_DDC,  TEGRA_MUX_RSVD2,    TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
+       {TEGRA_PINGROUP_DTA,  TEGRA_MUX_VI,       TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
+       {TEGRA_PINGROUP_DTB,  TEGRA_MUX_VI,       TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
+       {TEGRA_PINGROUP_DTC,  TEGRA_MUX_VI,       TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
+       {TEGRA_PINGROUP_DTD,  TEGRA_MUX_VI,       TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
+       {TEGRA_PINGROUP_GMD,  TEGRA_MUX_SFLASH,   TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
+       {TEGRA_PINGROUP_LPW0, TEGRA_MUX_RSVD4,    TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
+       {TEGRA_PINGROUP_LPW2, TEGRA_MUX_RSVD4,    TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
+       {TEGRA_PINGROUP_LSC1, TEGRA_MUX_RSVD4,    TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
+       {TEGRA_PINGROUP_LSCK, TEGRA_MUX_RSVD4,    TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
+       {TEGRA_PINGROUP_LSDA, TEGRA_MUX_RSVD4,    TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
+       {TEGRA_PINGROUP_PTA,  TEGRA_MUX_RSVD2,    TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
+       {TEGRA_PINGROUP_SLXC, TEGRA_MUX_SDIO3,    TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
+       {TEGRA_PINGROUP_SLXK, TEGRA_MUX_SDIO3,    TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
+       {TEGRA_PINGROUP_SPIA, TEGRA_MUX_GMI,      TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
+       {TEGRA_PINGROUP_SPIC, TEGRA_MUX_GMI,      TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
+       {TEGRA_PINGROUP_SPIG, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
+ };
  
+ static struct platform_device *pinmux_devices[] = {
+       &tegra_gpio_device,
+       &tegra_pinmux_device,
+ };
  
- static struct tegra_gpio_table gpio_table[] = {
+ static struct tegra_gpio_table common_gpio_table[] = {
        { .gpio = TEGRA_GPIO_SD2_CD,            .enable = true },
        { .gpio = TEGRA_GPIO_SD2_WP,            .enable = true },
        { .gpio = TEGRA_GPIO_SD2_POWER,         .enable = true },
        { .gpio = TEGRA_GPIO_LIDSWITCH,         .enable = true },
        { .gpio = TEGRA_GPIO_POWERKEY,          .enable = true },
        { .gpio = TEGRA_GPIO_ISL29018_IRQ,      .enable = true },
 +      { .gpio = TEGRA_GPIO_CDC_IRQ,           .enable = true },
 +      { .gpio = TEGRA_GPIO_USB1,              .enable = true },
  };
  
- void __init seaboard_pinmux_init(void)
+ static void __init update_pinmux(struct tegra_pingroup_config *newtbl, int size)
+ {
+       int i, j;
+       struct tegra_pingroup_config *new_pingroup, *base_pingroup;
+       /* Update base seaboard pinmux table with secondary board
+        * specific pinmux table table.
+        */
+       for (i = 0; i < size; i++) {
+               new_pingroup = &newtbl[i];
+               for (j = 0; j < ARRAY_SIZE(seaboard_pinmux); j++) {
+                       base_pingroup = &seaboard_pinmux[j];
+                       if (new_pingroup->pingroup == base_pingroup->pingroup) {
+                               *base_pingroup = *new_pingroup;
+                               break;
+                       }
+               }
+       }
+ }
+ void __init seaboard_common_pinmux_init(void)
  {
+       platform_add_devices(pinmux_devices, ARRAY_SIZE(pinmux_devices));
        tegra_pinmux_config_table(seaboard_pinmux, ARRAY_SIZE(seaboard_pinmux));
  
        tegra_drive_pinmux_config_table(seaboard_drive_pinmux,
                                        ARRAY_SIZE(seaboard_drive_pinmux));
  
-       tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table));
+       tegra_gpio_config(common_gpio_table, ARRAY_SIZE(common_gpio_table));
+ }
+ void __init seaboard_pinmux_init(void)
+ {
+       seaboard_common_pinmux_init();
  }
+ void __init ventana_pinmux_init(void)
+ {
+       update_pinmux(ventana_pinmux, ARRAY_SIZE(ventana_pinmux));
+       seaboard_common_pinmux_init();
+ }
  #include <mach/iomap.h>
  #include <mach/dma.h>
  #include <mach/usb_phy.h>
 +
  #include "gpio-names.h"
 +#include "devices.h"
  
+ static struct resource gpio_resource[] = {
+       [0] = {
+               .start  = TEGRA_GPIO_BASE,
+               .end    = TEGRA_GPIO_BASE + TEGRA_GPIO_SIZE-1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = INT_GPIO1,
+               .end    = INT_GPIO1,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = {
+               .start  = INT_GPIO2,
+               .end    = INT_GPIO2,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [3] = {
+               .start  = INT_GPIO3,
+               .end    = INT_GPIO3,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [4] = {
+               .start  = INT_GPIO4,
+               .end    = INT_GPIO4,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [5] = {
+               .start  = INT_GPIO5,
+               .end    = INT_GPIO5,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [6] = {
+               .start  = INT_GPIO6,
+               .end    = INT_GPIO6,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [7] = {
+               .start  = INT_GPIO7,
+               .end    = INT_GPIO7,
+               .flags  = IORESOURCE_IRQ,
+       },
+ };
+ struct platform_device tegra_gpio_device = {
+       .name           = "tegra-gpio",
+       .id             = -1,
+       .resource       = gpio_resource,
+       .num_resources  = ARRAY_SIZE(gpio_resource),
+ };
+ static struct resource pinmux_resource[] = {
+       [0] = {
+               /* Tri-state registers */
+               .start  = TEGRA_APB_MISC_BASE + 0x14,
+               .end    = TEGRA_APB_MISC_BASE + 0x20 + 3,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               /* Mux registers */
+               .start  = TEGRA_APB_MISC_BASE + 0x80,
+               .end    = TEGRA_APB_MISC_BASE + 0x9c + 3,
+               .flags  = IORESOURCE_MEM,
+       },
+       [2] = {
+               /* Pull-up/down registers */
+               .start  = TEGRA_APB_MISC_BASE + 0xa0,
+               .end    = TEGRA_APB_MISC_BASE + 0xb0 + 3,
+               .flags  = IORESOURCE_MEM,
+       },
+       [3] = {
+               /* Pad control registers */
+               .start  = TEGRA_APB_MISC_BASE + 0x868,
+               .end    = TEGRA_APB_MISC_BASE + 0x90c + 3,
+               .flags  = IORESOURCE_MEM,
+       },
+ };
+ struct platform_device tegra_pinmux_device = {
+       .name           = "tegra-pinmux",
+       .id             = -1,
+       .resource       = pinmux_resource,
+       .num_resources  = ARRAY_SIZE(pinmux_resource),
+ };
  static struct resource i2c_resource1[] = {
        [0] = {
                .start  = INT_I2C,
@@@ -4,50 -4,31 +4,31 @@@ source "arch/arm/plat-mxc/devices/Kconf
  
  menu "Freescale MXC Implementations"
  
- config ARCH_MX50_SUPPORTED
-       bool
- config ARCH_MX53_SUPPORTED
-       bool
  choice
        prompt "Freescale CPU family:"
        default ARCH_MX3
  
- config ARCH_MX1
-       bool "MX1-based"
-       help
-         This enables support for systems based on the Freescale i.MX1 family
- config ARCH_MX2
-       bool "MX2-based"
-       help
-         This enables support for systems based on the Freescale i.MX2 family
- config ARCH_MX25
-       bool "MX25-based"
+ config ARCH_IMX_V4_V5
+       bool "i.MX1, i.MX21, i.MX25, i.MX27"
+       select AUTO_ZRELADDR
+       select ARM_PATCH_PHYS_VIRT
        help
-         This enables support for systems based on the Freescale i.MX25 family
+         This enables support for systems based on the Freescale i.MX ARMv4
+         and ARMv5 SoCs
  
  config ARCH_MX3
        bool "MX3-based"
        help
          This enables support for systems based on the Freescale i.MX3 family
  
- config ARCH_MX503
-       bool "i.MX50 + i.MX53"
-       select ARCH_MX50_SUPPORTED
-       select ARCH_MX53_SUPPORTED
+ config ARCH_MX5
+       bool "i.MX50, i.MX51, i.MX53"
+       select AUTO_ZRELADDR
+       select ARM_PATCH_PHYS_VIRT
        help
 -        This enables support for machines using Freescale's i.MX50 and i.MX51
 +        This enables support for machines using Freescale's i.MX50 and i.MX53
          processors.
  
- config ARCH_MX51
-       bool "i.MX51"
-       select ARCH_MX51_SUPPORTED
-       help
-         This enables support for systems based on the Freescale i.MX51 family
  endchoice
  
  source "arch/arm/mach-imx/Kconfig"