]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 24 Mar 2012 00:30:49 +0000 (17:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 24 Mar 2012 00:30:49 +0000 (17:30 -0700)
Pull #1 ARM updates from Russell King:
 "This one covers stuff which Arnd is waiting for me to push, as this is
  shared between both our trees and probably other trees elsewhere.

  Essentially, this contains:
   - AMBA primecell device initializer updates - mostly shrinking the
     size of the device declarations in platform code to something more
     reasonable.
   - Getting rid of the NO_IRQ crap from AMBA primecell stuff.
   - Nicolas' idle cleanups.  This in combination with the restart
     cleanups from the last merge window results in a great many
     mach/system.h files being deleted."

Yay: ~80 files, ~2000 lines deleted.

* 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm: (60 commits)
  ARM: remove disable_fiq and arch_ret_to_user macros
  ARM: make entry-macro.S depend on !MULTI_IRQ_HANDLER
  ARM: rpc: make default fiq handler run-time installed
  ARM: make arch_ret_to_user macro optional
  ARM: amba: samsung: use common amba device initializers
  ARM: amba: spear: use common amba device initializers
  ARM: amba: nomadik: use common amba device initializers
  ARM: amba: u300: use common amba device initializers
  ARM: amba: lpc32xx: use common amba device initializers
  ARM: amba: netx: use common amba device initializers
  ARM: amba: bcmring: use common amba device initializers
  ARM: amba: ep93xx: use common amba device initializers
  ARM: amba: omap2: use common amba device initializers
  ARM: amba: integrator: use common amba device initializers
  ARM: amba: realview: get rid of private platform amba_device initializer
  ARM: amba: versatile: get rid of private platform amba_device initializer
  ARM: amba: vexpress: get rid of private platform amba_device initializer
  ARM: amba: provide common initializers for static amba devices
  ARM: amba: make use of -1 IRQs warn
  ARM: amba: u300: get rid of NO_IRQ initializers
  ...

12 files changed:
1  2 
arch/arm/Kconfig
arch/arm/kernel/process.c
arch/arm/mach-ep93xx/core.c
arch/arm/mach-exynos/common.c
arch/arm/mach-imx/mm-imx3.c
arch/arm/mach-imx/mm-imx5.c
arch/arm/mach-omap2/pm24xx.c
arch/arm/mach-spear3xx/spear300.c
arch/arm/mach-u300/core.c
arch/arm/mach-versatile/core.c
drivers/mmc/host/mmci.c
drivers/of/platform.c

diff --combined arch/arm/Kconfig
index dfb0312f4e73024f14eb0181bccf9e40870cbd3a,7d809b7e0504eb345f1dfe355bc589db6cfd3ae3..87693e631129d5acbd9811d3de33637ecfc6211a
@@@ -186,6 -186,9 +186,9 @@@ config GENERIC_ISA_DM
  config FIQ
        bool
  
+ config NEED_RET_TO_USER
+       bool
  config ARCH_MTD_XIP
        bool
  
@@@ -479,6 -482,7 +482,7 @@@ config ARCH_IOP13X
        select ARCH_SUPPORTS_MSI
        select VMSPLIT_1G
        select NEED_MACH_MEMORY_H
+       select NEED_RET_TO_USER
        help
          Support for Intel's IOP13XX (XScale) family of processors.
  
@@@ -486,6 -490,7 +490,7 @@@ config ARCH_IOP32
        bool "IOP32x-based"
        depends on MMU
        select CPU_XSCALE
+       select NEED_RET_TO_USER
        select PLAT_IOP
        select PCI
        select ARCH_REQUIRE_GPIOLIB
@@@ -497,6 -502,7 +502,7 @@@ config ARCH_IOP33
        bool "IOP33x-based"
        depends on MMU
        select CPU_XSCALE
+       select NEED_RET_TO_USER
        select PLAT_IOP
        select PCI
        select ARCH_REQUIRE_GPIOLIB
@@@ -1280,7 -1286,7 +1286,7 @@@ config ARM_ERRATA_74362
        depends on CPU_V7
        help
          This option enables the workaround for the 743622 Cortex-A9
 -        (r2p0..r2p2) erratum. Under very rare conditions, a faulty
 +        (r2p*) erratum. Under very rare conditions, a faulty
          optimisation in the Cortex-A9 Store Buffer may lead to data
          corruption. This workaround sets a specific bit in the diagnostic
          register of the Cortex-A9 which disables the Store Buffer
index 219e4efee1a6b64d17855ada4ce30db9c35175cd,008e7ce766a758be5c76204be2399095485d6eea..d3eca4524533ccd0b6f36d19cee44957b9cf938b
@@@ -61,8 -61,6 +61,6 @@@ extern void setup_mm_for_reboot(void)
  
  static volatile int hlt_counter;
  
- #include <mach/system.h>
  void disable_hlt(void)
  {
        hlt_counter++;
@@@ -181,13 -179,17 +179,17 @@@ void cpu_idle_wait(void
  EXPORT_SYMBOL_GPL(cpu_idle_wait);
  
  /*
-  * This is our default idle handler.  We need to disable
-  * interrupts here to ensure we don't miss a wakeup call.
+  * This is our default idle handler.
   */
+ void (*arm_pm_idle)(void);
  static void default_idle(void)
  {
-       if (!need_resched())
-               arch_idle();
+       if (arm_pm_idle)
+               arm_pm_idle();
+       else
+               cpu_do_idle();
        local_irq_enable();
  }
  
@@@ -215,6 -217,10 +217,10 @@@ void cpu_idle(void
                                cpu_die();
  #endif
  
+                       /*
+                        * We need to disable interrupts here
+                        * to ensure we don't miss a wakeup call.
+                        */
                        local_irq_disable();
  #ifdef CONFIG_PL310_ERRATA_769419
                        wmb();
                        if (hlt_counter) {
                                local_irq_enable();
                                cpu_relax();
-                       } else {
+                       } else if (!need_resched()) {
                                stop_critical_timings();
                                if (cpuidle_idle_call())
                                        pm_idle();
                                start_critical_timings();
                                /*
-                                * This will eventually be removed - pm_idle
-                                * functions should always return with IRQs
-                                * enabled.
+                                * pm_idle functions must always
+                                * return with IRQs enabled.
                                 */
                                WARN_ON(irqs_disabled());
+                       } else
                                local_irq_enable();
-                       }
                }
                leds_event(led_idle_end);
                rcu_idle_exit();
                tick_nohz_idle_exit();
 -              preempt_enable_no_resched();
 -              schedule();
 -              preempt_disable();
 +              schedule_preempt_disabled();
        }
  }
  
@@@ -533,7 -540,8 +538,7 @@@ int vectors_user_mapping(void
        struct mm_struct *mm = current->mm;
        return install_special_mapping(mm, 0xffff0000, PAGE_SIZE,
                                       VM_READ | VM_EXEC |
 -                                     VM_MAYREAD | VM_MAYEXEC |
 -                                     VM_ALWAYSDUMP | VM_RESERVED,
 +                                     VM_MAYREAD | VM_MAYEXEC | VM_RESERVED,
                                       NULL);
  }
  
index b5c1dae8327fd87ccf945913a185397142135ca5,903edb02fe4f54c2c50ade7248f5e676f7675d7b..41f0d680c5e19386db9da2a980eadf438e6ee8bd
@@@ -279,48 -279,14 +279,14 @@@ static struct amba_pl010_data ep93xx_ua
        .set_mctrl      = ep93xx_uart_set_mctrl,
  };
  
- static struct amba_device uart1_device = {
-       .dev            = {
-               .init_name      = "apb:uart1",
-               .platform_data  = &ep93xx_uart_data,
-       },
-       .res            = {
-               .start  = EP93XX_UART1_PHYS_BASE,
-               .end    = EP93XX_UART1_PHYS_BASE + 0x0fff,
-               .flags  = IORESOURCE_MEM,
-       },
-       .irq            = { IRQ_EP93XX_UART1, NO_IRQ },
-       .periphid       = 0x00041010,
- };
- static struct amba_device uart2_device = {
-       .dev            = {
-               .init_name      = "apb:uart2",
-               .platform_data  = &ep93xx_uart_data,
-       },
-       .res            = {
-               .start  = EP93XX_UART2_PHYS_BASE,
-               .end    = EP93XX_UART2_PHYS_BASE + 0x0fff,
-               .flags  = IORESOURCE_MEM,
-       },
-       .irq            = { IRQ_EP93XX_UART2, NO_IRQ },
-       .periphid       = 0x00041010,
- };
+ static AMBA_APB_DEVICE(uart1, "apb:uart1", 0x00041010, EP93XX_UART1_PHYS_BASE,
+       { IRQ_EP93XX_UART1 }, &ep93xx_uart_data);
  
- static struct amba_device uart3_device = {
-       .dev            = {
-               .init_name      = "apb:uart3",
-               .platform_data  = &ep93xx_uart_data,
-       },
-       .res            = {
-               .start  = EP93XX_UART3_PHYS_BASE,
-               .end    = EP93XX_UART3_PHYS_BASE + 0x0fff,
-               .flags  = IORESOURCE_MEM,
-       },
-       .irq            = { IRQ_EP93XX_UART3, NO_IRQ },
-       .periphid       = 0x00041010,
- };
+ static AMBA_APB_DEVICE(uart2, "apb:uart2", 0x00041010, EP93XX_UART2_PHYS_BASE,
+       { IRQ_EP93XX_UART2 }, &ep93xx_uart_data);
  
+ static AMBA_APB_DEVICE(uart3, "apb:uart3", 0x00041010, EP93XX_UART3_PHYS_BASE,
+       { IRQ_EP93XX_UART3 }, &ep93xx_uart_data);
  
  static struct resource ep93xx_rtc_resource[] = {
        {
@@@ -817,12 -783,23 +783,12 @@@ void __init ep93xx_register_i2s(void
  #define EP93XX_I2SCLKDIV_MASK         (EP93XX_SYSCON_I2SCLKDIV_ORIDE | \
                                         EP93XX_SYSCON_I2SCLKDIV_SPOL)
  
 -int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config)
 +int ep93xx_i2s_acquire(void)
  {
        unsigned val;
  
 -      /* Sanity check */
 -      if (i2s_pins & ~EP93XX_SYSCON_DEVCFG_I2S_MASK)
 -              return -EINVAL;
 -      if (i2s_config & ~EP93XX_I2SCLKDIV_MASK)
 -              return -EINVAL;
 -
 -      /* Must have only one of I2SONSSP/I2SONAC97 set */
 -      if ((i2s_pins & EP93XX_SYSCON_DEVCFG_I2SONSSP) ==
 -          (i2s_pins & EP93XX_SYSCON_DEVCFG_I2SONAC97))
 -              return -EINVAL;
 -
 -      ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_I2S_MASK);
 -      ep93xx_devcfg_set_bits(i2s_pins);
 +      ep93xx_devcfg_set_clear(EP93XX_SYSCON_DEVCFG_I2SONAC97,
 +                      EP93XX_SYSCON_DEVCFG_I2S_MASK);
  
        /*
         * This is potentially racy with the clock api for i2s_mclk, sclk and 
         */
        val = __raw_readl(EP93XX_SYSCON_I2SCLKDIV);
        val &= ~EP93XX_I2SCLKDIV_MASK;
 -      val |= i2s_config;
 +      val |= EP93XX_SYSCON_I2SCLKDIV_ORIDE | EP93XX_SYSCON_I2SCLKDIV_SPOL;
        ep93xx_syscon_swlocked_write(val, EP93XX_SYSCON_I2SCLKDIV);
  
        return 0;
index 6de298c5d2d324afb9cb6e323d3a5d9701058ac3,031c1e5b3dfe7281bc501bda41956c9093b593ea..93fa2d532e4ad6b1caafff8724e715b40182f7f3
@@@ -201,14 -201,6 +201,6 @@@ static struct map_desc exynos4_iodesc1[
        },
  };
  
- static void exynos_idle(void)
- {
-       if (!need_resched())
-               cpu_do_idle();
-       local_irq_enable();
- }
  void exynos4_restart(char mode, const char *cmd)
  {
        __raw_writel(0x1, S5P_SWRESET);
@@@ -402,7 -394,7 +394,7 @@@ void __init exynos4_init_irq(void
        gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000;
  
        if (!of_have_populated_dt())
 -              gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset);
 +              gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset, NULL);
  #ifdef CONFIG_OF
        else
                of_irq_init(exynos4_dt_irq_match);
@@@ -467,10 -459,6 +459,6 @@@ early_initcall(exynos4_l2x0_cache_init)
  int __init exynos_init(void)
  {
        printk(KERN_INFO "EXYNOS: Initializing architecture\n");
-       /* set idle function */
-       pm_idle = exynos_idle;
        return device_register(&exynos4_dev);
  }
  
index 2530c151b7b3d5aa50a1731c9ceaf1a3cc949ab8,8404ee72555ac4dda154e27d33b9c6f7804afaab..9c9b7f9f43dc9790d10f295ffbab01da323a4014
@@@ -34,31 -34,29 +34,29 @@@ static void imx3_idle(void
  {
        unsigned long reg = 0;
  
-       if (!need_resched())
-               __asm__ __volatile__(
-                       /* disable I and D cache */
-                       "mrc p15, 0, %0, c1, c0, 0\n"
-                       "bic %0, %0, #0x00001000\n"
-                       "bic %0, %0, #0x00000004\n"
-                       "mcr p15, 0, %0, c1, c0, 0\n"
-                       /* invalidate I cache */
-                       "mov %0, #0\n"
-                       "mcr p15, 0, %0, c7, c5, 0\n"
-                       /* clear and invalidate D cache */
-                       "mov %0, #0\n"
-                       "mcr p15, 0, %0, c7, c14, 0\n"
-                       /* WFI */
-                       "mov %0, #0\n"
-                       "mcr p15, 0, %0, c7, c0, 4\n"
-                       "nop\n" "nop\n" "nop\n" "nop\n"
-                       "nop\n" "nop\n" "nop\n"
-                       /* enable I and D cache */
-                       "mrc p15, 0, %0, c1, c0, 0\n"
-                       "orr %0, %0, #0x00001000\n"
-                       "orr %0, %0, #0x00000004\n"
-                       "mcr p15, 0, %0, c1, c0, 0\n"
-                       : "=r" (reg));
-       local_irq_enable();
+       __asm__ __volatile__(
+               /* disable I and D cache */
+               "mrc p15, 0, %0, c1, c0, 0\n"
+               "bic %0, %0, #0x00001000\n"
+               "bic %0, %0, #0x00000004\n"
+               "mcr p15, 0, %0, c1, c0, 0\n"
+               /* invalidate I cache */
+               "mov %0, #0\n"
+               "mcr p15, 0, %0, c7, c5, 0\n"
+               /* clear and invalidate D cache */
+               "mov %0, #0\n"
+               "mcr p15, 0, %0, c7, c14, 0\n"
+               /* WFI */
+               "mov %0, #0\n"
+               "mcr p15, 0, %0, c7, c0, 4\n"
+               "nop\n" "nop\n" "nop\n" "nop\n"
+               "nop\n" "nop\n" "nop\n"
+               /* enable I and D cache */
+               "mrc p15, 0, %0, c1, c0, 0\n"
+               "orr %0, %0, #0x00001000\n"
+               "orr %0, %0, #0x00000004\n"
+               "mcr p15, 0, %0, c1, c0, 0\n"
+               : "=r" (reg));
  }
  
  static void __iomem *imx3_ioremap(unsigned long phys_addr, size_t size,
@@@ -134,8 -132,8 +132,8 @@@ void __init imx31_init_early(void
  {
        mxc_set_cpu_type(MXC_CPU_MX31);
        mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR));
-       pm_idle = imx3_idle;
        imx_ioremap = imx3_ioremap;
+       arm_pm_idle = imx3_idle;
  }
  
  void __init mx31_init_irq(void)
@@@ -158,10 -156,6 +156,10 @@@ static struct sdma_platform_data imx31_
        .script_addrs = &imx31_to2_sdma_script,
  };
  
 +static const struct resource imx31_audmux_res[] __initconst = {
 +      DEFINE_RES_MEM(MX31_AUDMUX_BASE_ADDR, SZ_16K),
 +};
 +
  void __init imx31_soc_init(void)
  {
        int to_version = mx31_revision() >> 4;
        }
  
        imx_add_imx_sdma("imx31-sdma", MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata);
 +      platform_device_register_simple("imx31-audmux", 0, imx31_audmux_res,
 +                                      ARRAY_SIZE(imx31_audmux_res));
  }
  #endif /* ifdef CONFIG_SOC_IMX31 */
  
@@@ -203,7 -195,7 +201,7 @@@ void __init imx35_init_early(void
        mxc_set_cpu_type(MXC_CPU_MX35);
        mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR));
        mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR));
-       pm_idle = imx3_idle;
+       arm_pm_idle = imx3_idle;
        imx_ioremap = imx3_ioremap;
  }
  
@@@ -247,10 -239,6 +245,10 @@@ static struct sdma_platform_data imx35_
        .script_addrs = &imx35_to2_sdma_script,
  };
  
 +static const struct resource imx35_audmux_res[] __initconst = {
 +      DEFINE_RES_MEM(MX35_AUDMUX_BASE_ADDR, SZ_16K),
 +};
 +
  void __init imx35_soc_init(void)
  {
        int to_version = mx35_revision() >> 4;
        }
  
        imx_add_imx_sdma("imx35-sdma", MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata);
 +      /* i.mx35 has the i.mx31 type audmux */
 +      platform_device_register_simple("imx31-audmux", 0, imx35_audmux_res,
 +                                      ARRAY_SIZE(imx35_audmux_res));
  }
  #endif /* ifdef CONFIG_SOC_IMX35 */
index 90d7880bb372a95a7ae5b0f57f897311215dbaf8,49549a72dc7dbb2de0c8d1e75af06deddbef2a59..dc7c4ed815312a3a9cfda690b87ad646d587da84
@@@ -26,23 -26,17 +26,17 @@@ static struct clk *gpc_dvfs_clk
  
  static void imx5_idle(void)
  {
-       if (!need_resched()) {
-               /* gpc clock is needed for SRPG */
-               if (gpc_dvfs_clk == NULL) {
-                       gpc_dvfs_clk = clk_get(NULL, "gpc_dvfs");
-                       if (IS_ERR(gpc_dvfs_clk))
-                               goto err0;
-               }
-               clk_enable(gpc_dvfs_clk);
-               mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
-               if (tzic_enable_wake())
-                       goto err1;
-               cpu_do_idle();
- err1:
-               clk_disable(gpc_dvfs_clk);
+       /* gpc clock is needed for SRPG */
+       if (gpc_dvfs_clk == NULL) {
+               gpc_dvfs_clk = clk_get(NULL, "gpc_dvfs");
+               if (IS_ERR(gpc_dvfs_clk))
+                       return;
        }
- err0:
-       local_irq_enable();
+       clk_enable(gpc_dvfs_clk);
+       mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
+       if (tzic_enable_wake() != 0)
+               cpu_do_idle();
+       clk_disable(gpc_dvfs_clk);
  }
  
  /*
@@@ -108,7 -102,7 +102,7 @@@ void __init imx51_init_early(void
        mxc_set_cpu_type(MXC_CPU_MX51);
        mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR));
        mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG1_BASE_ADDR));
-       pm_idle = imx5_idle;
+       arm_pm_idle = imx5_idle;
  }
  
  void __init imx53_init_early(void)
@@@ -170,18 -164,6 +164,18 @@@ static struct sdma_platform_data imx53_
        .script_addrs = &imx53_sdma_script,
  };
  
 +static const struct resource imx50_audmux_res[] __initconst = {
 +      DEFINE_RES_MEM(MX50_AUDMUX_BASE_ADDR, SZ_16K),
 +};
 +
 +static const struct resource imx51_audmux_res[] __initconst = {
 +      DEFINE_RES_MEM(MX51_AUDMUX_BASE_ADDR, SZ_16K),
 +};
 +
 +static const struct resource imx53_audmux_res[] __initconst = {
 +      DEFINE_RES_MEM(MX53_AUDMUX_BASE_ADDR, SZ_16K),
 +};
 +
  void __init imx50_soc_init(void)
  {
        /* i.mx50 has the i.mx31 type gpio */
        mxc_register_gpio("imx31-gpio", 3, MX50_GPIO4_BASE_ADDR, SZ_16K, MX50_INT_GPIO4_LOW, MX50_INT_GPIO4_HIGH);
        mxc_register_gpio("imx31-gpio", 4, MX50_GPIO5_BASE_ADDR, SZ_16K, MX50_INT_GPIO5_LOW, MX50_INT_GPIO5_HIGH);
        mxc_register_gpio("imx31-gpio", 5, MX50_GPIO6_BASE_ADDR, SZ_16K, MX50_INT_GPIO6_LOW, MX50_INT_GPIO6_HIGH);
 +
 +      /* i.mx50 has the i.mx31 type audmux */
 +      platform_device_register_simple("imx31-audmux", 0, imx50_audmux_res,
 +                                      ARRAY_SIZE(imx50_audmux_res));
  }
  
  void __init imx51_soc_init(void)
  
        /* i.mx51 has the i.mx35 type sdma */
        imx_add_imx_sdma("imx35-sdma", MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata);
 +      /* i.mx51 has the i.mx31 type audmux */
 +      platform_device_register_simple("imx31-audmux", 0, imx51_audmux_res,
 +                                      ARRAY_SIZE(imx51_audmux_res));
  }
  
  void __init imx53_soc_init(void)
  
        /* i.mx53 has the i.mx35 type sdma */
        imx_add_imx_sdma("imx35-sdma", MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata);
 +      /* i.mx53 has the i.mx31 type audmux */
 +      platform_device_register_simple("imx31-audmux", 0, imx53_audmux_res,
 +                                      ARRAY_SIZE(imx53_audmux_res));
  }
index 23de98d0384151b76274f67a99a10a005d4b3541,1f736222a629c50f46cbcace5da6e986db631489..a4eb5c280435701d571b25a2b5f95c2d7f2b6fec
@@@ -82,7 -82,13 +82,7 @@@ static int omap2_fclks_active(void
        f1 = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
        f2 = omap2_cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2);
  
 -      /* Ignore UART clocks.  These are handled by UART core (serial.c) */
 -      f1 &= ~(OMAP24XX_EN_UART1_MASK | OMAP24XX_EN_UART2_MASK);
 -      f2 &= ~OMAP24XX_EN_UART3_MASK;
 -
 -      if (f1 | f2)
 -              return 1;
 -      return 0;
 +      return (f1 | f2) ? 1 : 0;
  }
  
  static void omap2_enter_full_retention(void)
@@@ -226,7 -232,6 +226,6 @@@ static int omap2_can_sleep(void
  
  static void omap2_pm_idle(void)
  {
-       local_irq_disable();
        local_fiq_disable();
  
        if (!omap2_can_sleep()) {
  
  out:
        local_fiq_enable();
-       local_irq_enable();
  }
  
  #ifdef CONFIG_SUSPEND
@@@ -462,7 -466,7 +460,7 @@@ static int __init omap2_pm_init(void
        }
  
        suspend_set_ops(&omap_pm_ops);
-       pm_idle = omap2_pm_idle;
+       arm_pm_idle = omap2_pm_idle;
  
        return 0;
  }
index 4f7f5182dd4dab838fae9237e75ade89e17cc90a,9da50e281e987a0e96bf9579aecf702baaf8103d..f7db66812abbbfff904a5776828d18c0b2991606
@@@ -430,18 -430,8 +430,8 @@@ static struct pl061_platform_data gpio1
        .irq_base       = SPEAR300_GPIO1_INT_BASE,
  };
  
- struct amba_device spear300_gpio1_device = {
-       .dev = {
-               .init_name = "gpio1",
-               .platform_data = &gpio1_plat_data,
-       },
-       .res = {
-               .start = SPEAR300_GPIO_BASE,
-               .end = SPEAR300_GPIO_BASE + SZ_4K - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       .irq = {SPEAR300_VIRQ_GPIO1, NO_IRQ},
- };
+ AMBA_APB_DEVICE(spear300_gpio1, "gpio1", 0, SPEAR300_GPIO_BASE,
+       {SPEAR300_VIRQ_GPIO1}, &gpio1_plat_data);
  
  /* spear300 routines */
  void __init spear300_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
        if (pmx_driver.base) {
                ret = pmx_register(&pmx_driver);
                if (ret)
 -                      printk(KERN_ERR "padmux: registeration failed. err no"
 +                      printk(KERN_ERR "padmux: registration failed. err no"
                                        ": %d\n", ret);
                /* Free Mapping, device selection already done */
                iounmap(pmx_driver.base);
index a7b3f36e2262281b30fa4d61e7f6a5e4beb0ffc5,b9865605da094c2728f79f6620fe3107f6d44c9f..b911590c8ae772f940214301c4b8e60c7d2f9f27
@@@ -26,8 -26,7 +26,8 @@@
  #include <linux/mtd/nand.h>
  #include <linux/mtd/fsmc.h>
  #include <linux/pinctrl/machine.h>
 -#include <linux/pinctrl/pinmux.h>
 +#include <linux/pinctrl/consumer.h>
 +#include <linux/pinctrl/pinconf-generic.h>
  #include <linux/dma-mapping.h>
  
  #include <asm/types.h>
@@@ -95,19 -94,9 +95,9 @@@ static struct amba_pl011_data uart0_pla
  #endif
  };
  
- static struct amba_device uart0_device = {
-       .dev = {
-               .coherent_dma_mask = ~0,
-               .init_name = "uart0", /* Slow device at 0x3000 offset */
-               .platform_data = &uart0_plat_data,
-       },
-       .res = {
-               .start = U300_UART0_BASE,
-               .end   = U300_UART0_BASE + SZ_4K - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       .irq = { IRQ_U300_UART0, NO_IRQ },
- };
+ /* Slow device at 0x3000 offset */
+ static AMBA_APB_DEVICE(uart0, "uart0", 0, U300_UART0_BASE,
+       { IRQ_U300_UART0 }, &uart0_plat_data);
  
  /* The U335 have an additional UART1 on the APP CPU */
  #ifdef CONFIG_MACH_U300_BS335
@@@ -119,71 -108,28 +109,28 @@@ static struct amba_pl011_data uart1_pla
  #endif
  };
  
- static struct amba_device uart1_device = {
-       .dev = {
-               .coherent_dma_mask = ~0,
-               .init_name = "uart1", /* Fast device at 0x7000 offset */
-               .platform_data = &uart1_plat_data,
-       },
-       .res = {
-               .start = U300_UART1_BASE,
-               .end   = U300_UART1_BASE + SZ_4K - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       .irq = { IRQ_U300_UART1, NO_IRQ },
- };
+ /* Fast device at 0x7000 offset */
+ static AMBA_APB_DEVICE(uart1, "uart1", 0, U300_UART1_BASE,
+       { IRQ_U300_UART1 }, &uart1_plat_data);
  #endif
  
- static struct amba_device pl172_device = {
-       .dev = {
-               .init_name = "pl172", /* AHB device at 0x4000 offset */
-               .platform_data = NULL,
-       },
-       .res = {
-               .start = U300_EMIF_CFG_BASE,
-               .end   = U300_EMIF_CFG_BASE + SZ_4K - 1,
-               .flags = IORESOURCE_MEM,
-       },
- };
+ /* AHB device at 0x4000 offset */
+ static AMBA_APB_DEVICE(pl172, "pl172", 0, U300_EMIF_CFG_BASE, { }, NULL);
  
  
  /*
   * Everything within this next ifdef deals with external devices connected to
   * the APP SPI bus.
   */
- static struct amba_device pl022_device = {
-       .dev = {
-               .coherent_dma_mask = ~0,
-               .init_name = "pl022", /* Fast device at 0x6000 offset */
-       },
-       .res = {
-               .start = U300_SPI_BASE,
-               .end   = U300_SPI_BASE + SZ_4K - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       .irq = {IRQ_U300_SPI, NO_IRQ },
-       /*
-        * This device has a DMA channel but the Linux driver does not use
-        * it currently.
-        */
- };
+ /* Fast device at 0x6000 offset */
+ static AMBA_APB_DEVICE(pl022, "pl022", 0, U300_SPI_BASE,
+       { IRQ_U300_SPI }, NULL);
  
- static struct amba_device mmcsd_device = {
-       .dev = {
-               .init_name = "mmci", /* Fast device at 0x1000 offset */
-               .platform_data = NULL, /* Added later */
-       },
-       .res = {
-               .start = U300_MMCSD_BASE,
-               .end   = U300_MMCSD_BASE + SZ_4K - 1,
-               .flags = IORESOURCE_MEM,
-       },
-       .irq = {IRQ_U300_MMCSD_MCIINTR0, IRQ_U300_MMCSD_MCIINTR1 },
-       /*
-        * This device has a DMA channel but the Linux driver does not use
-        * it currently.
-        */
- };
+ /* Fast device at 0x1000 offset */
+ #define U300_MMCSD_IRQS       { IRQ_U300_MMCSD_MCIINTR0, IRQ_U300_MMCSD_MCIINTR1 }
+ static AMBA_APB_DEVICE(mmcsd, "mmci", 0, U300_MMCSD_BASE,
+       U300_MMCSD_IRQS, NULL);
  
  /*
   * The order of device declaration may be important, since some devices
@@@ -1478,7 -1424,7 +1425,7 @@@ static struct coh901318_platform coh901
        .max_channels = U300_DMA_CHANNELS,
  };
  
 -static struct resource pinmux_resources[] = {
 +static struct resource pinctrl_resources[] = {
        {
                .start = U300_SYSCON_BASE,
                .end   = U300_SYSCON_BASE + SZ_4K - 1,
@@@ -1507,13 -1453,6 +1454,13 @@@ static struct platform_device i2c1_devi
        .resource = i2c1_resources,
  };
  
 +static struct platform_device pinctrl_device = {
 +      .name = "pinctrl-u300",
 +      .id = -1,
 +      .num_resources = ARRAY_SIZE(pinctrl_resources),
 +      .resource = pinctrl_resources,
 +};
 +
  /*
   * The different variants have a few different versions of the
   * GPIO block, with different number of ports.
@@@ -1533,7 -1472,6 +1480,7 @@@ static struct u300_gpio_platform u300_g
  #endif
        .gpio_base = 0,
        .gpio_irq_base = IRQ_U300_GPIO_BASE,
 +      .pinctrl_device = &pinctrl_device,
  };
  
  static struct platform_device gpio_device = {
@@@ -1606,67 -1544,71 +1553,67 @@@ static struct platform_device dma_devic
        },
  };
  
 -static struct platform_device pinmux_device = {
 -      .name = "pinmux-u300",
 -      .id = -1,
 -      .num_resources = ARRAY_SIZE(pinmux_resources),
 -      .resource = pinmux_resources,
 +static unsigned long pin_pullup_conf[] = {
 +      PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 1),
  };
  
 -/* Pinmux settings */
 -static struct pinmux_map __initdata u300_pinmux_map[] = {
 +static unsigned long pin_highz_conf[] = {
 +      PIN_CONF_PACKED(PIN_CONFIG_BIAS_HIGH_IMPEDANCE, 0),
 +};
 +
 +/* Pin control settings */
 +static struct pinctrl_map __initdata u300_pinmux_map[] = {
        /* anonymous maps for chip power and EMIFs */
 -      PINMUX_MAP_SYS_HOG("POWER", "pinmux-u300", "power"),
 -      PINMUX_MAP_SYS_HOG("EMIF0", "pinmux-u300", "emif0"),
 -      PINMUX_MAP_SYS_HOG("EMIF1", "pinmux-u300", "emif1"),
 +      PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "power"),
 +      PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "emif0"),
 +      PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "emif1"),
        /* per-device maps for MMC/SD, SPI and UART */
 -      PINMUX_MAP("MMCSD", "pinmux-u300", "mmc0", "mmci"),
 -      PINMUX_MAP("SPI", "pinmux-u300", "spi0", "pl022"),
 -      PINMUX_MAP("UART0", "pinmux-u300", "uart0", "uart0"),
 +      PIN_MAP_MUX_GROUP_DEFAULT("mmci",  "pinctrl-u300", NULL, "mmc0"),
 +      PIN_MAP_MUX_GROUP_DEFAULT("pl022", "pinctrl-u300", NULL, "spi0"),
 +      PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-u300", NULL, "uart0"),
 +      /* This pin is used for clock return rather than GPIO */
 +      PIN_MAP_CONFIGS_PIN_DEFAULT("mmci", "pinctrl-u300", "PIO APP GPIO 11",
 +                                  pin_pullup_conf),
 +      /* This pin is used for card detect */
 +      PIN_MAP_CONFIGS_PIN_DEFAULT("mmci", "pinctrl-u300", "PIO MS INS",
 +                                  pin_highz_conf),
  };
  
  struct u300_mux_hog {
 -      const char *name;
        struct device *dev;
 -      struct pinmux *pmx;
 +      struct pinctrl *p;
  };
  
  static struct u300_mux_hog u300_mux_hogs[] = {
        {
 -              .name = "uart0",
                .dev = &uart0_device.dev,
        },
        {
 -              .name = "spi0",
                .dev = &pl022_device.dev,
        },
        {
 -              .name = "mmc0",
                .dev = &mmcsd_device.dev,
        },
  };
  
 -static int __init u300_pinmux_fetch(void)
 +static int __init u300_pinctrl_fetch(void)
  {
        int i;
  
        for (i = 0; i < ARRAY_SIZE(u300_mux_hogs); i++) {
 -              struct pinmux *pmx;
 -              int ret;
 +              struct pinctrl *p;
  
 -              pmx = pinmux_get(u300_mux_hogs[i].dev, NULL);
 -              if (IS_ERR(pmx)) {
 -                      pr_err("u300: could not get pinmux hog %s\n",
 -                             u300_mux_hogs[i].name);
 -                      continue;
 -              }
 -              ret = pinmux_enable(pmx);
 -              if (ret) {
 -                      pr_err("u300: could enable pinmux hog %s\n",
 -                             u300_mux_hogs[i].name);
 +              p = pinctrl_get_select_default(u300_mux_hogs[i].dev);
 +              if (IS_ERR(p)) {
 +                      pr_err("u300: could not get pinmux hog for dev %s\n",
 +                             dev_name(u300_mux_hogs[i].dev));
                        continue;
                }
 -              u300_mux_hogs[i].pmx = pmx;
 +              u300_mux_hogs[i].p = p;
        }
        return 0;
  }
 -subsys_initcall(u300_pinmux_fetch);
 +subsys_initcall(u300_pinctrl_fetch);
  
  /*
   * Notice that AMBA devices are initialized before platform devices.
@@@ -1681,6 -1623,7 +1628,6 @@@ static struct platform_device *platform
        &gpio_device,
        &nand_device,
        &wdog_device,
 -      &pinmux_device,
  };
  
  /*
@@@ -1865,8 -1808,8 +1812,8 @@@ void __init u300_init_devices(void
        u300_assign_physmem();
  
        /* Initialize pinmuxing */
 -      pinmux_register_mappings(u300_pinmux_map,
 -                               ARRAY_SIZE(u300_pinmux_map));
 +      pinctrl_register_mappings(u300_pinmux_map,
 +                                ARRAY_SIZE(u300_pinmux_map));
  
        /* Register subdevices on the I2C buses */
        u300_i2c_register_board_devices();
index 008ce22b9a062d573a84566734b43c70c2947111,4f352e45be0a0516cdd72d5612211097014beb85..0968772aedbe1bfac8f9438c759dfb65bb0c29b0
@@@ -98,11 -98,8 +98,11 @@@ static const struct of_device_id sic_of
  
  void __init versatile_init_irq(void)
  {
 -      vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0, 0);
 -      irq_domain_generate_simple(vic_of_match, VERSATILE_VIC_BASE, IRQ_VIC_START);
 +      struct device_node *np;
 +
 +      np = of_find_matching_node_by_address(NULL, vic_of_match,
 +                                            VERSATILE_VIC_BASE);
 +      __vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0, 0, np);
  
        writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR);
  
@@@ -585,58 -582,58 +585,58 @@@ static struct pl022_ssp_controller ssp0
        .num_chipselect = 1,
  };
  
- #define AACI_IRQ      { IRQ_AACI, NO_IRQ }
+ #define AACI_IRQ      { IRQ_AACI }
  #define MMCI0_IRQ     { IRQ_MMCI0A,IRQ_SIC_MMCI0B }
- #define KMI0_IRQ      { IRQ_SIC_KMI0, NO_IRQ }
- #define KMI1_IRQ      { IRQ_SIC_KMI1, NO_IRQ }
+ #define KMI0_IRQ      { IRQ_SIC_KMI0 }
+ #define KMI1_IRQ      { IRQ_SIC_KMI1 }
  
  /*
   * These devices are connected directly to the multi-layer AHB switch
   */
- #define SMC_IRQ               { NO_IRQ, NO_IRQ }
- #define MPMC_IRQ      { NO_IRQ, NO_IRQ }
- #define CLCD_IRQ      { IRQ_CLCDINT, NO_IRQ }
- #define DMAC_IRQ      { IRQ_DMAINT, NO_IRQ }
+ #define SMC_IRQ               { }
+ #define MPMC_IRQ      { }
+ #define CLCD_IRQ      { IRQ_CLCDINT }
+ #define DMAC_IRQ      { IRQ_DMAINT }
  
  /*
   * These devices are connected via the core APB bridge
   */
- #define SCTL_IRQ      { NO_IRQ, NO_IRQ }
- #define WATCHDOG_IRQ  { IRQ_WDOGINT, NO_IRQ }
- #define GPIO0_IRQ     { IRQ_GPIOINT0, NO_IRQ }
- #define GPIO1_IRQ     { IRQ_GPIOINT1, NO_IRQ }
- #define RTC_IRQ               { IRQ_RTCINT, NO_IRQ }
+ #define SCTL_IRQ      { }
+ #define WATCHDOG_IRQ  { IRQ_WDOGINT }
+ #define GPIO0_IRQ     { IRQ_GPIOINT0 }
+ #define GPIO1_IRQ     { IRQ_GPIOINT1 }
+ #define RTC_IRQ               { IRQ_RTCINT }
  
  /*
   * These devices are connected via the DMA APB bridge
   */
- #define SCI_IRQ               { IRQ_SCIINT, NO_IRQ }
- #define UART0_IRQ     { IRQ_UARTINT0, NO_IRQ }
- #define UART1_IRQ     { IRQ_UARTINT1, NO_IRQ }
- #define UART2_IRQ     { IRQ_UARTINT2, NO_IRQ }
- #define SSP_IRQ               { IRQ_SSPINT, NO_IRQ }
+ #define SCI_IRQ               { IRQ_SCIINT }
+ #define UART0_IRQ     { IRQ_UARTINT0 }
+ #define UART1_IRQ     { IRQ_UARTINT1 }
+ #define UART2_IRQ     { IRQ_UARTINT2 }
+ #define SSP_IRQ               { IRQ_SSPINT }
  
  /* FPGA Primecells */
- AMBA_DEVICE(aaci,  "fpga:04", AACI,     NULL);
- AMBA_DEVICE(mmc0,  "fpga:05", MMCI0,    &mmc0_plat_data);
- AMBA_DEVICE(kmi0,  "fpga:06", KMI0,     NULL);
- AMBA_DEVICE(kmi1,  "fpga:07", KMI1,     NULL);
+ APB_DEVICE(aaci,  "fpga:04", AACI,     NULL);
+ APB_DEVICE(mmc0,  "fpga:05", MMCI0,    &mmc0_plat_data);
+ APB_DEVICE(kmi0,  "fpga:06", KMI0,     NULL);
+ APB_DEVICE(kmi1,  "fpga:07", KMI1,     NULL);
  
  /* DevChip Primecells */
- AMBA_DEVICE(smc,   "dev:00",  SMC,      NULL);
- AMBA_DEVICE(mpmc,  "dev:10",  MPMC,     NULL);
- AMBA_DEVICE(clcd,  "dev:20",  CLCD,     &clcd_plat_data);
- AMBA_DEVICE(dmac,  "dev:30",  DMAC,     NULL);
- AMBA_DEVICE(sctl,  "dev:e0",  SCTL,     NULL);
- AMBA_DEVICE(wdog,  "dev:e1",  WATCHDOG, NULL);
- AMBA_DEVICE(gpio0, "dev:e4",  GPIO0,    &gpio0_plat_data);
- AMBA_DEVICE(gpio1, "dev:e5",  GPIO1,    &gpio1_plat_data);
- AMBA_DEVICE(rtc,   "dev:e8",  RTC,      NULL);
- AMBA_DEVICE(sci0,  "dev:f0",  SCI,      NULL);
- AMBA_DEVICE(uart0, "dev:f1",  UART0,    NULL);
- AMBA_DEVICE(uart1, "dev:f2",  UART1,    NULL);
- AMBA_DEVICE(uart2, "dev:f3",  UART2,    NULL);
- AMBA_DEVICE(ssp0,  "dev:f4",  SSP,      &ssp0_plat_data);
+ AHB_DEVICE(smc,   "dev:00",  SMC,      NULL);
+ AHB_DEVICE(mpmc,  "dev:10",  MPMC,     NULL);
+ AHB_DEVICE(clcd,  "dev:20",  CLCD,     &clcd_plat_data);
+ AHB_DEVICE(dmac,  "dev:30",  DMAC,     NULL);
+ APB_DEVICE(sctl,  "dev:e0",  SCTL,     NULL);
+ APB_DEVICE(wdog,  "dev:e1",  WATCHDOG, NULL);
+ APB_DEVICE(gpio0, "dev:e4",  GPIO0,    &gpio0_plat_data);
+ APB_DEVICE(gpio1, "dev:e5",  GPIO1,    &gpio1_plat_data);
+ APB_DEVICE(rtc,   "dev:e8",  RTC,      NULL);
+ APB_DEVICE(sci0,  "dev:f0",  SCI,      NULL);
+ APB_DEVICE(uart0, "dev:f1",  UART0,    NULL);
+ APB_DEVICE(uart1, "dev:f2",  UART1,    NULL);
+ APB_DEVICE(uart2, "dev:f3",  UART2,    NULL);
+ APB_DEVICE(ssp0,  "dev:f4",  SSP,      &ssp0_plat_data);
  
  static struct amba_device *amba_devs[] __initdata = {
        &dmac_device,
diff --combined drivers/mmc/host/mmci.c
index 11e589cd8233e5f7438f7240d14c8f7897fbf8d7,304f2f98b68023b175ad71df111c7541d40e5dc0..bdfd05517dd5ae22371e3bf73f4471263ec339a4
@@@ -1271,13 -1271,12 +1271,13 @@@ static int __devinit mmci_probe(struct 
        /*
         * Block size can be up to 2048 bytes, but must be a power of two.
         */
 -      mmc->max_blk_size = 2048;
 +      mmc->max_blk_size = 1 << 11;
  
        /*
 -       * No limit on the number of blocks transferred.
 +       * Limit the number of blocks transferred so that we don't overflow
 +       * the maximum request size.
         */
 -      mmc->max_blk_count = mmc->max_req_size;
 +      mmc->max_blk_count = mmc->max_req_size >> 11;
  
        spin_lock_init(&host->lock);
  
        if (ret)
                goto unmap;
  
-       if (dev->irq[1] == NO_IRQ)
+       if (dev->irq[1] == NO_IRQ || !dev->irq[1])
                host->singleirq = true;
        else {
                ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED,
diff --combined drivers/of/platform.c
index 20fbebd49db348f6c61ed13a038335b748629495,cae9477a6ed374cb64f8a50271b3f68469bb2749..343ad29e211c66768491e325046ff0b58bcb15ec
@@@ -55,7 -55,7 +55,7 @@@ EXPORT_SYMBOL(of_find_device_by_node)
  #include <asm/dcr.h>
  #endif
  
 -#if !defined(CONFIG_SPARC)
 +#ifdef CONFIG_OF_ADDRESS
  /*
   * The following routines scan a subtree and registers a device for
   * each applicable node.
@@@ -253,7 -253,7 +253,7 @@@ static struct amba_device *of_amba_devi
        if (!of_device_is_available(node))
                return NULL;
  
-       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+       dev = amba_device_alloc(NULL, 0, 0);
        if (!dev)
                return NULL;
  
        if (ret)
                goto err_free;
  
-       ret = amba_device_register(dev, &iomem_resource);
+       ret = amba_device_add(dev, &iomem_resource);
        if (ret)
                goto err_free;
  
        return dev;
  
  err_free:
-       kfree(dev);
+       amba_device_put(dev);
        return NULL;
  }
  #else /* CONFIG_ARM_AMBA */
@@@ -462,4 -462,4 +462,4 @@@ int of_platform_populate(struct device_
        of_node_put(root);
        return rc;
  }
 -#endif /* !CONFIG_SPARC */
 +#endif /* CONFIG_OF_ADDRESS */