Merge branch 'depends/rmk/memory_h' into next/fixes
authorArnd Bergmann <arnd@arndb.de>
Mon, 31 Oct 2011 22:11:46 +0000 (23:11 +0100)
committerArnd Bergmann <arnd@arndb.de>
Mon, 31 Oct 2011 23:25:01 +0000 (00:25 +0100)
Fix up all conflicts between the memory.h cleanup and bug fixes.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
80 files changed:
1  2 
arch/arm/Kconfig
arch/arm/kernel/setup.c
arch/arm/mach-davinci/board-da850-evm.c
arch/arm/mach-davinci/sleep.S
arch/arm/mach-ep93xx/edb93xx.c
arch/arm/mach-ep93xx/simone.c
arch/arm/mach-ep93xx/snappercl15.c
arch/arm/mach-exynos4/mach-universal_c210.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-mx27ads.c
arch/arm/mach-imx/mach-mx31_3ds.c
arch/arm/mach-integrator/integrator_ap.c
arch/arm/mach-ixp4xx/dsmg600-setup.c
arch/arm/mach-ixp4xx/fsg-setup.c
arch/arm/mach-ixp4xx/nas100d-setup.c
arch/arm/mach-ixp4xx/nslu2-setup.c
arch/arm/mach-ks8695/board-acs5k.c
arch/arm/mach-ks8695/board-dsm320.c
arch/arm/mach-ks8695/board-micrel.c
arch/arm/mach-lpc32xx/phy3250.c
arch/arm/mach-msm/board-msm7x27.c
arch/arm/mach-msm/board-msm7x30.c
arch/arm/mach-msm/board-qsd8x50.c
arch/arm/mach-msm/board-sapphire.c
arch/arm/mach-nomadik/board-nhk8815.c
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/board-fsample.c
arch/arm/mach-omap1/board-generic.c
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-htcherald.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-nokia770.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/board-palmte.c
arch/arm/mach-omap1/board-palmtt.c
arch/arm/mach-omap1/board-palmz71.c
arch/arm/mach-omap1/board-perseus2.c
arch/arm/mach-omap1/board-sx1.c
arch/arm/mach-omap1/board-voiceblue.c
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-generic.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-orion5x/db88f5281-setup.c
arch/arm/mach-orion5x/dns323-setup.c
arch/arm/mach-orion5x/kurobox_pro-setup.c
arch/arm/mach-orion5x/mv2120-setup.c
arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
arch/arm/mach-orion5x/rd88f5182-setup.c
arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
arch/arm/mach-orion5x/terastation_pro2-setup.c
arch/arm/mach-orion5x/ts209-setup.c
arch/arm/mach-orion5x/ts409-setup.c
arch/arm/mach-orion5x/wnr854t-setup.c
arch/arm/mach-orion5x/wrt350n-v2-setup.c
arch/arm/mach-pxa/balloon3.c
arch/arm/mach-pxa/cm-x2xx.c
arch/arm/mach-pxa/cm-x300.c
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-pxa/palmtreo.c
arch/arm/mach-pxa/palmtx.c
arch/arm/mach-pxa/saarb.c
arch/arm/mach-pxa/z2.c
arch/arm/mach-pxa/zeus.c
arch/arm/mach-s3c64xx/mach-smdk6410.c
arch/arm/mach-shmobile/board-ag5evm.c
arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/mach-u300/core.c
arch/arm/mach-ux500/board-mop500.c
arch/arm/mach-ux500/board-u5500.c
arch/arm/mach-vexpress/v2m.c
arch/arm/mm/dma-mapping.c
arch/arm/mm/init.c

diff --combined arch/arm/Kconfig
@@@ -195,7 -195,8 +195,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 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 ARM_PATCH_PHYS_VIRT_16BIT
-       def_bool y
-       depends on ARM_PATCH_PHYS_VIRT && ARCH_MSM
+ 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.
  
  source "init/Kconfig"
  
@@@ -246,6 -256,7 +256,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.
  
@@@ -261,6 -272,7 +272,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.
  
@@@ -301,7 -313,6 +313,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.
@@@ -322,6 -333,7 +333,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.
  
@@@ -362,6 -374,7 +374,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
@@@ -377,6 -390,7 +390,7 @@@ config ARCH_EP93X
        select ARCH_REQUIRE_GPIOLIB
        select ARCH_HAS_HOLES_MEMORYMODEL
        select ARCH_USES_GETTIMEOFFSET
 -      select NEED_MEMORY_H
++      select NEED_MACH_MEMORY_H
        help
          This enables support for the Cirrus EP93xx series of CPUs.
  
@@@ -385,6 -399,7 +399,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.
@@@ -434,6 -449,7 +449,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.
  
@@@ -464,6 -480,7 +480,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.
  
@@@ -473,6 -490,7 +490,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.
  
@@@ -566,6 -584,7 +584,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.
@@@ -657,6 -676,7 +676,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.
  
@@@ -671,6 -691,7 +691,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.
@@@ -689,6 -710,7 +710,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.
  
@@@ -781,6 -803,7 +803,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
  
@@@ -797,6 -820,7 +820,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
  
@@@ -808,6 -832,7 +832,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>).
@@@ -835,7 -860,7 +860,8 @@@ config ARCH_U30
        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.
  
@@@ -1272,32 -1297,6 +1298,32 @@@ config ARM_ERRATA_75432
          This workaround defines cpu_relax() as smp_mb(), preventing correctly
          written polling loops from denying visibility of updates to memory.
  
 +config ARM_ERRATA_364296
 +      bool "ARM errata: Possible cache data corruption with hit-under-miss enabled"
 +      depends on CPU_V6 && !SMP
 +      help
 +        This options enables the workaround for the 364296 ARM1136
 +        r0p2 erratum (possible cache data corruption with
 +        hit-under-miss enabled). It sets the undocumented bit 31 in
 +        the auxiliary control register and the FI bit in the control
 +        register, thus disabling hit-under-miss without putting the
 +        processor into full low interrupt latency mode. ARM11MPCore
 +        is not affected.
 +
 +config ARM_ERRATA_764369
 +      bool "ARM errata: Data cache line maintenance operation by MVA may not succeed"
 +      depends on CPU_V7 && SMP
 +      help
 +        This option enables the workaround for erratum 764369
 +        affecting Cortex-A9 MPCore with two or more processors (all
 +        current revisions). Under certain timing circumstances, a data
 +        cache line maintenance operation by MVA targeting an Inner
 +        Shareable memory region may fail to proceed up to either the
 +        Point of Coherency or to the Point of Unification of the
 +        system. This workaround adds a DSB instruction before the
 +        relevant cache maintenance functions and sets a specific bit
 +        in the diagnostic control register of the SCU.
 +
  endmenu
  
  source "arch/arm/common/Kconfig"
@@@ -1954,7 -1953,6 +1980,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
diff --combined arch/arm/kernel/setup.c
@@@ -280,19 -280,18 +280,19 @@@ static void __init cacheid_init(void
        if (arch >= CPU_ARCH_ARMv6) {
                if ((cachetype & (7 << 29)) == 4 << 29) {
                        /* ARMv7 register format */
 +                      arch = CPU_ARCH_ARMv7;
                        cacheid = CACHEID_VIPT_NONALIASING;
                        if ((cachetype & (3 << 14)) == 1 << 14)
                                cacheid |= CACHEID_ASID_TAGGED;
 -                      else if (cpu_has_aliasing_icache(CPU_ARCH_ARMv7))
 -                              cacheid |= CACHEID_VIPT_I_ALIASING;
 -              } else if (cachetype & (1 << 23)) {
 -                      cacheid = CACHEID_VIPT_ALIASING;
                } else {
 -                      cacheid = CACHEID_VIPT_NONALIASING;
 -                      if (cpu_has_aliasing_icache(CPU_ARCH_ARMv6))
 -                              cacheid |= CACHEID_VIPT_I_ALIASING;
 +                      arch = CPU_ARCH_ARMv6;
 +                      if (cachetype & (1 << 23))
 +                              cacheid = CACHEID_VIPT_ALIASING;
 +                      else
 +                              cacheid = CACHEID_VIPT_NONALIASING;
                }
 +              if (cpu_has_aliasing_icache(arch))
 +                      cacheid |= CACHEID_VIPT_I_ALIASING;
        } else {
                cacheid = CACHEID_VIVT;
        }
@@@ -820,25 -819,8 +820,8 @@@ static struct machine_desc * __init set
  
        if (__atags_pointer)
                tags = phys_to_virt(__atags_pointer);
-       else if (mdesc->boot_params) {
- #ifdef CONFIG_MMU
-               /*
-                * We still are executing with a minimal MMU mapping created
-                * with the presumption that the machine default for this
-                * is located in the first MB of RAM.  Anything else will
-                * fault and silently hang the kernel at this point.
-                */
-               if (mdesc->boot_params < PHYS_OFFSET ||
-                   mdesc->boot_params >= PHYS_OFFSET + SZ_1M) {
-                       printk(KERN_WARNING
-                              "Default boot params at physical 0x%08lx out of reach\n",
-                              mdesc->boot_params);
-               } else
- #endif
-               {
-                       tags = phys_to_virt(mdesc->boot_params);
-               }
-       }
+       else if (mdesc->atag_offset)
+               tags = (void *)(PAGE_OFFSET + mdesc->atag_offset);
  
  #if defined(CONFIG_DEPRECATED_PARAM_STRUCT)
        /*
@@@ -115,32 -115,6 +115,32 @@@ static struct spi_board_info da850evm_s
        },
  };
  
 +#ifdef CONFIG_MTD
 +static void da850_evm_m25p80_notify_add(struct mtd_info *mtd)
 +{
 +      char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
 +      size_t retlen;
 +
 +      if (!strcmp(mtd->name, "MAC-Address")) {
 +              mtd->read(mtd, 0, ETH_ALEN, &retlen, mac_addr);
 +              if (retlen == ETH_ALEN)
 +                      pr_info("Read MAC addr from SPI Flash: %pM\n",
 +                              mac_addr);
 +      }
 +}
 +
 +static struct mtd_notifier da850evm_spi_notifier = {
 +      .add    = da850_evm_m25p80_notify_add,
 +};
 +
 +static void da850_evm_setup_mac_addr(void)
 +{
 +      register_mtd_user(&da850evm_spi_notifier);
 +}
 +#else
 +static void da850_evm_setup_mac_addr(void) { }
 +#endif
 +
  static struct mtd_partition da850_evm_norflash_partition[] = {
        {
                .name           = "bootloaders + env",
@@@ -1270,8 -1244,6 +1270,8 @@@ static __init void da850_evm_init(void
        if (ret)
                pr_warning("da850_evm_init: sata registration failed: %d\n",
                                ret);
 +
 +      da850_evm_setup_mac_addr();
  }
  
  #ifdef CONFIG_SERIAL_8250_CONSOLE
@@@ -1291,7 -1263,7 +1291,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,
@@@ -22,7 -22,7 +22,7 @@@
  #include <linux/linkage.h>
  #include <asm/assembler.h>
  #include <mach/psc.h>
- #include <mach/memory.h>
+ #include <mach/ddr2.h>
  
  #include "clock.h"
  
@@@ -217,11 -217,7 +217,11 @@@ ddr2clk_stop_done
  ENDPROC(davinci_ddr_psc_config)
  
  CACHE_FLUSH:
 -      .word   arm926_flush_kern_cache_all
 +#ifdef CONFIG_CPU_V6
 +      .word   v6_flush_kern_cache_all
 +#else
 +      .word   arm926_flush_kern_cache_all
 +#endif
  
  ENTRY(davinci_cpu_suspend_sz)
        .word   . - davinci_cpu_suspend
@@@ -37,7 -37,6 +37,7 @@@
  #include <mach/hardware.h>
  #include <mach/fb.h>
  #include <mach/ep93xx_spi.h>
 +#include <mach/gpio-ep93xx.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -241,7 -240,7 +241,7 @@@ static void __init edb93xx_init_machine
  #ifdef CONFIG_MACH_EDB9301
  MACHINE_START(EDB9301, "Cirrus Logic EDB9301 Evaluation Board")
        /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
-       .boot_params    = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .timer          = &ep93xx_timer,
@@@ -252,7 -251,7 +252,7 @@@ MACHINE_EN
  #ifdef CONFIG_MACH_EDB9302
  MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
        /* Maintainer: George Kashperko <george@chas.com.ua> */
-       .boot_params    = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .timer          = &ep93xx_timer,
@@@ -263,7 -262,7 +263,7 @@@ MACHINE_EN
  #ifdef CONFIG_MACH_EDB9302A
  MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
        /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
-       .boot_params    = EP93XX_SDCE0_PHYS_BASE + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .timer          = &ep93xx_timer,
@@@ -274,7 -273,7 +274,7 @@@ MACHINE_EN
  #ifdef CONFIG_MACH_EDB9307
  MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
        /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
-       .boot_params    = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .timer          = &ep93xx_timer,
@@@ -285,7 -284,7 +285,7 @@@ MACHINE_EN
  #ifdef CONFIG_MACH_EDB9307A
  MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
        /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
-       .boot_params    = EP93XX_SDCE0_PHYS_BASE + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .timer          = &ep93xx_timer,
@@@ -296,7 -295,7 +296,7 @@@ MACHINE_EN
  #ifdef CONFIG_MACH_EDB9312
  MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
        /* Maintainer: Toufeeq Hussain <toufeeq_hussain@infosys.com> */
-       .boot_params    = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .timer          = &ep93xx_timer,
@@@ -307,7 -306,7 +307,7 @@@ MACHINE_EN
  #ifdef CONFIG_MACH_EDB9315
  MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board")
        /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
-       .boot_params    = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .timer          = &ep93xx_timer,
@@@ -318,7 -317,7 +318,7 @@@ MACHINE_EN
  #ifdef CONFIG_MACH_EDB9315A
  MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
        /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
-       .boot_params    = EP93XX_SDCE0_PHYS_BASE + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .timer          = &ep93xx_timer,
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
 -#include <linux/gpio.h>
  #include <linux/i2c.h>
  #include <linux/i2c-gpio.h>
  
  #include <mach/hardware.h>
  #include <mach/fb.h>
 +#include <mach/gpio-ep93xx.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -65,8 -65,8 +65,8 @@@ static void __init simone_init_machine(
  }
  
  MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board")
- /* Maintainer: Ryan Mallon */
-       .boot_params    = EP93XX_SDCE0_PHYS_BASE + 0x100,
      /* Maintainer: Ryan Mallon */
+       .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .timer          = &ep93xx_timer,
@@@ -20,6 -20,7 +20,6 @@@
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/io.h>
 -#include <linux/gpio.h>
  #include <linux/i2c.h>
  #include <linux/i2c-gpio.h>
  #include <linux/fb.h>
@@@ -29,7 -30,6 +29,7 @@@
  
  #include <mach/hardware.h>
  #include <mach/fb.h>
 +#include <mach/gpio-ep93xx.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -163,7 -163,7 +163,7 @@@ static void __init snappercl15_init_mac
  
  MACHINE_START(SNAPPER_CL15, "Bluewater Systems Snapper CL15")
        /* Maintainer: Ryan Mallon */
-       .boot_params    = EP93XX_SDCE0_PHYS_BASE + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = ep93xx_map_io,
        .init_irq       = ep93xx_init_irq,
        .timer          = &ep93xx_timer,
@@@ -79,7 -79,7 +79,7 @@@ static struct s3c2410_uartcfg universal
  };
  
  static struct regulator_consumer_supply max8952_consumer =
 -      REGULATOR_SUPPLY("vddarm", NULL);
 +      REGULATOR_SUPPLY("vdd_arm", NULL);
  
  static struct max8952_platform_data universal_max8952_pdata __initdata = {
        .gpio_vid0      = EXYNOS4_GPX0(3),
  };
  
  static struct regulator_consumer_supply lp3974_buck1_consumer =
 -      REGULATOR_SUPPLY("vddint", NULL);
 +      REGULATOR_SUPPLY("vdd_int", NULL);
  
  static struct regulator_consumer_supply lp3974_buck2_consumer =
        REGULATOR_SUPPLY("vddg3d", NULL);
@@@ -762,7 -762,7 +762,7 @@@ static void __init universal_machine_in
  
  MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
        /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
-       .boot_params    = S5P_PA_SDRAM + 0x100,
+       .atag_offset    = 0x100,
        .init_irq       = exynos4_init_irq,
        .map_io         = universal_map_io,
        .init_machine   = universal_machine_init,
@@@ -310,8 -310,8 +310,8 @@@ static struct sys_timer eukrea_cpuimx27
        .init = eukrea_cpuimx27_timer_init,
  };
  
 -MACHINE_START(CPUIMX27, "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,
@@@ -192,9 -192,9 +192,9 @@@ struct sys_timer eukrea_cpuimx35_timer 
        .init   = eukrea_cpuimx35_timer_init,
  };
  
 -MACHINE_START(EUKREA_CPUIMX35, "Eukrea CPUIMX35")
 +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,
@@@ -161,9 -161,9 +161,9 @@@ static struct sys_timer eukrea_cpuimx25
        .init   = eukrea_cpuimx25_timer_init,
  };
  
 -MACHINE_START(EUKREA_CPUIMX25, "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,
@@@ -13,7 -13,7 +13,7 @@@
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/platform_device.h>
  #include <linux/mtd/mtd.h>
  #include <linux/mtd/map.h>
@@@ -27,6 -27,7 +27,6 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach/time.h>
  #include <asm/mach/map.h>
 -#include <mach/gpio.h>
  #include <mach/iomux-mx27.h>
  
  #include "devices-imx27.h"
@@@ -344,7 -345,7 +344,7 @@@ 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,
@@@ -542,7 -542,7 +542,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
  };
@@@ -764,7 -764,7 +764,7 @@@ 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,
@@@ -32,7 -32,6 +32,7 @@@
  #include <linux/interrupt.h>
  #include <linux/io.h>
  #include <linux/mtd/physmap.h>
 +#include <video/vga.h>
  
  #include <mach/hardware.h>
  #include <mach/platform.h>
@@@ -155,7 -154,6 +155,7 @@@ static struct map_desc ap_io_desc[] __i
  static void __init ap_map_io(void)
  {
        iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc));
 +      vga_base = PCI_MEMORY_VADDR;
  }
  
  #define INTEGRATOR_SC_VALID_INT       0x003fffff
@@@ -339,15 -337,15 +339,15 @@@ static unsigned long timer_reload
  static void integrator_clocksource_init(u32 khz)
  {
        void __iomem *base = (void __iomem *)TIMER2_VA_BASE;
 -      u32 ctrl = TIMER_CTRL_ENABLE;
 +      u32 ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC;
  
        if (khz >= 1500) {
                khz /= 16;
 -              ctrl = TIMER_CTRL_DIV16;
 +              ctrl |= TIMER_CTRL_DIV16;
        }
  
 -      writel(ctrl, base + TIMER_CTRL);
        writel(0xffff, base + TIMER_LOAD);
 +      writel(ctrl, base + TIMER_CTRL);
  
        clocksource_mmio_init(base + TIMER_VALUE, "timer2",
                khz * 1000, 200, 16, clocksource_mmio_readl_down);
@@@ -459,7 -457,7 +459,7 @@@ static struct sys_timer ap_timer = 
  
  MACHINE_START(INTEGRATOR, "ARM-Integrator")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .reserve        = integrator_reserve,
        .map_io         = ap_map_io,
        .init_early     = integrator_init_early,
@@@ -16,7 -16,7 +16,7 @@@
   * Author: Rod Whitby <rod@whitby.id.au>
   * Maintainers: http://www.nslu2-linux.org/
   */
 -
 +#include <linux/gpio.h>
  #include <linux/irq.h>
  #include <linux/jiffies.h>
  #include <linux/timer.h>
@@@ -31,6 -31,7 +31,6 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach/flash.h>
  #include <asm/mach/time.h>
 -#include <asm/gpio.h>
  
  #define DSMG600_SDA_PIN               5
  #define DSMG600_SCL_PIN               4
@@@ -278,7 -279,7 +278,7 @@@ static void __init dsmg600_init(void
  
  MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
        /* Maintainer: www.nslu2-linux.org */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .map_io         = ixp4xx_map_io,
        .init_irq       = ixp4xx_init_irq,
        .timer          = &dsmg600_timer,
@@@ -14,7 -14,7 +14,7 @@@
   * Maintainers: http://www.nslu2-linux.org/
   *
   */
 -
 +#include <linux/gpio.h>
  #include <linux/if_ether.h>
  #include <linux/irq.h>
  #include <linux/serial.h>
@@@ -27,6 -27,7 +27,6 @@@
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/flash.h>
 -#include <asm/gpio.h>
  
  #define FSG_SDA_PIN           12
  #define FSG_SCL_PIN           13
@@@ -272,7 -273,7 +272,7 @@@ MACHINE_START(FSG, "Freecom FSG-3"
        .map_io         = ixp4xx_map_io,
        .init_irq       = ixp4xx_init_irq,
        .timer          = &ixp4xx_timer,
-       .boot_params    = 0x0100,
+       .atag_offset    = 0x100,
        .init_machine   = fsg_init,
  #if defined(CONFIG_PCI)
        .dma_zone_size  = SZ_64M,
@@@ -17,7 -17,7 +17,7 @@@
   * Maintainers: http://www.nslu2-linux.org/
   *
   */
 -
 +#include <linux/gpio.h>
  #include <linux/if_ether.h>
  #include <linux/irq.h>
  #include <linux/jiffies.h>
@@@ -32,6 -32,7 +32,6 @@@
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/flash.h>
 -#include <asm/gpio.h>
  
  #define NAS100D_SDA_PIN               5
  #define NAS100D_SCL_PIN               6
@@@ -313,7 -314,7 +313,7 @@@ static void __init nas100d_init(void
  
  MACHINE_START(NAS100D, "Iomega NAS 100d")
        /* Maintainer: www.nslu2-linux.org */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .map_io         = ixp4xx_map_io,
        .init_irq       = ixp4xx_init_irq,
        .timer          = &ixp4xx_timer,
@@@ -16,7 -16,7 +16,7 @@@
   * Maintainers: http://www.nslu2-linux.org/
   *
   */
 -
 +#include <linux/gpio.h>
  #include <linux/if_ether.h>
  #include <linux/irq.h>
  #include <linux/serial.h>
@@@ -30,6 -30,7 +30,6 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach/flash.h>
  #include <asm/mach/time.h>
 -#include <asm/gpio.h>
  
  #define NSLU2_SDA_PIN         7
  #define NSLU2_SCL_PIN         6
@@@ -299,7 -300,7 +299,7 @@@ static void __init nslu2_init(void
  
  MACHINE_START(NSLU2, "Linksys NSLU2")
        /* Maintainer: www.nslu2-linux.org */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .map_io         = ixp4xx_map_io,
        .init_irq       = ixp4xx_init_irq,
        .timer          = &nslu2_timer,
@@@ -10,7 -10,7 +10,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/types.h>
  #include <linux/interrupt.h>
@@@ -34,7 -34,7 +34,7 @@@
  #include <asm/mach/irq.h>
  
  #include <mach/devices.h>
 -#include <mach/gpio.h>
 +#include <mach/gpio-ks8695.h>
  
  #include "generic.h"
  
@@@ -223,7 -223,7 +223,7 @@@ static void __init acs5k_init(void
  
  MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board")
        /* Maintainer: Simtec Electronics. */
-       .boot_params    = KS8695_SDRAM_PA + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = acs5k_init,
@@@ -10,7 -10,7 +10,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/types.h>
  #include <linux/interrupt.h>
@@@ -29,7 -29,7 +29,7 @@@
  #include <asm/mach/irq.h>
  
  #include <mach/devices.h>
 -#include <mach/gpio.h>
 +#include <mach/gpio-ks8695.h>
  
  #include "generic.h"
  
@@@ -121,7 -121,7 +121,7 @@@ static void __init dsm320_init(void
  
  MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
        /* Maintainer: Simtec Electronics. */
-       .boot_params    = KS8695_SDRAM_PA + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = dsm320_init,
@@@ -5,7 -5,7 +5,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/types.h>
  #include <linux/interrupt.h>
@@@ -18,7 -18,7 +18,7 @@@
  #include <asm/mach/map.h>
  #include <asm/mach/irq.h>
  
 -#include <mach/gpio.h>
 +#include <mach/gpio-ks8695.h>
  #include <mach/devices.h>
  
  #include "generic.h"
@@@ -53,7 -53,7 +53,7 @@@ static void __init micrel_init(void
  
  MACHINE_START(KS8695, "KS8695 Centaur Development Board")
        /* Maintainer: Micrel Semiconductor Inc. */
-       .boot_params    = KS8695_SDRAM_PA + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = ks8695_map_io,
        .init_irq       = ks8695_init_irq,
        .init_machine   = micrel_init,
@@@ -37,7 -37,6 +37,7 @@@
  
  #include <mach/hardware.h>
  #include <mach/platform.h>
 +#include <mach/gpio-lpc32xx.h>
  #include "common.h"
  
  /*
@@@ -383,7 -382,7 +383,7 @@@ arch_initcall(lpc32xx_display_uid)
  
  MACHINE_START(PHY3250, "Phytec 3250 board with the LPC3250 Microcontroller")
        /* Maintainer: Kevin Wells, NXP Semiconductors */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .map_io         = lpc32xx_map_io,
        .init_irq       = lpc32xx_init_irq,
        .timer          = &lpc32xx_timer,
@@@ -13,7 -13,7 +13,7 @@@
   * GNU General Public License for more details.
   *
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -34,6 -34,7 +34,6 @@@
  
  #include <mach/vreg.h>
  #include <mach/mpp.h>
 -#include <mach/gpio.h>
  #include <mach/board.h>
  #include <mach/msm_iomap.h>
  
@@@ -129,7 -130,7 +129,7 @@@ static void __init msm7x2x_map_io(void
  }
  
  MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF")
-       .boot_params    = PLAT_PHYS_OFFSET + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = msm7x2x_map_io,
        .init_irq       = msm7x2x_init_irq,
        .init_machine   = msm7x2x_init,
  MACHINE_END
  
  MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")
-       .boot_params    = PLAT_PHYS_OFFSET + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = msm7x2x_map_io,
        .init_irq       = msm7x2x_init_irq,
        .init_machine   = msm7x2x_init,
  MACHINE_END
  
  MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")
-       .boot_params    = PLAT_PHYS_OFFSET + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = msm7x2x_map_io,
        .init_irq       = msm7x2x_init_irq,
        .init_machine   = msm7x2x_init,
  MACHINE_END
  
  MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA")
-       .boot_params    = PLAT_PHYS_OFFSET + 0x100,
+       .atag_offset    = 0x100,
        .map_io         = msm7x2x_map_io,
        .init_irq       = msm7x2x_init_irq,
        .init_machine   = msm7x2x_init,
@@@ -14,7 -14,7 +14,7 @@@
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
   * 02110-1301, USA.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/irq.h>
  #include <linux/gpio.h>
  #include <linux/smsc911x.h>
  #include <linux/usb/msm_hsusb.h>
  #include <linux/clkdev.h>
+ #include <linux/memblock.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/memory.h>
  #include <asm/setup.h>
  
 -#include <mach/gpio.h>
  #include <mach/board.h>
  #include <mach/msm_iomap.h>
  #include <mach/dma.h>
  
  extern struct sys_timer msm_timer;
  
+ static void __init msm7x30_fixup(struct machine_desc *desc, struct tag *tag,
+                        char **cmdline, struct meminfo *mi)
+ {
+       for (; tag->hdr.size; tag = tag_next(tag))
+               if (tag->hdr.tag == ATAG_MEM && tag->u.mem.start == 0x200000) {
+                       tag->u.mem.start = 0;
+                       tag->u.mem.size += SZ_2M;
+               }
+ }
+ static void __init msm7x30_reserve(void)
+ {
+       memblock_remove(0x0, SZ_2M);
+ }
  static int hsusb_phy_init_seq[] = {
        0x30, 0x32,     /* Enable and set Pre-Emphasis Depth to 20% */
        0x02, 0x36,     /* Disable CDR Auto Reset feature */
@@@ -105,7 -122,9 +121,9 @@@ static void __init msm7x30_map_io(void
  }
  
  MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
-       .boot_params = PLAT_PHYS_OFFSET + 0x100,
+       .atag_offset = 0x100,
+       .fixup = msm7x30_fixup,
+       .reserve = msm7x30_reserve,
        .map_io = msm7x30_map_io,
        .init_irq = msm7x30_init_irq,
        .init_machine = msm7x30_init,
  MACHINE_END
  
  MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
-       .boot_params = PLAT_PHYS_OFFSET + 0x100,
+       .atag_offset = 0x100,
+       .fixup = msm7x30_fixup,
+       .reserve = msm7x30_reserve,
        .map_io = msm7x30_map_io,
        .init_irq = msm7x30_init_irq,
        .init_machine = msm7x30_init,
  MACHINE_END
  
  MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
-       .boot_params = PLAT_PHYS_OFFSET + 0x100,
+       .atag_offset = 0x100,
+       .fixup = msm7x30_fixup,
+       .reserve = msm7x30_reserve,
        .map_io = msm7x30_map_io,
        .init_irq = msm7x30_init_irq,
        .init_machine = msm7x30_init,
@@@ -14,7 -14,7 +14,7 @@@
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
   * 02110-1301, USA.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/irq.h>
  #include <linux/gpio.h>
@@@ -32,6 -32,7 +32,6 @@@
  #include <mach/board.h>
  #include <mach/irqs.h>
  #include <mach/sirc.h>
 -#include <mach/gpio.h>
  #include <mach/vreg.h>
  #include <mach/mmc.h>
  
@@@ -192,7 -193,7 +192,7 @@@ static void __init qsd8x50_init(void
  }
  
  MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
-       .boot_params = PLAT_PHYS_OFFSET + 0x100,
+       .atag_offset = 0x100,
        .map_io = qsd8x50_map_io,
        .init_irq = qsd8x50_init_irq,
        .init_machine = qsd8x50_init,
  MACHINE_END
  
  MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
-       .boot_params = PLAT_PHYS_OFFSET + 0x100,
+       .atag_offset = 0x100,
        .map_io = qsd8x50_map_io,
        .init_irq = qsd8x50_init_irq,
        .init_machine = qsd8x50_init,
@@@ -11,7 -11,7 +11,7 @@@
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
  */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -22,6 -22,7 +22,6 @@@
  
  #include <linux/delay.h>
  
 -#include <asm/gpio.h>
  #include <mach/hardware.h>
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -104,7 -105,7 +104,7 @@@ static void __init sapphire_map_io(void
  
  MACHINE_START(SAPPHIRE, "sapphire")
  /* Maintainer: Brian Swetland <swetland@google.com> */
-       .boot_params    = PLAT_PHYS_OFFSET + 0x100,
+       .atag_offset    = 0x100,
        .fixup          = sapphire_fixup,
        .map_io         = sapphire_map_io,
        .init_irq       = sapphire_init_irq,
@@@ -27,7 -27,6 +27,7 @@@
  #include <asm/mach/irq.h>
  #include <asm/mach/flash.h>
  
 +#include <plat/gpio-nomadik.h>
  #include <plat/mtu.h>
  
  #include <mach/setup.h>
@@@ -277,7 -276,7 +277,7 @@@ static void __init nhk8815_platform_ini
  
  MACHINE_START(NOMADIK, "NHK8815")
        /* Maintainer: ST MicroElectronics */
-       .boot_params    = 0x100,
+       .atag_offset    = 0x100,
        .map_io         = cpu8815_map_io,
        .init_irq       = cpu8815_init_irq,
        .timer          = &nomadik_timer,
@@@ -11,7 -11,7 +11,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/input.h>
@@@ -30,6 -30,7 +30,6 @@@
  
  #include <plat/io.h>
  #include <plat/board-ams-delta.h>
 -#include <mach/gpio.h>
  #include <plat/keypad.h>
  #include <plat/mux.h>
  #include <plat/usb.h>
@@@ -385,7 -386,7 +385,7 @@@ static void __init ams_delta_map_io(voi
  
  MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
        /* Maintainer: Jonathan McDowell <noodles@earth.li> */
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = ams_delta_map_io,
        .reserve        = omap_reserve,
        .init_irq       = ams_delta_init_irq,
@@@ -10,7 -10,7 +10,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -28,6 -28,7 +28,6 @@@
  #include <asm/mach/map.h>
  
  #include <plat/tc.h>
 -#include <mach/gpio.h>
  #include <plat/mux.h>
  #include <plat/flash.h>
  #include <plat/fpga.h>
@@@ -388,7 -389,7 +388,7 @@@ static void __init omap_fsample_map_io(
  
  MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
  /* Maintainer: Brian Swetland <swetland@google.com> */
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = omap_fsample_map_io,
        .reserve        = omap_reserve,
        .init_irq       = omap_fsample_init_irq,
@@@ -12,7 -12,7 +12,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -22,6 -22,7 +22,6 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  
 -#include <mach/gpio.h>
  #include <plat/mux.h>
  #include <plat/usb.h>
  #include <plat/board.h>
@@@ -93,7 -94,7 +93,7 @@@ static void __init omap_generic_map_io(
  
  MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
        /* Maintainer: Tony Lindgren <tony@atomide.com> */
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = omap_generic_map_io,
        .reserve        = omap_reserve,
        .init_irq       = omap_generic_init_irq,
@@@ -18,7 -18,7 +18,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/platform_device.h>
  #include <linux/delay.h>
@@@ -32,6 -32,7 +32,6 @@@
  #include <linux/smc91x.h>
  
  #include <mach/hardware.h>
 -#include <asm/gpio.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -460,7 -461,7 +460,7 @@@ static void __init h2_map_io(void
  
  MACHINE_START(OMAP_H2, "TI-H2")
        /* Maintainer: Imre Deak <imre.deak@nokia.com> */
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = h2_map_io,
        .reserve        = omap_reserve,
        .init_irq       = h2_init_irq,
@@@ -13,7 -13,7 +13,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/types.h>
  #include <linux/init.h>
  #include <linux/major.h>
@@@ -34,6 -34,7 +34,6 @@@
  #include <asm/setup.h>
  #include <asm/page.h>
  #include <mach/hardware.h>
 -#include <asm/gpio.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -448,7 -449,7 +448,7 @@@ static void __init h3_map_io(void
  
  MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
        /* Maintainer: Texas Instruments, Inc. */
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = h3_map_io,
        .reserve        = omap_reserve,
        .init_irq       = h3_init_irq,
@@@ -23,6 -23,7 +23,6 @@@
   * 02110-1301, USA.
   *
   */
 -
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -610,7 -611,7 +610,7 @@@ static void __init htcherald_init_irq(v
  MACHINE_START(HERALD, "HTC Herald")
        /* Maintainer: Cory Maccarrone <darkstar6262@gmail.com> */
        /* Maintainer: wing-linux.sourceforge.net */
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = htcherald_map_io,
        .reserve        = omap_reserve,
        .init_irq       = htcherald_init_irq,
@@@ -15,7 -15,7 +15,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -34,6 -34,7 +34,6 @@@
  #include <plat/mux.h>
  #include <plat/flash.h>
  #include <plat/fpga.h>
 -#include <mach/gpio.h>
  #include <plat/tc.h>
  #include <plat/usb.h>
  #include <plat/keypad.h>
@@@ -458,7 -459,7 +458,7 @@@ static void __init innovator_map_io(voi
  
  MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
        /* Maintainer: MontaVista Software, Inc. */
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = innovator_map_io,
        .reserve        = omap_reserve,
        .init_irq       = innovator_init_irq,
@@@ -7,7 -7,7 +7,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/mutex.h>
@@@ -26,6 -26,7 +26,6 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  
 -#include <mach/gpio.h>
  #include <plat/mux.h>
  #include <plat/usb.h>
  #include <plat/board.h>
@@@ -263,7 -264,7 +263,7 @@@ static void __init omap_nokia770_map_io
  }
  
  MACHINE_START(NOKIA770, "Nokia 770")
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = omap_nokia770_map_io,
        .reserve        = omap_reserve,
        .init_irq       = omap_nokia770_init_irq,
@@@ -25,7 -25,7 +25,7 @@@
   * with this program; if not, write  to the Free Software Foundation, Inc.,
   * 675 Mass Ave, Cambridge, MA 02139, USA.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -42,6 -42,7 +42,6 @@@
  #include <linux/i2c/tps65010.h>
  
  #include <mach/hardware.h>
 -#include <asm/gpio.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -582,7 -583,7 +582,7 @@@ static void __init osk_map_io(void
  
  MACHINE_START(OMAP_OSK, "TI-OSK")
        /* Maintainer: Dirk Behme <dirk.behme@de.bosch.com> */
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = osk_map_io,
        .reserve        = omap_reserve,
        .init_irq       = osk_init_irq,
@@@ -16,7 -16,7 +16,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/input.h>
@@@ -33,6 -33,7 +33,6 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  
 -#include <mach/gpio.h>
  #include <plat/flash.h>
  #include <plat/mux.h>
  #include <plat/usb.h>
@@@ -274,7 -275,7 +274,7 @@@ static void __init omap_palmte_map_io(v
  }
  
  MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = omap_palmte_map_io,
        .reserve        = omap_reserve,
        .init_irq       = omap_palmte_init_irq,
@@@ -12,7 -12,6 +12,7 @@@
   */
  
  #include <linux/delay.h>
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -31,6 -30,7 +31,6 @@@
  #include <asm/mach/map.h>
  
  #include <plat/led.h>
 -#include <mach/gpio.h>
  #include <plat/flash.h>
  #include <plat/mux.h>
  #include <plat/usb.h>
@@@ -321,7 -321,7 +321,7 @@@ static void __init omap_palmtt_map_io(v
  }
  
  MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = omap_palmtt_map_io,
        .reserve        = omap_reserve,
        .init_irq       = omap_palmtt_init_irq,
@@@ -15,7 -15,6 +15,7 @@@
   */
  
  #include <linux/delay.h>
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -33,6 -32,7 +33,6 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  
 -#include <mach/gpio.h>
  #include <plat/flash.h>
  #include <plat/mux.h>
  #include <plat/usb.h>
@@@ -341,7 -341,7 +341,7 @@@ omap_palmz71_map_io(void
  }
  
  MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = omap_palmz71_map_io,
        .reserve        = omap_reserve,
        .init_irq       = omap_palmz71_init_irq,
@@@ -10,7 -10,7 +10,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -28,6 -28,7 +28,6 @@@
  #include <asm/mach/map.h>
  
  #include <plat/tc.h>
 -#include <mach/gpio.h>
  #include <plat/mux.h>
  #include <plat/fpga.h>
  #include <plat/flash.h>
@@@ -349,7 -350,7 +349,7 @@@ static void __init omap_perseus2_map_io
  
  MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
        /* Maintainer: Kevin Hilman <kjh@hilman.org> */
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = omap_perseus2_map_io,
        .reserve        = omap_reserve,
        .init_irq       = omap_perseus2_init_irq,
@@@ -14,7 -14,7 +14,7 @@@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/input.h>
@@@ -32,6 -32,7 +32,6 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  
 -#include <mach/gpio.h>
  #include <plat/flash.h>
  #include <plat/mux.h>
  #include <plat/dma.h>
@@@ -420,7 -421,7 +420,7 @@@ static void __init omap_sx1_map_io(void
  }
  
  MACHINE_START(SX1, "OMAP310 based Siemens SX1")
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = omap_sx1_map_io,
        .reserve        = omap_reserve,
        .init_irq       = omap_sx1_init_irq,
@@@ -13,7 -13,6 +13,7 @@@
   */
  
  #include <linux/delay.h>
 +#include <linux/gpio.h>
  #include <linux/platform_device.h>
  #include <linux/interrupt.h>
  #include <linux/irq.h>
@@@ -34,6 -33,7 +34,6 @@@
  
  #include <plat/board-voiceblue.h>
  #include <plat/common.h>
 -#include <mach/gpio.h>
  #include <plat/flash.h>
  #include <plat/mux.h>
  #include <plat/tc.h>
@@@ -301,7 -301,7 +301,7 @@@ static void __init voiceblue_init(void
  
  MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
        /* Maintainer: Ladislav Michl <michl@2n.cz> */
-       .boot_params    = 0x10000100,
+       .atag_offset    = 0x100,
        .map_io         = voiceblue_map_io,
        .reserve        = omap_reserve,
        .init_irq       = voiceblue_init_irq,
@@@ -193,8 -193,7 +193,8 @@@ static int __init omap2430_i2c_init(voi
  {
        omap_register_i2c_bus(1, 100, sdp2430_i2c1_boardinfo,
                        ARRAY_SIZE(sdp2430_i2c1_boardinfo));
 -      omap2_pmic_init("twl4030", &sdp2430_twldata);
 +      omap_pmic_init(2, 100, "twl4030", INT_24XX_SYS_NIRQ,
 +                      &sdp2430_twldata);
        return 0;
  }
  
@@@ -257,7 -256,7 +257,7 @@@ static void __init omap_2430sdp_map_io(
  
  MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
        /* Maintainer: Syed Khasim - Texas Instruments Inc */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap_2430sdp_map_io,
        .init_early     = omap_2430sdp_init_early,
@@@ -129,7 -129,7 +129,7 @@@ static const int sdp4430_keymap[] = 
        KEY(7, 6, KEY_OK),
        KEY(7, 7, KEY_DOWN),
  };
 -static struct omap_device_pad keypad_pads[] __initdata = {
 +static struct omap_device_pad keypad_pads[] = {
        {       .name   = "kpd_col1.kpd_col1",
                .enable = OMAP_WAKEUP_EN | OMAP_MUX_MODE1,
        },
@@@ -838,7 -838,7 +838,7 @@@ static void __init omap_4430sdp_map_io(
  
  MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
        /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap_4430sdp_map_io,
        .init_early     = omap_4430sdp_init_early,
@@@ -15,7 -15,7 +15,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/device.h>
@@@ -25,6 -25,7 +25,6 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  
 -#include <mach/gpio.h>
  #include <plat/usb.h>
  #include <plat/board.h>
  #include <plat/common.h>
@@@ -65,7 -66,7 +65,7 @@@ static void __init omap_generic_map_io(
  /* XXX This machine entry name should be updated */
  MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
        /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap_generic_map_io,
        .init_early     = omap_generic_init_early,
@@@ -10,7 -10,7 +10,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -31,6 -31,7 +31,6 @@@
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  
 -#include <mach/gpio.h>
  #include <plat/usb.h>
  #include <plat/board.h>
  #include <plat/common.h>
@@@ -381,7 -382,7 +381,7 @@@ static void __init omap_h4_map_io(void
  
  MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
        /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap_h4_map_io,
        .init_early     = omap_h4_init_early,
@@@ -10,7 -10,7 +10,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -34,6 -34,7 +34,6 @@@
  #include <asm/mach/map.h>
  
  #include <plat/mcspi.h>
 -#include <mach/gpio.h>
  #include <plat/board.h>
  #include <plat/common.h>
  #include <plat/gpmc.h>
@@@ -332,7 -333,7 +332,7 @@@ static void __init omap_ldp_init(void
  }
  
  MACHINE_START(OMAP_LDP, "OMAP LDP board")
-       .boot_params    = 0x80000100,
+       .atag_offset    = 0x100,
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
        .init_early     = omap_ldp_init_early,
@@@ -9,7 -9,7 +9,7 @@@
   * License version 2.  This program is licensed "as is" without any
   * warranty of any kind, whether express or implied.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -21,6 -21,7 +21,6 @@@
  #include <linux/mv643xx_eth.h>
  #include <linux/i2c.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/pci.h>
  #include <mach/orion5x.h>
@@@ -358,7 -359,7 +358,7 @@@ static void __init db88f5281_init(void
  
  MACHINE_START(DB88F5281, "Marvell Orion-2 Development Board")
        /* Maintainer: Tzachi Perelstein <tzachi@marvell.com> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = db88f5281_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -13,7 -13,7 +13,7 @@@
   * License, or (at your option) any later version.
   *
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/delay.h>
@@@ -30,6 -30,7 +30,6 @@@
  #include <linux/phy.h>
  #include <linux/marvell_phy.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/pci.h>
  #include <mach/orion5x.h>
@@@ -76,7 -77,7 +76,7 @@@ static int __init dns323_pci_map_irq(co
        /*
         * Check for devices with hard-wired IRQs.
         */
 -      irq = orion5x_pci_map_irq(const dev, slot, pin);
 +      irq = orion5x_pci_map_irq(dev, slot, pin);
        if (irq != -1)
                return irq;
  
@@@ -729,7 -730,7 +729,7 @@@ static void __init dns323_init(void
  /* Warning: D-Link uses a wrong mach-type (=526) in their bootloader */
  MACHINE_START(DNS323, "D-Link DNS-323")
        /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = dns323_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -7,7 -7,7 +7,7 @@@
   * License version 2.  This program is licensed "as is" without any
   * warranty of any kind, whether express or implied.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -21,6 -21,7 +21,6 @@@
  #include <linux/serial_reg.h>
  #include <linux/ata_platform.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/pci.h>
  #include <mach/orion5x.h>
@@@ -379,7 -380,7 +379,7 @@@ static void __init kurobox_pro_init(voi
  #ifdef CONFIG_MACH_KUROBOX_PRO
  MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro")
        /* Maintainer: Ronen Shitrit <rshitrit@marvell.com> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = kurobox_pro_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -392,7 -393,7 +392,7 @@@ MACHINE_EN
  #ifdef CONFIG_MACH_LINKSTATION_PRO
  MACHINE_START(LINKSTATION_PRO, "Buffalo Linkstation Pro/Live")
        /* Maintainer: Byron Bradley <byron.bbradley@gmail.com> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = kurobox_pro_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -7,7 -7,7 +7,7 @@@
   * published by the Free Software Foundation; either version 2 of the
   * License, or (at your option) any later version.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -20,6 -20,7 +20,6 @@@
  #include <linux/i2c.h>
  #include <linux/ata_platform.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/mach/arch.h>
  #include <mach/orion5x.h>
  #include "common.h"
@@@ -228,7 -229,7 +228,7 @@@ static void __init mv2120_init(void
  /* Warning: HP uses a wrong mach-type (=526) in their bootloader */
  MACHINE_START(MV2120, "HP Media Vault mv2120")
        /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = mv2120_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -7,7 -7,7 +7,7 @@@
   * License version 2.  This program is licensed "as is" without any
   * warranty of any kind, whether express or implied.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -18,6 -18,7 +18,6 @@@
  #include <linux/ethtool.h>
  #include <net/dsa.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/leds.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/pci.h>
@@@ -168,7 -169,7 +168,7 @@@ subsys_initcall(rd88f5181l_fxo_pci_init
  
  MACHINE_START(RD88F5181L_FXO, "Marvell Orion-VoIP FXO Reference Design")
        /* Maintainer: Nicolas Pitre <nico@marvell.com> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = rd88f5181l_fxo_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -7,7 -7,7 +7,7 @@@
   * License version 2.  This program is licensed "as is" without any
   * warranty of any kind, whether express or implied.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -19,6 -19,7 +19,6 @@@
  #include <linux/i2c.h>
  #include <net/dsa.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/leds.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/pci.h>
@@@ -180,7 -181,7 +180,7 @@@ subsys_initcall(rd88f5181l_ge_pci_init)
  
  MACHINE_START(RD88F5181L_GE, "Marvell Orion-VoIP GE Reference Design")
        /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = rd88f5181l_ge_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -9,7 -9,7 +9,7 @@@
   * License version 2.  This program is licensed "as is" without any
   * warranty of any kind, whether express or implied.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -20,6 -20,7 +20,6 @@@
  #include <linux/ata_platform.h>
  #include <linux/i2c.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/leds.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/pci.h>
@@@ -305,7 -306,7 +305,7 @@@ static void __init rd88f5182_init(void
  
  MACHINE_START(RD88F5182, "Marvell Orion-NAS Reference Design")
        /* Maintainer: Ronen Shitrit <rshitrit@marvell.com> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = rd88f5182_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -7,7 -7,7 +7,7 @@@
   * License version 2.  This program is licensed "as is" without any
   * warranty of any kind, whether express or implied.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -21,6 -21,7 +21,6 @@@
  #include <linux/ethtool.h>
  #include <net/dsa.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/leds.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/pci.h>
@@@ -121,7 -122,7 +121,7 @@@ subsys_initcall(rd88f6183ap_ge_pci_init
  
  MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design")
        /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = rd88f6183ap_ge_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -8,7 -8,7 +8,7 @@@
   * as published by the Free Software Foundation; either version
   * 2 of the License, or (at your option) any later version.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -20,6 -20,7 +20,6 @@@
  #include <linux/i2c.h>
  #include <linux/serial_reg.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/pci.h>
  #include <mach/orion5x.h>
@@@ -357,7 -358,7 +357,7 @@@ static void __init tsp2_init(void
  
  MACHINE_START(TERASTATION_PRO2, "Buffalo Terastation Pro II/Live")
        /* Maintainer:  Sylver Bruneau <sylver.bruneau@googlemail.com> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = tsp2_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -8,7 -8,7 +8,7 @@@
   * as published by the Free Software Foundation; either version
   * 2 of the License, or (at your option) any later version.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -23,6 -23,7 +23,6 @@@
  #include <linux/serial_reg.h>
  #include <linux/ata_platform.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/pci.h>
  #include <mach/orion5x.h>
@@@ -322,7 -323,7 +322,7 @@@ static void __init qnap_ts209_init(void
  
  MACHINE_START(TS209, "QNAP TS-109/TS-209")
        /* Maintainer: Byron Bradley <byron.bbradley@gmail.com> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = qnap_ts209_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -11,7 -11,7 +11,7 @@@
   * as published by the Free Software Foundation; either version
   * 2 of the License, or (at your option) any later version.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -25,6 -25,7 +25,6 @@@
  #include <linux/i2c.h>
  #include <linux/serial_reg.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/pci.h>
  #include <mach/orion5x.h>
@@@ -311,7 -312,7 +311,7 @@@ static void __init qnap_ts409_init(void
  
  MACHINE_START(TS409, "QNAP TS-409")
        /* Maintainer:  Sylver Bruneau <sylver.bruneau@gmail.com> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = qnap_ts409_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -5,7 -5,7 +5,7 @@@
   * License version 2.  This program is licensed "as is" without any
   * warranty of any kind, whether express or implied.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -17,6 -17,7 +17,6 @@@
  #include <linux/ethtool.h>
  #include <net/dsa.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/pci.h>
  #include <mach/orion5x.h>
@@@ -172,7 -173,7 +172,7 @@@ subsys_initcall(wnr854t_pci_init)
  
  MACHINE_START(WNR854T, "Netgear WNR854T")
        /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = wnr854t_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -5,7 -5,7 +5,7 @@@
   * License version 2.  This program is licensed "as is" without any
   * warranty of any kind, whether express or implied.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
@@@ -20,6 -20,7 +20,6 @@@
  #include <linux/input.h>
  #include <net/dsa.h>
  #include <asm/mach-types.h>
 -#include <asm/gpio.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/pci.h>
  #include <mach/orion5x.h>
@@@ -260,7 -261,7 +260,7 @@@ subsys_initcall(wrt350n_v2_pci_init)
  
  MACHINE_START(WRT350N_V2, "Linksys WRT350N v2")
        /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .init_machine   = wrt350n_v2_init,
        .map_io         = orion5x_map_io,
        .init_early     = orion5x_init_early,
@@@ -591,7 -591,7 +591,7 @@@ static void balloon3_nand_cmd_ctl(struc
                                BALLOON3_NAND_CONTROL_REG);
                if (balloon3_ctl_set)
                        __raw_writel(balloon3_ctl_set,
 -                              BALLOON3_NAND_CONTROL_REG |
 +                              BALLOON3_NAND_CONTROL_REG +
                                BALLOON3_FPGA_SETnCLR);
        }
  
@@@ -608,7 -608,7 +608,7 @@@ static void balloon3_nand_select_chip(s
        __raw_writew(
                BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 |
                BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3,
 -              BALLOON3_NAND_CONTROL_REG | BALLOON3_FPGA_SETnCLR);
 +              BALLOON3_NAND_CONTROL_REG + BALLOON3_FPGA_SETnCLR);
  
        /* Deassert correct nCE line */
        __raw_writew(BALLOON3_NAND_CONTROL_FLCE0 << chip,
@@@ -626,7 -626,7 +626,7 @@@ static int balloon3_nand_probe(struct p
        int ret;
  
        __raw_writew(BALLOON3_NAND_CONTROL2_16BIT,
 -              BALLOON3_NAND_CONTROL2_REG | BALLOON3_FPGA_SETnCLR);
 +              BALLOON3_NAND_CONTROL2_REG + BALLOON3_FPGA_SETnCLR);
  
        ver = __raw_readw(BALLOON3_FPGA_VER);
        if (ver < 0x4f08)
                BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 |
                BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3 |
                BALLOON3_NAND_CONTROL_FLWP,
 -              BALLOON3_NAND_CONTROL_REG | BALLOON3_FPGA_SETnCLR);
 +              BALLOON3_NAND_CONTROL_REG + BALLOON3_FPGA_SETnCLR);
        return 0;
  
  err2:
@@@ -807,7 -807,7 +807,7 @@@ static void __init balloon3_init(void
  
  static struct map_desc balloon3_io_desc[] __initdata = {
        {       /* CPLD/FPGA */
 -              .virtual        =  BALLOON3_FPGA_VIRT,
 +              .virtual        = (unsigned long)BALLOON3_FPGA_VIRT,
                .pfn            = __phys_to_pfn(BALLOON3_FPGA_PHYS),
                .length         = BALLOON3_FPGA_LENGTH,
                .type           = MT_DEVICE,
@@@ -828,5 -828,5 +828,5 @@@ MACHINE_START(BALLOON3, "Balloon3"
        .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = balloon3_init,
-       .boot_params    = PLAT_PHYS_OFFSET + 0x100,
+       .atag_offset    = 0x100,
  MACHINE_END
@@@ -39,7 -39,7 +39,7 @@@ extern void cmx270_init(void)
  #define CMX2XX_NR_IRQS                (IRQ_BOARD_START + 40)
  
  /* virtual addresses for statically mapped regions */
 -#define CMX2XX_VIRT_BASE      (0xe8000000)
 +#define CMX2XX_VIRT_BASE      (void __iomem *)(0xe8000000)
  #define CMX2XX_IT8152_VIRT    (CMX2XX_VIRT_BASE)
  
  /* physical address if local-bus attached devices */
@@@ -482,7 -482,7 +482,7 @@@ static void __init cmx2xx_init_irq(void
  /* Map PCI companion statically */
  static struct map_desc cmx2xx_io_desc[] __initdata = {
        [0] = { /* PCI bridge */
 -              .virtual        = CMX2XX_IT8152_VIRT,
 +              .virtual        = (unsigned long)CMX2XX_IT8152_VIRT,
                .pfn            = __phys_to_pfn(PXA_CS4_PHYS),
                .length         = SZ_64M,
                .type           = MT_DEVICE
@@@ -513,7 -513,7 +513,7 @@@ static void __init cmx2xx_map_io(void
  #endif
  
  MACHINE_START(ARMCORE, "Compulab CM-X2XX")
-       .boot_params    = 0xa0000100,
+       .atag_offset    = 0x100,
        .map_io         = cmx2xx_map_io,
        .nr_irqs        = CMX2XX_NR_IRQS,
        .init_irq       = cmx2xx_init_irq,
@@@ -775,6 -775,7 +775,6 @@@ static struct gpio cm_x300_wi2wi_gpios[
  
  static void __init cm_x300_init_wi2wi(void)
  {
 -      int bt_reset, wlan_en;
        int err;
  
        if (system_rev < 130) {
        }
  
        udelay(10);
 -      gpio_set_value(bt_reset, 0);
 +      gpio_set_value(cm_x300_wi2wi_gpios[1].gpio, 0);
        udelay(10);
 -      gpio_set_value(bt_reset, 1);
 +      gpio_set_value(cm_x300_wi2wi_gpios[1].gpio, 1);
  
 -      gpio_free(wlan_en);
 -      gpio_free(bt_reset);
 +      gpio_free_array(ARRAY_AND_SIZE(cm_x300_wi2wi_gpios));
  }
  
  /* MFP */
@@@ -850,7 -852,7 +850,7 @@@ static void __init cm_x300_fixup(struc
  }
  
  MACHINE_START(CM_X300, "CM-X300 module")
-       .boot_params    = 0xa0000100,
+       .atag_offset    = 0x100,
        .map_io         = pxa3xx_map_io,
        .init_irq       = pxa3xx_init_irq,
        .handle_irq     = pxa3xx_handle_irq,
@@@ -12,7 -12,7 +12,7 @@@
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
  #include <linux/syscore_ops.h>
@@@ -39,6 -39,7 +39,6 @@@
  #include <asm/mach/flash.h>
  
  #include <mach/pxa27x.h>
 -#include <mach/gpio.h>
  #include <mach/lpd270.h>
  #include <mach/audio.h>
  #include <mach/pxafb.h>
@@@ -479,7 -480,7 +479,7 @@@ static void __init lpd270_init(void
  
  static struct map_desc lpd270_io_desc[] __initdata = {
        {
 -              .virtual        = LPD270_CPLD_VIRT,
 +              .virtual        = (unsigned long)LPD270_CPLD_VIRT,
                .pfn            = __phys_to_pfn(LPD270_CPLD_PHYS),
                .length         = LPD270_CPLD_SIZE,
                .type           = MT_DEVICE,
@@@ -498,7 -499,7 +498,7 @@@ static void __init lpd270_map_io(void
  
  MACHINE_START(LOGICPD_PXA270, "LogicPD PXA270 Card Engine")
        /* Maintainer: Peter Barada */
-       .boot_params    = 0xa0000100,
+       .atag_offset    = 0x100,
        .map_io         = lpd270_map_io,
        .nr_irqs        = LPD270_NR_IRQS,
        .init_irq       = lpd270_init_irq,
@@@ -12,7 -12,7 +12,7 @@@
   *  it under the terms of the GNU General Public License version 2 as
   *  published by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
  #include <linux/syscore_ops.h>
@@@ -43,6 -43,7 +43,6 @@@
  #include <asm/mach/flash.h>
  
  #include <mach/pxa27x.h>
 -#include <mach/gpio.h>
  #include <mach/mainstone.h>
  #include <mach/audio.h>
  #include <mach/pxafb.h>
@@@ -615,7 -616,7 +615,7 @@@ static void __init mainstone_map_io(voi
  
  MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
        /* Maintainer: MontaVista Software Inc. */
-       .boot_params    = 0xa0000100,   /* BLOB boot parameter setting */
+       .atag_offset    = 0x100,        /* BLOB boot parameter setting */
        .map_io         = mainstone_map_io,
        .nr_irqs        = MAINSTONE_NR_IRQS,
        .init_irq       = mainstone_init_irq,
@@@ -423,7 -423,6 +423,7 @@@ static void __init palmphone_common_ini
        palmtreo_leds_init();
  }
  
 +#ifdef CONFIG_MACH_TREO680
  static void __init treo680_init(void)
  {
        pxa2xx_mfp_config(ARRAY_AND_SIZE(treo680_pin_config));
        palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, GPIO_NR_TREO680_SD_READONLY,
                        GPIO_NR_TREO680_SD_POWER, 0);
  }
 +#endif
  
 +#ifdef CONFIG_MACH_CENTRO
  static void __init centro_init(void)
  {
        pxa2xx_mfp_config(ARRAY_AND_SIZE(centro685_pin_config));
        palm27x_mmc_init(GPIO_NR_TREO_SD_DETECT_N, -1,
                        GPIO_NR_CENTRO_SD_POWER, 1);
  }
 +#endif
  
 +#ifdef CONFIG_MACH_TREO680
  MACHINE_START(TREO680, "Palm Treo 680")
-       .boot_params    = 0xa0000100,
+       .atag_offset    = 0x100,
        .map_io         = pxa27x_map_io,
        .reserve        = treo_reserve,
        .init_irq       = pxa27x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = treo680_init,
  MACHINE_END
 +#endif
  
 +#ifdef CONFIG_MACH_CENTRO
  MACHINE_START(CENTRO, "Palm Centro 685")
-       .boot_params    = 0xa0000100,
+       .atag_offset    = 0x100,
        .map_io         = pxa27x_map_io,
        .reserve        = treo_reserve,
        .init_irq       = pxa27x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = centro_init,
  MACHINE_END
 +#endif
@@@ -247,7 -247,7 +247,7 @@@ static void palmtx_nand_cmd_ctl(struct 
                                 unsigned int ctrl)
  {
        struct nand_chip *this = mtd->priv;
 -      unsigned long nandaddr = (unsigned long)this->IO_ADDR_W;
 +      char __iomem *nandaddr = this->IO_ADDR_W;
  
        if (cmd == NAND_CMD_NONE)
                return;
@@@ -315,17 -315,17 +315,17 @@@ static inline void palmtx_nand_init(voi
   ******************************************************************************/
  static struct map_desc palmtx_io_desc[] __initdata = {
  {
 -      .virtual        = PALMTX_PCMCIA_VIRT,
 +      .virtual        = (unsigned long)PALMTX_PCMCIA_VIRT,
        .pfn            = __phys_to_pfn(PALMTX_PCMCIA_PHYS),
        .length         = PALMTX_PCMCIA_SIZE,
        .type           = MT_DEVICE,
  }, {
 -      .virtual        = PALMTX_NAND_ALE_VIRT,
 +      .virtual        = (unsigned long)PALMTX_NAND_ALE_VIRT,
        .pfn            = __phys_to_pfn(PALMTX_NAND_ALE_PHYS),
        .length         = SZ_1M,
        .type           = MT_DEVICE,
  }, {
 -      .virtual        = PALMTX_NAND_CLE_VIRT,
 +      .virtual        = (unsigned long)PALMTX_NAND_CLE_VIRT,
        .pfn            = __phys_to_pfn(PALMTX_NAND_CLE_PHYS),
        .length         = SZ_1M,
        .type           = MT_DEVICE,
@@@ -364,7 -364,7 +364,7 @@@ static void __init palmtx_init(void
  }
  
  MACHINE_START(PALMTX, "Palm T|X")
-       .boot_params    = 0xa0000100,
+       .atag_offset    = 0x100,
        .map_io         = palmtx_map_io,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
@@@ -9,13 -9,12 +9,13 @@@
   *  it under the terms of the GNU General Public License version 2 as
   *  publishhed by the Free Software Foundation.
   */
 -
 +#include <linux/gpio.h>
  #include <linux/init.h>
  #include <linux/kernel.h>
  #include <linux/i2c.h>
  #include <linux/i2c/pxa-i2c.h>
  #include <linux/mfd/88pm860x.h>
 +#include <linux/gpio.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -24,7 -23,7 +24,7 @@@
  #include <mach/hardware.h>
  #include <mach/mfp.h>
  #include <mach/mfp-pxa930.h>
 -#include <mach/gpio.h>
 +#include <mach/pxa95x.h>
  
  #include "generic.h"
  
@@@ -104,7 -103,7 +104,7 @@@ static void __init saarb_init(void
  }
  
  MACHINE_START(SAARB, "PXA955 Handheld Platform (aka SAARB)")
-       .boot_params    = 0xa0000100,
+       .atag_offset    = 0x100,
        .map_io         = pxa3xx_map_io,
        .nr_irqs        = SAARB_NR_IRQS,
        .init_irq       = pxa95x_init_irq,
diff --combined arch/arm/mach-pxa/z2.c
@@@ -686,8 -686,7 +686,8 @@@ static void z2_power_off(void
         */
        PSPR = 0x0;
        local_irq_disable();
 -      pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP, PHYS_OFFSET - PAGE_OFFSET);
 +      pxa27x_set_pwrmode(PWRMODE_DEEPSLEEP);
 +      pxa27x_cpu_pm_enter(PM_SUSPEND_MEM);
  }
  #else
  #define z2_power_off   NULL
@@@ -719,7 -718,7 +719,7 @@@ static void __init z2_init(void
  }
  
  MACHINE_START(ZIPIT2, "Zipit Z2")
-       .boot_params    = 0xa0000100,
+       .atag_offset    = 0x100,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
        .handle_irq     = pxa27x_handle_irq,
diff --combined arch/arm/mach-pxa/zeus.c
@@@ -860,25 -860,25 +860,25 @@@ static void __init zeus_init(void
  
  static struct map_desc zeus_io_desc[] __initdata = {
        {
 -              .virtual = ZEUS_CPLD_VERSION,
 +              .virtual = (unsigned long)ZEUS_CPLD_VERSION,
                .pfn     = __phys_to_pfn(ZEUS_CPLD_VERSION_PHYS),
                .length  = 0x1000,
                .type    = MT_DEVICE,
        },
        {
 -              .virtual = ZEUS_CPLD_ISA_IRQ,
 +              .virtual = (unsigned long)ZEUS_CPLD_ISA_IRQ,
                .pfn     = __phys_to_pfn(ZEUS_CPLD_ISA_IRQ_PHYS),
                .length  = 0x1000,
                .type    = MT_DEVICE,
        },
        {
 -              .virtual = ZEUS_CPLD_CONTROL,
 +              .virtual = (unsigned long)ZEUS_CPLD_CONTROL,
                .pfn     = __phys_to_pfn(ZEUS_CPLD_CONTROL_PHYS),
                .length  = 0x1000,
                .type    = MT_DEVICE,
        },
        {
 -              .virtual = ZEUS_PC104IO,
 +              .virtual = (unsigned long)ZEUS_PC104IO,
                .pfn     = __phys_to_pfn(ZEUS_PC104IO_PHYS),
                .length  = 0x00800000,
                .type    = MT_DEVICE,
@@@ -904,7 -904,7 +904,7 @@@ static void __init zeus_map_io(void
  
  MACHINE_START(ARCOM_ZEUS, "Arcom/Eurotech ZEUS")
        /* Maintainer: Marc Zyngier <maz@misterjones.org> */
-       .boot_params    = 0xa0000100,
+       .atag_offset    = 0x100,
        .map_io         = zeus_map_io,
        .nr_irqs        = ZEUS_NR_IRQS,
        .init_irq       = zeus_init_irq,
@@@ -262,6 -262,45 +262,6 @@@ static struct samsung_keypad_platdata s
        .cols           = 8,
  };
  
 -static int smdk6410_backlight_init(struct device *dev)
 -{
 -      int ret;
 -
 -      ret = gpio_request(S3C64XX_GPF(15), "Backlight");
 -      if (ret) {
 -              printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
 -              return ret;
 -      }
 -
 -      /* Configure GPIO pin with S3C64XX_GPF15_PWM_TOUT1 */
 -      s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2));
 -
 -      return 0;
 -}
 -
 -static void smdk6410_backlight_exit(struct device *dev)
 -{
 -      s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_OUTPUT);
 -      gpio_free(S3C64XX_GPF(15));
 -}
 -
 -static struct platform_pwm_backlight_data smdk6410_backlight_data = {
 -      .pwm_id         = 1,
 -      .max_brightness = 255,
 -      .dft_brightness = 255,
 -      .pwm_period_ns  = 78770,
 -      .init           = smdk6410_backlight_init,
 -      .exit           = smdk6410_backlight_exit,
 -};
 -
 -static struct platform_device smdk6410_backlight_device = {
 -      .name           = "pwm-backlight",
 -      .dev            = {
 -              .parent         = &s3c_device_timer[1].dev,
 -              .platform_data  = &smdk6410_backlight_data,
 -      },
 -};
 -
  static struct map_desc smdk6410_iodesc[] = {};
  
  static struct platform_device *smdk6410_devices[] __initdata = {
@@@ -703,7 -742,7 +703,7 @@@ static void __init smdk6410_machine_ini
  
  MACHINE_START(SMDK6410, "SMDK6410")
        /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
-       .boot_params    = S3C64XX_PA_SDRAM + 0x100,
+       .atag_offset    = 0x100,
  
        .init_irq       = s3c6410_init_irq,
        .map_io         = smdk6410_map_io,
@@@ -37,6 -37,7 +37,7 @@@
  #include <linux/mmc/sh_mobile_sdhi.h>
  #include <linux/mfd/tmio.h>
  #include <linux/sh_clk.h>
+ #include <linux/dma-mapping.h>
  #include <video/sh_mobile_lcdc.h>
  #include <video/sh_mipi_dsi.h>
  #include <sound/sh_fsi.h>
@@@ -341,7 -342,6 +342,7 @@@ static struct platform_device mipidsi0_
  static struct sh_mobile_sdhi_info sdhi0_info = {
        .dma_slave_tx   = SHDMA_SLAVE_SDHI0_TX,
        .dma_slave_rx   = SHDMA_SLAVE_SDHI0_RX,
 +      .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT,
        .tmio_caps      = MMC_CAP_SD_HIGHSPEED,
        .tmio_ocr_mask  = MMC_VDD_27_28 | MMC_VDD_28_29,
  };
@@@ -383,7 -383,7 +384,7 @@@ void ag5evm_sdhi1_set_pwr(struct platfo
  }
  
  static struct sh_mobile_sdhi_info sh_sdhi1_info = {
 -      .tmio_flags     = TMIO_MMC_WRPROTECT_DISABLE,
 +      .tmio_flags     = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
        .tmio_caps      = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
        .tmio_ocr_mask  = MMC_VDD_32_33 | MMC_VDD_33_34,
        .set_pwr        = ag5evm_sdhi1_set_pwr,
@@@ -447,6 -447,8 +448,8 @@@ static struct map_desc ag5evm_io_desc[
  static void __init ag5evm_map_io(void)
  {
        iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc));
+       /* DMA memory at 0xf6000000 - 0xffdfffff */
+       init_consistent_dma_size(158 << 20);
  
        /* setup early devices and console here as well */
        sh73a0_add_early_devices();
@@@ -42,6 -42,7 +42,7 @@@
  #include <linux/leds.h>
  #include <linux/input/sh_keysc.h>
  #include <linux/usb/r8a66597.h>
+ #include <linux/dma-mapping.h>
  
  #include <media/sh_mobile_ceu.h>
  #include <media/sh_mobile_csi2.h>
@@@ -1170,6 -1171,8 +1171,8 @@@ static struct map_desc ap4evb_io_desc[
  static void __init ap4evb_map_io(void)
  {
        iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc));
+       /* DMA memory at 0xf6000000 - 0xffdfffff */
+       init_consistent_dma_size(158 << 20);
  
        /* setup early devices and console here as well */
        sh7372_add_early_devices();
@@@ -1412,7 -1415,6 +1415,7 @@@ static void __init ap4evb_init(void
        fsi_init_pm_clock();
        sh7372_pm_init();
        pm_clk_add(&fsi_device.dev, "spu2");
 +      pm_clk_add(&lcdc1_device.dev, "hdmi");
  }
  
  static void __init ap4evb_timer_init(void)
@@@ -45,6 -45,7 +45,7 @@@
  #include <linux/tca6416_keypad.h>
  #include <linux/usb/r8a66597.h>
  #include <linux/usb/renesas_usbhs.h>
+ #include <linux/dma-mapping.h>
  
  #include <video/sh_mobile_hdmi.h>
  #include <video/sh_mobile_lcdc.h>
@@@ -641,8 -642,6 +642,8 @@@ static struct usbhs_private usbhs0_priv
                },
                .driver_param = {
                        .buswait_bwait  = 4,
 +                      .d0_tx_id       = SHDMA_SLAVE_USB0_TX,
 +                      .d1_rx_id       = SHDMA_SLAVE_USB0_RX,
                },
        },
  };
@@@ -812,8 -811,6 +813,8 @@@ static struct usbhs_private usbhs1_priv
                        .buswait_bwait  = 4,
                        .pipe_type      = usbhs1_pipe_cfg,
                        .pipe_size      = ARRAY_SIZE(usbhs1_pipe_cfg),
 +                      .d0_tx_id       = SHDMA_SLAVE_USB1_TX,
 +                      .d1_rx_id       = SHDMA_SLAVE_USB1_RX,
                },
        },
  };
@@@ -1381,6 -1378,8 +1382,8 @@@ static struct map_desc mackerel_io_desc
  static void __init mackerel_map_io(void)
  {
        iotable_init(mackerel_io_desc, ARRAY_SIZE(mackerel_io_desc));
+       /* DMA memory at 0xf6000000 - 0xffdfffff */
+       init_consistent_dma_size(158 << 20);
  
        /* setup early devices and console here as well */
        sh7372_add_early_devices();
@@@ -1592,7 -1591,6 +1595,7 @@@ static void __init mackerel_init(void
        hdmi_init_pm_clock();
        sh7372_pm_init();
        pm_clk_add(&fsi_device.dev, "spu2");
 +      pm_clk_add(&hdmi_lcdc_device.dev, "hdmi");
  }
  
  static void __init mackerel_timer_init(void)
@@@ -25,6 -25,7 +25,7 @@@
  #include <linux/err.h>
  #include <linux/mtd/nand.h>
  #include <linux/mtd/fsmc.h>
+ #include <linux/dma-mapping.h>
  
  #include <asm/types.h>
  #include <asm/setup.h>
@@@ -37,7 -38,6 +38,7 @@@
  #include <mach/hardware.h>
  #include <mach/syscon.h>
  #include <mach/dma_channels.h>
 +#include <mach/gpio-u300.h>
  
  #include "clock.h"
  #include "mmc.h"
@@@ -93,6 -93,8 +94,8 @@@ static struct map_desc u300_io_desc[] _
  void __init u300_map_io(void)
  {
        iotable_init(u300_io_desc, ARRAY_SIZE(u300_io_desc));
+       /* We enable a real big DMA buffer if need be. */
+       init_consistent_dma_size(SZ_4M);
  }
  
  /*
@@@ -240,7 -242,7 +243,7 @@@ static struct resource gpio_resources[
                .end   = IRQ_U300_GPIO_PORT2,
                .flags = IORESOURCE_IRQ,
        },
 -#ifdef U300_COH901571_3
 +#if defined(CONFIG_MACH_U300_BS365) || defined(CONFIG_MACH_U300_BS335)
        {
                .name  = "gpio3",
                .start = IRQ_U300_GPIO_PORT3,
                .end   = IRQ_U300_GPIO_PORT4,
                .flags = IORESOURCE_IRQ,
        },
 +#endif
  #ifdef CONFIG_MACH_U300_BS335
        {
                .name  = "gpio5",
                .flags = IORESOURCE_IRQ,
        },
  #endif /* CONFIG_MACH_U300_BS335 */
 -#endif /* U300_COH901571_3 */
  };
  
  static struct resource keypad_resources[] = {
@@@ -1557,35 -1559,11 +1560,35 @@@ static struct platform_device i2c1_devi
        .resource = i2c1_resources,
  };
  
 +/*
 + * The different variants have a few different versions of the
 + * GPIO block, with different number of ports.
 + */
 +static struct u300_gpio_platform u300_gpio_plat = {
 +#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
 +      .variant = U300_GPIO_COH901335,
 +      .ports = 3,
 +#endif
 +#ifdef CONFIG_MACH_U300_BS335
 +      .variant = U300_GPIO_COH901571_3_BS335,
 +      .ports = 7,
 +#endif
 +#ifdef CONFIG_MACH_U300_BS365
 +      .variant = U300_GPIO_COH901571_3_BS365,
 +      .ports = 5,
 +#endif
 +      .gpio_base = 0,
 +      .gpio_irq_base = IRQ_U300_GPIO_BASE,
 +};
 +
  static struct platform_device gpio_device = {
        .name = "u300-gpio",
        .id = -1,
        .num_resources = ARRAY_SIZE(gpio_resources),
        .resource = gpio_resources,
 +      .dev = {
 +              .platform_data = &u300_gpio_plat,
 +      },
  };
  
  static struct platform_device keypad_device = {
@@@ -1691,7 -1669,7 +1694,7 @@@ void __init u300_init_irq(void
        BUG_ON(IS_ERR(clk));
        clk_enable(clk);
  
 -      for (i = 0; i < NR_IRQS; i++)
 +      for (i = 0; i < U300_VIC_IRQS_END; i++)
                set_bit(i, (unsigned long *) &mask[0]);
        vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], mask[0]);
        vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], mask[1]);
@@@ -37,7 -37,6 +37,7 @@@
  #include <plat/i2c.h>
  #include <plat/ste_dma40.h>
  #include <plat/pincfg.h>
 +#include <plat/gpio-nomadik.h>
  
  #include <mach/hardware.h>
  #include <mach/setup.h>
@@@ -646,7 -645,7 +646,7 @@@ static void __init mop500_init_machine(
  
  MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
        /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
-       .boot_params    = 0x100,
+       .atag_offset    = 0x100,
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
  MACHINE_END
  
  MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
-       .boot_params    = 0x100,
+       .atag_offset    = 0x100,
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        .timer          = &ux500_timer,
  MACHINE_END
  
  MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
-       .boot_params    = 0x100,
+       .atag_offset    = 0x100,
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
@@@ -8,6 -8,7 +8,6 @@@
  #include <linux/init.h>
  #include <linux/platform_device.h>
  #include <linux/amba/bus.h>
 -#include <linux/gpio.h>
  #include <linux/irq.h>
  #include <linux/i2c.h>
  
@@@ -16,7 -17,6 +16,7 @@@
  
  #include <plat/pincfg.h>
  #include <plat/i2c.h>
 +#include <plat/gpio-nomadik.h>
  
  #include <mach/hardware.h>
  #include <mach/devices.h>
@@@ -118,7 -118,7 +118,7 @@@ static void __init u5500_init_machine(v
  }
  
  MACHINE_START(U5500, "ST-Ericsson U5500 Platform")
-       .boot_params    = 0x00000100,
+       .atag_offset    = 0x100,
        .map_io         = u5500_map_io,
        .init_irq       = ux500_init_irq,
        .timer          = &ux500_timer,
@@@ -318,10 -318,6 +318,10 @@@ static struct clk v2m_sp804_clk = 
        .rate   = 1000000,
  };
  
 +static struct clk v2m_ref_clk = {
 +      .rate   = 32768,
 +};
 +
  static struct clk dummy_apb_pclk;
  
  static struct clk_lookup v2m_lookups[] = {
        }, {    /* CLCD */
                .dev_id         = "mb:clcd",
                .clk            = &osc1_clk,
 +      }, {    /* SP805 WDT */
 +              .dev_id         = "mb:wdt",
 +              .clk            = &v2m_ref_clk,
        }, {    /* SP804 timers */
                .dev_id         = "sp804",
                .con_id         = "v2m-timer0",
@@@ -443,7 -436,7 +443,7 @@@ static void __init v2m_init(void
  }
  
  MACHINE_START(VEXPRESS, "ARM-Versatile Express")
-       .boot_params    = PLAT_PHYS_OFFSET + 0x00000100,
+       .atag_offset    = 0x100,
        .map_io         = v2m_map_io,
        .init_early     = v2m_init_early,
        .init_irq       = v2m_init_irq,
  #include <linux/device.h>
  #include <linux/dma-mapping.h>
  #include <linux/highmem.h>
+ #include <linux/slab.h>
  
  #include <asm/memory.h>
  #include <asm/highmem.h>
  #include <asm/cacheflush.h>
  #include <asm/tlbflush.h>
  #include <asm/sizes.h>
+ #include <asm/mach/arch.h>
  
  #include "mm.h"
  
@@@ -117,26 -119,37 +119,37 @@@ static void __dma_free_buffer(struct pa
  }
  
  #ifdef CONFIG_MMU
- /* Sanity check size */
- #if (CONSISTENT_DMA_SIZE % SZ_2M)
- #error "CONSISTENT_DMA_SIZE must be multiple of 2MiB"
- #endif
  
- #define CONSISTENT_OFFSET(x)  (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT)
- #define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PGDIR_SHIFT)
- #define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PGDIR_SHIFT)
+ #define CONSISTENT_OFFSET(x)  (((unsigned long)(x) - consistent_base) >> PAGE_SHIFT)
+ #define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - consistent_base) >> PGDIR_SHIFT)
  
  /*
   * These are the page tables (2MB each) covering uncached, DMA consistent allocations
   */
- static pte_t *consistent_pte[NUM_CONSISTENT_PTES];
+ static pte_t **consistent_pte;
+ #define DEFAULT_CONSISTENT_DMA_SIZE SZ_2M
+ unsigned long consistent_base = CONSISTENT_END - DEFAULT_CONSISTENT_DMA_SIZE;
+ void __init init_consistent_dma_size(unsigned long size)
+ {
+       unsigned long base = CONSISTENT_END - ALIGN(size, SZ_2M);
+       BUG_ON(consistent_pte); /* Check we're called before DMA region init */
+       BUG_ON(base < VMALLOC_END);
+       /* Grow region to accommodate specified size  */
+       if (base < consistent_base)
+               consistent_base = base;
+ }
  
  #include "vmregion.h"
  
  static struct arm_vmregion_head consistent_head = {
        .vm_lock        = __SPIN_LOCK_UNLOCKED(&consistent_head.vm_lock),
        .vm_list        = LIST_HEAD_INIT(consistent_head.vm_list),
-       .vm_start       = CONSISTENT_BASE,
        .vm_end         = CONSISTENT_END,
  };
  
@@@ -155,7 -168,17 +168,17 @@@ static int __init consistent_init(void
        pmd_t *pmd;
        pte_t *pte;
        int i = 0;
-       u32 base = CONSISTENT_BASE;
+       unsigned long base = consistent_base;
+       unsigned long num_ptes = (CONSISTENT_END - base) >> PGDIR_SHIFT;
+       consistent_pte = kmalloc(num_ptes * sizeof(pte_t), GFP_KERNEL);
+       if (!consistent_pte) {
+               pr_err("%s: no memory\n", __func__);
+               return -ENOMEM;
+       }
+       pr_debug("DMA memory: 0x%08lx - 0x%08lx:\n", base, CONSISTENT_END);
+       consistent_head.vm_start = base;
  
        do {
                pgd = pgd_offset(&init_mm, base);
@@@ -198,7 -221,7 +221,7 @@@ __dma_alloc_remap(struct page *page, si
        size_t align;
        int bit;
  
-       if (!consistent_pte[0]) {
+       if (!consistent_pte) {
                printk(KERN_ERR "%s: not initialised\n", __func__);
                dump_stack();
                return NULL;
@@@ -324,8 -347,6 +347,8 @@@ __dma_alloc(struct device *dev, size_t 
  
        if (addr)
                *handle = pfn_to_dma(dev, page_to_pfn(page));
 +      else
 +              __dma_free_buffer(page, size);
  
        return addr;
  }
diff --combined arch/arm/mm/init.c
@@@ -298,7 -298,7 +298,7 @@@ static void __init arm_bootmem_free(uns
  #ifdef CONFIG_HAVE_ARCH_PFN_VALID
  int pfn_valid(unsigned long pfn)
  {
 -      return memblock_is_memory(pfn << PAGE_SHIFT);
 +      return memblock_is_memory(__pfn_to_phys(pfn));
  }
  EXPORT_SYMBOL(pfn_valid);
  #endif
@@@ -653,9 -653,6 +653,6 @@@ void __init mem_init(void
                        "    ITCM    : 0x%08lx - 0x%08lx   (%4ld kB)\n"
  #endif
                        "    fixmap  : 0x%08lx - 0x%08lx   (%4ld kB)\n"
- #ifdef CONFIG_MMU
-                       "    DMA     : 0x%08lx - 0x%08lx   (%4ld MB)\n"
- #endif
                        "    vmalloc : 0x%08lx - 0x%08lx   (%4ld MB)\n"
                        "    lowmem  : 0x%08lx - 0x%08lx   (%4ld MB)\n"
  #ifdef CONFIG_HIGHMEM
                        MLK(ITCM_OFFSET, (unsigned long) itcm_end),
  #endif
                        MLK(FIXADDR_START, FIXADDR_TOP),
- #ifdef CONFIG_MMU
-                       MLM(CONSISTENT_BASE, CONSISTENT_END),
- #endif
                        MLM(VMALLOC_START, VMALLOC_END),
                        MLM(PAGE_OFFSET, (unsigned long)high_memory),
  #ifdef CONFIG_HIGHMEM
         * be detected at build time already.
         */
  #ifdef CONFIG_MMU
-       BUILD_BUG_ON(VMALLOC_END                        > CONSISTENT_BASE);
-       BUG_ON(VMALLOC_END                              > CONSISTENT_BASE);
        BUILD_BUG_ON(TASK_SIZE                          > MODULES_VADDR);
        BUG_ON(TASK_SIZE                                > MODULES_VADDR);
  #endif