Merge branch 'imx/devel' into next/dt
authorArnd Bergmann <arnd@arndb.de>
Tue, 1 Nov 2011 16:12:22 +0000 (17:12 +0100)
committerArnd Bergmann <arnd@arndb.de>
Tue, 1 Nov 2011 16:12:22 +0000 (17:12 +0100)
The board changes in the imx/devel branch conflict with other changes in
the device imx/dt branch.

Conflicts:
arch/arm/mach-mx5/board-mx53_loco.c
arch/arm/mach-mx5/board-mx53_smd.c
arch/arm/plat-mxc/include/mach/common.h
arch/arm/plat-mxc/include/mach/memory.h

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
42 files changed:
1  2 
arch/arm/Kconfig
arch/arm/Makefile
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/Kconfig
arch/arm/mach-mx5/Makefile
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-mx5/board-mx53_ard.c
arch/arm/mach-mx5/board-mx53_evk.c
arch/arm/mach-mx5/board-mx53_loco.c
arch/arm/mach-mx5/board-mx53_smd.c
arch/arm/mach-mx5/clock-mx51-mx53.c
arch/arm/plat-mxc/include/mach/common.h

diff --combined arch/arm/Kconfig
@@@ -29,7 -29,6 +29,7 @@@ config AR
        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.
 +
 +        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 ARM_PATCH_PHYS_VIRT_16BIT
 -      def_bool y
 -      depends on ARM_PATCH_PHYS_VIRT && ARCH_MSM
 +config NEED_MACH_MEMORY_H
 +      bool
        help
 -        This option extends the physical to virtual translation patching
 -        to allow physical memory down to a theoretical minimum of 64K
 -        boundaries.
 +        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
 +        Please provide the physical address corresponding to the
 +        location of main memory in your system.
  
  source "init/Kconfig"
  
@@@ -257,7 -246,6 +257,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.
  
@@@ -273,7 -261,6 +273,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.
  
@@@ -314,6 -301,7 +314,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.
@@@ -334,7 -322,6 +334,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.
  
@@@ -375,7 -362,6 +375,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
@@@ -391,7 -377,6 +391,7 @@@ config ARCH_EP93X
        select ARCH_REQUIRE_GPIOLIB
        select ARCH_HAS_HOLES_MEMORYMODEL
        select ARCH_USES_GETTIMEOFFSET
 +      select NEED_MEMORY_H
        help
          This enables support for the Cirrus EP93xx series of CPUs.
  
@@@ -400,7 -385,6 +400,7 @@@ config ARCH_FOOTBRIDG
        select CPU_SA110
        select FOOTBRIDGE
        select GENERIC_CLOCKEVENTS
 +      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.
@@@ -413,6 -397,7 +413,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
  
@@@ -450,7 -435,6 +451,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.
  
@@@ -481,7 -465,6 +482,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.
  
@@@ -491,7 -474,6 +492,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.
  
@@@ -585,7 -567,6 +586,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.
@@@ -677,7 -658,6 +678,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.
  
@@@ -692,7 -672,6 +693,7 @@@ config ARCH_RP
        select NO_IOPORT
        select ARCH_SPARSEMEM_ENABLE
        select ARCH_USES_GETTIMEOFFSET
 +      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.
@@@ -711,7 -690,6 +712,7 @@@ config ARCH_SA110
        select HAVE_SCHED_CLOCK
        select TICK_ONESHOT
        select ARCH_REQUIRE_GPIOLIB
 +      select NEED_MACH_MEMORY_H
        help
          Support for StrongARM 11x0 based boards.
  
@@@ -804,7 -782,6 +805,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
  
@@@ -821,7 -798,6 +822,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
  
@@@ -833,7 -809,6 +834,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>).
@@@ -861,7 -836,6 +862,7 @@@ config ARCH_U30
        select CLKDEV_LOOKUP
        select HAVE_MACH_CLKDEV
        select GENERIC_GPIO
 +      select NEED_MACH_MEMORY_H
        help
          Support for ST-Ericsson U300 series mobile platforms.
  
@@@ -1434,31 -1408,6 +1435,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
@@@ -1859,38 -1808,6 +1860,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 ""
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
@@@ -314,25 -314,19 +314,19 @@@ static struct mtd_partition armadillo5x
        },
  };
  
- static struct physmap_flash_data armadillo5x0_nor_flash_pdata = {
+ static const struct physmap_flash_data
+               armadillo5x0_nor_flash_pdata __initconst = {
        .width          = 2,
        .parts          = armadillo5x0_nor_flash_partitions,
        .nr_parts       = ARRAY_SIZE(armadillo5x0_nor_flash_partitions),
  };
  
- static struct resource armadillo5x0_nor_flash_resource = {
+ static const struct resource armadillo5x0_nor_flash_resource __initconst = {
        .flags          = IORESOURCE_MEM,
        .start          = MX31_CS0_BASE_ADDR,
        .end            = MX31_CS0_BASE_ADDR + SZ_64M - 1,
  };
  
- static struct platform_device armadillo5x0_nor_flash = {
-       .name                   = "physmap-flash",
-       .id                     = -1,
-       .num_resources          = 1,
-       .resource               = &armadillo5x0_nor_flash_resource,
- };
  /*
   * FB support
   */
@@@ -514,8 -508,10 +508,10 @@@ static void __init armadillo5x0_init(vo
        imx31_add_mx3_sdc_fb(&mx3fb_pdata);
  
        /* Register NOR Flash */
-       mxc_register_device(&armadillo5x0_nor_flash,
-                           &armadillo5x0_nor_flash_pdata);
+       platform_device_register_resndata(NULL, "physmap-flash", -1,
+                       &armadillo5x0_nor_flash_resource, 1,
+                       &armadillo5x0_nor_flash_pdata,
+                       sizeof(armadillo5x0_nor_flash_pdata));
  
        /* Register NAND Flash */
        imx31_add_mxc_nand(&armadillo5x0_nand_board_info);
@@@ -558,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
@@@ -66,7 -66,7 +66,7 @@@ static struct i2c_board_info eukrea_cpu
                I2C_BOARD_INFO("tsc2007", 0x48),
                .type           = "tsc2007",
                .platform_data  = &tsc2007_info,
-               .irq            = gpio_to_irq(TSC2007_IRQGPIO),
+               .irq            = IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
        },
  };
  
@@@ -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
@@@ -271,10 -271,11 +271,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
@@@ -68,23 -68,16 +68,16 @@@ static const struct imxuart_platform_da
   * Physmap flash
   */
  
- static struct physmap_flash_data mx1ads_flash_data = {
+ static const struct physmap_flash_data mx1ads_flash_data __initconst = {
        .width          = 4,            /* bankwidth in bytes */
  };
  
- static struct resource flash_resource = {
+ static const struct resource flash_resource __initconst = {
        .start  = MX1_CS0_PHYS,
        .end    = MX1_CS0_PHYS + SZ_32M - 1,
        .flags  = IORESOURCE_MEM,
  };
  
- static struct platform_device flash_device = {
-       .name   = "physmap-flash",
-       .id     = 0,
-       .resource = &flash_resource,
-       .num_resources = 1,
- };
  /*
   * I2C
   */
@@@ -125,7 -118,9 +118,9 @@@ static void __init mx1ads_init(void
        imx1_add_imx_uart1(&uart1_pdata);
  
        /* Physmap flash */
-       mxc_register_device(&flash_device, &mx1ads_flash_data);
+       platform_device_register_resndata(NULL, "physmap-flash", 0,
+                       &flash_resource, 1,
+                       &mx1ads_flash_data, sizeof(mx1ads_flash_data));
  
        /* I2C */
        i2c_register_board_info(0, mx1ads_i2c_devices,
@@@ -145,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
@@@ -359,7 -359,7 +359,7 @@@ static struct spi_board_info mx27_3ds_s
                .bus_num        = 1,
                .chip_select    = 0, /* SS0 */
                .platform_data  = &mc13783_pdata,
-               .irq = gpio_to_irq(PMIC_INT),
+               .irq = IMX_GPIO_TO_IRQ(PMIC_INT),
                .mode = SPI_CS_HIGH,
        }, {
                .modalias       = "l4f00242t03",
@@@ -421,10 -421,11 +421,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
@@@ -345,10 -345,11 +345,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
@@@ -764,10 -764,11 +764,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
@@@ -349,10 -349,11 +349,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
@@@ -249,6 -249,7 +249,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)
@@@ -262,10 -263,11 +263,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
@@@ -1,8 -1,9 +1,9 @@@
- if ARCH_MX503 || ARCH_MX51
+ if ARCH_MX5
  # ARCH_MX5/50/53 are left to mark places where prevent multi-soc in single
  # image. So for most time, SOC_IMX50/51/53 should be used.
  
- config ARCH_MX5
+ config ARCH_MX51
        bool
  
  config ARCH_MX50
@@@ -19,7 -20,6 +20,6 @@@ config SOC_IMX5
        select ARCH_MXC_IOMUX_V3
        select ARCH_MXC_AUDMUX_V2
        select ARCH_HAS_CPUFREQ
-       select ARCH_MX5
        select ARCH_MX50
  
  config        SOC_IMX51
@@@ -30,7 -30,7 +30,7 @@@
        select ARCH_MXC_IOMUX_V3
        select ARCH_MXC_AUDMUX_V2
        select ARCH_HAS_CPUFREQ
-       select ARCH_MX5
+       select ARCH_MX51
  
  config        SOC_IMX53
        bool
        select ARM_L1_CACHE_SHIFT_6
        select MXC_TZIC
        select ARCH_MXC_IOMUX_V3
-       select ARCH_MX5
        select ARCH_MX53
  
- if ARCH_MX50_SUPPORTED
  #comment "i.MX50 machines:"
  
  config MACH_MX50_RDP
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
        select IMX_HAVE_PLATFORM_SPI_IMX
-       select IMX_HAVE_PLATFORM_FEC
        help
          Include support for MX50 reference design platform (RDP) board. This
          includes specific configurations for the board and its peripherals.
  
- endif # ARCH_MX50_SUPPORTED
- if ARCH_MX51
  comment "i.MX51 machines:"
  
 +config MACH_IMX51_DT
 +      bool "Support i.MX51 platforms from device tree"
 +      select SOC_IMX51
 +      select USE_OF
 +      select MACH_MX51_BABBAGE
 +      help
 +        Include support for Freescale i.MX51 based platforms
 +        using the device tree for discovery
 +
  config MACH_MX51_BABBAGE
        bool "Support MX51 BABBAGE platforms"
        select SOC_IMX51
+       select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_MXC_EHCI
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
        select IMX_HAVE_PLATFORM_SPI_IMX
        help
@@@ -100,8 -87,10 +96,10 @@@ config MACH_MX51_3D
  config MACH_EUKREA_CPUIMX51
        bool "Support Eukrea CPUIMX51 module"
        select SOC_IMX51
+       select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_MXC_EHCI
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_SPI_IMX
        help
@@@ -128,10 -117,12 +126,12 @@@ endchoic
  config MACH_EUKREA_CPUIMX51SD
        bool "Support Eukrea CPUIMX51SD module"
        select SOC_IMX51
+       select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX_I2C
-       select IMX_HAVE_PLATFORM_SPI_IMX
        select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_MXC_EHCI
        select IMX_HAVE_PLATFORM_MXC_NAND
+       select IMX_HAVE_PLATFORM_SPI_IMX
        help
          Include support for Eukrea CPUIMX51SD platform. This includes
          specific configurations for the module and its peripherals.
@@@ -156,6 -147,8 +156,8 @@@ config MX51_EFIKA_COMMO
        bool
        select SOC_IMX51
        select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_MXC_EHCI
+       select IMX_HAVE_PLATFORM_PATA_IMX
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
        select IMX_HAVE_PLATFORM_SPI_IMX
        select MXC_ULPI if USB_ULPI
@@@ -176,23 -169,8 +178,20 @@@ config MACH_MX51_EFIKAS
          Include support for Genesi Efika Smartbook. This includes specific
          configurations for the board and its peripherals.
  
- endif # ARCH_MX51
- if ARCH_MX53_SUPPORTED
  comment "i.MX53 machines:"
  
 +config MACH_IMX53_DT
 +      bool "Support i.MX53 platforms from device tree"
 +      select SOC_IMX53
 +      select USE_OF
 +      select MACH_MX53_ARD
 +      select MACH_MX53_EVK
 +      select MACH_MX53_LOCO
 +      select MACH_MX53_SMD
 +      help
 +        Include support for Freescale i.MX53 based platforms
 +        using the device tree for discovery
 +
  config MACH_MX53_EVK
        bool "Support MX53 EVK platforms"
        select SOC_IMX53
@@@ -242,6 -220,4 +241,4 @@@ config MACH_MX53_AR
          Include support for MX53 ARD platform. This includes specific
          configurations for the board and its peripherals.
  
- endif # ARCH_MX53_SUPPORTED
  endif
@@@ -3,8 -3,7 +3,7 @@@
  #
  
  # Object file lists.
- obj-y   := cpu.o mm.o clock-mx51-mx53.o devices.o ehci.o system.o
- obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
+ obj-y   := cpu.o mm.o clock-mx51-mx53.o ehci.o system.o
  
  obj-$(CONFIG_PM) += pm-imx5.o
  obj-$(CONFIG_CPU_FREQ_IMX)    += cpu_op-mx51.o
@@@ -22,6 -21,3 +21,6 @@@ obj-$(CONFIG_MX51_EFIKA_COMMON) += mx51
  obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o
  obj-$(CONFIG_MACH_MX51_EFIKASB) += board-mx51_efikasb.o
  obj-$(CONFIG_MACH_MX50_RDP) += board-mx50_rdp.o
 +
 +obj-$(CONFIG_MACH_IMX51_DT) += imx51-dt.o
 +obj-$(CONFIG_MACH_IMX53_DT) += imx53-dt.o
  #include <linux/delay.h>
  #include <linux/io.h>
  #include <linux/interrupt.h>
- #include <linux/irq.h>
  
  #include <mach/eukrea-baseboards.h>
  #include <mach/common.h>
  #include <mach/hardware.h>
  #include <mach/iomux-mx51.h>
  
- #include <asm/irq.h>
  #include <asm/setup.h>
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/time.h>
  
  #include "devices-imx51.h"
- #include "devices.h"
  
  #define CPUIMX51_USBH1_STP    IMX_GPIO_NR(1, 27)
  #define CPUIMX51_QUARTA_GPIO  IMX_GPIO_NR(3, 28)
@@@ -57,7 -54,7 +54,7 @@@
  static struct plat_serial8250_port serial_platform_data[] = {
        {
                .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x400000),
-               .irq = gpio_to_irq(CPUIMX51_QUARTA_GPIO),
+               .irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTA_GPIO),
                .irqflags = IRQF_TRIGGER_HIGH,
                .uartclk = CPUIMX51_QUART_XTAL,
                .regshift = CPUIMX51_QUART_REGSHIFT,
@@@ -65,7 -62,7 +62,7 @@@
                .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
        }, {
                .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x800000),
-               .irq = gpio_to_irq(CPUIMX51_QUARTB_GPIO),
+               .irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTB_GPIO),
                .irqflags = IRQF_TRIGGER_HIGH,
                .uartclk = CPUIMX51_QUART_XTAL,
                .regshift = CPUIMX51_QUART_REGSHIFT,
@@@ -73,7 -70,7 +70,7 @@@
                .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
        }, {
                .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x1000000),
-               .irq = gpio_to_irq(CPUIMX51_QUARTC_GPIO),
+               .irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTC_GPIO),
                .irqflags = IRQF_TRIGGER_HIGH,
                .uartclk = CPUIMX51_QUART_XTAL,
                .regshift = CPUIMX51_QUART_REGSHIFT,
@@@ -81,7 -78,7 +78,7 @@@
                .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
        }, {
                .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000),
-               .irq = gpio_to_irq(CPUIMX51_QUARTD_GPIO),
+               .irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTD_GPIO),
                .irqflags = IRQF_TRIGGER_HIGH,
                .uartclk = CPUIMX51_QUART_XTAL,
                .regshift = CPUIMX51_QUART_REGSHIFT,
@@@ -167,7 -164,7 +164,7 @@@ static int initialize_otg_port(struct p
        void __iomem *usb_base;
        void __iomem *usbother_base;
  
-       usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+       usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
        if (!usb_base)
                return -ENOMEM;
        usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@@ -190,7 -187,7 +187,7 @@@ static int initialize_usbh1_port(struc
        void __iomem *usb_base;
        void __iomem *usbother_base;
  
-       usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+       usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
        if (!usb_base)
                return -ENOMEM;
        usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
                        MXC_EHCI_ITC_NO_THRESHOLD);
  }
  
- static struct mxc_usbh_platform_data dr_utmi_config = {
+ static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
        .init           = initialize_otg_port,
        .portsc = MXC_EHCI_UTMI_16BIT,
  };
  
- static struct fsl_usb2_platform_data usb_pdata = {
+ static const struct fsl_usb2_platform_data usb_pdata __initconst = {
        .operating_mode = FSL_USB2_DR_DEVICE,
        .phy_mode       = FSL_USB2_PHY_UTMI_WIDE,
  };
  
- static struct mxc_usbh_platform_data usbh1_config = {
+ static const struct mxc_usbh_platform_data usbh1_config __initconst = {
        .init           = initialize_usbh1_port,
        .portsc = MXC_EHCI_MODE_ULPI,
  };
@@@ -270,12 -267,12 +267,12 @@@ static void __init eukrea_cpuimx51_init
                                ARRAY_SIZE(eukrea_cpuimx51_i2c_devices));
  
        if (otg_mode_host)
-               mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
+               imx51_add_mxc_ehci_otg(&dr_utmi_config);
        else {
                initialize_otg_port(NULL);
-               mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
+               imx51_add_fsl_usb2_udc(&usb_pdata);
        }
-       mxc_register_device(&mxc_usbh1_device, &usbh1_config);
+       imx51_add_mxc_ehci_hs(1, &usbh1_config);
  
  #ifdef CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD
        eukrea_mbimx51_baseboard_init();
@@@ -293,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
@@@ -22,7 -22,6 +22,6 @@@
  #include <linux/delay.h>
  #include <linux/io.h>
  #include <linux/interrupt.h>
- #include <linux/irq.h>
  #include <linux/i2c-gpio.h>
  #include <linux/spi/spi.h>
  #include <linux/can/platform/mcp251x.h>
  #include <mach/hardware.h>
  #include <mach/iomux-mx51.h>
  
- #include <asm/irq.h>
  #include <asm/setup.h>
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/time.h>
  
  #include "devices-imx51.h"
- #include "devices.h"
  #include "cpu_op-mx51.h"
  
  #define USBH1_RST             IMX_GPIO_NR(2, 28)
@@@ -108,7 -105,7 +105,7 @@@ static iomux_v3_cfg_t eukrea_cpuimx51sd
  
        /* Touchscreen */
        /* IRQ */
-       _MX51_PAD_GPIO_NAND__GPIO_NAND | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP |
+       NEW_PAD_CTRL(MX51_PAD_GPIO_NAND__GPIO_NAND, PAD_CTL_PUS_22K_UP |
                        PAD_CTL_PKE | PAD_CTL_SRE_FAST |
                        PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
  };
@@@ -129,7 -126,7 +126,7 @@@ static struct i2c_board_info eukrea_cpu
                I2C_BOARD_INFO("tsc2007", 0x49),
                .type           = "tsc2007",
                .platform_data  = &tsc2007_info,
-               .irq            = gpio_to_irq(TSC2007_IRQGPIO),
+               .irq            = IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
        },
  };
  
@@@ -149,7 -146,7 +146,7 @@@ static int initialize_otg_port(struct p
        void __iomem *usb_base;
        void __iomem *usbother_base;
  
-       usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+       usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
        if (!usb_base)
                return -ENOMEM;
        usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@@ -172,7 -169,7 +169,7 @@@ static int initialize_usbh1_port(struc
        void __iomem *usb_base;
        void __iomem *usbother_base;
  
-       usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+       usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
        if (!usb_base)
                return -ENOMEM;
        usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
                        MXC_EHCI_ITC_NO_THRESHOLD);
  }
  
- static struct mxc_usbh_platform_data dr_utmi_config = {
+ static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
        .init           = initialize_otg_port,
        .portsc = MXC_EHCI_UTMI_16BIT,
  };
  
- static struct fsl_usb2_platform_data usb_pdata = {
+ static const struct fsl_usb2_platform_data usb_pdata __initconst = {
        .operating_mode = FSL_USB2_DR_DEVICE,
        .phy_mode       = FSL_USB2_PHY_UTMI_WIDE,
  };
  
- static struct mxc_usbh_platform_data usbh1_config = {
+ static const struct mxc_usbh_platform_data usbh1_config __initconst = {
        .init           = initialize_usbh1_port,
        .portsc = MXC_EHCI_MODE_ULPI,
  };
@@@ -245,7 -242,7 +242,7 @@@ static struct spi_board_info cpuimx51sd
                .mode           = SPI_MODE_0,
                .chip_select     = 0,
                .platform_data   = &mcp251x_info,
-               .irq             = gpio_to_irq(CAN_IRQGPIO)
+               .irq             = IMX_GPIO_TO_IRQ(CAN_IRQGPIO)
        },
  };
  
@@@ -303,17 -300,17 +300,17 @@@ static void __init eukrea_cpuimx51sd_in
        platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
  
        if (otg_mode_host)
-               mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
+               imx51_add_mxc_ehci_otg(&dr_utmi_config);
        else {
                initialize_otg_port(NULL);
-               mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
+               imx51_add_fsl_usb2_udc(&usb_pdata);
        }
  
        gpio_request(USBH1_RST, "usb_rst");
        gpio_direction_output(USBH1_RST, 0);
        msleep(20);
        gpio_set_value(USBH1_RST, 1);
-       mxc_register_device(&mxc_usbh1_device, &usbh1_config);
+       imx51_add_mxc_ehci_hs(1, &usbh1_config);
  
  #ifdef CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD
        eukrea_mbimxsd51_baseboard_init();
@@@ -331,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
@@@ -25,7 -25,6 +25,6 @@@
  #include <mach/3ds_debugboard.h>
  
  #include "devices-imx51.h"
- #include "devices.h"
  
  #define EXPIO_PARENT_INT      gpio_to_irq(IMX_GPIO_NR(1, 6))
  #define MX51_3DS_ECSPI2_CS    (GPIO_PORTC + 28)
@@@ -169,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
  #include <mach/hardware.h>
  #include <mach/iomux-mx51.h>
  
- #include <asm/irq.h>
  #include <asm/setup.h>
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/time.h>
  
  #include "devices-imx51.h"
- #include "devices.h"
  #include "cpu_op-mx51.h"
  
  #define BABBAGE_USB_HUB_RESET IMX_GPIO_NR(1, 7)
@@@ -176,7 -174,7 +174,7 @@@ static const struct imxi2c_platform_dat
        .bitrate = 100000,
  };
  
- static struct imxi2c_platform_data babbage_hsi2c_data = {
+ static const struct imxi2c_platform_data babbage_hsi2c_data __initconst = {
        .bitrate = 400000,
  };
  
@@@ -249,7 -247,7 +247,7 @@@ static int initialize_otg_port(struct p
        void __iomem *usb_base;
        void __iomem *usbother_base;
  
-       usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+       usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
        if (!usb_base)
                return -ENOMEM;
        usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@@ -272,7 -270,7 +270,7 @@@ static int initialize_usbh1_port(struc
        void __iomem *usb_base;
        void __iomem *usbother_base;
  
-       usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
+       usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
        if (!usb_base)
                return -ENOMEM;
        usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
                        MXC_EHCI_ITC_NO_THRESHOLD);
  }
  
- static struct mxc_usbh_platform_data dr_utmi_config = {
+ static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
        .init           = initialize_otg_port,
        .portsc = MXC_EHCI_UTMI_16BIT,
  };
  
- static struct fsl_usb2_platform_data usb_pdata = {
+ static const struct fsl_usb2_platform_data usb_pdata __initconst = {
        .operating_mode = FSL_USB2_DR_DEVICE,
        .phy_mode       = FSL_USB2_PHY_UTMI_WIDE,
  };
  
- static struct mxc_usbh_platform_data usbh1_config = {
+ static const struct mxc_usbh_platform_data usbh1_config __initconst = {
        .init           = initialize_usbh1_port,
        .portsc = MXC_EHCI_MODE_ULPI,
  };
@@@ -351,27 -349,22 +349,27 @@@ static const struct esdhc_platform_dat
        .wp_type = ESDHC_WP_GPIO,
  };
  
 +void __init imx51_babbage_common_init(void)
 +{
 +      mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
 +                                       ARRAY_SIZE(mx51babbage_pads));
 +}
 +
  /*
   * Board specific initialization.
   */
  static void __init mx51_babbage_init(void)
  {
        iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP;
-       iomux_v3_cfg_t power_key = _MX51_PAD_EIM_A27__GPIO2_21 |
-               MUX_PAD_CTRL(PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP);
+       iomux_v3_cfg_t power_key = NEW_PAD_CTRL(MX51_PAD_EIM_A27__GPIO2_21,
+               PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP);
  
        imx51_soc_init();
  
  #if defined(CONFIG_CPU_FREQ_IMX)
        get_cpu_op = mx51_get_cpu_op;
  #endif
 -      mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
 -                                      ARRAY_SIZE(mx51babbage_pads));
 +      imx51_babbage_common_init();
  
        imx51_add_imx_uart(0, &uart_pdata);
        imx51_add_imx_uart(1, NULL);
  
        imx51_add_imx_i2c(0, &babbage_i2c_data);
        imx51_add_imx_i2c(1, &babbage_i2c_data);
-       mxc_register_device(&mxc_hsi2c_device, &babbage_hsi2c_data);
+       imx51_add_hsi2c(&babbage_hsi2c_data);
  
        if (otg_mode_host)
-               mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
+               imx51_add_mxc_ehci_otg(&dr_utmi_config);
        else {
                initialize_otg_port(NULL);
-               mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
+               imx51_add_fsl_usb2_udc(&usb_pdata);
        }
  
        gpio_usbh1_active();
-       mxc_register_device(&mxc_usbh1_device, &usbh1_config);
+       imx51_add_mxc_ehci_hs(1, &usbh1_config);
        /* setback USBH1_STP to be function */
        mxc_iomux_v3_setup_pad(usbh1stp);
        babbage_usbhub_reset();
@@@ -421,10 -414,11 +419,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
  #include <mach/hardware.h>
  #include <mach/iomux-mx51.h>
  
- #include <asm/irq.h>
  #include <asm/setup.h>
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/time.h>
  
  #include "devices-imx51.h"
- #include "devices.h"
  #include "efika.h"
  
  #define EFIKAMX_PCBID0                IMX_GPIO_NR(3, 16)
@@@ -163,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,
@@@ -239,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);
@@@ -280,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
  #include <mach/hardware.h>
  #include <mach/iomux-mx51.h>
  
- #include <asm/irq.h>
  #include <asm/setup.h>
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/time.h>
  
  #include "devices-imx51.h"
- #include "devices.h"
  #include "efika.h"
  
  #define EFIKASB_USBH2_STP     IMX_GPIO_NR(2, 20)
@@@ -56,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 */
@@@ -97,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)
        return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_ITC_NO_THRESHOLD);
  }
  
- static struct mxc_usbh_platform_data usbh2_config = {
+ static struct mxc_usbh_platform_data usbh2_config __initdata = {
        .init   = initialize_usbh2_port,
        .portsc = MXC_EHCI_MODE_ULPI,
  };
@@@ -129,7 -130,7 +130,7 @@@ static void __init mx51_efikasb_usb(voi
        usbh2_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
                        ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND);
        if (usbh2_config.otg)
-               mxc_register_device(&mxc_usbh2_device, &usbh2_config);
+               imx51_add_mxc_ehci_hs(2, &usbh2_config);
  }
  
  static const struct gpio_led mx51_efikasb_leds[] __initconst = {
@@@ -182,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)
@@@ -250,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);
@@@ -266,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
@@@ -134,8 -134,8 +134,8 @@@ static struct resource ard_smsc911x_res
                .flags = IORESOURCE_MEM,
        },
        {
-               .start =  gpio_to_irq(ARD_ETHERNET_INT_B),
-               .end =  gpio_to_irq(ARD_ETHERNET_INT_B),
+               .start =  IMX_GPIO_TO_IRQ(ARD_ETHERNET_INT_B),
+               .end =  IMX_GPIO_TO_IRQ(ARD_ETHERNET_INT_B),
                .flags = IORESOURCE_IRQ,
        },
  };
@@@ -171,6 -171,9 +171,6 @@@ static struct imxi2c_platform_data mx53
  
  static void __init mx53_ard_io_init(void)
  {
 -      mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads,
 -                              ARRAY_SIZE(mx53_ard_pads));
 -
        gpio_request(ARD_ETHERNET_INT_B, "eth-int-b");
        gpio_direction_input(ARD_ETHERNET_INT_B);
  
@@@ -213,13 -216,6 +213,13 @@@ static int weim_cs_config(void
        return 0;
  }
  
 +void __init imx53_ard_common_init(void)
 +{
 +      mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads,
 +                                       ARRAY_SIZE(mx53_ard_pads));
 +      weim_cs_config();
 +}
 +
  static struct platform_device *devices[] __initdata = {
        &ard_smsc_lan9220_device,
  };
@@@ -229,8 -225,8 +229,8 @@@ static void __init mx53_ard_board_init(
        imx53_soc_init();
        imx53_add_imx_uart(0, NULL);
  
 +      imx53_ard_common_init();
        mx53_ard_io_init();
 -      weim_cs_config();
        platform_add_devices(devices, ARRAY_SIZE(devices));
  
        imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data);
        imx53_add_imx_i2c(1, &mx53_ard_i2c2_data);
        imx53_add_imx_i2c(2, &mx53_ard_i2c3_data);
        imx_add_gpio_keys(&ard_button_data);
+       imx53_add_ahci_imx();
  }
  
  static void __init mx53_ard_timer_init(void)
@@@ -253,6 -250,7 +254,7 @@@ MACHINE_START(MX53_ARD, "Freescale MX5
        .map_io = mx53_map_io,
        .init_early = imx53_init_early,
        .init_irq = mx53_init_irq,
+       .handle_irq = imx53_handle_irq,
        .timer = &mx53_ard_timer,
        .init_machine = mx53_ard_board_init,
  MACHINE_END
@@@ -131,17 -131,12 +131,17 @@@ static const struct spi_imx_master mx53
        .num_chipselect = ARRAY_SIZE(mx53_evk_spi_cs),
  };
  
 +void __init imx53_evk_common_init(void)
 +{
 +      mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads,
 +                                       ARRAY_SIZE(mx53_evk_pads));
 +}
 +
  static void __init mx53_evk_board_init(void)
  {
        imx53_soc_init();
 +      imx53_evk_common_init();
  
 -      mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads,
 -                                      ARRAY_SIZE(mx53_evk_pads));
        mx53_evk_init_uart();
        mx53_evk_fec_reset();
        imx53_add_fec(&mx53_evk_fec_pdata);
@@@ -172,6 -167,7 +172,7 @@@ MACHINE_START(MX53_EVK, "Freescale MX5
        .map_io = mx53_map_io,
        .init_early = imx53_init_early,
        .init_irq = mx53_init_irq,
+       .handle_irq = imx53_handle_irq,
        .timer = &mx53_evk_timer,
        .init_machine = mx53_evk_board_init,
  MACHINE_END
@@@ -22,6 -22,7 +22,7 @@@
  #include <linux/clk.h>
  #include <linux/delay.h>
  #include <linux/gpio.h>
+ #include <linux/i2c.h>
  
  #include <mach/common.h>
  #include <mach/hardware.h>
@@@ -42,6 -43,7 +43,7 @@@
  #define LOCO_SD3_CD                   IMX_GPIO_NR(3, 11)
  #define LOCO_SD3_WP                   IMX_GPIO_NR(3, 12)
  #define LOCO_SD1_CD                   IMX_GPIO_NR(3, 13)
+ #define LOCO_ACCEL_EN                 IMX_GPIO_NR(6, 14)
  
  static iomux_v3_cfg_t mx53_loco_pads[] = {
        /* FEC */
        MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD,
        MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS,
        MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD,
+       /* I2C1 */
+       MX53_PAD_CSI0_DAT8__I2C1_SDA,
+       MX53_PAD_CSI0_DAT9__I2C1_SCL,
+       MX53_PAD_NANDF_CS1__GPIO6_14,   /* Accelerometer Enable */
        /* I2C2 */
        MX53_PAD_KEY_COL3__I2C2_SCL,
        MX53_PAD_KEY_ROW3__I2C2_SDA,
@@@ -257,27 -263,37 +263,42 @@@ static const struct gpio_led_platform_d
        .num_leds       = ARRAY_SIZE(mx53loco_leds),
  };
  
 +void __init imx53_qsb_common_init(void)
 +{
 +      mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
 +                                       ARRAY_SIZE(mx53_loco_pads));
 +}
 +
+ static struct i2c_board_info mx53loco_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("mma8450", 0x1C),
+       },
+ };
  static void __init mx53_loco_board_init(void)
  {
+       int ret;
        imx53_soc_init();
 +      imx53_qsb_common_init();
  
 -      mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
 -                                      ARRAY_SIZE(mx53_loco_pads));
        imx53_add_imx_uart(0, NULL);
        mx53_loco_fec_reset();
        imx53_add_fec(&mx53_loco_fec_data);
        imx53_add_imx2_wdt(0, NULL);
+       ret = gpio_request_one(LOCO_ACCEL_EN, GPIOF_OUT_INIT_HIGH, "accel_en");
+       if (ret)
+               pr_err("Cannot request ACCEL_EN pin: %d\n", ret);
+       i2c_register_board_info(0, mx53loco_i2c_devices,
+                               ARRAY_SIZE(mx53loco_i2c_devices));
        imx53_add_imx_i2c(0, &mx53_loco_i2c_data);
        imx53_add_imx_i2c(1, &mx53_loco_i2c_data);
        imx53_add_sdhci_esdhc_imx(0, &mx53_loco_sd1_data);
        imx53_add_sdhci_esdhc_imx(2, &mx53_loco_sd3_data);
        imx_add_gpio_keys(&loco_button_data);
        gpio_led_register_device(-1, &mx53loco_leds_data);
+       imx53_add_ahci_imx();
  }
  
  static void __init mx53_loco_timer_init(void)
@@@ -293,6 -309,7 +314,7 @@@ MACHINE_START(MX53_LOCO, "Freescale MX5
        .map_io = mx53_map_io,
        .init_early = imx53_init_early,
        .init_irq = mx53_init_irq,
+       .handle_irq = imx53_handle_irq,
        .timer = &mx53_loco_timer,
        .init_machine = mx53_loco_board_init,
  MACHINE_END
@@@ -35,6 -35,7 +35,7 @@@
  #include "devices-imx53.h"
  
  #define SMD_FEC_PHY_RST               IMX_GPIO_NR(7, 6)
+ #define MX53_SMD_SATA_PWR_EN    IMX_GPIO_NR(3, 3)
  
  static iomux_v3_cfg_t mx53_smd_pads[] = {
        MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
@@@ -111,17 -112,25 +112,30 @@@ static const struct imxi2c_platform_dat
        .bitrate = 100000,
  };
  
+ static inline void mx53_smd_ahci_pwr_on(void)
+ {
+       int ret;
+       /* Enable SATA PWR */
+       ret = gpio_request_one(MX53_SMD_SATA_PWR_EN,
+                       GPIOF_DIR_OUT | GPIOF_INIT_HIGH, "ahci-sata-pwr");
+       if (ret) {
+               pr_err("failed to enable SATA_PWR_EN: %d\n", ret);
+               return;
+       }
+ }
 +void __init imx53_smd_common_init(void)
 +{
 +      mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads,
 +                                       ARRAY_SIZE(mx53_smd_pads));
 +}
 +
  static void __init mx53_smd_board_init(void)
  {
        imx53_soc_init();
 +      imx53_smd_common_init();
  
 -      mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads,
 -                                      ARRAY_SIZE(mx53_smd_pads));
        mx53_smd_init_uart();
        mx53_smd_fec_reset();
        imx53_add_fec(&mx53_smd_fec_data);
        imx53_add_sdhci_esdhc_imx(0, NULL);
        imx53_add_sdhci_esdhc_imx(1, NULL);
        imx53_add_sdhci_esdhc_imx(2, NULL);
+       mx53_smd_ahci_pwr_on();
+       imx53_add_ahci_imx();
  }
  
  static void __init mx53_smd_timer_init(void)
@@@ -145,6 -156,7 +161,7 @@@ MACHINE_START(MX53_SMD, "Freescale MX5
        .map_io = mx53_map_io,
        .init_early = imx53_init_early,
        .init_irq = mx53_init_irq,
+       .handle_irq = imx53_handle_irq,
        .timer = &mx53_smd_timer,
        .init_machine = mx53_smd_board_init,
  MACHINE_END
@@@ -15,7 -15,6 +15,7 @@@
  #include <linux/clk.h>
  #include <linux/io.h>
  #include <linux/clkdev.h>
 +#include <linux/of.h>
  
  #include <asm/div64.h>
  
@@@ -1402,6 -1401,22 +1402,22 @@@ static struct clk esdhc4_mx53_clk = 
        .secondary = &esdhc4_ipg_clk,
  };
  
+ static struct clk sata_clk = {
+       .parent = &ipg_clk,
+       .enable = _clk_max_enable,
+       .enable_reg = MXC_CCM_CCGR4,
+       .enable_shift = MXC_CCM_CCGRx_CG1_OFFSET,
+       .disable = _clk_max_disable,
+ };
+ static struct clk ahci_phy_clk = {
+       .parent = &usb_phy1_clk,
+ };
+ static struct clk ahci_dma_clk = {
+       .parent = &ahb_clk,
+ };
  DEFINE_CLOCK(mipi_esc_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG5_OFFSET, NULL, NULL, NULL, &pll2_sw_clk);
  DEFINE_CLOCK(mipi_hsc2_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG4_OFFSET, NULL, NULL, &mipi_esc_clk, &pll2_sw_clk);
  DEFINE_CLOCK(mipi_hsc1_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG3_OFFSET, NULL, NULL, &mipi_hsc2_clk, &pll2_sw_clk);
@@@ -1419,6 -1434,10 +1435,10 @@@ DEFINE_CLOCK(ipu_di0_clk, 0, MXC_CCM_CC
  DEFINE_CLOCK(ipu_di1_clk, 0, MXC_CCM_CCGR6, MXC_CCM_CCGRx_CG6_OFFSET,
                NULL, NULL, &pll3_sw_clk, NULL);
  
+ /* PATA */
+ DEFINE_CLOCK(pata_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG0_OFFSET,
+               NULL, NULL, &ipg_clk, &spba_clk);
  #define _REGISTER_CLOCK(d, n, c) \
         { \
                .dev_id = d, \
@@@ -1475,6 -1494,7 +1495,7 @@@ static struct clk_lookup mx51_lookups[
        _REGISTER_CLOCK("imx-ipuv3", "di0", ipu_di0_clk)
        _REGISTER_CLOCK("imx-ipuv3", "di1", ipu_di1_clk)
        _REGISTER_CLOCK(NULL, "gpc_dvfs", gpc_dvfs_clk)
+       _REGISTER_CLOCK("pata_imx", NULL, pata_clk)
  };
  
  static struct clk_lookup mx53_lookups[] = {
        _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
        _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
        _REGISTER_CLOCK("imx-keypad", NULL, dummy_clk)
+       _REGISTER_CLOCK("pata_imx", NULL, pata_clk)
+       _REGISTER_CLOCK("imx53-ahci.0", "ahci", sata_clk)
+       _REGISTER_CLOCK("imx53-ahci.0", "ahci_phy", ahci_phy_clk)
+       _REGISTER_CLOCK("imx53-ahci.0", "ahci_dma", ahci_dma_clk)
  };
  
  static void clk_tree_init(void)
@@@ -1549,9 -1573,8 +1574,8 @@@ int __init mx51_clocks_init(unsigned lo
        clk_enable(&main_bus_clk);
  
        clk_enable(&iim_clk);
-       mx51_revision();
+       imx_print_silicon_rev("i.MX51", mx51_revision());
        clk_disable(&iim_clk);
-       mx51_display_revision();
  
        /* move usb_phy_clk to 24MHz */
        clk_set_parent(&usb_phy1_clk, &osc_clk);
  
        /* System timer */
        mxc_timer_init(&gpt_clk, MX51_IO_ADDRESS(MX51_GPT1_BASE_ADDR),
-               MX51_MXC_INT_GPT);
+               MX51_INT_GPT);
        return 0;
  }
  
@@@ -1593,9 -1616,8 +1617,8 @@@ int __init mx53_clocks_init(unsigned lo
        clk_enable(&main_bus_clk);
  
        clk_enable(&iim_clk);
-       mx53_revision();
+       imx_print_silicon_rev("i.MX53", mx53_revision());
        clk_disable(&iim_clk);
-       mx53_display_revision();
  
        /* Set SDHC parents to be PLL2 */
        clk_set_parent(&esdhc1_clk, &pll2_sw_clk);
                MX53_INT_GPT);
        return 0;
  }
 +
 +static void __init clk_get_freq_dt(unsigned long *ckil, unsigned long *osc,
 +                                 unsigned long *ckih1, unsigned long *ckih2)
 +{
 +      struct device_node *np;
 +
 +      /* retrieve the freqency of fixed clocks from device tree */
 +      for_each_compatible_node(np, NULL, "fixed-clock") {
 +              u32 rate;
 +              if (of_property_read_u32(np, "clock-frequency", &rate))
 +                      continue;
 +
 +              if (of_device_is_compatible(np, "fsl,imx-ckil"))
 +                      *ckil = rate;
 +              else if (of_device_is_compatible(np, "fsl,imx-osc"))
 +                      *osc = rate;
 +              else if (of_device_is_compatible(np, "fsl,imx-ckih1"))
 +                      *ckih1 = rate;
 +              else if (of_device_is_compatible(np, "fsl,imx-ckih2"))
 +                      *ckih2 = rate;
 +      }
 +}
 +
 +int __init mx51_clocks_init_dt(void)
 +{
 +      unsigned long ckil, osc, ckih1, ckih2;
 +
 +      clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 +      return mx51_clocks_init(ckil, osc, ckih1, ckih2);
 +}
 +
 +int __init mx53_clocks_init_dt(void)
 +{
 +      unsigned long ckil, osc, ckih1, ckih2;
 +
 +      clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
 +      return mx53_clocks_init(ckil, osc, ckih1, ckih2);
 +}
@@@ -64,20 -64,37 +64,44 @@@ extern int mx51_clocks_init(unsigned lo
                        unsigned long ckih1, unsigned long ckih2);
  extern int mx53_clocks_init(unsigned long ckil, unsigned long osc,
                        unsigned long ckih1, unsigned long ckih2);
 +extern int mx51_clocks_init_dt(void);
 +extern int mx53_clocks_init_dt(void);
  extern struct platform_device *mxc_register_gpio(char *name, int id,
        resource_size_t iobase, resource_size_t iosize, int irq, int irq_high);
- extern int mxc_register_device(struct platform_device *pdev, void *data);
  extern void mxc_set_cpu_type(unsigned int type);
  extern void mxc_arch_reset_init(void __iomem *);
  extern void mx51_efikamx_reset(void);
  extern int mx53_revision(void);
  extern int mx53_display_revision(void);
  
+ enum mxc_cpu_pwr_mode {
+       WAIT_CLOCKED,           /* wfi only */
+       WAIT_UNCLOCKED,         /* WAIT */
+       WAIT_UNCLOCKED_POWER_OFF,       /* WAIT + SRPG */
+       STOP_POWER_ON,          /* just STOP */
+       STOP_POWER_OFF,         /* STOP + SRPG */
+ };
+ extern void mx5_cpu_lp_set(enum mxc_cpu_pwr_mode mode);
+ extern void (*imx_idle)(void);
+ extern void imx_print_silicon_rev(const char *cpu, int srev);
+ void avic_handle_irq(struct pt_regs *);
+ void tzic_handle_irq(struct pt_regs *);
+ #define imx1_handle_irq avic_handle_irq
+ #define imx21_handle_irq avic_handle_irq
+ #define imx25_handle_irq avic_handle_irq
+ #define imx27_handle_irq avic_handle_irq
+ #define imx31_handle_irq avic_handle_irq
+ #define imx35_handle_irq avic_handle_irq
+ #define imx50_handle_irq tzic_handle_irq
+ #define imx51_handle_irq tzic_handle_irq
+ #define imx53_handle_irq tzic_handle_irq
 +extern void imx51_babbage_common_init(void);
 +extern void imx53_ard_common_init(void);
 +extern void imx53_evk_common_init(void);
 +extern void imx53_qsb_common_init(void);
 +extern void imx53_smd_common_init(void);
  #endif