Merge tag 'cleanup-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 May 2013 18:22:14 +0000 (11:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 May 2013 18:22:14 +0000 (11:22 -0700)
Pull ARM SoC late cleanups from Arnd Bergmann:
 "These are cleanups and smaller changes that either depend on earlier
  feature branches or came in late during the development cycle.  We
  normally try to get all cleanups early, so these are the exceptions:

   - A follow-up on the clocksource reworks, hopefully the last time we
     need to merge clocksource subsystem changes through arm-soc.

     A first set of patches was part of the original 3.10 arm-soc
     cleanup series because of interdependencies with timer drivers now
     moved out of arch/arm.

   - Migrating the SPEAr13xx platform away from using auxdata for DMA
     channel descriptions towards using information in device tree,
     based on the earlier SPEAr multiplatform series

   - A few follow-ups on the Atmel SAMA5 support and other changes for
     Atmel at91 based on the larger at91 reworks.

   - Moving the armada irqchip implementation to drivers/irqchip

   - Several OMAP cleanups following up on the larger series already
     merged in 3.10."

* tag 'cleanup-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (50 commits)
  ARM: OMAP4: change the device names in usb_bind_phy
  ARM: OMAP2+: Fix mismerge for timer.c between ff931c82 and da4a686a
  ARM: SPEAr: conditionalize SMP code
  ARM: arch_timer: Silence debug preempt warnings
  ARM: OMAP: remove unused variable
  serial: amba-pl011: fix !CONFIG_DMA_ENGINE case
  ata: arasan: remove the need for platform_data
  ARM: at91/sama5d34ek.dts: remove not needed compatibility string
  ARM: at91: dts: add MCI DMA support
  ARM: at91: dts: add i2c dma support
  ARM: at91: dts: set #dma-cells to the correct value
  ARM: at91: suspend both memory controllers on at91sam9263
  irqchip: armada-370-xp: slightly cleanup irq controller driver
  irqchip: armada-370-xp: move IRQ handler to avoid forward declaration
  irqchip: move IRQ driver for Armada 370/XP
  ARM: mvebu: move L2 cache initialization in init_early()
  devtree: add binding documentation for sp804
  ARM: integrator-cp: convert use CLKSRC_OF for timer init
  ARM: versatile: use OF init for sp804 timer
  ARM: versatile: add versatile dtbs to dtbs target
  ...

21 files changed:
1  2 
arch/arm/Kconfig
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/at91sam9g45.dtsi
arch/arm/boot/dts/at91sam9n12.dtsi
arch/arm/boot/dts/at91sam9x5.dtsi
arch/arm/boot/dts/spear1340.dtsi
arch/arm/kernel/sched_clock.c
arch/arm/mach-at91/cpuidle.c
arch/arm/mach-at91/setup.c
arch/arm/mach-mvebu/Makefile
arch/arm/mach-mvebu/armada-370-xp.c
arch/arm/mach-omap2/timer.c
arch/arm/mach-shmobile/setup-r8a7740.c
arch/arm/mach-spear/Makefile
arch/arm/mach-vexpress/v2m.c
drivers/clocksource/Kconfig
drivers/clocksource/exynos_mct.c
drivers/irqchip/Makefile
drivers/irqchip/irq-armada-370-xp.c
drivers/tty/serial/amba-pl011.c
include/linux/of.h

diff --combined arch/arm/Kconfig
index 18bef301d6e690ce08f0c33c89ebb49be54a09dc,38b5d5dad8e4cef3daa1160615a834aa86229b62..34ef016626ff401211964897e5c75ec9f012583b
@@@ -15,7 -15,6 +15,7 @@@ config AR
        select GENERIC_IRQ_SHOW
        select GENERIC_PCI_IOMAP
        select GENERIC_SMP_IDLE_THREAD
 +      select GENERIC_IDLE_POLL_SETUP
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
        select HARDIRQS_SW_RESEND
@@@ -59,7 -58,6 +59,7 @@@
        select CLONE_BACKWARDS
        select OLD_SIGSUSPEND3
        select OLD_SIGACTION
 +      select HAVE_CONTEXT_TRACKING
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
@@@ -363,6 -361,37 +363,6 @@@ config ARCH_AT9
          This enables support for systems based on Atmel
          AT91RM9200 and AT91SAM9* processors.
  
 -config ARCH_BCM2835
 -      bool "Broadcom BCM2835 family"
 -      select ARCH_REQUIRE_GPIOLIB
 -      select ARM_AMBA
 -      select ARM_ERRATA_411920
 -      select ARM_TIMER_SP804
 -      select CLKDEV_LOOKUP
 -      select CLKSRC_OF
 -      select COMMON_CLK
 -      select CPU_V6
 -      select GENERIC_CLOCKEVENTS
 -      select MULTI_IRQ_HANDLER
 -      select PINCTRL
 -      select PINCTRL_BCM2835
 -      select SPARSE_IRQ
 -      select USE_OF
 -      help
 -        This enables support for the Broadcom BCM2835 SoC. This SoC is
 -        use in the Raspberry Pi, and Roku 2 devices.
 -
 -config ARCH_CNS3XXX
 -      bool "Cavium Networks CNS3XXX family"
 -      select ARM_GIC
 -      select CPU_V6K
 -      select GENERIC_CLOCKEVENTS
 -      select MIGHT_HAVE_CACHE_L2X0
 -      select MIGHT_HAVE_PCI
 -      select PCI_DOMAINS if PCI
 -      help
 -        Support for Cavium Networks CNS3XXX platform.
 -
  config ARCH_CLPS711X
        bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
        select ARCH_REQUIRE_GPIOLIB
@@@ -381,11 -410,25 +381,11 @@@ config ARCH_GEMIN
        bool "Cortina Systems Gemini"
        select ARCH_REQUIRE_GPIOLIB
        select ARCH_USES_GETTIMEOFFSET
 +      select NEED_MACH_GPIO_H
        select CPU_FA526
        help
          Support for the Cortina Systems Gemini family SoCs
  
 -config ARCH_SIRF
 -      bool "CSR SiRF"
 -      select ARCH_REQUIRE_GPIOLIB
 -      select AUTO_ZRELADDR
 -      select COMMON_CLK
 -      select GENERIC_CLOCKEVENTS
 -      select GENERIC_IRQ_CHIP
 -      select MIGHT_HAVE_CACHE_L2X0
 -      select NO_IOPORT
 -      select PINCTRL
 -      select PINCTRL_SIRF
 -      select USE_OF
 -      help
 -        Support for CSR SiRFprimaII/Marco/Polo platforms
 -
  config ARCH_EBSA110
        bool "EBSA-110"
        select ARCH_USES_GETTIMEOFFSET
@@@ -425,6 -468,21 +425,6 @@@ config ARCH_FOOTBRIDG
          Support for systems based on the DC21285 companion chip
          ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
  
 -config ARCH_MXS
 -      bool "Freescale MXS-based"
 -      select ARCH_REQUIRE_GPIOLIB
 -      select CLKDEV_LOOKUP
 -      select CLKSRC_MMIO
 -      select COMMON_CLK
 -      select GENERIC_CLOCKEVENTS
 -      select HAVE_CLK_PREPARE
 -      select MULTI_IRQ_HANDLER
 -      select PINCTRL
 -      select SPARSE_IRQ
 -      select USE_OF
 -      help
 -        Support for Freescale MXS-based family of processors
 -
  config ARCH_NETX
        bool "Hilscher NetX based"
        select ARM_VIC
        help
          This enables support for systems based on the Hilscher NetX Soc
  
 -config ARCH_H720X
 -      bool "Hynix HMS720x-based"
 -      select ARCH_USES_GETTIMEOFFSET
 -      select CPU_ARM720T
 -      select ISA_DMA_API
 -      help
 -        This enables support for systems based on the Hynix HMS720x
 -
  config ARCH_IOP13XX
        bool "IOP13xx-based"
        depends on MMU
@@@ -483,8 -549,6 +483,8 @@@ config ARCH_IXP4X
        select GENERIC_CLOCKEVENTS
        select MIGHT_HAVE_PCI
        select NEED_MACH_IO_H
 +      select USB_EHCI_BIG_ENDIAN_MMIO
 +      select USB_EHCI_BIG_ENDIAN_DESC
        help
          Support for Intel's IXP4XX (XScale) family of processors.
  
@@@ -498,7 -562,6 +498,7 @@@ config ARCH_DOV
        select PINCTRL_DOVE
        select PLAT_ORION_LEGACY
        select USB_ARCH_HAS_EHCI
 +      select MVEBU_MBUS
        help
          Support for the Marvell Dove SoC 88AP510
  
@@@ -512,7 -575,6 +512,7 @@@ config ARCH_KIRKWOO
        select PINCTRL
        select PINCTRL_KIRKWOOD
        select PLAT_ORION_LEGACY
 +      select MVEBU_MBUS
        help
          Support for the following Marvell Kirkwood series SoCs:
          88F6180, 88F6192 and 88F6281.
@@@ -524,7 -586,6 +524,7 @@@ config ARCH_MV78XX
        select GENERIC_CLOCKEVENTS
        select PCI
        select PLAT_ORION_LEGACY
 +      select MVEBU_MBUS
        help
          Support for the following Marvell MV78xx0 series SoCs:
          MV781x0, MV782x0.
@@@ -537,7 -598,6 +537,7 @@@ config ARCH_ORION5
        select GENERIC_CLOCKEVENTS
        select PCI
        select PLAT_ORION_LEGACY
 +      select MVEBU_MBUS
        help
          Support for the following Marvell Orion 5x series SoCs:
          Orion-1 (5181), Orion-VoIP (5181L), Orion-NAS (5182),
@@@ -601,6 -661,25 +601,6 @@@ config ARCH_LPC32X
        help
          Support for the NXP LPC32XX family of processors
  
 -config ARCH_TEGRA
 -      bool "NVIDIA Tegra"
 -      select ARCH_HAS_CPUFREQ
 -      select ARCH_REQUIRE_GPIOLIB
 -      select CLKDEV_LOOKUP
 -      select CLKSRC_MMIO
 -      select CLKSRC_OF
 -      select COMMON_CLK
 -      select GENERIC_CLOCKEVENTS
 -      select HAVE_CLK
 -      select HAVE_SMP
 -      select MIGHT_HAVE_CACHE_L2X0
 -      select SOC_BUS
 -      select SPARSE_IRQ
 -      select USE_OF
 -      help
 -        This enables support for NVIDIA Tegra based systems (Tegra APX,
 -        Tegra 6xx and Tegra 2 series).
 -
  config ARCH_PXA
        bool "PXA2xx/PXA3xx-based"
        depends on MMU
@@@ -638,8 -717,6 +638,8 @@@ config ARCH_SHMOBIL
        bool "Renesas SH-Mobile / R-Mobile"
        select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
 +      select HAVE_ARM_SCU if SMP
 +      select HAVE_ARM_TWD if LOCAL_TIMERS
        select HAVE_CLK
        select HAVE_MACH_CLKDEV
        select HAVE_SMP
        select MULTI_IRQ_HANDLER
        select NEED_MACH_MEMORY_H
        select NO_IOPORT
 -      select PINCTRL
 +      select PINCTRL if ARCH_WANT_OPTIONAL_GPIOLIB
        select PM_GENERIC_DOMAINS if PM
        select SPARSE_IRQ
        help
@@@ -693,10 -770,10 +693,10 @@@ config ARCH_SA110
  config ARCH_S3C24XX
        bool "Samsung S3C24XX SoCs"
        select ARCH_HAS_CPUFREQ
 +      select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -752,11 -829,11 +752,11 @@@ config ARCH_S5P64X
  
  config ARCH_S5PC100
        bool "Samsung S5PC100"
 +      select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select CPU_V7
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -789,7 -866,6 +789,7 @@@ config ARCH_EXYNO
        select ARCH_HAS_HOLES_MEMORYMODEL
        select ARCH_SPARSEMEM_ENABLE
        select CLKDEV_LOOKUP
 +      select COMMON_CLK
        select CPU_V7
        select GENERIC_CLOCKEVENTS
        select HAVE_CLK
@@@ -832,6 -908,43 +832,6 @@@ config ARCH_U30
        help
          Support for ST-Ericsson U300 series mobile platforms.
  
 -config ARCH_U8500
 -      bool "ST-Ericsson U8500 Series"
 -      depends on MMU
 -      select ARCH_HAS_CPUFREQ
 -      select ARCH_REQUIRE_GPIOLIB
 -      select ARM_AMBA
 -      select CLKDEV_LOOKUP
 -      select CPU_V7
 -      select GENERIC_CLOCKEVENTS
 -      select HAVE_SMP
 -      select MIGHT_HAVE_CACHE_L2X0
 -      select SPARSE_IRQ
 -      help
 -        Support for ST-Ericsson's Ux500 architecture
 -
 -config ARCH_NOMADIK
 -      bool "STMicroelectronics Nomadik"
 -      select ARCH_REQUIRE_GPIOLIB
 -      select ARM_AMBA
 -      select ARM_VIC
 -      select CLKSRC_NOMADIK_MTU
 -      select COMMON_CLK
 -      select CPU_ARM926T
 -      select GENERIC_CLOCKEVENTS
 -      select MIGHT_HAVE_CACHE_L2X0
 -      select USE_OF
 -      select PINCTRL
 -      select PINCTRL_STN8815
 -      select SPARSE_IRQ
 -      help
 -        Support for the Nomadik platform by ST-Ericsson
 -
 -config PLAT_SPEAR_SINGLE
 -      bool "ST SPEAr"
 -      help
 -        Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
 -
  config ARCH_DAVINCI
        bool "TI DaVinci"
        select ARCH_HAS_HOLES_MEMORYMODEL
@@@ -923,8 -1036,6 +923,8 @@@ source "arch/arm/mach-at91/Kconfig
  
  source "arch/arm/mach-bcm/Kconfig"
  
 +source "arch/arm/mach-bcm2835/Kconfig"
 +
  source "arch/arm/mach-clps711x/Kconfig"
  
  source "arch/arm/mach-cns3xxx/Kconfig"
@@@ -939,6 -1050,8 +939,6 @@@ source "arch/arm/mach-footbridge/Kconfi
  
  source "arch/arm/mach-gemini/Kconfig"
  
 -source "arch/arm/mach-h720x/Kconfig"
 -
  source "arch/arm/mach-highbank/Kconfig"
  
  source "arch/arm/mach-integrator/Kconfig"
@@@ -1059,6 -1172,8 +1059,7 @@@ config PLAT_VERSATIL
  config ARM_TIMER_SP804
        bool
        select CLKSRC_MMIO
 -      select HAVE_SCHED_CLOCK
+       select CLKSRC_OF if OF
  
  source arch/arm/mm/Kconfig
  
@@@ -1417,6 -1532,7 +1418,6 @@@ config SM
        depends on GENERIC_CLOCKEVENTS
        depends on HAVE_SMP
        depends on MMU
 -      select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
        select USE_GENERIC_SMP_HELPERS
        help
          This enables support for systems with more than one CPU. If you have
@@@ -1491,14 -1607,6 +1492,14 @@@ config HAVE_ARM_TW
        help
          This options enables support for the ARM timer and watchdog unit
  
 +config MCPM
 +      bool "Multi-Cluster Power Management"
 +      depends on CPU_V7 && SMP
 +      help
 +        This option provides the common power management infrastructure
 +        for (multi-)cluster based systems, such as big.LITTLE based
 +        systems.
 +
  choice
        prompt "Memory split"
        default VMSPLIT_3G
@@@ -1549,6 -1657,7 +1550,6 @@@ config LOCAL_TIMER
        bool "Use local timer interrupts"
        depends on SMP
        default y
 -      select HAVE_ARM_TWD if (!ARCH_MSM_SCORPIONMP && !CLKSRC_EXYNOS_MCT)
        help
          Enable support for local timers on SMP platforms, rather then the
          legacy IPI broadcast method.  Local timers allows the system
@@@ -1562,7 -1671,7 +1563,7 @@@ config ARCH_NR_GPI
        int
        default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
        default 512 if SOC_OMAP5
 -      default 355 if ARCH_U8500
 +      default 392 if ARCH_U8500
        default 352 if ARCH_VT8500
        default 288 if ARCH_SUNXI
        default 264 if MACH_H4700
@@@ -1586,9 -1695,8 +1587,9 @@@ config SCHED_HRTIC
        def_bool HIGH_RES_TIMERS
  
  config THUMB2_KERNEL
 -      bool "Compile the kernel in Thumb-2 mode"
 +      bool "Compile the kernel in Thumb-2 mode" if !CPU_THUMBONLY
        depends on CPU_V7 && !CPU_V6 && !CPU_V6K
 +      default y if CPU_THUMBONLY
        select AEABI
        select ARM_ASM_UNIFIED
        select ARM_UNWIND
@@@ -2054,8 -2162,40 +2055,8 @@@ endmen
  menu "CPU Power Management"
  
  if ARCH_HAS_CPUFREQ
 -
  source "drivers/cpufreq/Kconfig"
  
 -config CPU_FREQ_IMX
 -      tristate "CPUfreq driver for i.MX CPUs"
 -      depends on ARCH_MXC && CPU_FREQ
 -      select CPU_FREQ_TABLE
 -      help
 -        This enables the CPUfreq driver for i.MX CPUs.
 -
 -config CPU_FREQ_SA1100
 -      bool
 -
 -config CPU_FREQ_SA1110
 -      bool
 -
 -config CPU_FREQ_INTEGRATOR
 -      tristate "CPUfreq driver for ARM Integrator CPUs"
 -      depends on ARCH_INTEGRATOR && CPU_FREQ
 -      default y
 -      help
 -        This enables the CPUfreq driver for ARM Integrator CPUs.
 -
 -        For details, take a look at <file:Documentation/cpu-freq>.
 -
 -        If in doubt, say Y.
 -
 -config CPU_FREQ_PXA
 -      bool
 -      depends on CPU_FREQ && ARCH_PXA && PXA25x
 -      default y
 -      select CPU_FREQ_DEFAULT_GOV_USERSPACE
 -      select CPU_FREQ_TABLE
 -
  config CPU_FREQ_S3C
        bool
        help
index e6611eaa288520b5dfee6bed813e5666f715402e,e35b0a7ac77bd64793cd9332868ab63357daf8c2..5f1f4dfd706ece84fe9937c87cd8d178301c053a
@@@ -3,7 -3,6 +3,7 @@@ ifeq ($(CONFIG_OF),y
  # Keep at91 dtb files sorted alphabetically for each SoC
  # rm9200
  dtb-$(CONFIG_ARCH_AT91) += at91rm9200ek.dtb
 +dtb-$(CONFIG_ARCH_AT91) += mpa1600.dtb
  # sam9260
  dtb-$(CONFIG_ARCH_AT91) += animeo_ip.dtb
  dtb-$(CONFIG_ARCH_AT91) += aks-cdu.dtb
@@@ -27,7 -26,6 +27,7 @@@ dtb-$(CONFIG_ARCH_AT91) += pm9g45.dt
  # sam9n12
  dtb-$(CONFIG_ARCH_AT91) += at91sam9n12ek.dtb
  # sam9x5
 +dtb-$(CONFIG_ARCH_AT91) += at91-ariag25.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9g15ek.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9g25ek.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9g35ek.dtb
@@@ -49,11 -47,7 +49,11 @@@ dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510
  dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \
        exynos4210-smdkv310.dtb \
        exynos4210-trats.dtb \
 +      exynos4412-odroidx.dtb \
        exynos4412-smdk4412.dtb \
 +      exynos4412-origen.dtb \
 +      exynos5250-arndale.dtb \
 +      exynos5440-sd5v1.dtb \
        exynos5250-smdk5250.dtb \
        exynos5250-snow.dtb \
        exynos5440-ssdk5440.dtb
@@@ -62,8 -56,7 +62,8 @@@ dtb-$(CONFIG_ARCH_HIGHBANK) += highbank
  dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
        integratorcp.dtb
  dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
 -dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
 +dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
 +      kirkwood-dns320.dtb \
        kirkwood-dns325.dtb \
        kirkwood-dockstar.dtb \
        kirkwood-dreamplug.dtb \
@@@ -77,7 -70,6 +77,7 @@@
        kirkwood-lschlv2.dtb \
        kirkwood-lsxhl.dtb \
        kirkwood-mplcec4.dtb \
 +      kirkwood-netgear_readynas_duo_v2.dtb \
        kirkwood-ns2.dtb \
        kirkwood-ns2lite.dtb \
        kirkwood-ns2max.dtb \
@@@ -100,26 -92,19 +100,26 @@@ dtb-$(CONFIG_ARCH_MXC) += 
        imx25-karo-tx25.dtb \
        imx25-pdk.dtb \
        imx27-apf27.dtb \
 +      imx27-apf27dev.dtb \
        imx27-pdk.dtb \
 +      imx27-phytec-phycore.dtb \
        imx31-bug.dtb \
        imx51-apf51.dtb \
 +      imx51-apf51dev.dtb \
        imx51-babbage.dtb \
        imx53-ard.dtb \
        imx53-evk.dtb \
        imx53-mba53.dtb \
        imx53-qsb.dtb \
        imx53-smd.dtb \
 +      imx6dl-sabreauto.dtb \
 +      imx6dl-sabresd.dtb \
 +      imx6dl-wandboard.dtb \
        imx6q-arm2.dtb \
        imx6q-sabreauto.dtb \
        imx6q-sabrelite.dtb \
 -      imx6q-sabresd.dtb
 +      imx6q-sabresd.dtb \
 +      imx6q-sbc6x.dtb
  dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
        imx23-olinuxino.dtb \
        imx23-stmp378x_devb.dtb \
        imx28-tx28.dtb
  dtb-$(CONFIG_ARCH_NOMADIK) += ste-nomadik-s8815.dtb
  dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
 +      omap3430-sdp.dtb \
        omap3-beagle.dtb \
 +      omap3-devkit8000.dtb \
        omap3-beagle-xm.dtb \
        omap3-evm.dtb \
        omap3-tobi.dtb \
 +      omap3-igep0020.dtb \
 +      omap3-igep0030.dtb \
        omap4-panda.dtb \
        omap4-panda-a4.dtb \
        omap4-panda-es.dtb \
@@@ -160,12 -141,7 +160,12 @@@ dtb-$(CONFIG_ARCH_U8500) += snowball.dt
        ccu9540.dtb
  dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \
        r8a7740-armadillo800eva.dtb \
 +      r8a7778-bockw.dtb \
 +      r8a7779-marzen-reference.dtb \
 +      r8a7790-lager.dtb \
        sh73a0-kzm9g.dtb \
 +      sh73a0-kzm9g-reference.dtb \
 +      r8a73a4-ape6evm.dtb \
        sh7372-mackerel.dtb
  dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
        socfpga_vt.dtb
@@@ -194,6 -170,8 +194,8 @@@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-har
        tegra30-cardhu-a04.dtb \
        tegra114-dalmore.dtb \
        tegra114-pluto.dtb
+ dtb-$(CONFIG_ARCH_VERSATILE) += versatile-ab.dtb \
+       versatile-pb.dtb
  dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \
        vexpress-v2p-ca9.dtb \
        vexpress-v2p-ca15-tc1.dtb \
index f8f7370e86694562d908639e8680e48f9db5b2ac,2b6e30cbc48b0a706f9bb31b51b4ebadae7a12a5..bf18a735c37d8b879a603e711dd25bde7e2980ac
                                compatible = "atmel,at91sam9g45-dma";
                                reg = <0xffffec00 0x200>;
                                interrupts = <21 4 0>;
+                               #dma-cells = <2>;
                        };
  
                        pinctrl@fffff200 {
                                        };
                                };
  
 +                              spi0 {
 +                                      pinctrl_spi0: spi0-0 {
 +                                              atmel,pins =
 +                                                      <1 0 0x1 0x0    /* PB0 periph A SPI0_MISO pin */
 +                                                       1 1 0x1 0x0    /* PB1 periph A SPI0_MOSI pin */
 +                                                       1 2 0x1 0x0>;  /* PB2 periph A SPI0_SPCK pin */
 +                                      };
 +                              };
 +
 +                              spi1 {
 +                                      pinctrl_spi1: spi1-0 {
 +                                              atmel,pins =
 +                                                      <1 14 0x1 0x0   /* PB14 periph A SPI1_MISO pin */
 +                                                       1 15 0x1 0x0   /* PB15 periph A SPI1_MOSI pin */
 +                                                       1 16 0x1 0x0>; /* PB16 periph A SPI1_SPCK pin */
 +                                      };
 +                              };
 +
                                pioA: gpio@fffff200 {
                                        compatible = "atmel,at91rm9200-gpio";
                                        reg = <0xfffff200 0x200>;
                                atmel,adc-drdy-mask = <0x10000>;
                                atmel,adc-status-register = <0x1c>;
                                atmel,adc-trigger-register = <0x08>;
 +                              atmel,adc-res = <8 10>;
 +                              atmel,adc-res-names = "lowres", "highres";
 +                              atmel,adc-use-res = "highres";
  
                                trigger@0 {
                                        trigger-name = "external-rising";
                                compatible = "atmel,hsmci";
                                reg = <0xfff80000 0x600>;
                                interrupts = <11 4 0>;
+                               dmas = <&dma 1 0>;
+                               dma-names = "rxtx";
                                #address-cells = <1>;
                                #size-cells = <0>;
                                status = "disabled";
                                compatible = "atmel,hsmci";
                                reg = <0xfffd0000 0x600>;
                                interrupts = <29 4 0>;
+                               dmas = <&dma 1 13>;
+                               dma-names = "rxtx";
                                #address-cells = <1>;
                                #size-cells = <0>;
                                status = "disabled";
                                compatible = "atmel,at91sam9260-wdt";
                                reg = <0xfffffd40 0x10>;
                                status = "disabled";
 +                      };
 +
 +                      spi0: spi@fffa4000 {
 +                              #address-cells = <1>;
 +                              #size-cells = <0>;
 +                              compatible = "atmel,at91rm9200-spi";
 +                              reg = <0xfffa4000 0x200>;
 +                              interrupts = <14 4 3>;
 +                              pinctrl-names = "default";
 +                              pinctrl-0 = <&pinctrl_spi0>;
 +                              status = "disabled";
 +                      };
 +
 +                      spi1: spi@fffa8000 {
 +                              #address-cells = <1>;
 +                              #size-cells = <0>;
 +                              compatible = "atmel,at91rm9200-spi";
 +                              reg = <0xfffa8000 0x200>;
 +                              interrupts = <15 4 3>;
 +                              pinctrl-names = "default";
 +                              pinctrl-0 = <&pinctrl_spi1>;
 +                              status = "disabled";
                        };
                };
  
index b2961f1ea51b4063d7b4d3ac053586b586dfeed4,b0bd70485f8710b815dfb37f4968c2b6e2a7f5cd..3de8e6dfbcb150baa7251d1803990724d93e4fe2
@@@ -89,6 -89,8 +89,8 @@@
                                compatible = "atmel,hsmci";
                                reg = <0xf0008000 0x600>;
                                interrupts = <12 4 0>;
+                               dmas = <&dma 1 0>;
+                               dma-names = "rxtx";
                                #address-cells = <1>;
                                #size-cells = <0>;
                                status = "disabled";
                                compatible = "atmel,at91sam9g45-dma";
                                reg = <0xffffec00 0x200>;
                                interrupts = <20 4 0>;
+                               #dma-cells = <2>;
                        };
  
                        pinctrl@fffff400 {
                                        };
                                };
  
 +                              spi0 {
 +                                      pinctrl_spi0: spi0-0 {
 +                                              atmel,pins =
 +                                                      <0 11 0x1 0x0   /* PA11 periph A SPI0_MISO pin */
 +                                                       0 12 0x1 0x0   /* PA12 periph A SPI0_MOSI pin */
 +                                                       0 13 0x1 0x0>; /* PA13 periph A SPI0_SPCK pin */
 +                                      };
 +                              };
 +
 +                              spi1 {
 +                                      pinctrl_spi1: spi1-0 {
 +                                              atmel,pins =
 +                                                      <0 21 0x2 0x0   /* PA21 periph B SPI1_MISO pin */
 +                                                       0 22 0x2 0x0   /* PA22 periph B SPI1_MOSI pin */
 +                                                       0 23 0x2 0x0>; /* PA23 periph B SPI1_SPCK pin */
 +                                      };
 +                              };
 +
                                pioA: gpio@fffff400 {
                                        compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
                                        reg = <0xfffff400 0x200>;
                                compatible = "atmel,at91sam9x5-i2c";
                                reg = <0xf8010000 0x100>;
                                interrupts = <9 4 6>;
+                               dmas = <&dma 1 13>,
+                                      <&dma 1 14>;
+                               dma-names = "tx", "rx";
                                #address-cells = <1>;
                                #size-cells = <0>;
                                status = "disabled";
                                compatible = "atmel,at91sam9x5-i2c";
                                reg = <0xf8014000 0x100>;
                                interrupts = <10 4 6>;
+                               dmas = <&dma 1 15>,
+                                      <&dma 1 16>;
+                               dma-names = "tx", "rx";
                                #address-cells = <1>;
                                #size-cells = <0>;
                                status = "disabled";
                        };
 +
 +                      spi0: spi@f0000000 {
 +                              #address-cells = <1>;
 +                              #size-cells = <0>;
 +                              compatible = "atmel,at91rm9200-spi";
 +                              reg = <0xf0000000 0x100>;
 +                              interrupts = <13 4 3>;
 +                              pinctrl-names = "default";
 +                              pinctrl-0 = <&pinctrl_spi0>;
 +                              status = "disabled";
 +                      };
 +
 +                      spi1: spi@f0004000 {
 +                              #address-cells = <1>;
 +                              #size-cells = <0>;
 +                              compatible = "atmel,at91rm9200-spi";
 +                              reg = <0xf0004000 0x100>;
 +                              interrupts = <14 4 3>;
 +                              pinctrl-names = "default";
 +                              pinctrl-0 = <&pinctrl_spi1>;
 +                              status = "disabled";
 +                      };
                };
  
                nand0: nand@40000000 {
index 640b3bbbb706f91ce14dce29af5b2d7d573c5e0d,cbb94732786ca28fb0033adad94677627e61cef8..1145ac330fb7c091647ce7425179402260d7de95
                                compatible = "atmel,at91sam9g45-dma";
                                reg = <0xffffec00 0x200>;
                                interrupts = <20 4 0>;
+                               #dma-cells = <2>;
                        };
  
                        dma1: dma-controller@ffffee00 {
                                compatible = "atmel,at91sam9g45-dma";
                                reg = <0xffffee00 0x200>;
                                interrupts = <21 4 0>;
+                               #dma-cells = <2>;
                        };
  
                        pinctrl@fffff400 {
                                        };
                                };
  
 +                              spi0 {
 +                                      pinctrl_spi0: spi0-0 {
 +                                              atmel,pins =
 +                                                      <0 11 0x1 0x0   /* PA11 periph A SPI0_MISO pin */
 +                                                       0 12 0x1 0x0   /* PA12 periph A SPI0_MOSI pin */
 +                                                       0 13 0x1 0x0>; /* PA13 periph A SPI0_SPCK pin */
 +                                      };
 +                              };
 +
 +                              spi1 {
 +                                      pinctrl_spi1: spi1-0 {
 +                                              atmel,pins =
 +                                                      <0 21 0x2 0x0   /* PA21 periph B SPI1_MISO pin */
 +                                                       0 22 0x2 0x0   /* PA22 periph B SPI1_MOSI pin */
 +                                                       0 23 0x2 0x0>; /* PA23 periph B SPI1_SPCK pin */
 +                                      };
 +                              };
 +
 +                              i2c0 {
 +                                      pinctrl_i2c0: i2c0-0 {
 +                                              atmel,pins =
 +                                                      <0 30 0x1 0x0   /* PA30 periph A I2C0 data */
 +                                                       0 31 0x1 0x0>; /* PA31 periph A I2C0 clock */
 +                                      };
 +                              };
 +
 +                              i2c1 {
 +                                      pinctrl_i2c1: i2c1-0 {
 +                                              atmel,pins =
 +                                                      <2 0 0x3 0x0    /* PC0 periph C I2C1 data */
 +                                                       2 1 0x3 0x0>;  /* PC1 periph C I2C1 clock */
 +                                      };
 +                              };
 +
 +                              i2c2 {
 +                                      pinctrl_i2c2: i2c2-0 {
 +                                              atmel,pins =
 +                                                      <1 4 0x2 0x0    /* PB4 periph B I2C2 data */
 +                                                       1 5 0x2 0x0>;  /* PB5 periph B I2C2 clock */
 +                                      };
 +                              };
 +
 +                              i2c_gpio0 {
 +                                      pinctrl_i2c_gpio0: i2c_gpio0-0 {
 +                                              atmel,pins =
 +                                                      <0 30 0x0 0x2   /* PA30 gpio multidrive I2C0 data */
 +                                                       0 31 0x0 0x2>; /* PA31 gpio multidrive I2C0 clock */
 +                                      };
 +                              };
 +
 +                              i2c_gpio1 {
 +                                      pinctrl_i2c_gpio1: i2c_gpio1-0 {
 +                                              atmel,pins =
 +                                                      <2 0 0x0 0x2    /* PC0 gpio multidrive I2C1 data */
 +                                                       2 1 0x0 0x2>;  /* PC1 gpio multidrive I2C1 clock */
 +                                      };
 +                              };
 +
 +                              i2c_gpio2 {
 +                                      pinctrl_i2c_gpio2: i2c_gpio2-0 {
 +                                              atmel,pins =
 +                                                      <1 4 0x0 0x2    /* PB4 gpio multidrive I2C2 data */
 +                                                       1 5 0x0 0x2>;  /* PB5 gpio multidrive I2C2 clock */
 +                                      };
 +                              };
 +
                                pioA: gpio@fffff400 {
                                        compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
                                        reg = <0xfffff400 0x200>;
                                compatible = "atmel,hsmci";
                                reg = <0xf0008000 0x600>;
                                interrupts = <12 4 0>;
+                               dmas = <&dma0 1 0>;
+                               dma-names = "rxtx";
                                #address-cells = <1>;
                                #size-cells = <0>;
                                status = "disabled";
                                compatible = "atmel,hsmci";
                                reg = <0xf000c000 0x600>;
                                interrupts = <26 4 0>;
+                               dmas = <&dma1 1 0>;
+                               dma-names = "rxtx";
                                #address-cells = <1>;
                                #size-cells = <0>;
                                status = "disabled";
                                compatible = "atmel,at91sam9x5-i2c";
                                reg = <0xf8010000 0x100>;
                                interrupts = <9 4 6>;
+                               dmas = <&dma0 1 7>,
+                                      <&dma0 1 8>;
+                               dma-names = "tx", "rx";
                                #address-cells = <1>;
                                #size-cells = <0>;
 +                              pinctrl-names = "default";
 +                              pinctrl-0 = <&pinctrl_i2c0>;
                                status = "disabled";
                        };
  
                                compatible = "atmel,at91sam9x5-i2c";
                                reg = <0xf8014000 0x100>;
                                interrupts = <10 4 6>;
+                               dmas = <&dma1 1 5>,
+                                      <&dma1 1 6>;
+                               dma-names = "tx", "rx";
                                #address-cells = <1>;
                                #size-cells = <0>;
 +                              pinctrl-names = "default";
 +                              pinctrl-0 = <&pinctrl_i2c1>;
                                status = "disabled";
                        };
  
                                compatible = "atmel,at91sam9x5-i2c";
                                reg = <0xf8018000 0x100>;
                                interrupts = <11 4 6>;
+                               dmas = <&dma0 1 9>,
+                                      <&dma0 1 10>;
+                               dma-names = "tx", "rx";
                                #address-cells = <1>;
                                #size-cells = <0>;
 +                              pinctrl-names = "default";
 +                              pinctrl-0 = <&pinctrl_i2c2>;
                                status = "disabled";
                        };
  
                                atmel,adc-drdy-mask = <0x1000000>;
                                atmel,adc-status-register = <0x30>;
                                atmel,adc-trigger-register = <0xc0>;
 +                              atmel,adc-res = <8 10>;
 +                              atmel,adc-res-names = "lowres", "highres";
 +                              atmel,adc-use-res = "highres";
  
                                trigger@0 {
                                        trigger-name = "external-rising";
                                        trigger-value = <0x6>;
                                };
                        };
 +
 +                      spi0: spi@f0000000 {
 +                              #address-cells = <1>;
 +                              #size-cells = <0>;
 +                              compatible = "atmel,at91rm9200-spi";
 +                              reg = <0xf0000000 0x100>;
 +                              interrupts = <13 4 3>;
 +                              pinctrl-names = "default";
 +                              pinctrl-0 = <&pinctrl_spi0>;
 +                              status = "disabled";
 +                      };
 +
 +                      spi1: spi@f0004000 {
 +                              #address-cells = <1>;
 +                              #size-cells = <0>;
 +                              compatible = "atmel,at91rm9200-spi";
 +                              reg = <0xf0004000 0x100>;
 +                              interrupts = <14 4 3>;
 +                              pinctrl-names = "default";
 +                              pinctrl-0 = <&pinctrl_spi1>;
 +                              status = "disabled";
 +                      };
 +
 +                      rtc@fffffeb0 {
 +                              compatible = "atmel,at91rm9200-rtc";
 +                              reg = <0xfffffeb0 0x40>;
 +                              interrupts = <1 4 7>;
 +                              status = "disabled";
 +                      };
                };
  
                nand0: nand@40000000 {
                i2c-gpio,delay-us = <2>;        /* ~100 kHz */
                #address-cells = <1>;
                #size-cells = <0>;
 +              pinctrl-names = "default";
 +              pinctrl-0 = <&pinctrl_i2c_gpio0>;
                status = "disabled";
        };
  
                i2c-gpio,delay-us = <2>;        /* ~100 kHz */
                #address-cells = <1>;
                #size-cells = <0>;
 +              pinctrl-names = "default";
 +              pinctrl-0 = <&pinctrl_i2c_gpio1>;
                status = "disabled";
        };
  
                i2c-gpio,delay-us = <2>;        /* ~100 kHz */
                #address-cells = <1>;
                #size-cells = <0>;
 +              pinctrl-names = "default";
 +              pinctrl-0 = <&pinctrl_i2c_gpio2>;
                status = "disabled";
        };
  };
index c511c4772efdd8f85b17dac9fac18030f0782845,e1786a0b2fcdc41c4718295880f737ca2c38e49b..54d128d35681a660d2625344a54f06a10ee0bf0b
@@@ -63,7 -63,7 +63,7 @@@
                pinmux: pinmux@e0700000 {
                        compatible = "st,spear1340-pinmux";
                        reg = <0xe0700000 0x1000>;
 -                      #gpio-range-cells = <2>;
 +                      #gpio-range-cells = <3>;
                };
  
                pwm: pwm@e0180000 {
                                reg = <0xb4100000 0x1000>;
                                interrupts = <0 105 0x4>;
                                status = "disabled";
+                               dmas = <&dwdma0 0x600 0 0 1>, /* 0xC << 11 */
+                                       <&dwdma0 0x680 0 1 0>; /* 0xD << 7 */
+                               dma-names = "tx", "rx";
                        };
  
                        thermal@e07008c4 {
                                interrupt-controller;
                                gpio-controller;
                                #gpio-cells = <2>;
 -                              gpio-ranges = <&pinmux 0 252>;
 +                              gpio-ranges = <&pinmux 0 252>;
                                status = "disabled";
  
                                st-plgpio,ngpio = <250>;
index 59d2adb764a995f9174a6494bd2bcc1974c10e73,880584852fca660d9726101e28270004f4f74675..e8edcaa0e4323c304d2b7a0cda4105eb3a1088f8
@@@ -20,6 -20,7 +20,7 @@@ struct clock_data 
        u64 epoch_ns;
        u32 epoch_cyc;
        u32 epoch_cyc_copy;
+       unsigned long rate;
        u32 mult;
        u32 shift;
        bool suspended;
@@@ -45,12 -46,12 +46,12 @@@ static u32 notrace jiffy_sched_clock_re
  
  static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
  
 -static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
 +static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
  {
        return (cyc * mult) >> shift;
  }
  
 -static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
 +static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
  {
        u64 epoch_ns;
        u32 epoch_cyc;
@@@ -113,11 -114,14 +114,14 @@@ void __init setup_sched_clock(u32 (*rea
        u64 res, wrap;
        char r_unit;
  
+       if (cd.rate > rate)
+               return;
        BUG_ON(bits > 32);
        WARN_ON(!irqs_disabled());
-       WARN_ON(read_sched_clock != jiffy_sched_clock_read);
        read_sched_clock = read;
        sched_clock_mask = (1 << bits) - 1;
+       cd.rate = rate;
  
        /* calculate the mult/shift to convert counter ticks to ns. */
        clocks_calc_mult_shift(&cd.mult, &cd.shift, rate, NSEC_PER_SEC, 0);
        pr_debug("Registered %pF as sched_clock source\n", read);
  }
  
unsigned long long notrace sched_clock(void)
static unsigned long long notrace sched_clock_32(void)
  {
        u32 cyc = read_sched_clock();
        return cyc_to_sched_clock(cyc, sched_clock_mask);
  }
  
+ unsigned long long __read_mostly (*sched_clock_func)(void) = sched_clock_32;
+ unsigned long long notrace sched_clock(void)
+ {
+       return sched_clock_func();
+ }
  void __init sched_clock_postinit(void)
  {
        /*
index 48f1228c611cc13712aa4c5b5b8d8fd419c6930f,4c6794603780a838c7bc892452ab1d624fbadb74..69f9e3bbf4e5642723688c950521039fbb1d9704
@@@ -27,6 -27,8 +27,6 @@@
  
  #define AT91_MAX_STATES       2
  
 -static DEFINE_PER_CPU(struct cpuidle_device, at91_cpuidle_device);
 -
  /* Actual code that puts the SoC in different idle states */
  static int at91_enter_idle(struct cpuidle_device *dev,
                        struct cpuidle_driver *drv,
@@@ -36,6 -38,8 +36,8 @@@
                at91rm9200_standby();
        else if (cpu_is_at91sam9g45())
                at91sam9g45_standby();
+       else if (cpu_is_at91sam9263())
+               at91sam9263_standby();
        else
                at91sam9_standby();
  
@@@ -45,6 -49,7 +47,6 @@@
  static struct cpuidle_driver at91_idle_driver = {
        .name                   = "at91_idle",
        .owner                  = THIS_MODULE,
 -      .en_core_tk_irqen       = 1,
        .states[0]              = ARM_CPUIDLE_WFI_STATE,
        .states[1]              = {
                .enter                  = at91_enter_idle,
  };
  
  /* Initialize CPU idle by registering the idle states */
 -static int at91_init_cpuidle(void)
 +static int __init at91_init_cpuidle(void)
  {
 -      struct cpuidle_device *device;
 -
 -      device = &per_cpu(at91_cpuidle_device, smp_processor_id());
 -      device->state_count = AT91_MAX_STATES;
 -
 -      cpuidle_register_driver(&at91_idle_driver);
 -
 -      if (cpuidle_register_device(device)) {
 -              printk(KERN_ERR "at91_init_cpuidle: Failed registering\n");
 -              return -EIO;
 -      }
 -      return 0;
 +      return cpuidle_register(&at91_idle_driver, NULL);
  }
  
  device_initcall(at91_init_cpuidle);
index e8491e77b1f78629d87ba4383483a31700939239,fd00a09da86b28119f9dea09e37c8fa646ad2461..e2f4bdd146d605baaee897e65c6b4af04dc3867b
@@@ -105,28 -105,32 +105,32 @@@ static void __init soc_detect(u32 dbgu_
        switch (socid) {
        case ARCH_ID_AT91RM9200:
                at91_soc_initdata.type = AT91_SOC_RM9200;
-               if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_NONE)
+               if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
                        at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
                at91_boot_soc = at91rm9200_soc;
                break;
  
        case ARCH_ID_AT91SAM9260:
                at91_soc_initdata.type = AT91_SOC_SAM9260;
+               at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
                at91_boot_soc = at91sam9260_soc;
                break;
  
        case ARCH_ID_AT91SAM9261:
                at91_soc_initdata.type = AT91_SOC_SAM9261;
+               at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
                at91_boot_soc = at91sam9261_soc;
                break;
  
        case ARCH_ID_AT91SAM9263:
                at91_soc_initdata.type = AT91_SOC_SAM9263;
+               at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
                at91_boot_soc = at91sam9263_soc;
                break;
  
        case ARCH_ID_AT91SAM9G20:
                at91_soc_initdata.type = AT91_SOC_SAM9G20;
+               at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
                at91_boot_soc = at91sam9260_soc;
                break;
  
  
        case ARCH_ID_AT91SAM9RL64:
                at91_soc_initdata.type = AT91_SOC_SAM9RL;
+               at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
                at91_boot_soc = at91sam9rl_soc;
                break;
  
        /* at91sam9g10 */
        if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
                at91_soc_initdata.type = AT91_SOC_SAM9G10;
+               at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
                at91_boot_soc = at91sam9261_soc;
        }
        /* at91sam9xe */
@@@ -242,7 -248,7 +248,7 @@@ static const char *soc_name[] = 
        [AT91_SOC_SAM9X5]       = "at91sam9x5",
        [AT91_SOC_SAM9N12]      = "at91sam9n12",
        [AT91_SOC_SAMA5D3]      = "sama5d3",
-       [AT91_SOC_NONE]         = "Unknown"
+       [AT91_SOC_UNKNOWN]      = "Unknown",
  };
  
  const char *at91_get_soc_type(struct at91_socinfo *c)
@@@ -268,7 -274,8 +274,8 @@@ static const char *soc_subtype_name[] 
        [AT91_SOC_SAMA5D33]     = "sama5d33",
        [AT91_SOC_SAMA5D34]     = "sama5d34",
        [AT91_SOC_SAMA5D35]     = "sama5d35",
-       [AT91_SOC_SUBTYPE_NONE] = "Unknown"
+       [AT91_SOC_SUBTYPE_NONE] = "None",
+       [AT91_SOC_SUBTYPE_UNKNOWN] = "Unknown",
  };
  
  const char *at91_get_soc_subtype(struct at91_socinfo *c)
@@@ -282,8 -289,8 +289,8 @@@ void __init at91_map_io(void
        /* Map peripherals */
        iotable_init(&at91_io_desc, 1);
  
-       at91_soc_initdata.type = AT91_SOC_NONE;
-       at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
+       at91_soc_initdata.type = AT91_SOC_UNKNOWN;
+       at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
  
        soc_detect(AT91_BASE_DBGU0);
        if (!at91_soc_is_detected())
  
        pr_info("AT91: Detected soc type: %s\n",
                at91_get_soc_type(&at91_soc_initdata));
-       pr_info("AT91: Detected soc subtype: %s\n",
-               at91_get_soc_subtype(&at91_soc_initdata));
+       if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
+               pr_info("AT91: Detected soc subtype: %s\n",
+                       at91_get_soc_subtype(&at91_soc_initdata));
  
        if (!at91_soc_is_enabled())
                panic("AT91: Soc not enabled");
@@@ -360,7 -368,7 +368,7 @@@ static void at91_dt_rstc(void
  
        of_id = of_match_node(rstc_ids, np);
        if (!of_id)
 -              panic("AT91: rtsc no restart function availlable\n");
 +              panic("AT91: rtsc no restart function available\n");
  
        arm_pm_restart = of_id->data;
  
@@@ -380,7 -388,7 +388,7 @@@ static void at91_dt_ramc(void
  
        np = of_find_matching_node(NULL, ramc_ids);
        if (!np)
 -              panic("unable to find compatible ram conroller node in dtb\n");
 +              panic("unable to find compatible ram controller node in dtb\n");
  
        at91_ramc_base[0] = of_iomap(np, 0);
        if (!at91_ramc_base[0])
@@@ -430,7 -438,7 +438,7 @@@ static void at91_dt_shdwc(void
  
        np = of_find_matching_node(NULL, shdwc_ids);
        if (!np) {
 -              pr_debug("AT91: unable to find compatible shutdown (shdwc) conroller node in dtb\n");
 +              pr_debug("AT91: unable to find compatible shutdown (shdwc) controller node in dtb\n");
                return;
        }
  
  
        if (!of_property_read_u32(np, "atmel,wakeup-counter", &reg)) {
                if (reg > AT91_SHDW_CPTWK0_MAX) {
 -                      pr_warn("AT91: shdwc wakeup conter 0x%x > 0x%x reduce it to 0x%x\n",
 +                      pr_warn("AT91: shdwc wakeup counter 0x%x > 0x%x reduce it to 0x%x\n",
                                reg, AT91_SHDW_CPTWK0_MAX, AT91_SHDW_CPTWK0_MAX);
                        reg = AT91_SHDW_CPTWK0_MAX;
                }
index ba769e082ad474c61c69860c24f22f7267670454,c3be068f1c96296804fb16a84b00aae976e3637a..2d04f0e218703e74da2ba700f640c6378d93fe66
@@@ -5,6 -5,6 +5,6 @@@ AFLAGS_coherency_ll.o            := -Wa,-march=ar
  
  obj-y                          += system-controller.o
  obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o
- obj-$(CONFIG_ARCH_MVEBU)       += coherency.o coherency_ll.o pmsu.o irq-armada-370-xp.o
 -obj-$(CONFIG_ARCH_MVEBU)       += addr-map.o coherency.o coherency_ll.o pmsu.o
++obj-$(CONFIG_ARCH_MVEBU)       += coherency.o coherency_ll.o pmsu.o
  obj-$(CONFIG_SMP)                += platsmp.o headsmp.o
  obj-$(CONFIG_HOTPLUG_CPU)        += hotplug.o
index 12d3655830d1482eba5c34667b01a0bb6bc6e9d7,433e8c5343b2524e5ecbf3177e16d7f291f48928..42a4cb3087e23ab04ea2e7e22971c1f38aeb9aa2
@@@ -19,7 -19,8 +19,9 @@@
  #include <linux/time-armada-370-xp.h>
  #include <linux/clk/mvebu.h>
  #include <linux/dma-mapping.h>
 +#include <linux/mbus.h>
+ #include <linux/irqchip.h>
+ #include <asm/hardware/cache-l2x0.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  #include <asm/mach/time.h>
@@@ -49,8 -50,6 +51,8 @@@ void __init armada_370_xp_timer_and_clk
  
  void __init armada_370_xp_init_early(void)
  {
 +      char *mbus_soc_name;
 +
        /*
         * Some Armada 370/XP devices allocate their coherent buffers
         * from atomic context. Increase size of atomic coherent pool
         */
        init_dma_coherent_pool_size(SZ_1M);
  
 +      /*
 +       * This initialization will be replaced by a DT-based
 +       * initialization once the mvebu-mbus driver gains DT support.
 +       */
 +      if (of_machine_is_compatible("marvell,armada370"))
 +              mbus_soc_name = "marvell,armada370-mbus";
 +      else
 +              mbus_soc_name = "marvell,armadaxp-mbus";
 +
 +      mvebu_mbus_init(mbus_soc_name,
 +                      ARMADA_370_XP_MBUS_WINS_BASE,
 +                      ARMADA_370_XP_MBUS_WINS_SIZE,
 +                      ARMADA_370_XP_SDRAM_WINS_BASE,
 +                      ARMADA_370_XP_SDRAM_WINS_SIZE);
++
+ #ifdef CONFIG_CACHE_L2X0
+       l2x0_of_init(0, ~0UL);
+ #endif
  }
  
  static void __init armada_370_xp_dt_init(void)
@@@ -90,8 -78,7 +96,7 @@@ DT_MACHINE_START(ARMADA_XP_DT, "Marvel
        .init_machine   = armada_370_xp_dt_init,
        .map_io         = armada_370_xp_map_io,
        .init_early     = armada_370_xp_init_early,
-       .init_irq       = armada_370_xp_init_irq,
-       .handle_irq     = armada_370_xp_handle_irq,
+       .init_irq       = irqchip_init,
        .init_time      = armada_370_xp_timer_and_clk_init,
        .restart        = mvebu_restart,
        .dt_compat      = armada_370_xp_dt_compat,
index 02e1d56a3fe56891e6f1eefd1465003e8d74edce,fdf1c039062ce39761715079db19342aba3662f4..05481490a5084c26e940bda8697106bfe50372c7
@@@ -46,7 -46,6 +46,6 @@@
  #include <asm/smp_twd.h>
  #include <asm/sched_clock.h>
  
- #include <asm/arch_timer.h>
  #include "omap_hwmod.h"
  #include "omap_device.h"
  #include <plat/counter-32k.h>
@@@ -133,12 -132,7 +132,12 @@@ static struct property device_disabled 
  };
  
  static struct of_device_id omap_timer_match[] __initdata = {
 -      { .compatible = "ti,omap2-timer", },
 +      { .compatible = "ti,omap2420-timer", },
 +      { .compatible = "ti,omap3430-timer", },
 +      { .compatible = "ti,omap4430-timer", },
 +      { .compatible = "ti,omap5430-timer", },
 +      { .compatible = "ti,am335x-timer", },
 +      { .compatible = "ti,am335x-timer-1ms", },
        { }
  };
  
@@@ -554,6 -548,8 +553,6 @@@ static inline void __init realtime_coun
                               clksrc_nr, clksrc_src, clksrc_prop)      \
  void __init omap##name##_gptimer_timer_init(void)                     \
  {                                                                     \
 -      if (omap_clk_init)                                              \
 -              omap_clk_init();                                        \
        omap_dmtimer_init();                                            \
        omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop);    \
        omap2_gptimer_clocksource_init((clksrc_nr), clksrc_src,         \
                                clksrc_nr, clksrc_src, clksrc_prop)     \
  void __init omap##name##_sync32k_timer_init(void)             \
  {                                                                     \
 -      if (omap_clk_init)                                              \
 -              omap_clk_init();                                        \
        omap_dmtimer_init();                                            \
        omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop);    \
        /* Enable the use of clocksource="gp_timer" kernel parameter */ \
@@@ -627,14 -625,10 +626,10 @@@ void __init omap4_local_timer_init(void
  #ifdef CONFIG_SOC_OMAP5
  void __init omap5_realtime_timer_init(void)
  {
-       int err;
        omap4_sync32k_timer_init();
        realtime_counter_init();
  
-       err = arch_timer_of_register();
-       if (err)
-               pr_err("%s: arch_timer_register failed %d\n", __func__, err);
+       clocksource_of_init();
  }
  #endif /* CONFIG_SOC_OMAP5 */
  
index 228d7aba4a7ce390682bd22653117d25958a20c6,104b474a2ccfeeb9527d9507e0dd5ad9efab204e..326a4ab0bd5f8ea0f6ba64f6a202ce60d9a66b40
@@@ -22,7 -22,6 +22,7 @@@
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/io.h>
 +#include <linux/platform_data/irq-renesas-intc-irqpin.h>
  #include <linux/platform_device.h>
  #include <linux/of_platform.h>
  #include <linux/serial_sci.h>
@@@ -95,126 -94,6 +95,126 @@@ void __init r8a7740_pinmux_init(void
        platform_device_register(&r8a7740_pfc_device);
  }
  
 +static struct renesas_intc_irqpin_config irqpin0_platform_data = {
 +      .irq_base = irq_pin(0), /* IRQ0 -> IRQ7 */
 +};
 +
 +static struct resource irqpin0_resources[] = {
 +      DEFINE_RES_MEM(0xe6900000, 4), /* ICR1A */
 +      DEFINE_RES_MEM(0xe6900010, 4), /* INTPRI00A */
 +      DEFINE_RES_MEM(0xe6900020, 1), /* INTREQ00A */
 +      DEFINE_RES_MEM(0xe6900040, 1), /* INTMSK00A */
 +      DEFINE_RES_MEM(0xe6900060, 1), /* INTMSKCLR00A */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ0 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ1 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ2 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ3 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ4 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ5 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ6 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ7 */
 +};
 +
 +static struct platform_device irqpin0_device = {
 +      .name           = "renesas_intc_irqpin",
 +      .id             = 0,
 +      .resource       = irqpin0_resources,
 +      .num_resources  = ARRAY_SIZE(irqpin0_resources),
 +      .dev            = {
 +              .platform_data  = &irqpin0_platform_data,
 +      },
 +};
 +
 +static struct renesas_intc_irqpin_config irqpin1_platform_data = {
 +      .irq_base = irq_pin(8), /* IRQ8 -> IRQ15 */
 +};
 +
 +static struct resource irqpin1_resources[] = {
 +      DEFINE_RES_MEM(0xe6900004, 4), /* ICR2A */
 +      DEFINE_RES_MEM(0xe6900014, 4), /* INTPRI10A */
 +      DEFINE_RES_MEM(0xe6900024, 1), /* INTREQ10A */
 +      DEFINE_RES_MEM(0xe6900044, 1), /* INTMSK10A */
 +      DEFINE_RES_MEM(0xe6900064, 1), /* INTMSKCLR10A */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ8 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ9 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ10 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ11 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ12 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ13 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ14 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ15 */
 +};
 +
 +static struct platform_device irqpin1_device = {
 +      .name           = "renesas_intc_irqpin",
 +      .id             = 1,
 +      .resource       = irqpin1_resources,
 +      .num_resources  = ARRAY_SIZE(irqpin1_resources),
 +      .dev            = {
 +              .platform_data  = &irqpin1_platform_data,
 +      },
 +};
 +
 +static struct renesas_intc_irqpin_config irqpin2_platform_data = {
 +      .irq_base = irq_pin(16), /* IRQ16 -> IRQ23 */
 +};
 +
 +static struct resource irqpin2_resources[] = {
 +      DEFINE_RES_MEM(0xe6900008, 4), /* ICR3A */
 +      DEFINE_RES_MEM(0xe6900018, 4), /* INTPRI30A */
 +      DEFINE_RES_MEM(0xe6900028, 1), /* INTREQ30A */
 +      DEFINE_RES_MEM(0xe6900048, 1), /* INTMSK30A */
 +      DEFINE_RES_MEM(0xe6900068, 1), /* INTMSKCLR30A */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ16 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ17 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ18 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ19 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ20 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ21 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ22 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ23 */
 +};
 +
 +static struct platform_device irqpin2_device = {
 +      .name           = "renesas_intc_irqpin",
 +      .id             = 2,
 +      .resource       = irqpin2_resources,
 +      .num_resources  = ARRAY_SIZE(irqpin2_resources),
 +      .dev            = {
 +              .platform_data  = &irqpin2_platform_data,
 +      },
 +};
 +
 +static struct renesas_intc_irqpin_config irqpin3_platform_data = {
 +      .irq_base = irq_pin(24), /* IRQ24 -> IRQ31 */
 +};
 +
 +static struct resource irqpin3_resources[] = {
 +      DEFINE_RES_MEM(0xe690000c, 4), /* ICR3A */
 +      DEFINE_RES_MEM(0xe690001c, 4), /* INTPRI30A */
 +      DEFINE_RES_MEM(0xe690002c, 1), /* INTREQ30A */
 +      DEFINE_RES_MEM(0xe690004c, 1), /* INTMSK30A */
 +      DEFINE_RES_MEM(0xe690006c, 1), /* INTMSKCLR30A */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ24 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ25 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ26 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ27 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ28 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ29 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ30 */
 +      DEFINE_RES_IRQ(gic_spi(149)), /* IRQ31 */
 +};
 +
 +static struct platform_device irqpin3_device = {
 +      .name           = "renesas_intc_irqpin",
 +      .id             = 3,
 +      .resource       = irqpin3_resources,
 +      .num_resources  = ARRAY_SIZE(irqpin3_resources),
 +      .dev            = {
 +              .platform_data  = &irqpin3_platform_data,
 +      },
 +};
 +
  /* SCIFA0 */
  static struct plat_sci_port scif0_platform_data = {
        .mapbase        = 0xe6c40000,
        .scscr          = SCSCR_RE | SCSCR_TE,
        .scbrr_algo_id  = SCBRR_ALGO_4,
        .type           = PORT_SCIFA,
 -      .irqs           = SCIx_IRQ_MUXED(evt2irq(0x0c00)),
 +      .irqs           = SCIx_IRQ_MUXED(gic_spi(100)),
  };
  
  static struct platform_device scif0_device = {
@@@ -240,7 -119,7 +240,7 @@@ static struct plat_sci_port scif1_platf
        .scscr          = SCSCR_RE | SCSCR_TE,
        .scbrr_algo_id  = SCBRR_ALGO_4,
        .type           = PORT_SCIFA,
 -      .irqs           = SCIx_IRQ_MUXED(evt2irq(0x0c20)),
 +      .irqs           = SCIx_IRQ_MUXED(gic_spi(101)),
  };
  
  static struct platform_device scif1_device = {
@@@ -258,7 -137,7 +258,7 @@@ static struct plat_sci_port scif2_platf
        .scscr          = SCSCR_RE | SCSCR_TE,
        .scbrr_algo_id  = SCBRR_ALGO_4,
        .type           = PORT_SCIFA,
 -      .irqs           = SCIx_IRQ_MUXED(evt2irq(0x0c40)),
 +      .irqs           = SCIx_IRQ_MUXED(gic_spi(102)),
  };
  
  static struct platform_device scif2_device = {
@@@ -276,7 -155,7 +276,7 @@@ static struct plat_sci_port scif3_platf
        .scscr          = SCSCR_RE | SCSCR_TE,
        .scbrr_algo_id  = SCBRR_ALGO_4,
        .type           = PORT_SCIFA,
 -      .irqs           = SCIx_IRQ_MUXED(evt2irq(0x0c60)),
 +      .irqs           = SCIx_IRQ_MUXED(gic_spi(103)),
  };
  
  static struct platform_device scif3_device = {
@@@ -294,7 -173,7 +294,7 @@@ static struct plat_sci_port scif4_platf
        .scscr          = SCSCR_RE | SCSCR_TE,
        .scbrr_algo_id  = SCBRR_ALGO_4,
        .type           = PORT_SCIFA,
 -      .irqs           = SCIx_IRQ_MUXED(evt2irq(0x0d20)),
 +      .irqs           = SCIx_IRQ_MUXED(gic_spi(104)),
  };
  
  static struct platform_device scif4_device = {
@@@ -312,7 -191,7 +312,7 @@@ static struct plat_sci_port scif5_platf
        .scscr          = SCSCR_RE | SCSCR_TE,
        .scbrr_algo_id  = SCBRR_ALGO_4,
        .type           = PORT_SCIFA,
 -      .irqs           = SCIx_IRQ_MUXED(evt2irq(0x0d40)),
 +      .irqs           = SCIx_IRQ_MUXED(gic_spi(105)),
  };
  
  static struct platform_device scif5_device = {
@@@ -330,7 -209,7 +330,7 @@@ static struct plat_sci_port scif6_platf
        .scscr          = SCSCR_RE | SCSCR_TE,
        .scbrr_algo_id  = SCBRR_ALGO_4,
        .type           = PORT_SCIFA,
 -      .irqs           = SCIx_IRQ_MUXED(evt2irq(0x04c0)),
 +      .irqs           = SCIx_IRQ_MUXED(gic_spi(106)),
  };
  
  static struct platform_device scif6_device = {
@@@ -348,7 -227,7 +348,7 @@@ static struct plat_sci_port scif7_platf
        .scscr          = SCSCR_RE | SCSCR_TE,
        .scbrr_algo_id  = SCBRR_ALGO_4,
        .type           = PORT_SCIFA,
 -      .irqs           = SCIx_IRQ_MUXED(evt2irq(0x04e0)),
 +      .irqs           = SCIx_IRQ_MUXED(gic_spi(107)),
  };
  
  static struct platform_device scif7_device = {
@@@ -366,7 -245,7 +366,7 @@@ static struct plat_sci_port scifb_platf
        .scscr          = SCSCR_RE | SCSCR_TE,
        .scbrr_algo_id  = SCBRR_ALGO_4,
        .type           = PORT_SCIFB,
 -      .irqs           = SCIx_IRQ_MUXED(evt2irq(0x0d60)),
 +      .irqs           = SCIx_IRQ_MUXED(gic_spi(108)),
  };
  
  static struct platform_device scifb_device = {
@@@ -394,7 -273,7 +394,7 @@@ static struct resource cmt10_resources[
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
 -              .start  = evt2irq(0x0b00),
 +              .start  = gic_spi(58),
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -425,7 -304,7 +425,7 @@@ static struct resource tmu00_resources[
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
 -              .start  = intcs_evt2irq(0xe80),
 +              .start  = gic_spi(198),
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -455,7 -334,7 +455,7 @@@ static struct resource tmu01_resources[
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
 -              .start  = intcs_evt2irq(0xea0),
 +              .start  = gic_spi(199),
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -485,7 -364,7 +485,7 @@@ static struct resource tmu02_resources[
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
 -              .start  = intcs_evt2irq(0xec0),
 +              .start  = gic_spi(200),
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -532,10 -411,6 +532,10 @@@ static struct platform_device ipmmu_dev
  };
  
  static struct platform_device *r8a7740_early_devices[] __initdata = {
 +      &irqpin0_device,
 +      &irqpin1_device,
 +      &irqpin2_device,
 +      &irqpin3_device,
        &scif0_device,
        &scif1_device,
        &scif2_device,
@@@ -650,14 -525,14 +650,14 @@@ static struct resource r8a7740_dmae0_re
        },
        {
                .name   = "error_irq",
 -              .start  = evt2irq(0x20c0),
 -              .end    = evt2irq(0x20c0),
 +              .start  = gic_spi(34),
 +              .end    = gic_spi(34),
                .flags  = IORESOURCE_IRQ,
        },
        {
                /* IRQ for channels 0-5 */
 -              .start  = evt2irq(0x2000),
 -              .end    = evt2irq(0x20a0),
 +              .start  = gic_spi(28),
 +              .end    = gic_spi(33),
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -678,14 -553,14 +678,14 @@@ static struct resource r8a7740_dmae1_re
        },
        {
                .name   = "error_irq",
 -              .start  = evt2irq(0x21c0),
 -              .end    = evt2irq(0x21c0),
 +              .start  = gic_spi(41),
 +              .end    = gic_spi(41),
                .flags  = IORESOURCE_IRQ,
        },
        {
                /* IRQ for channels 0-5 */
 -              .start  = evt2irq(0x2100),
 -              .end    = evt2irq(0x21a0),
 +              .start  = gic_spi(35),
 +              .end    = gic_spi(40),
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -706,14 -581,14 +706,14 @@@ static struct resource r8a7740_dmae2_re
        },
        {
                .name   = "error_irq",
 -              .start  = evt2irq(0x22c0),
 -              .end    = evt2irq(0x22c0),
 +              .start  = gic_spi(48),
 +              .end    = gic_spi(48),
                .flags  = IORESOURCE_IRQ,
        },
        {
                /* IRQ for channels 0-5 */
 -              .start  = evt2irq(0x2200),
 -              .end    = evt2irq(0x22a0),
 +              .start  = gic_spi(42),
 +              .end    = gic_spi(47),
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -802,8 -677,8 +802,8 @@@ static struct resource r8a7740_usb_dma_
        },
        {
                /* IRQ for channels */
 -              .start  = evt2irq(0x0a00),
 -              .end    = evt2irq(0x0a00),
 +              .start  = gic_spi(49),
 +              .end    = gic_spi(49),
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -827,8 -702,8 +827,8 @@@ static struct resource i2c0_resources[
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
 -              .start  = intcs_evt2irq(0xe00),
 -              .end    = intcs_evt2irq(0xe60),
 +              .start  = gic_spi(201),
 +              .end    = gic_spi(204),
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -841,8 -716,8 +841,8 @@@ static struct resource i2c1_resources[
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
 -              .start  = evt2irq(0x780), /* IIC1_ALI1 */
 -              .end    = evt2irq(0x7e0), /* IIC1_DTEI1 */
 +              .start  = gic_spi(70), /* IIC1_ALI1 */
 +              .end    = gic_spi(73), /* IIC1_DTEI1 */
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -863,8 -738,8 +863,8 @@@ static struct platform_device i2c1_devi
  
  static struct resource pmu_resources[] = {
        [0] = {
 -              .start  = evt2irq(0x19a0),
 -              .end    = evt2irq(0x19a0),
 +              .start  = gic_spi(83),
 +              .end    = gic_spi(83),
                .flags  = IORESOURCE_IRQ,
        },
  };
@@@ -1029,8 -904,8 +1029,7 @@@ DT_MACHINE_START(R8A7740_DT, "Generic R
        .map_io         = r8a7740_map_io,
        .init_early     = r8a7740_add_early_devices_dt,
        .init_irq       = r8a7740_init_irq,
 -      .handle_irq     = shmobile_handle_irq_intc,
        .init_machine   = r8a7740_add_standard_devices_dt,
-       .init_time      = shmobile_timer_init,
        .dt_compat      = r8a7740_boards_compat_dt,
  MACHINE_END
  
index af9bffb94f1cd07c2f5648f21d8a969e634ff61e,8aaf724e1ea41260eb0c8ba9bfac3d059d2018d7..a946c19ab31a5db0a2f2766d9f68fc996175ff6e
@@@ -7,10 -7,10 +7,10 @@@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) :
  # Common support
  obj-y := restart.o time.o
  
obj-$(CONFIG_SMP)             += headsmp.o platsmp.o
obj-$(CONFIG_HOTPLUG_CPU)     += hotplug.o
smp-$(CONFIG_SMP)             += headsmp.o platsmp.o
smp-$(CONFIG_HOTPLUG_CPU)     += hotplug.o
  
- obj-$(CONFIG_ARCH_SPEAR13XX)  += spear13xx.o
+ obj-$(CONFIG_ARCH_SPEAR13XX)  += spear13xx.o $(smp-y)
  obj-$(CONFIG_MACH_SPEAR1310)  += spear1310.o
  obj-$(CONFIG_MACH_SPEAR1340)  += spear1340.o
  
@@@ -22,5 -22,3 +22,5 @@@ obj-$(CONFIG_MACH_SPEAR320)   += spear320
  
  obj-$(CONFIG_ARCH_SPEAR6XX)   += spear6xx.o
  obj-$(CONFIG_ARCH_SPEAR6XX)   += pl080.o
 +
 +CFLAGS_hotplug.o              += -march=armv7-a
index 9366f37902d991de48de0092f79797c781b3b9fd,09e571ddc984731266da692f8923c295ff8fb40a..b6083bb1eb8cf4c9092630a25c43b041c163f7f6
@@@ -1,6 -1,7 +1,7 @@@
  /*
   * Versatile Express V2M Motherboard Support
   */
+ #include <linux/clocksource.h>
  #include <linux/device.h>
  #include <linux/amba/bus.h>
  #include <linux/amba/mmci.h>
  #include <linux/regulator/fixed.h>
  #include <linux/regulator/machine.h>
  #include <linux/vexpress.h>
 +#include <linux/clk-provider.h>
 +#include <linux/clkdev.h>
  
- #include <asm/arch_timer.h>
  #include <asm/mach-types.h>
  #include <asm/sizes.h>
  #include <asm/mach/arch.h>
@@@ -63,9 -61,6 +63,6 @@@ static void __init v2m_sp804_init(void 
        if (WARN_ON(!base || irq == NO_IRQ))
                return;
  
-       writel(0, base + TIMER_1_BASE + TIMER_CTRL);
-       writel(0, base + TIMER_2_BASE + TIMER_CTRL);
        sp804_clocksource_init(base + TIMER_2_BASE, "v2m-timer1");
        sp804_clockevents_init(base + TIMER_1_BASE, irq, "v2m-timer0");
  }
@@@ -363,6 -358,8 +360,6 @@@ static void __init v2m_init(void
        for (i = 0; i < ARRAY_SIZE(v2m_amba_devs); i++)
                amba_device_register(v2m_amba_devs[i], &iomem_resource);
  
 -      pm_power_off = vexpress_power_off;
 -
        ct_desc->init_tile();
  }
  
@@@ -374,6 -371,7 +371,6 @@@ MACHINE_START(VEXPRESS, "ARM-Versatile 
        .init_irq       = v2m_init_irq,
        .init_time      = v2m_timer_init,
        .init_machine   = v2m_init,
 -      .restart        = vexpress_restart,
  MACHINE_END
  
  static struct map_desc v2m_rs1_io_desc __initdata = {
@@@ -430,29 -428,11 +427,11 @@@ void __init v2m_dt_init_early(void
  
  static void __init v2m_dt_timer_init(void)
  {
-       struct device_node *node = NULL;
 -      vexpress_clk_of_init();
 +      of_clk_init(NULL);
  
        clocksource_of_init();
-       do {
-               node = of_find_compatible_node(node, NULL, "arm,sp804");
-       } while (node && vexpress_get_site_by_node(node) != VEXPRESS_SITE_MB);
-       if (node) {
-               pr_info("Using SP804 '%s' as a clock & events source\n",
-                               node->full_name);
-               WARN_ON(clk_register_clkdev(of_clk_get_by_name(node,
-                               "timclken1"), "v2m-timer0", "sp804"));
-               WARN_ON(clk_register_clkdev(of_clk_get_by_name(node,
-                               "timclken2"), "v2m-timer1", "sp804"));
-               v2m_sp804_init(of_iomap(node, 0),
-                               irq_of_parse_and_map(node, 0));
-       }
-       arch_timer_of_register();
  
-       if (arch_timer_sched_clock_init() != 0)
-               versatile_sched_clock_init(vexpress_get_24mhz_clock_base(),
+       versatile_sched_clock_init(vexpress_get_24mhz_clock_base(),
                                24000000);
  }
  
@@@ -467,6 -447,7 +446,6 @@@ static void __init v2m_dt_init(void
  {
        l2x0_of_init(0x00400000, 0xfe0fffff);
        of_platform_populate(NULL, v2m_dt_bus_match, NULL, NULL);
 -      pm_power_off = vexpress_power_off;
  }
  
  static const char * const v2m_dt_match[] __initconst = {
@@@ -483,4 -464,5 +462,4 @@@ DT_MACHINE_START(VEXPRESS_DT, "ARM-Vers
        .init_irq       = irqchip_init,
        .init_time      = v2m_dt_timer_init,
        .init_machine   = v2m_dt_init,
 -      .restart        = vexpress_restart,
  MACHINE_END
index 7bc6e51757eeda9fddc14b19a6814cbbc3e5d304,29ba35e6a143d0ef7ccdea34587a7749369cc101..c20de4a85cbd69c3107fbf0e9befde5b1047ca7b
@@@ -25,7 -25,7 +25,7 @@@ config DW_APB_TIMER_O
  config ARMADA_370_XP_TIMER
        bool
  
 -config SUNXI_TIMER
 +config SUN4I_TIMER
        bool
  
  config VT8500_TIMER
@@@ -65,6 -65,7 +65,7 @@@ config CLKSRC_DBX500_PRCMU_SCHED_CLOC
  
  config ARM_ARCH_TIMER
        bool
+       select CLKSRC_OF if OF
  
  config CLKSRC_METAG_GENERIC
        def_bool y if METAG
index 661026834b23df3643175d43f4166e182d11edbb,b078d7cbc93089f08860e4fac3ea2cc7facabd29..13a9e4923a0350fd59ea5d914c366d9739819d81
@@@ -24,7 -24,6 +24,6 @@@
  #include <linux/of_address.h>
  #include <linux/clocksource.h>
  
- #include <asm/arch_timer.h>
  #include <asm/localtimer.h>
  
  #include <plat/cpu.h>
@@@ -477,20 -476,12 +476,20 @@@ static struct local_timer_ops exynos4_m
  };
  #endif /* CONFIG_LOCAL_TIMERS */
  
 -static void __init exynos4_timer_resources(void __iomem *base)
 +static void __init exynos4_timer_resources(struct device_node *np, void __iomem *base)
  {
 -      struct clk *mct_clk;
 -      mct_clk = clk_get(NULL, "xtal");
 +      struct clk *mct_clk, *tick_clk;
  
 -      clk_rate = clk_get_rate(mct_clk);
 +      tick_clk = np ? of_clk_get_by_name(np, "fin_pll") :
 +                              clk_get(NULL, "fin_pll");
 +      if (IS_ERR(tick_clk))
 +              panic("%s: unable to determine tick clock rate\n", __func__);
 +      clk_rate = clk_get_rate(tick_clk);
 +
 +      mct_clk = np ? of_clk_get_by_name(np, "mct") : clk_get(NULL, "mct");
 +      if (IS_ERR(mct_clk))
 +              panic("%s: unable to retrieve mct clock instance\n", __func__);
 +      clk_prepare_enable(mct_clk);
  
        reg_base = base;
        if (!reg_base)
@@@ -522,7 -513,7 +521,7 @@@ void __init mct_init(void
                panic("unable to determine mct controller type\n");
        }
  
 -      exynos4_timer_resources(S5P_VA_SYSTIMER);
 +      exynos4_timer_resources(NULL, S5P_VA_SYSTIMER);
        exynos4_clocksource_init();
        exynos4_clockevent_init();
  }
@@@ -541,15 -532,11 +540,15 @@@ static void __init mct_init_dt(struct d
         * timer irqs are specified after the four global timer
         * irqs are specified.
         */
 +#ifdef CONFIG_OF
        nr_irqs = of_irq_count(np);
 +#else
 +      nr_irqs = 0;
 +#endif
        for (i = MCT_L0_IRQ; i < nr_irqs; i++)
                mct_irqs[i] = irq_of_parse_and_map(np, i);
  
 -      exynos4_timer_resources(of_iomap(np, 0));
 +      exynos4_timer_resources(np, of_iomap(np, 0));
        exynos4_clocksource_init();
        exynos4_clockevent_init();
  }
diff --combined drivers/irqchip/Makefile
index c28fcccf4a0da770750693e47f2144c751471bac,154722aa26cbf7c526c001ee1041d16094254fef..cda4cb5f7327b77534a45776eb39b06f3c36a43c
@@@ -2,16 -2,14 +2,17 @@@ obj-$(CONFIG_IRQCHIP)                 += irqchip.
  
  obj-$(CONFIG_ARCH_BCM2835)            += irq-bcm2835.o
  obj-$(CONFIG_ARCH_EXYNOS)             += exynos-combiner.o
+ obj-$(CONFIG_ARCH_MVEBU)              += irq-armada-370-xp.o
 +obj-$(CONFIG_ARCH_MXS)                        += irq-mxs.o
  obj-$(CONFIG_ARCH_S3C24XX)            += irq-s3c24xx.o
  obj-$(CONFIG_METAG)                   += irq-metag-ext.o
  obj-$(CONFIG_METAG_PERFCOUNTER_IRQS)  += irq-metag.o
 -obj-$(CONFIG_ARCH_SUNXI)              += irq-sunxi.o
 +obj-$(CONFIG_ARCH_SUNXI)              += irq-sun4i.o
  obj-$(CONFIG_ARCH_SPEAR3XX)           += spear-shirq.o
  obj-$(CONFIG_ARM_GIC)                 += irq-gic.o
  obj-$(CONFIG_ARM_VIC)                 += irq-vic.o
 +obj-$(CONFIG_SIRF_IRQ)                        += irq-sirfsoc.o
  obj-$(CONFIG_RENESAS_INTC_IRQPIN)     += irq-renesas-intc-irqpin.o
  obj-$(CONFIG_RENESAS_IRQC)            += irq-renesas-irqc.o
  obj-$(CONFIG_VERSATILE_FPGA_IRQ)      += irq-versatile-fpga.o
 +obj-$(CONFIG_ARCH_VT8500)             += irq-vt8500.o
index 0000000000000000000000000000000000000000,ad1e6422a73291bbd08ab4d91b931b0e1de373a5..bb328a366122851b0d28308e13079dfb3ad146d2
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,294 +1,288 @@@
 - * For CPU interrtups, mask/unmask the calling CPU's bit
+ /*
+  * Marvell Armada 370 and Armada XP SoC IRQ handling
+  *
+  * Copyright (C) 2012 Marvell
+  *
+  * Lior Amsalem <alior@marvell.com>
+  * Gregory CLEMENT <gregory.clement@free-electrons.com>
+  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+  * Ben Dooks <ben.dooks@codethink.co.uk>
+  *
+  * This file is licensed under the terms of the GNU General Public
+  * License version 2.  This program is licensed "as is" without any
+  * warranty of any kind, whether express or implied.
+  */
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/init.h>
+ #include <linux/irq.h>
+ #include <linux/interrupt.h>
+ #include <linux/io.h>
+ #include <linux/of_address.h>
+ #include <linux/of_irq.h>
+ #include <linux/irqdomain.h>
+ #include <asm/mach/arch.h>
+ #include <asm/exception.h>
+ #include <asm/smp_plat.h>
+ #include <asm/mach/irq.h>
+ #include "irqchip.h"
+ /* Interrupt Controller Registers Map */
+ #define ARMADA_370_XP_INT_SET_MASK_OFFS               (0x48)
+ #define ARMADA_370_XP_INT_CLEAR_MASK_OFFS     (0x4C)
+ #define ARMADA_370_XP_INT_CONTROL             (0x00)
+ #define ARMADA_370_XP_INT_SET_ENABLE_OFFS     (0x30)
+ #define ARMADA_370_XP_INT_CLEAR_ENABLE_OFFS   (0x34)
+ #define ARMADA_370_XP_INT_SOURCE_CTL(irq)     (0x100 + irq*4)
+ #define ARMADA_370_XP_CPU_INTACK_OFFS         (0x44)
+ #define ARMADA_370_XP_SW_TRIG_INT_OFFS           (0x4)
+ #define ARMADA_370_XP_IN_DRBEL_MSK_OFFS          (0xc)
+ #define ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS        (0x8)
+ #define ARMADA_370_XP_MAX_PER_CPU_IRQS                (28)
+ #define ARMADA_370_XP_TIMER0_PER_CPU_IRQ      (5)
+ #define IPI_DOORBELL_START                      (0)
+ #define IPI_DOORBELL_END                        (8)
+ #define IPI_DOORBELL_MASK                       0xFF
+ static DEFINE_RAW_SPINLOCK(irq_controller_lock);
+ static void __iomem *per_cpu_int_base;
+ static void __iomem *main_int_base;
+ static struct irq_domain *armada_370_xp_mpic_domain;
+ /*
+  * In SMP mode:
+  * For shared global interrupts, mask/unmask global enable bit
 -#ifdef CONFIG_SMP
++ * For CPU interrupts, mask/unmask the calling CPU's bit
+  */
+ static void armada_370_xp_irq_mask(struct irq_data *d)
+ {
 -#else
 -      writel(irqd_to_hwirq(d),
 -             per_cpu_int_base + ARMADA_370_XP_INT_SET_MASK_OFFS);
 -#endif
+       irq_hw_number_t hwirq = irqd_to_hwirq(d);
+       if (hwirq != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
+               writel(hwirq, main_int_base +
+                               ARMADA_370_XP_INT_CLEAR_ENABLE_OFFS);
+       else
+               writel(hwirq, per_cpu_int_base +
+                               ARMADA_370_XP_INT_SET_MASK_OFFS);
 -#ifdef CONFIG_SMP
+ }
+ static void armada_370_xp_irq_unmask(struct irq_data *d)
+ {
 -#else
 -      writel(irqd_to_hwirq(d),
 -             per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
 -#endif
+       irq_hw_number_t hwirq = irqd_to_hwirq(d);
+       if (hwirq != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
+               writel(hwirq, main_int_base +
+                               ARMADA_370_XP_INT_SET_ENABLE_OFFS);
+       else
+               writel(hwirq, per_cpu_int_base +
+                               ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
 -      writel(hw, main_int_base + ARMADA_370_XP_INT_SET_ENABLE_OFFS);
+ }
+ #ifdef CONFIG_SMP
+ static int armada_xp_set_affinity(struct irq_data *d,
+                                 const struct cpumask *mask_val, bool force)
+ {
+       unsigned long reg;
+       unsigned long new_mask = 0;
+       unsigned long online_mask = 0;
+       unsigned long count = 0;
+       irq_hw_number_t hwirq = irqd_to_hwirq(d);
+       int cpu;
+       for_each_cpu(cpu, mask_val) {
+               new_mask |= 1 << cpu_logical_map(cpu);
+               count++;
+       }
+       /*
+        * Forbid mutlicore interrupt affinity
+        * This is required since the MPIC HW doesn't limit
+        * several CPUs from acknowledging the same interrupt.
+        */
+       if (count > 1)
+               return -EINVAL;
+       for_each_cpu(cpu, cpu_online_mask)
+               online_mask |= 1 << cpu_logical_map(cpu);
+       raw_spin_lock(&irq_controller_lock);
+       reg = readl(main_int_base + ARMADA_370_XP_INT_SOURCE_CTL(hwirq));
+       reg = (reg & (~online_mask)) | new_mask;
+       writel(reg, main_int_base + ARMADA_370_XP_INT_SOURCE_CTL(hwirq));
+       raw_spin_unlock(&irq_controller_lock);
+       return 0;
+ }
+ #endif
+ static struct irq_chip armada_370_xp_irq_chip = {
+       .name           = "armada_370_xp_irq",
+       .irq_mask       = armada_370_xp_irq_mask,
+       .irq_mask_ack   = armada_370_xp_irq_mask,
+       .irq_unmask     = armada_370_xp_irq_unmask,
+ #ifdef CONFIG_SMP
+       .irq_set_affinity = armada_xp_set_affinity,
+ #endif
+ };
+ static int armada_370_xp_mpic_irq_map(struct irq_domain *h,
+                                     unsigned int virq, irq_hw_number_t hw)
+ {
+       armada_370_xp_irq_mask(irq_get_irq_data(virq));
++      if (hw != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
++              writel(hw, per_cpu_int_base +
++                      ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
++      else
++              writel(hw, main_int_base + ARMADA_370_XP_INT_SET_ENABLE_OFFS);
+       irq_set_status_flags(virq, IRQ_LEVEL);
+       if (hw == ARMADA_370_XP_TIMER0_PER_CPU_IRQ) {
+               irq_set_percpu_devid(virq);
+               irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip,
+                                       handle_percpu_devid_irq);
+       } else {
+               irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip,
+                                       handle_level_irq);
+       }
+       set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
+       return 0;
+ }
+ #ifdef CONFIG_SMP
+ void armada_mpic_send_doorbell(const struct cpumask *mask, unsigned int irq)
+ {
+       int cpu;
+       unsigned long map = 0;
+       /* Convert our logical CPU mask into a physical one. */
+       for_each_cpu(cpu, mask)
+               map |= 1 << cpu_logical_map(cpu);
+       /*
+        * Ensure that stores to Normal memory are visible to the
+        * other CPUs before issuing the IPI.
+        */
+       dsb();
+       /* submit softirq */
+       writel((map << 8) | irq, main_int_base +
+               ARMADA_370_XP_SW_TRIG_INT_OFFS);
+ }
+ void armada_xp_mpic_smp_cpu_init(void)
+ {
+       /* Clear pending IPIs */
+       writel(0, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS);
+       /* Enable first 8 IPIs */
+       writel(IPI_DOORBELL_MASK, per_cpu_int_base +
+               ARMADA_370_XP_IN_DRBEL_MSK_OFFS);
+       /* Unmask IPI interrupt */
+       writel(0, per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
+ }
+ #endif /* CONFIG_SMP */
+ static struct irq_domain_ops armada_370_xp_mpic_irq_ops = {
+       .map = armada_370_xp_mpic_irq_map,
+       .xlate = irq_domain_xlate_onecell,
+ };
+ static asmlinkage void __exception_irq_entry
+ armada_370_xp_handle_irq(struct pt_regs *regs)
+ {
+       u32 irqstat, irqnr;
+       do {
+               irqstat = readl_relaxed(per_cpu_int_base +
+                                       ARMADA_370_XP_CPU_INTACK_OFFS);
+               irqnr = irqstat & 0x3FF;
+               if (irqnr > 1022)
+                       break;
+               if (irqnr > 0) {
+                       irqnr = irq_find_mapping(armada_370_xp_mpic_domain,
+                                       irqnr);
+                       handle_IRQ(irqnr, regs);
+                       continue;
+               }
+ #ifdef CONFIG_SMP
+               /* IPI Handling */
+               if (irqnr == 0) {
+                       u32 ipimask, ipinr;
+                       ipimask = readl_relaxed(per_cpu_int_base +
+                                               ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS)
+                               & IPI_DOORBELL_MASK;
+                       writel(~IPI_DOORBELL_MASK, per_cpu_int_base +
+                               ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS);
+                       /* Handle all pending doorbells */
+                       for (ipinr = IPI_DOORBELL_START;
+                            ipinr < IPI_DOORBELL_END; ipinr++) {
+                               if (ipimask & (0x1 << ipinr))
+                                       handle_IPI(ipinr, regs);
+                       }
+                       continue;
+               }
+ #endif
+       } while (1);
+ }
+ static int __init armada_370_xp_mpic_of_init(struct device_node *node,
+                                            struct device_node *parent)
+ {
+       u32 control;
+       main_int_base = of_iomap(node, 0);
+       per_cpu_int_base = of_iomap(node, 1);
+       BUG_ON(!main_int_base);
+       BUG_ON(!per_cpu_int_base);
+       control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL);
+       armada_370_xp_mpic_domain =
+               irq_domain_add_linear(node, (control >> 2) & 0x3ff,
+                               &armada_370_xp_mpic_irq_ops, NULL);
+       if (!armada_370_xp_mpic_domain)
+               panic("Unable to add Armada_370_Xp MPIC irq domain (DT)\n");
+       irq_set_default_host(armada_370_xp_mpic_domain);
+ #ifdef CONFIG_SMP
+       armada_xp_mpic_smp_cpu_init();
+       /*
+        * Set the default affinity from all CPUs to the boot cpu.
+        * This is required since the MPIC doesn't limit several CPUs
+        * from acknowledging the same interrupt.
+        */
+       cpumask_clear(irq_default_affinity);
+       cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
+ #endif
+       set_handle_irq(armada_370_xp_handle_irq);
+       return 0;
+ }
+ IRQCHIP_DECLARE(armada_370_xp_mpic, "marvell,mpic", armada_370_xp_mpic_of_init);
index b2e9e177a354dc16f1e6654a68c19855f9fdba0e,1c1942b5cee9b5d88f2b139de4a56c261048f1c7..8ab70a6209199145f840b9d0cff0b255700f454c
@@@ -29,7 -29,6 +29,7 @@@
   * and hooked into this driver.
   */
  
 +
  #if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
  #define SUPPORT_SYSRQ
  #endif
  /* There is by now at least one vendor with differing details, so handle it */
  struct vendor_data {
        unsigned int            ifls;
 -      unsigned int            fifosize;
        unsigned int            lcrh_tx;
        unsigned int            lcrh_rx;
        bool                    oversampling;
        bool                    dma_threshold;
        bool                    cts_event_workaround;
 +
 +      unsigned int (*get_fifosize)(unsigned int periphid);
  };
  
 +static unsigned int get_fifosize_arm(unsigned int periphid)
 +{
 +      unsigned int rev = (periphid >> 20) & 0xf;
 +      return rev < 3 ? 16 : 32;
 +}
 +
  static struct vendor_data vendor_arm = {
        .ifls                   = UART011_IFLS_RX4_8|UART011_IFLS_TX4_8,
 -      .fifosize               = 16,
        .lcrh_tx                = UART011_LCRH,
        .lcrh_rx                = UART011_LCRH,
        .oversampling           = false,
        .dma_threshold          = false,
        .cts_event_workaround   = false,
 +      .get_fifosize           = get_fifosize_arm,
  };
  
 +static unsigned int get_fifosize_st(unsigned int periphid)
 +{
 +      return 64;
 +}
 +
  static struct vendor_data vendor_st = {
        .ifls                   = UART011_IFLS_RX_HALF|UART011_IFLS_TX_HALF,
 -      .fifosize               = 64,
        .lcrh_tx                = ST_UART011_LCRH_TX,
        .lcrh_rx                = ST_UART011_LCRH_RX,
        .oversampling           = true,
        .dma_threshold          = true,
        .cts_event_workaround   = true,
 +      .get_fifosize           = get_fifosize_st,
  };
  
  static struct uart_amba_port *amba_ports[UART_NR];
@@@ -130,12 -117,6 +130,12 @@@ struct pl011_dmarx_data 
        struct pl011_sgbuf      sgbuf_b;
        dma_cookie_t            cookie;
        bool                    running;
 +      struct timer_list       timer;
 +      unsigned int last_residue;
 +      unsigned long last_jiffies;
 +      bool auto_poll_rate;
 +      unsigned int poll_rate;
 +      unsigned int poll_timeout;
  };
  
  struct pl011_dmatx_data {
@@@ -242,18 -223,16 +242,18 @@@ static int pl011_fifo_to_tty(struct uar
  static int pl011_sgbuf_init(struct dma_chan *chan, struct pl011_sgbuf *sg,
        enum dma_data_direction dir)
  {
 -      sg->buf = kmalloc(PL011_DMA_BUFFER_SIZE, GFP_KERNEL);
 +      dma_addr_t dma_addr;
 +
 +      sg->buf = dma_alloc_coherent(chan->device->dev,
 +              PL011_DMA_BUFFER_SIZE, &dma_addr, GFP_KERNEL);
        if (!sg->buf)
                return -ENOMEM;
  
 -      sg_init_one(&sg->sg, sg->buf, PL011_DMA_BUFFER_SIZE);
 +      sg_init_table(&sg->sg, 1);
 +      sg_set_page(&sg->sg, phys_to_page(dma_addr),
 +              PL011_DMA_BUFFER_SIZE, offset_in_page(dma_addr));
 +      sg_dma_address(&sg->sg) = dma_addr;
  
 -      if (dma_map_sg(chan->device->dev, &sg->sg, 1, dir) != 1) {
 -              kfree(sg->buf);
 -              return -EINVAL;
 -      }
        return 0;
  }
  
@@@ -261,13 -240,12 +261,13 @@@ static void pl011_sgbuf_free(struct dma
        enum dma_data_direction dir)
  {
        if (sg->buf) {
 -              dma_unmap_sg(chan->device->dev, &sg->sg, 1, dir);
 -              kfree(sg->buf);
 +              dma_free_coherent(chan->device->dev,
 +                      PL011_DMA_BUFFER_SIZE, sg->buf,
 +                      sg_dma_address(&sg->sg));
        }
  }
  
- static void pl011_dma_probe_initcall(struct uart_amba_port *uap)
+ static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port *uap)
  {
        /* DMA is the sole user of the platform data right now */
        struct amba_pl011_data *plat = uap->port.dev->platform_data;
        struct dma_chan *chan;
        dma_cap_mask_t mask;
  
-       /* We need platform data */
-       if (!plat || !plat->dma_filter) {
-               dev_info(uap->port.dev, "no DMA platform data\n");
-               return;
-       }
+       chan = dma_request_slave_channel(dev, "tx");
  
-       /* Try to acquire a generic DMA engine slave TX channel */
-       dma_cap_zero(mask);
-       dma_cap_set(DMA_SLAVE, mask);
-       chan = dma_request_channel(mask, plat->dma_filter, plat->dma_tx_param);
        if (!chan) {
-               dev_err(uap->port.dev, "no TX DMA channel!\n");
-               return;
+               /* We need platform data */
+               if (!plat || !plat->dma_filter) {
+                       dev_info(uap->port.dev, "no DMA platform data\n");
+                       return;
+               }
+               /* Try to acquire a generic DMA engine slave TX channel */
+               dma_cap_zero(mask);
+               dma_cap_set(DMA_SLAVE, mask);
+               chan = dma_request_channel(mask, plat->dma_filter,
+                                               plat->dma_tx_param);
+               if (!chan) {
+                       dev_err(uap->port.dev, "no TX DMA channel!\n");
+                       return;
+               }
        }
  
        dmaengine_slave_config(chan, &tx_conf);
                 dma_chan_name(uap->dmatx.chan));
  
        /* Optionally make use of an RX channel as well */
-       if (plat->dma_rx_param) {
+       chan = dma_request_slave_channel(dev, "rx");
+       
+       if (!chan && plat->dma_rx_param) {
+               chan = dma_request_channel(mask, plat->dma_filter, plat->dma_rx_param);
+               if (!chan) {
+                       dev_err(uap->port.dev, "no RX DMA channel!\n");
+                       return;
+               }
+       }
+       if (chan) {
                struct dma_slave_config rx_conf = {
                        .src_addr = uap->port.mapbase + UART01x_DR,
                        .src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE,
                        .device_fc = false,
                };
  
-               chan = dma_request_channel(mask, plat->dma_filter, plat->dma_rx_param);
-               if (!chan) {
-                       dev_err(uap->port.dev, "no RX DMA channel!\n");
-                       return;
-               }
                dmaengine_slave_config(chan, &rx_conf);
                uap->dmarx.chan = chan;
  
 +              if (plat->dma_rx_poll_enable) {
 +                      /* Set poll rate if specified. */
 +                      if (plat->dma_rx_poll_rate) {
 +                              uap->dmarx.auto_poll_rate = false;
 +                              uap->dmarx.poll_rate = plat->dma_rx_poll_rate;
 +                      } else {
 +                              /*
 +                               * 100 ms defaults to poll rate if not
 +                               * specified. This will be adjusted with
 +                               * the baud rate at set_termios.
 +                               */
 +                              uap->dmarx.auto_poll_rate = true;
 +                              uap->dmarx.poll_rate =  100;
 +                      }
 +                      /* 3 secs defaults poll_timeout if not specified. */
 +                      if (plat->dma_rx_poll_timeout)
 +                              uap->dmarx.poll_timeout =
 +                                      plat->dma_rx_poll_timeout;
 +                      else
 +                              uap->dmarx.poll_timeout = 3000;
 +              } else
 +                      uap->dmarx.auto_poll_rate = false;
 +
                dev_info(uap->port.dev, "DMA channel RX %s\n",
                         dma_chan_name(uap->dmarx.chan));
        }
  struct dma_uap {
        struct list_head node;
        struct uart_amba_port *uap;
+       struct device *dev;
  };
  
  static LIST_HEAD(pl011_dma_uarts);
@@@ -370,7 -336,7 +381,7 @@@ static int __init pl011_dma_initcall(vo
  
        list_for_each_safe(node, tmp, &pl011_dma_uarts) {
                struct dma_uap *dmau = list_entry(node, struct dma_uap, node);
-               pl011_dma_probe_initcall(dmau->uap);
+               pl011_dma_probe_initcall(dmau->dev, dmau->uap);
                list_del(node);
                kfree(dmau);
        }
  
  device_initcall(pl011_dma_initcall);
  
- static void pl011_dma_probe(struct uart_amba_port *uap)
+ static void pl011_dma_probe(struct device *dev, struct uart_amba_port *uap)
  {
        struct dma_uap *dmau = kzalloc(sizeof(struct dma_uap), GFP_KERNEL);
        if (dmau) {
                dmau->uap = uap;
+               dmau->dev = dev;
                list_add_tail(&dmau->node, &pl011_dma_uarts);
        }
  }
  #else
- static void pl011_dma_probe(struct uart_amba_port *uap)
+ static void pl011_dma_probe(struct device *dev, struct uart_amba_port *uap)
  {
-       pl011_dma_probe_initcall(uap);
+       pl011_dma_probe_initcall(dev, uap);
  }
  #endif
  
@@@ -746,30 -713,24 +758,30 @@@ static void pl011_dma_rx_chars(struct u
        struct tty_port *port = &uap->port.state->port;
        struct pl011_sgbuf *sgbuf = use_buf_b ?
                &uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a;
 -      struct device *dev = uap->dmarx.chan->device->dev;
        int dma_count = 0;
        u32 fifotaken = 0; /* only used for vdbg() */
  
 -      /* Pick everything from the DMA first */
 +      struct pl011_dmarx_data *dmarx = &uap->dmarx;
 +      int dmataken = 0;
 +
 +      if (uap->dmarx.poll_rate) {
 +              /* The data can be taken by polling */
 +              dmataken = sgbuf->sg.length - dmarx->last_residue;
 +              /* Recalculate the pending size */
 +              if (pending >= dmataken)
 +                      pending -= dmataken;
 +      }
 +
 +      /* Pick the remain data from the DMA */
        if (pending) {
 -              /* Sync in buffer */
 -              dma_sync_sg_for_cpu(dev, &sgbuf->sg, 1, DMA_FROM_DEVICE);
  
                /*
                 * First take all chars in the DMA pipe, then look in the FIFO.
                 * Note that tty_insert_flip_buf() tries to take as many chars
                 * as it can.
                 */
 -              dma_count = tty_insert_flip_string(port, sgbuf->buf, pending);
 -
 -              /* Return buffer to device */
 -              dma_sync_sg_for_device(dev, &sgbuf->sg, 1, DMA_FROM_DEVICE);
 +              dma_count = tty_insert_flip_string(port, sgbuf->buf + dmataken,
 +                              pending);
  
                uap->port.icount.rx += dma_count;
                if (dma_count < pending)
                                 "couldn't insert all characters (TTY is full?)\n");
        }
  
 +      /* Reset the last_residue for Rx DMA poll */
 +      if (uap->dmarx.poll_rate)
 +              dmarx->last_residue = sgbuf->sg.length;
 +
        /*
         * Only continue with trying to read the FIFO if all DMA chars have
         * been taken first.
@@@ -920,57 -877,6 +932,57 @@@ static inline void pl011_dma_rx_stop(st
        writew(uap->dmacr, uap->port.membase + UART011_DMACR);
  }
  
 +/*
 + * Timer handler for Rx DMA polling.
 + * Every polling, It checks the residue in the dma buffer and transfer
 + * data to the tty. Also, last_residue is updated for the next polling.
 + */
 +static void pl011_dma_rx_poll(unsigned long args)
 +{
 +      struct uart_amba_port *uap = (struct uart_amba_port *)args;
 +      struct tty_port *port = &uap->port.state->port;
 +      struct pl011_dmarx_data *dmarx = &uap->dmarx;
 +      struct dma_chan *rxchan = uap->dmarx.chan;
 +      unsigned long flags = 0;
 +      unsigned int dmataken = 0;
 +      unsigned int size = 0;
 +      struct pl011_sgbuf *sgbuf;
 +      int dma_count;
 +      struct dma_tx_state state;
 +
 +      sgbuf = dmarx->use_buf_b ? &uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a;
 +      rxchan->device->device_tx_status(rxchan, dmarx->cookie, &state);
 +      if (likely(state.residue < dmarx->last_residue)) {
 +              dmataken = sgbuf->sg.length - dmarx->last_residue;
 +              size = dmarx->last_residue - state.residue;
 +              dma_count = tty_insert_flip_string(port, sgbuf->buf + dmataken,
 +                              size);
 +              if (dma_count == size)
 +                      dmarx->last_residue =  state.residue;
 +              dmarx->last_jiffies = jiffies;
 +      }
 +      tty_flip_buffer_push(port);
 +
 +      /*
 +       * If no data is received in poll_timeout, the driver will fall back
 +       * to interrupt mode. We will retrigger DMA at the first interrupt.
 +       */
 +      if (jiffies_to_msecs(jiffies - dmarx->last_jiffies)
 +                      > uap->dmarx.poll_timeout) {
 +
 +              spin_lock_irqsave(&uap->port.lock, flags);
 +              pl011_dma_rx_stop(uap);
 +              spin_unlock_irqrestore(&uap->port.lock, flags);
 +
 +              uap->dmarx.running = false;
 +              dmaengine_terminate_all(rxchan);
 +              del_timer(&uap->dmarx.timer);
 +      } else {
 +              mod_timer(&uap->dmarx.timer,
 +                      jiffies + msecs_to_jiffies(uap->dmarx.poll_rate));
 +      }
 +}
 +
  static void pl011_dma_startup(struct uart_amba_port *uap)
  {
        int ret;
@@@ -1033,16 -939,6 +1045,16 @@@ skip_rx
                if (pl011_dma_rx_trigger_dma(uap))
                        dev_dbg(uap->port.dev, "could not trigger initial "
                                "RX DMA job, fall back to interrupt mode\n");
 +              if (uap->dmarx.poll_rate) {
 +                      init_timer(&(uap->dmarx.timer));
 +                      uap->dmarx.timer.function = pl011_dma_rx_poll;
 +                      uap->dmarx.timer.data = (unsigned long)uap;
 +                      mod_timer(&uap->dmarx.timer,
 +                              jiffies +
 +                              msecs_to_jiffies(uap->dmarx.poll_rate));
 +                      uap->dmarx.last_residue = PL011_DMA_BUFFER_SIZE;
 +                      uap->dmarx.last_jiffies = jiffies;
 +              }
        }
  }
  
@@@ -1078,8 -974,6 +1090,8 @@@ static void pl011_dma_shutdown(struct u
                /* Clean up the RX DMA */
                pl011_sgbuf_free(uap->dmarx.chan, &uap->dmarx.sgbuf_a, DMA_FROM_DEVICE);
                pl011_sgbuf_free(uap->dmarx.chan, &uap->dmarx.sgbuf_b, DMA_FROM_DEVICE);
 +              if (uap->dmarx.poll_rate)
 +                      del_timer_sync(&uap->dmarx.timer);
                uap->using_rx_dma = false;
        }
  }
@@@ -1094,9 -988,10 +1106,9 @@@ static inline bool pl011_dma_rx_running
        return uap->using_rx_dma && uap->dmarx.running;
  }
  
 -
  #else
  /* Blank functions if the DMA engine is not available */
- static inline void pl011_dma_probe(struct uart_amba_port *uap)
+ static inline void pl011_dma_probe(struct device *dev, struct uart_amba_port *uap)
  {
  }
  
@@@ -1205,20 -1100,8 +1217,20 @@@ static void pl011_rx_chars(struct uart_
                        dev_dbg(uap->port.dev, "could not trigger RX DMA job "
                                "fall back to interrupt mode again\n");
                        uap->im |= UART011_RXIM;
 -              } else
 +              } else {
                        uap->im &= ~UART011_RXIM;
 +#ifdef CONFIG_DMA_ENGINE
 +                      /* Start Rx DMA poll */
 +                      if (uap->dmarx.poll_rate) {
 +                              uap->dmarx.last_jiffies = jiffies;
 +                              uap->dmarx.last_residue = PL011_DMA_BUFFER_SIZE;
 +                              mod_timer(&uap->dmarx.timer,
 +                                      jiffies +
 +                                      msecs_to_jiffies(uap->dmarx.poll_rate));
 +                      }
 +#endif
 +              }
 +
                writew(uap->im, uap->port.membase + UART011_IMSC);
        }
        spin_lock(&uap->port.lock);
@@@ -1293,6 -1176,7 +1305,6 @@@ static irqreturn_t pl011_int(int irq, v
        unsigned int dummy_read;
  
        spin_lock_irqsave(&uap->port.lock, flags);
 -
        status = readw(uap->port.membase + UART011_MIS);
        if (status) {
                do {
@@@ -1679,13 -1563,6 +1691,13 @@@ pl011_set_termios(struct uart_port *por
         */
        baud = uart_get_baud_rate(port, termios, old, 0,
                                  port->uartclk / clkdiv);
 +#ifdef CONFIG_DMA_ENGINE
 +      /*
 +       * Adjust RX DMA polling rate with baud rate if not specified.
 +       */
 +      if (uap->dmarx.auto_poll_rate)
 +              uap->dmarx.poll_rate = DIV_ROUND_UP(10000000, baud);
 +#endif
  
        if (baud > port->uartclk/16)
                quot = DIV_ROUND_CLOSEST(port->uartclk * 8, baud);
@@@ -2145,7 -2022,7 +2157,7 @@@ static int pl011_probe(struct amba_devi
        uap->lcrh_rx = vendor->lcrh_rx;
        uap->lcrh_tx = vendor->lcrh_tx;
        uap->old_cr = 0;
 -      uap->fifosize = vendor->fifosize;
 +      uap->fifosize = vendor->get_fifosize(dev->periphid);
        uap->port.dev = &dev->dev;
        uap->port.mapbase = dev->res.start;
        uap->port.membase = base;
        uap->port.ops = &amba_pl011_pops;
        uap->port.flags = UPF_BOOT_AUTOCONF;
        uap->port.line = i;
-       pl011_dma_probe(uap);
+       pl011_dma_probe(&dev->dev, uap);
  
        /* Ensure interrupts from this UART are masked and cleared */
        writew(0, uap->port.membase + UART011_IMSC);
diff --combined include/linux/of.h
index 1b671c3809b8e4f30c445c7f58c43726b0ce6eb6,b0f3bbd0216bb69e386e652a75044dd239e3f65e..1fd08ca23106df836678989d96e2a16824b1a932
@@@ -356,11 -356,6 +356,11 @@@ static inline struct device_node *of_fi
        return NULL;
  }
  
 +static inline struct device_node *of_get_parent(const struct device_node *node)
 +{
 +      return NULL;
 +}
 +
  static inline bool of_have_populated_dt(void)
  {
        return false;
@@@ -387,6 -382,11 +387,11 @@@ static inline int of_device_is_compatib
        return 0;
  }
  
+ static inline int of_device_is_available(const struct device_node *device)
+ {
+       return 0;
+ }
  static inline struct property *of_find_property(const struct device_node *np,
                                                const char *name,
                                                int *lenp)
@@@ -554,14 -554,4 +559,14 @@@ static inline int of_property_read_u32(
        return of_property_read_u32_array(np, propname, out_value, 1);
  }
  
 +#if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE)
 +extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
 +extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop);
 +extern void proc_device_tree_remove_prop(struct proc_dir_entry *pde,
 +                                       struct property *prop);
 +extern void proc_device_tree_update_prop(struct proc_dir_entry *pde,
 +                                       struct property *newprop,
 +                                       struct property *oldprop);
 +#endif
 +
  #endif /* _LINUX_OF_H */