]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Feb 2013 22:58:40 +0000 (14:58 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Feb 2013 22:58:40 +0000 (14:58 -0800)
Pull ARM SoC cleanups from Arnd Bergmann:
 "A large number of cleanups, all over the platforms.  This is dominated
  largely by the Samsung platforms (s3c, s5p, exynos) and a few of the
  others moving code out of arch/arm into more appropriate subsystems.

  The clocksource and irqchip drivers are now abstracted to the point
  where platforms that are already cleaned up do not need to even
  specify the driver they use, it can all get configured from the device
  tree as we do for normal device drivers.  The clocksource changes
  basically touch every single platform in the process.

  We further clean up the use of platform specific header files here,
  with the goal of turning more of the platforms over to being
  "multiplatform" enabled, which implies that they cannot expose their
  headers to architecture independent code any more.

  It is expected that no functional changes are part of the cleanup.
  The overall reduction in total code lines is mostly the result of
  removing broken and obsolete code."

* tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (133 commits)
  ARM: mvebu: correct gated clock documentation
  ARM: kirkwood: add missing include for nsa310
  ARM: exynos: move exynos4210-combiner to drivers/irqchip
  mfd: db8500-prcmu: update resource passing
  drivers/db8500-cpufreq: delete dangling include
  ARM: at91: remove NEOCORE 926 board
  sunxi: Cleanup the reset code and add meaningful registers defines
  ARM: S3C24XX: header mach/regs-mem.h local
  ARM: S3C24XX: header mach/regs-power.h local
  ARM: S3C24XX: header mach/regs-s3c2412-mem.h local
  ARM: S3C24XX: Remove plat-s3c24xx directory in arch/arm/
  ARM: S3C24XX: transform s3c2443 subirqs into new structure
  ARM: S3C24XX: modify s3c2443 irq init to initialize all irqs
  ARM: S3C24XX: move s3c2443 irq code to irq.c
  ARM: S3C24XX: transform s3c2416 irqs into new structure
  ARM: S3C24XX: modify s3c2416 irq init to initialize all irqs
  ARM: S3C24XX: move s3c2416 irq init to common irq code
  ARM: S3C24XX: Modify s3c_irq_wake to use the hwirq property
  ARM: S3C24XX: Move irq syscore-ops to irq-pm
  clocksource: always define CLOCKSOURCE_OF_DECLARE
  ...

60 files changed:
1  2 
MAINTAINERS
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm/Makefile
arch/arm/kernel/smp.c
arch/arm/kernel/smp_twd.c
arch/arm/mach-exynos/common.c
arch/arm/mach-exynos/mach-exynos5-dt.c
arch/arm/mach-exynos/pm.c
arch/arm/mach-highbank/highbank.c
arch/arm/mach-imx/Kconfig
arch/arm/mach-integrator/integrator_ap.c
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-4430sdp.c
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-devkit8000.c
arch/arm/mach-omap2/board-igep0020.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-omap3logic.c
arch/arm/mach-omap2/board-omap3pandora.c
arch/arm/mach-omap2/board-omap3stalker.c
arch/arm/mach-omap2/board-omap3touchbook.c
arch/arm/mach-omap2/board-omap4panda.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/board-rm680.c
arch/arm/mach-omap2/omap-wakeupgen.c
arch/arm/mach-omap2/timer.c
arch/arm/mach-s3c24xx/Kconfig
arch/arm/mach-s3c24xx/mach-osiris.c
arch/arm/mach-s3c24xx/pm-s3c2412.c
arch/arm/mach-s3c24xx/pm-s3c2416.c
arch/arm/mach-s3c24xx/sleep-s3c2410.S
arch/arm/mach-s3c64xx/pm.c
arch/arm/mach-sa1100/assabet.c
arch/arm/mach-sa1100/lart.c
arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-armadillo800eva.c
arch/arm/mach-shmobile/board-kzm9g.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/mach-tegra/cpu-tegra.c
arch/arm/mach-ux500/board-mop500.c
arch/arm/mach-ux500/cpu-db8500.c
arch/arm/mach-ux500/cpu.c
arch/arm/mach-versatile/core.c
drivers/clocksource/sunxi_timer.c
drivers/cpufreq/db8500-cpufreq.c
drivers/cpufreq/exynos-cpufreq.c
drivers/cpufreq/exynos-cpufreq.h
drivers/cpufreq/exynos4210-cpufreq.c
drivers/cpufreq/exynos4x12-cpufreq.c
drivers/cpufreq/exynos5250-cpufreq.c
drivers/gpio/gpio-samsung.c
drivers/irqchip/irq-gic.c
include/asm-generic/vmlinux.lds.h
include/linux/time.h
kernel/time/timekeeping.c

diff --combined MAINTAINERS
index 22b754a8b4b31e149f074dd53bc908b7b8564310,43dbae19838b9281125a518a0a72c2df6a3ab9b6..f4da1b8314da110a1f26a363c913133228221ed9
@@@ -670,16 -670,8 +670,16 @@@ F:       drivers/input/serio/ambakmi.
  F:    include/linux/amba/kmi.h
  
  ARM PRIMECELL MMCI PL180/1 DRIVER
 -S:    Orphan
 +M:    Russell King <linux@arm.linux.org.uk>
 +S:    Maintained
  F:    drivers/mmc/host/mmci.*
 +F:    include/linux/amba/mmci.h
 +
 +ARM PRIMECELL UART PL010 AND PL011 DRIVERS
 +M:    Russell King <linux@arm.linux.org.uk>
 +S:    Maintained
 +F:    drivers/tty/serial/amba-pl01*.c
 +F:    include/linux/amba/serial.h
  
  ARM PRIMECELL BUS SUPPORT
  M:    Russell King <linux@arm.linux.org.uk>
@@@ -1256,17 -1248,12 +1256,17 @@@ M:   Tony Prisk <linux@prisktech.co.nz
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/mach-vt8500/
 +F:    drivers/clocksource/vt8500_timer.c
 +F:    drivers/gpio/gpio-vt8500.c
 +F:    drivers/mmc/host/wmt-sdmmc.c
 +F:    drivers/pwm/pwm-vt8500.c
 +F:    drivers/rtc/rtc-vt8500.c
 +F:    drivers/tty/serial/vt8500_serial.c
 +F:    drivers/usb/host/ehci-vt8500.c
 +F:    drivers/usb/host/uhci-platform.c
  F:    drivers/video/vt8500lcdfb.*
  F:    drivers/video/wm8505fb*
  F:    drivers/video/wmt_ge_rops.*
 -F:    drivers/tty/serial/vt8500_serial.c
 -F:    drivers/rtc/rtc-vt8500.c
 -F:    drivers/mmc/host/wmt-sdmmc.c
  
  ARM/ZIPIT Z2 SUPPORT
  M:    Marek Vasut <marek.vasut@gmail.com>
@@@ -1275,14 -1262,6 +1275,14 @@@ S:    Maintaine
  F:    arch/arm/mach-pxa/z2.c
  F:    arch/arm/mach-pxa/include/mach/z2.h
  
 +ARM/ZYNQ ARCHITECTURE
 +M:    Michal Simek <michal.simek@xilinx.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +W:    http://wiki.xilinx.com
 +T:    git git://git.xilinx.com/linux-xlnx.git
 +S:    Supported
 +F:    arch/arm/mach-zynq/
 +
  ARM64 PORT (AARCH64 ARCHITECTURE)
  M:    Catalin Marinas <catalin.marinas@arm.com>
  M:    Will Deacon <will.deacon@arm.com>
@@@ -1324,7 -1303,7 +1324,7 @@@ F:      include/linux/dmaengine.
  F:    include/linux/async_tx.h
  
  AT24 EEPROM DRIVER
 -M:    Wolfram Sang <w.sang@pengutronix.de>
 +M:    Wolfram Sang <wsa@the-dreams.de>
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
  F:    drivers/misc/eeprom/at24.c
@@@ -1510,7 -1489,7 +1510,7 @@@ AVR32 ARCHITECTUR
  M:    Haavard Skinnemoen <hskinnemoen@gmail.com>
  M:    Hans-Christian Egtvedt <egtvedt@samfundet.no>
  W:    http://www.atmel.com/products/AVR32/
 -W:    http://avr32linux.org/
 +W:    http://mirror.egtvedt.no/avr32linux.org/
  W:    http://avrfreaks.net/
  S:    Maintained
  F:    arch/avr32/
@@@ -2161,10 -2140,10 +2161,10 @@@ S:   Maintaine
  F:    tools/power/cpupower
  
  CPUSETS
 -M:    Paul Menage <paul@paulmenage.org>
 +M:    Li Zefan <lizefan@huawei.com>
  W:    http://www.bullopensource.org/cpuset/
  W:    http://oss.sgi.com/projects/cpusets/
 -S:    Supported
 +S:    Maintained
  F:    Documentation/cgroups/cpusets.txt
  F:    include/linux/cpuset.h
  F:    kernel/cpuset.c
@@@ -2995,6 -2974,11 +2995,6 @@@ S:     Maintaine
  F:    include/linux/netfilter_bridge/
  F:    net/bridge/
  
 -ETHERTEAM 16I DRIVER
 -M:    Mika Kuoppala <miku@iki.fi>
 -S:    Maintained
 -F:    drivers/net/ethernet/fujitsu/eth16i.c
 -
  EXT2 FILE SYSTEM
  M:    Jan Kara <jack@suse.cz>
  L:    linux-ext4@vger.kernel.org
@@@ -3773,11 -3757,12 +3773,11 @@@ S:   Maintaine
  F:    drivers/i2c/i2c-stub.c
  
  I2C SUBSYSTEM
 -M:    Wolfram Sang <w.sang@pengutronix.de>
 +M:    Wolfram Sang <wsa@the-dreams.de>
  M:    "Ben Dooks (embedded platforms)" <ben-linux@fluff.org>
  L:    linux-i2c@vger.kernel.org
  W:    http://i2c.wiki.kernel.org/
 -T:    quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/
 -T:    git git://git.pengutronix.de/git/wsa/linux.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
  S:    Maintained
  F:    Documentation/i2c/
  F:    drivers/i2c/
@@@ -4231,6 -4216,7 +4231,7 @@@ M:      Thomas Gleixner <tglx@linutronix.de
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
  F:    kernel/irq/
+ F:    drivers/irqchip/
  
  IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY)
  M:    Benjamin Herrenschmidt <benh@kernel.crashing.org>
@@@ -4496,15 -4482,6 +4497,15 @@@ F:    arch/s390/include/asm/kvm
  F:    arch/s390/kvm/
  F:    drivers/s390/kvm/
  
 +KERNEL VIRTUAL MACHINE (KVM) FOR ARM
 +M:    Christoffer Dall <cdall@cs.columbia.edu>
 +L:    kvmarm@lists.cs.columbia.edu
 +W:    http://systems.cs.columbia.edu/projects/kvm-arm
 +S:    Maintained
 +F:    arch/arm/include/uapi/asm/kvm*
 +F:    arch/arm/include/asm/kvm*
 +F:    arch/arm/kvm/
 +
  KEXEC
  M:    Eric Biederman <ebiederm@xmission.com>
  W:    http://kernel.org/pub/linux/utils/kernel/kexec/
@@@ -5393,6 -5370,13 +5394,6 @@@ F:     include/linux/sunrpc
  F:    include/uapi/linux/nfs*
  F:    include/uapi/linux/sunrpc/
  
 -NI5010 NETWORK DRIVER
 -M:    Jan-Pascal van Best <janpascal@vanbest.org>
 -M:    Andreas Mohr <andi@lisas.de>
 -L:    netdev@vger.kernel.org
 -S:    Maintained
 -F:    drivers/net/ethernet/racal/ni5010.*
 -
  NILFS2 FILESYSTEM
  M:    KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
  L:    linux-nilfs@vger.kernel.org
@@@ -5418,13 -5402,6 +5419,13 @@@ S:    Maintaine
  F:    Documentation/scsi/NinjaSCSI.txt
  F:    drivers/scsi/nsp32*
  
 +NTB DRIVER
 +M:    Jon Mason <jon.mason@intel.com>
 +S:    Supported
 +F:    drivers/ntb/
 +F:    drivers/net/ntb_netdev.c
 +F:    include/linux/ntb.h
 +
  NTFS FILESYSTEM
  M:    Anton Altaparmakov <anton@tuxera.com>
  L:    linux-ntfs-dev@lists.sourceforge.net
@@@ -5802,6 -5779,15 +5803,6 @@@ L:     linux-i2c@vger.kernel.or
  S:    Maintained
  F:    drivers/i2c/muxes/i2c-mux-pca9541.c
  
 -PCA9564/PCA9665 I2C BUS DRIVER
 -M:    Wolfram Sang <w.sang@pengutronix.de>
 -L:    linux-i2c@vger.kernel.org
 -S:    Maintained
 -F:    drivers/i2c/algos/i2c-algo-pca.c
 -F:    drivers/i2c/busses/i2c-pca-*
 -F:    include/linux/i2c-algo-pca.h
 -F:    include/linux/i2c-pca-platform.h
 -
  PCDP - PRIMARY CONSOLE AND DEBUG PORT
  M:    Khalid Aziz <khalid@gonehiking.org>
  S:    Maintained
@@@ -6613,7 -6599,7 +6614,7 @@@ F:      drivers/dma/dw_dmac_regs.
  F:    drivers/dma/dw_dmac.c
  
  TIMEKEEPING, NTP
 -M:    John Stultz <johnstul@us.ibm.com>
 +M:    John Stultz <john.stultz@linaro.org>
  M:    Thomas Gleixner <tglx@linutronix.de>
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
  S:    Supported
@@@ -7193,7 -7179,6 +7194,7 @@@ F:      drivers/clk/spear
  
  SPI SUBSYSTEM
  M:    Grant Likely <grant.likely@secretlab.ca>
 +M:    Mark Brown <broonie@opensource.wolfsonmicro.com>
  L:    spi-devel-general@lists.sourceforge.net
  Q:    http://patchwork.kernel.org/project/spi-devel-general/list/
  T:    git git://git.secretlab.ca/git/linux-2.6.git
@@@ -7319,7 -7304,8 +7320,7 @@@ S:      Odd Fixe
  F:    drivers/staging/olpc_dcon/
  
  STAGING - OZMO DEVICES USB OVER WIFI DRIVER
 -M:    Rupesh Gujare <rgujare@ozmodevices.com>
 -M:    Chris Kelly <ckelly@ozmodevices.com>
 +M:    Rupesh Gujare <rupesh.gujare@atmel.com>
  S:    Maintained
  F:    drivers/staging/ozwpan/
  
@@@ -7551,18 -7537,13 +7552,18 @@@ S:   Maintaine
  F:    drivers/media/tuners/tea5767.*
  
  TEAM DRIVER
 -M:    Jiri Pirko <jpirko@redhat.com>
 +M:    Jiri Pirko <jiri@resnulli.us>
  L:    netdev@vger.kernel.org
  S:    Supported
  F:    drivers/net/team/
  F:    include/linux/if_team.h
  F:    include/uapi/linux/if_team.h
  
 +TECHNOLOGIC SYSTEMS TS-5500 PLATFORM SUPPORT
 +M:    Savoir-faire Linux Inc. <kernel@savoirfairelinux.com>
 +S:    Maintained
 +F:    arch/x86/platform/ts5500/
 +
  TECHNOTREND USB IR RECEIVER
  M:    Sean Young <sean@mess.org>
  L:    linux-media@vger.kernel.org
@@@ -7637,22 -7618,6 +7638,22 @@@ F:    Documentation/backlight/lp855x-drive
  F:    drivers/video/backlight/lp855x_bl.c
  F:    include/linux/platform_data/lp855x.h
  
 +TI LP8727 CHARGER DRIVER
 +M:    Milo Kim <milo.kim@ti.com>
 +S:    Maintained
 +F:    drivers/power/lp8727_charger.c
 +F:    include/linux/platform_data/lp8727.h
 +
 +TI LP8788 MFD DRIVER
 +M:    Milo Kim <milo.kim@ti.com>
 +S:    Maintained
 +F:    drivers/iio/adc/lp8788_adc.c
 +F:    drivers/leds/leds-lp8788.c
 +F:    drivers/mfd/lp8788*.c
 +F:    drivers/power/lp8788-charger.c
 +F:    drivers/regulator/lp8788-*.c
 +F:    include/linux/mfd/lp8788*.h
 +
  TI TWL4030 SERIES SOC CODEC DRIVER
  M:    Peter Ujfalusi <peter.ujfalusi@ti.com>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
@@@ -7947,10 -7912,9 +7948,10 @@@ F:    drivers/net/wireless/ath/ar5523
  USB ATTACHED SCSI
  M:    Matthew Wilcox <willy@linux.intel.com>
  M:    Sarah Sharp <sarah.a.sharp@linux.intel.com>
 +M:    Gerd Hoffmann <kraxel@redhat.com>
  L:    linux-usb@vger.kernel.org
  L:    linux-scsi@vger.kernel.org
 -S:    Supported
 +S:    Maintained
  F:    drivers/usb/storage/uas.c
  
  USB CDC ETHERNET DRIVER
diff --combined arch/arm/Kconfig
index 09238c83e6d63c55f56a3aa28978606328941c74,42e263a8d3534710b571ae9d5ab72aa895aeb9c3..c038431f2567591aac314644dfa20e1f005aa6f2
@@@ -36,6 -36,7 +36,6 @@@ config AR
        select HAVE_GENERIC_HARDIRQS
        select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
        select HAVE_IDE if PCI || ISA || PCMCIA
 -      select HAVE_IRQ_WORK
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_LZMA
        select HAVE_KERNEL_LZO
@@@ -260,8 -261,7 +260,8 @@@ config MM
  #
  choice
        prompt "ARM system type"
 -      default ARCH_MULTIPLATFORM
 +      default ARCH_VERSATILE if !MMU
 +      default ARCH_MULTIPLATFORM if MMU
  
  config ARCH_MULTIPLATFORM
        bool "Allow multiple platforms to be selected"
@@@ -344,10 -344,10 +344,10 @@@ config ARCH_BCM283
        select ARM_ERRATA_411920
        select ARM_TIMER_SP804
        select CLKDEV_LOOKUP
+       select CLKSRC_OF
        select COMMON_CLK
        select CPU_V6
        select GENERIC_CLOCKEVENTS
-       select GENERIC_GPIO
        select MULTI_IRQ_HANDLER
        select PINCTRL
        select PINCTRL_BCM2835
@@@ -642,9 -642,9 +642,9 @@@ config ARCH_TEGR
        select ARCH_HAS_CPUFREQ
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
+       select CLKSRC_OF
        select COMMON_CLK
        select GENERIC_CLOCKEVENTS
-       select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
@@@ -744,7 -744,6 +744,6 @@@ config ARCH_S3C24X
        select ARCH_HAS_CPUFREQ
        select ARCH_USES_GETTIMEOFFSET
        select CLKDEV_LOOKUP
-       select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -787,7 -786,6 +786,6 @@@ config ARCH_S5P64X
        select CLKSRC_MMIO
        select CPU_V6
        select GENERIC_CLOCKEVENTS
-       select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -802,7 -800,6 +800,6 @@@ config ARCH_S5PC10
        select ARCH_USES_GETTIMEOFFSET
        select CLKDEV_LOOKUP
        select CPU_V7
-       select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -820,7 -817,6 +817,6 @@@ config ARCH_S5PV21
        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
@@@ -838,7 -834,6 +834,6 @@@ config ARCH_EXYNO
        select CLKDEV_LOOKUP
        select CPU_V7
        select GENERIC_CLOCKEVENTS
-       select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -873,7 -868,6 +868,6 @@@ config ARCH_U30
        select COMMON_CLK
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
-       select GENERIC_GPIO
        select HAVE_TCM
        select SPARSE_IRQ
        help
@@@ -957,7 -951,6 +951,6 @@@ config ARCH_VT8500_SINGL
        select COMMON_CLK
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
-       select GENERIC_GPIO
        select HAVE_CLK
        select MULTI_IRQ_HANDLER
        select SPARSE_IRQ
@@@ -1086,17 -1079,12 +1079,12 @@@ source "arch/arm/mach-realview/Kconfig
  source "arch/arm/mach-sa1100/Kconfig"
  
  source "arch/arm/plat-samsung/Kconfig"
- source "arch/arm/plat-s3c24xx/Kconfig"
  
  source "arch/arm/mach-socfpga/Kconfig"
  
  source "arch/arm/plat-spear/Kconfig"
  
  source "arch/arm/mach-s3c24xx/Kconfig"
- if ARCH_S3C24XX
- source "arch/arm/mach-s3c2412/Kconfig"
- source "arch/arm/mach-s3c2440/Kconfig"
- endif
  
  if ARCH_S3C64XX
  source "arch/arm/mach-s3c64xx/Kconfig"
@@@ -1450,10 -1438,6 +1438,10 @@@ config ISA_DM
        bool
        select ISA_DMA_API
  
 +config ARCH_NO_VIRT_TO_BUS
 +      def_bool y
 +      depends on !ARCH_RPC && !ARCH_NETWINDER && !ARCH_SHARK
 +
  # Select ISA DMA interface
  config ISA_DMA_API
        bool
@@@ -1535,6 -1519,7 +1523,6 @@@ config SM
  
  config SMP_ON_UP
        bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
        depends on SMP && !XIP_KERNEL
        default y
        help
@@@ -1623,16 -1608,6 +1611,16 @@@ config HOTPLUG_CP
          Say Y here to experiment with turning CPUs off and on.  CPUs
          can be controlled through /sys/devices/system/cpu.
  
 +config ARM_PSCI
 +      bool "Support for the ARM Power State Coordination Interface (PSCI)"
 +      depends on CPU_V7
 +      help
 +        Say Y here if you want Linux to communicate with system firmware
 +        implementing the PSCI specification for CPU-centric power
 +        management operations described in ARM document number ARM DEN
 +        0022A ("Power State Coordination Interface System Software on
 +        ARM processors").
 +
  config LOCAL_TIMERS
        bool "Use local timer interrupts"
        depends on SMP
@@@ -1650,7 -1625,7 +1638,7 @@@ config ARCH_NR_GPI
        default 355 if ARCH_U8500
        default 264 if MACH_H4700
        default 512 if SOC_OMAP5
 -      default 288 if ARCH_VT8500
 +      default 288 if ARCH_VT8500 || ARCH_SUNXI
        default 0
        help
          Maximum number of GPIOs in the system.
@@@ -1668,9 -1643,6 +1656,9 @@@ config H
        default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE
        default 100
  
 +config SCHED_HRTICK
 +      def_bool HIGH_RES_TIMERS
 +
  config THUMB2_KERNEL
        bool "Compile the kernel in Thumb-2 mode"
        depends on CPU_V7 && !CPU_V6 && !CPU_V6K
@@@ -1735,7 -1707,7 +1723,7 @@@ config AEAB
  
  config OABI_COMPAT
        bool "Allow old ABI binaries to run with this kernel (EXPERIMENTAL)"
 -      depends on AEABI && EXPERIMENTAL && !THUMB2_KERNEL
 +      depends on AEABI && !THUMB2_KERNEL
        default y
        help
          This option preserves the old syscall interface along with the
@@@ -1859,6 -1831,7 +1847,6 @@@ config SECCOM
  
  config CC_STACKPROTECTOR
        bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
        help
          This option turns on the -fstack-protector GCC feature. This
          feature puts, at the beginning of functions, a canary value on
@@@ -1875,7 -1848,7 +1863,7 @@@ config XEN_DOM
  
  config XEN
        bool "Xen guest support on ARM (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL && ARM && OF
 +      depends on ARM && OF
        depends on CPU_V7 && !CPU_V6
        help
          Say Y if you want to run Linux in a Virtual Machine on Xen on ARM.
@@@ -1944,7 -1917,7 +1932,7 @@@ config ZBOOT_RO
  
  choice
        prompt "Include SD/MMC loader in zImage (EXPERIMENTAL)"
 -      depends on ZBOOT_ROM && ARCH_SH7372 && EXPERIMENTAL
 +      depends on ZBOOT_ROM && ARCH_SH7372
        default ZBOOT_ROM_NONE
        help
          Include experimental SD/MMC loading code in the ROM-able zImage.
@@@ -1973,7 -1946,7 +1961,7 @@@ endchoic
  
  config ARM_APPENDED_DTB
        bool "Use appended device tree blob to zImage (EXPERIMENTAL)"
 -      depends on OF && !ZBOOT_ROM && EXPERIMENTAL
 +      depends on OF && !ZBOOT_ROM
        help
          With this option, the boot code will look for a device tree binary
          (DTB) appended to zImage
@@@ -2091,7 -2064,7 +2079,7 @@@ config XIP_PHYS_ADD
  
  config KEXEC
        bool "Kexec system call (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL && (!SMP || HOTPLUG_CPU)
 +      depends on (!SMP || HOTPLUG_CPU)
        help
          kexec is a system call that implements the ability to shutdown your
          current kernel, and to start another kernel.  It is like a reboot
@@@ -2113,6 -2086,7 +2101,6 @@@ config ATAGS_PRO
  
  config CRASH_DUMP
        bool "Build kdump crash kernel (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
        help
          Generate crash dump after being started by kexec. This should
          be normally only set in special crash dump kernels which are
@@@ -2179,7 -2153,7 +2167,7 @@@ config CPU_FREQ_S3
  
  config CPU_FREQ_S3C24XX
        bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)"
 -      depends on ARCH_S3C24XX && CPU_FREQ && EXPERIMENTAL
 +      depends on ARCH_S3C24XX && CPU_FREQ
        select CPU_FREQ_S3C
        help
          This enables the CPUfreq driver for the Samsung S3C24XX family
  
  config CPU_FREQ_S3C24XX_PLL
        bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)"
 -      depends on CPU_FREQ_S3C24XX && EXPERIMENTAL
 +      depends on CPU_FREQ_S3C24XX
        help
          Compile in support for changing the PLL frequency from the
          S3C24XX series CPUfreq driver. The PLL takes time to settle
@@@ -2254,7 -2228,7 +2242,7 @@@ config FPE_NWFPE_X
  
  config FPE_FASTFPE
        bool "FastFPE math emulation (EXPERIMENTAL)"
 -      depends on (!AEABI || OABI_COMPAT) && !CPU_32v3 && EXPERIMENTAL
 +      depends on (!AEABI || OABI_COMPAT) && !CPU_32v3
        ---help---
          Say Y here to include the FAST floating point emulator in the kernel.
          This is an experimental much faster emulator which now also has full
@@@ -2336,5 -2310,3 +2324,5 @@@ source "security/Kconfig
  source "crypto/Kconfig"
  
  source "lib/Kconfig"
 +
 +source "arch/arm/kvm/Kconfig"
diff --combined arch/arm/Kconfig.debug
index fc2a591e1676cc3e25b79f6d384ed99588498fe6,1dceb8e316183acc8a751323c0c0a916449616fa..ad375a51a7d2713b9b4c4a962d4e1302ff8bfbf5
@@@ -32,7 -32,7 +32,7 @@@ config FRAME_POINTE
  
  config ARM_UNWIND
        bool "Enable stack unwinding support (EXPERIMENTAL)"
 -      depends on AEABI && EXPERIMENTAL
 +      depends on AEABI
        default y
        help
          This option enables stack unwinding support in the kernel
@@@ -219,12 -219,12 +219,12 @@@ choic
                  Say Y here if you want kernel low-level debugging support
                  on i.MX51.
  
-       config DEBUG_IMX50_IMX53_UART
-               bool "i.MX50 and i.MX53 Debug UART"
-               depends on SOC_IMX50 || SOC_IMX53
+       config DEBUG_IMX53_UART
+               bool "i.MX53 Debug UART"
+               depends on SOC_IMX53
                help
                  Say Y here if you want kernel low-level debugging support
-                 on i.MX50 or i.MX53.
+                 on i.MX53.
  
        config DEBUG_IMX6Q_UART
                bool "i.MX6Q Debug UART"
@@@ -497,7 -497,7 +497,7 @@@ config DEBUG_LL_INCLUD
                                 DEBUG_IMX21_IMX27_UART || \
                                 DEBUG_IMX31_IMX35_UART || \
                                 DEBUG_IMX51_UART || \
-                                DEBUG_IMX50_IMX53_UART ||\
+                                DEBUG_IMX53_UART ||\
                                 DEBUG_IMX6Q_UART
        default "debug/highbank.S" if DEBUG_HIGHBANK_UART
        default "debug/mvebu.S" if DEBUG_MVEBU_UART
diff --combined arch/arm/Makefile
index 4bcd2d6b05358fe334d5005104573d6ac68e9326,a554f759c72fb48e393e153c19014103e8bc2756..1b7071681a5e056c049044fcb316c108c3ed2fbb
@@@ -173,7 -173,7 +173,7 @@@ machine-$(CONFIG_ARCH_PRIMA2)              += prima
  machine-$(CONFIG_ARCH_PXA)            += pxa
  machine-$(CONFIG_ARCH_REALVIEW)               += realview
  machine-$(CONFIG_ARCH_RPC)            += rpc
- machine-$(CONFIG_ARCH_S3C24XX)                += s3c24xx s3c2412 s3c2440
+ machine-$(CONFIG_ARCH_S3C24XX)                += s3c24xx
  machine-$(CONFIG_ARCH_S3C64XX)                += s3c64xx
  machine-$(CONFIG_ARCH_S5P64X0)                += s5p64x0
  machine-$(CONFIG_ARCH_S5PC100)                += s5pc100
@@@ -204,7 -204,7 +204,7 @@@ plat-$(CONFIG_ARCH_S3C64XX)        += samsun
  plat-$(CONFIG_PLAT_IOP)               += iop
  plat-$(CONFIG_PLAT_ORION)     += orion
  plat-$(CONFIG_PLAT_PXA)               += pxa
- plat-$(CONFIG_PLAT_S3C24XX)   += s3c24xx samsung
+ plat-$(CONFIG_PLAT_S3C24XX)   += samsung
  plat-$(CONFIG_PLAT_S5P)               += samsung
  plat-$(CONFIG_PLAT_SPEAR)     += spear
  plat-$(CONFIG_PLAT_VERSATILE) += versatile
@@@ -252,7 -252,6 +252,7 @@@ core-$(CONFIG_FPE_NWFPE)   += arch/arm/nw
  core-$(CONFIG_FPE_FASTFPE)    += $(FASTFPE_OBJ)
  core-$(CONFIG_VFP)            += arch/arm/vfp/
  core-$(CONFIG_XEN)            += arch/arm/xen/
 +core-$(CONFIG_KVM_ARM_HOST)   += arch/arm/kvm/
  
  # If we have a machine-specific directory, then include it in the build.
  core-y                                += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
diff --combined arch/arm/kernel/smp.c
index 365c8d92e2eb44e15cc6ef641755991e3efd26d5,3fc96db2a4b662feb745b28bc9e0cd1c8a63f82c..60340fa561d4c187eba947ca416ba215c4ffc8db
@@@ -125,6 -125,18 +125,6 @@@ void __init smp_init_cpus(void
                smp_ops.smp_init_cpus();
  }
  
 -static void __init platform_smp_prepare_cpus(unsigned int max_cpus)
 -{
 -      if (smp_ops.smp_prepare_cpus)
 -              smp_ops.smp_prepare_cpus(max_cpus);
 -}
 -
 -static void __cpuinit platform_secondary_init(unsigned int cpu)
 -{
 -      if (smp_ops.smp_secondary_init)
 -              smp_ops.smp_secondary_init(cpu);
 -}
 -
  int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
  {
        if (smp_ops.smp_boot_secondary)
@@@ -142,6 -154,12 +142,6 @@@ static int platform_cpu_kill(unsigned i
        return 1;
  }
  
 -static void platform_cpu_die(unsigned int cpu)
 -{
 -      if (smp_ops.cpu_die)
 -              smp_ops.cpu_die(cpu);
 -}
 -
  static int platform_cpu_disable(unsigned int cpu)
  {
        if (smp_ops.cpu_disable)
@@@ -239,8 -257,7 +239,8 @@@ void __ref cpu_die(void
         * actual CPU shutdown procedure is at least platform (if not
         * CPU) specific.
         */
 -      platform_cpu_die(cpu);
 +      if (smp_ops.cpu_die)
 +              smp_ops.cpu_die(cpu);
  
        /*
         * Do not return to the idle loop - jump back to the secondary
@@@ -307,8 -324,7 +307,8 @@@ asmlinkage void __cpuinit secondary_sta
        /*
         * Give the platform a chance to do its own initialisation.
         */
 -      platform_secondary_init(cpu);
 +      if (smp_ops.smp_secondary_init)
 +              smp_ops.smp_secondary_init(cpu);
  
        notify_cpu_starting(cpu);
  
@@@ -383,8 -399,8 +383,8 @@@ void __init smp_prepare_cpus(unsigned i
                /*
                 * Initialise the present map, which describes the set of CPUs
                 * actually populated at the present time. A platform should
 -               * re-initialize the map in platform_smp_prepare_cpus() if
 -               * present != possible (e.g. physical hotplug).
 +               * re-initialize the map in the platforms smp_prepare_cpus()
 +               * if present != possible (e.g. physical hotplug).
                 */
                init_cpu_present(cpu_possible_mask);
  
                 * Initialise the SCU if there are more than one CPU
                 * and let them know where to start.
                 */
 -              platform_smp_prepare_cpus(max_cpus);
 +              if (smp_ops.smp_prepare_cpus)
 +                      smp_ops.smp_prepare_cpus(max_cpus);
        }
  }
  
@@@ -401,7 -416,8 +401,8 @@@ static void (*smp_cross_call)(const str
  
  void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned int))
  {
-       smp_cross_call = fn;
+       if (!smp_cross_call)
+               smp_cross_call = fn;
  }
  
  void arch_send_call_function_ipi_mask(const struct cpumask *mask)
index ae0c7bb39ae88b5b9bdbf17b6272f309742f9b47,dc9bb01466659e420f14508cd2fd58f86b308202..c092115d903a8ad4e4c789398a7c444064ff273a
  
  #include <asm/smp_twd.h>
  #include <asm/localtimer.h>
- #include <asm/hardware/gic.h>
  
  /* set up by the platform code */
  static void __iomem *twd_base;
  
  static struct clk *twd_clk;
  static unsigned long twd_timer_rate;
 -static bool common_setup_called;
  static DEFINE_PER_CPU(bool, percpu_setup_called);
  
  static struct clock_event_device __percpu **twd_evt;
@@@ -238,28 -238,25 +237,28 @@@ static irqreturn_t twd_handler(int irq
        return IRQ_NONE;
  }
  
 -static struct clk *twd_get_clock(void)
 +static void twd_get_clock(struct device_node *np)
  {
 -      struct clk *clk;
        int err;
  
 -      clk = clk_get_sys("smp_twd", NULL);
 -      if (IS_ERR(clk)) {
 -              pr_err("smp_twd: clock not found: %d\n", (int)PTR_ERR(clk));
 -              return clk;
 +      if (np)
 +              twd_clk = of_clk_get(np, 0);
 +      else
 +              twd_clk = clk_get_sys("smp_twd", NULL);
 +
 +      if (IS_ERR(twd_clk)) {
 +              pr_err("smp_twd: clock not found %d\n", (int) PTR_ERR(twd_clk));
 +              return;
        }
  
 -      err = clk_prepare_enable(clk);
 +      err = clk_prepare_enable(twd_clk);
        if (err) {
                pr_err("smp_twd: clock failed to prepare+enable: %d\n", err);
 -              clk_put(clk);
 -              return ERR_PTR(err);
 +              clk_put(twd_clk);
 +              return;
        }
  
 -      return clk;
 +      twd_timer_rate = clk_get_rate(twd_clk);
  }
  
  /*
@@@ -282,7 -279,26 +281,7 @@@ static int __cpuinit twd_timer_setup(st
        }
        per_cpu(percpu_setup_called, cpu) = true;
  
 -      /*
 -       * This stuff only need to be done once for the entire TWD cluster
 -       * during the runtime of the system.
 -       */
 -      if (!common_setup_called) {
 -              twd_clk = twd_get_clock();
 -
 -              /*
 -               * We use IS_ERR_OR_NULL() here, because if the clock stubs
 -               * are active we will get a valid clk reference which is
 -               * however NULL and will return the rate 0. In that case we
 -               * need to calibrate the rate instead.
 -               */
 -              if (!IS_ERR_OR_NULL(twd_clk))
 -                      twd_timer_rate = clk_get_rate(twd_clk);
 -              else
 -                      twd_calibrate_rate();
 -
 -              common_setup_called = true;
 -      }
 +      twd_calibrate_rate();
  
        /*
         * The following is done once per CPU the first time .setup() is
@@@ -313,7 -329,7 +312,7 @@@ static struct local_timer_ops twd_lt_op
        .stop   = twd_timer_stop,
  };
  
 -static int __init twd_local_timer_common_register(void)
 +static int __init twd_local_timer_common_register(struct device_node *np)
  {
        int err;
  
        if (err)
                goto out_irq;
  
 +      twd_get_clock(np);
 +
        return 0;
  
  out_irq:
@@@ -358,7 -372,7 +357,7 @@@ int __init twd_local_timer_register(str
        if (!twd_base)
                return -ENOMEM;
  
 -      return twd_local_timer_common_register();
 +      return twd_local_timer_common_register(NULL);
  }
  
  #ifdef CONFIG_OF
@@@ -390,7 -404,7 +389,7 @@@ void __init twd_local_timer_of_register
                goto out;
        }
  
 -      err = twd_local_timer_common_register();
 +      err = twd_local_timer_common_register(np);
  
  out:
        WARN(err, "twd_local_timer_of_register failed (%d)\n", err);
index 0c7e3ad7ba93fb8583b4ce16a1c71ea44f47a118,4bf62c97849f7ecbbe7bcd2afd80a35ecabb19f1..d63d399c7bae2801e2c1e9f03590cfa13ad77674
@@@ -12,6 -12,7 +12,7 @@@
  #include <linux/kernel.h>
  #include <linux/interrupt.h>
  #include <linux/irq.h>
+ #include <linux/irqchip.h>
  #include <linux/io.h>
  #include <linux/device.h>
  #include <linux/gpio.h>
  #include <linux/of_irq.h>
  #include <linux/export.h>
  #include <linux/irqdomain.h>
+ #include <linux/irqchip.h>
  #include <linux/of_address.h>
+ #include <linux/irqchip/arm-gic.h>
  
  #include <asm/proc-fns.h>
  #include <asm/exception.h>
  #include <asm/hardware/cache-l2x0.h>
- #include <asm/hardware/gic.h>
  #include <asm/mach/map.h>
  #include <asm/mach/irq.h>
  #include <asm/cacheflush.h>
@@@ -35,7 -37,6 +37,6 @@@
  #include <mach/regs-irq.h>
  #include <mach/regs-pmu.h>
  #include <mach/regs-gpio.h>
- #include <mach/pmu.h>
  
  #include <plat/cpu.h>
  #include <plat/clock.h>
@@@ -299,7 -300,6 +300,7 @@@ void exynos4_restart(char mode, const c
  
  void exynos5_restart(char mode, const char *cmd)
  {
 +      struct device_node *np;
        u32 val;
        void __iomem *addr;
  
                val = 0x1;
                addr = EXYNOS_SWRESET;
        } else if (of_machine_is_compatible("samsung,exynos5440")) {
 -              val = (0x10 << 20) | (0x1 << 16);
 -              addr = EXYNOS5440_SWRESET;
 +              np = of_find_compatible_node(NULL, NULL, "samsung,exynos5440-clock");
 +              addr = of_iomap(np, 0) + 0xcc;
 +              val = (0xfff << 20) | (0x1 << 16);
        } else {
                pr_err("%s: cannot support non-DT\n", __func__);
                return;
@@@ -440,220 -439,6 +441,6 @@@ static void __init exynos5_init_clocks(
  #endif
  }
  
- #define COMBINER_ENABLE_SET   0x0
- #define COMBINER_ENABLE_CLEAR 0x4
- #define COMBINER_INT_STATUS   0xC
- static DEFINE_SPINLOCK(irq_controller_lock);
- struct combiner_chip_data {
-       unsigned int irq_offset;
-       unsigned int irq_mask;
-       void __iomem *base;
- };
- static struct irq_domain *combiner_irq_domain;
- static struct combiner_chip_data combiner_data[MAX_COMBINER_NR];
- static inline void __iomem *combiner_base(struct irq_data *data)
- {
-       struct combiner_chip_data *combiner_data =
-               irq_data_get_irq_chip_data(data);
-       return combiner_data->base;
- }
- static void combiner_mask_irq(struct irq_data *data)
- {
-       u32 mask = 1 << (data->hwirq % 32);
-       __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_CLEAR);
- }
- static void combiner_unmask_irq(struct irq_data *data)
- {
-       u32 mask = 1 << (data->hwirq % 32);
-       __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET);
- }
- static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
- {
-       struct combiner_chip_data *chip_data = irq_get_handler_data(irq);
-       struct irq_chip *chip = irq_get_chip(irq);
-       unsigned int cascade_irq, combiner_irq;
-       unsigned long status;
-       chained_irq_enter(chip, desc);
-       spin_lock(&irq_controller_lock);
-       status = __raw_readl(chip_data->base + COMBINER_INT_STATUS);
-       spin_unlock(&irq_controller_lock);
-       status &= chip_data->irq_mask;
-       if (status == 0)
-               goto out;
-       combiner_irq = __ffs(status);
-       cascade_irq = combiner_irq + (chip_data->irq_offset & ~31);
-       if (unlikely(cascade_irq >= NR_IRQS))
-               do_bad_IRQ(cascade_irq, desc);
-       else
-               generic_handle_irq(cascade_irq);
-  out:
-       chained_irq_exit(chip, desc);
- }
- static struct irq_chip combiner_chip = {
-       .name           = "COMBINER",
-       .irq_mask       = combiner_mask_irq,
-       .irq_unmask     = combiner_unmask_irq,
- };
- static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq)
- {
-       unsigned int max_nr;
-       if (soc_is_exynos5250())
-               max_nr = EXYNOS5_MAX_COMBINER_NR;
-       else
-               max_nr = EXYNOS4_MAX_COMBINER_NR;
-       if (combiner_nr >= max_nr)
-               BUG();
-       if (irq_set_handler_data(irq, &combiner_data[combiner_nr]) != 0)
-               BUG();
-       irq_set_chained_handler(irq, combiner_handle_cascade_irq);
- }
- static void __init combiner_init_one(unsigned int combiner_nr,
-                                    void __iomem *base)
- {
-       combiner_data[combiner_nr].base = base;
-       combiner_data[combiner_nr].irq_offset = irq_find_mapping(
-               combiner_irq_domain, combiner_nr * MAX_IRQ_IN_COMBINER);
-       combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3);
-       /* Disable all interrupts */
-       __raw_writel(combiner_data[combiner_nr].irq_mask,
-                    base + COMBINER_ENABLE_CLEAR);
- }
- #ifdef CONFIG_OF
- static int combiner_irq_domain_xlate(struct irq_domain *d,
-                                    struct device_node *controller,
-                                    const u32 *intspec, unsigned int intsize,
-                                    unsigned long *out_hwirq,
-                                    unsigned int *out_type)
- {
-       if (d->of_node != controller)
-               return -EINVAL;
-       if (intsize < 2)
-               return -EINVAL;
-       *out_hwirq = intspec[0] * MAX_IRQ_IN_COMBINER + intspec[1];
-       *out_type = 0;
-       return 0;
- }
- #else
- static int combiner_irq_domain_xlate(struct irq_domain *d,
-                                    struct device_node *controller,
-                                    const u32 *intspec, unsigned int intsize,
-                                    unsigned long *out_hwirq,
-                                    unsigned int *out_type)
- {
-       return -EINVAL;
- }
- #endif
- static int combiner_irq_domain_map(struct irq_domain *d, unsigned int irq,
-                                  irq_hw_number_t hw)
- {
-       irq_set_chip_and_handler(irq, &combiner_chip, handle_level_irq);
-       irq_set_chip_data(irq, &combiner_data[hw >> 3]);
-       set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
-       return 0;
- }
- static struct irq_domain_ops combiner_irq_domain_ops = {
-       .xlate  = combiner_irq_domain_xlate,
-       .map    = combiner_irq_domain_map,
- };
- static void __init combiner_init(void __iomem *combiner_base,
-                                struct device_node *np)
- {
-       int i, irq, irq_base;
-       unsigned int max_nr, nr_irq;
-       if (np) {
-               if (of_property_read_u32(np, "samsung,combiner-nr", &max_nr)) {
-                       pr_warning("%s: number of combiners not specified, "
-                               "setting default as %d.\n",
-                               __func__, EXYNOS4_MAX_COMBINER_NR);
-                       max_nr = EXYNOS4_MAX_COMBINER_NR;
-               }
-       } else {
-               max_nr = soc_is_exynos5250() ? EXYNOS5_MAX_COMBINER_NR :
-                                               EXYNOS4_MAX_COMBINER_NR;
-       }
-       nr_irq = max_nr * MAX_IRQ_IN_COMBINER;
-       irq_base = irq_alloc_descs(COMBINER_IRQ(0, 0), 1, nr_irq, 0);
-       if (IS_ERR_VALUE(irq_base)) {
-               irq_base = COMBINER_IRQ(0, 0);
-               pr_warning("%s: irq desc alloc failed. Continuing with %d as linux irq base\n", __func__, irq_base);
-       }
-       combiner_irq_domain = irq_domain_add_legacy(np, nr_irq, irq_base, 0,
-                               &combiner_irq_domain_ops, &combiner_data);
-       if (WARN_ON(!combiner_irq_domain)) {
-               pr_warning("%s: irq domain init failed\n", __func__);
-               return;
-       }
-       for (i = 0; i < max_nr; i++) {
-               combiner_init_one(i, combiner_base + (i >> 2) * 0x10);
-               irq = IRQ_SPI(i);
- #ifdef CONFIG_OF
-               if (np)
-                       irq = irq_of_parse_and_map(np, i);
- #endif
-               combiner_cascade_irq(i, irq);
-       }
- }
- #ifdef CONFIG_OF
- static int __init combiner_of_init(struct device_node *np,
-                                  struct device_node *parent)
- {
-       void __iomem *combiner_base;
-       combiner_base = of_iomap(np, 0);
-       if (!combiner_base) {
-               pr_err("%s: failed to map combiner registers\n", __func__);
-               return -ENXIO;
-       }
-       combiner_init(combiner_base, np);
-       return 0;
- }
- static const struct of_device_id exynos_dt_irq_match[] = {
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       { .compatible = "arm,cortex-a15-gic", .data = gic_of_init, },
-       { .compatible = "samsung,exynos4210-combiner",
-                       .data = combiner_of_init, },
-       {},
- };
- #endif
  void __init exynos4_init_irq(void)
  {
        unsigned int gic_bank_offset;
                gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset, NULL);
  #ifdef CONFIG_OF
        else
-               of_irq_init(exynos_dt_irq_match);
+               irqchip_init();
  #endif
  
        if (!of_have_populated_dt())
  void __init exynos5_init_irq(void)
  {
  #ifdef CONFIG_OF
-       of_irq_init(exynos_dt_irq_match);
+       irqchip_init();
  #endif
        /*
         * The parameters of s5p_init_irq() are for VIC init.
@@@ -1033,8 -818,8 +820,8 @@@ static int __init exynos_init_irq_eint(
         * interrupt support code here can be completely removed.
         */
        static const struct of_device_id exynos_pinctrl_ids[] = {
 -              { .compatible = "samsung,pinctrl-exynos4210", },
 -              { .compatible = "samsung,pinctrl-exynos4x12", },
 +              { .compatible = "samsung,exynos4210-pinctrl", },
 +              { .compatible = "samsung,exynos4x12-pinctrl", },
        };
        struct device_node *pctrl_np, *wkup_np;
        const char *wkup_compat = "samsung,exynos4210-wakeup-eint";
index ea9e3020972d2b2a18ac7b26d559035d36e58f46,0deeecffa3aef2c5992c3998078f7b2ffc09ecf8..973a06637572842f5c8ff7fca86e590a78812e62
@@@ -16,7 -16,6 +16,6 @@@
  #include <linux/io.h>
  
  #include <asm/mach/arch.h>
- #include <asm/hardware/gic.h>
  #include <mach/map.h>
  #include <mach/regs-pmu.h>
  
@@@ -104,12 -103,6 +103,12 @@@ static const struct of_dev_auxdata exyn
        OF_DEV_AUXDATA("samsung,mfc-v6", 0x11000000, "s5p-mfc-v6", NULL),
        OF_DEV_AUXDATA("samsung,exynos5250-tmu", 0x10060000,
                                "exynos-tmu", NULL),
 +      OF_DEV_AUXDATA("samsung,i2s-v5", 0x03830000,
 +                              "samsung-i2s.0", NULL),
 +      OF_DEV_AUXDATA("samsung,i2s-v5", 0x12D60000,
 +                              "samsung-i2s.1", NULL),
 +      OF_DEV_AUXDATA("samsung,i2s-v5", 0x12D70000,
 +                              "samsung-i2s.2", NULL),
        {},
  };
  
@@@ -185,10 -178,9 +184,9 @@@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG E
        .init_irq       = exynos5_init_irq,
        .smp            = smp_ops(exynos_smp_ops),
        .map_io         = exynos5_dt_map_io,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = exynos5_dt_machine_init,
        .init_late      = exynos_init_late,
-       .timer          = &exynos4_timer,
+       .init_time      = exynos4_timer_init,
        .dt_compat      = exynos5_dt_compat,
        .restart        = exynos5_restart,
        .reserve        = exynos5_reserve,
index 5106ab83e593f8c3902d77a19b5efff00b46d4db,f459afda822a4d14a7a1caf24bfebf97ee39dd7c..e3faaa812016848ae81e7bef29c4aa556a1565a8
@@@ -34,7 -34,8 +34,8 @@@
  #include <mach/regs-clock.h>
  #include <mach/regs-pmu.h>
  #include <mach/pm-core.h>
- #include <mach/pmu.h>
+ #include "common.h"
  
  static struct sleep_save exynos4_set_clksrc[] = {
        { .reg = EXYNOS4_CLKSRC_MASK_TOP                , .val = 0x00000001, },
@@@ -91,8 -92,8 +92,8 @@@ static int exynos_cpu_suspend(unsigned 
        /* issue the standby signal into the pm unit. */
        cpu_do_idle();
  
 -      /* we should never get past here */
 -      panic("sleep resumed to originator?");
 +      pr_info("Failed to suspend the system\n");
 +      return 1; /* Aborting suspend */
  }
  
  static void exynos_pm_prepare(void)
@@@ -282,8 -283,6 +283,8 @@@ static void exynos_pm_resume(void
        if (!(tmp & S5P_CENTRAL_LOWPWR_CFG)) {
                tmp |= S5P_CENTRAL_LOWPWR_CFG;
                __raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION);
 +              /* clear the wakeup state register */
 +              __raw_writel(0x0, S5P_WAKEUP_STAT);
                /* No need to perform below restore code */
                goto early_wakeup;
        }
index 65656ff0eb339c10d581196f0580420c8ba3c7bc,fd630bccbd315fec1582ae91ac95d46dfce05008..a4f9f50247d4e9e4f5dc008436145b9a204bc2cb
@@@ -18,6 -18,7 +18,7 @@@
  #include <linux/dma-mapping.h>
  #include <linux/io.h>
  #include <linux/irq.h>
+ #include <linux/irqchip.h>
  #include <linux/irqdomain.h>
  #include <linux/of.h>
  #include <linux/of_irq.h>
  #include <linux/of_address.h>
  #include <linux/smp.h>
  #include <linux/amba/bus.h>
 +#include <linux/clk-provider.h>
  
  #include <asm/arch_timer.h>
  #include <asm/cacheflush.h>
 +#include <asm/cputype.h>
  #include <asm/smp_plat.h>
  #include <asm/smp_twd.h>
  #include <asm/hardware/arm_timer.h>
  #include <asm/hardware/timer-sp.h>
- #include <asm/hardware/gic.h>
  #include <asm/hardware/cache-l2x0.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
@@@ -61,19 -59,13 +61,13 @@@ static void __init highbank_scu_map_io(
  
  void highbank_set_cpu_jump(int cpu, void *jump_addr)
  {
 -      cpu = cpu_logical_map(cpu);
 +      cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(cpu), 0);
        writel(virt_to_phys(jump_addr), HB_JUMP_TABLE_VIRT(cpu));
        __cpuc_flush_dcache_area(HB_JUMP_TABLE_VIRT(cpu), 16);
        outer_clean_range(HB_JUMP_TABLE_PHYS(cpu),
                          HB_JUMP_TABLE_PHYS(cpu) + 15);
  }
  
- const static struct of_device_id irq_match[] = {
-       { .compatible = "arm,cortex-a15-gic", .data = gic_of_init, },
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       {}
- };
  #ifdef CONFIG_CACHE_L2X0
  static void highbank_l2x0_disable(void)
  {
@@@ -84,7 -76,7 +78,7 @@@
  
  static void __init highbank_init_irq(void)
  {
-       of_irq_init(irq_match);
+       irqchip_init();
  
        if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9"))
                highbank_scu_map_io();
@@@ -118,7 -110,7 +112,7 @@@ static void __init highbank_timer_init(
        WARN_ON(!timer_base);
        irq = irq_of_parse_and_map(np, 0);
  
 -      highbank_clocks_init();
 +      of_clk_init(NULL);
        lookup.clk = of_clk_get(np, 0);
        clkdev_add(&lookup);
  
        arch_timer_sched_clock_init();
  }
  
- static struct sys_timer highbank_timer = {
-       .init = highbank_timer_init,
- };
  static void highbank_power_off(void)
  {
        highbank_set_pwr_shutdown();
@@@ -211,8 -199,7 +201,7 @@@ DT_MACHINE_START(HIGHBANK, "Highbank"
        .smp            = smp_ops(highbank_smp_ops),
        .map_io         = debug_ll_io_init,
        .init_irq       = highbank_init_irq,
-       .timer          = &highbank_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = highbank_timer_init,
        .init_machine   = highbank_init,
        .dt_compat      = highbank_match,
        .restart        = highbank_restart,
index 64b40a4615b54da5bc60f79e2f09cb44e91e92e2,7b11d3329e81dee99447f87277b7b6309d795354..4c9c6f9d2c559707cf7fa55e9f3b6ef33115fc6a
@@@ -95,9 -95,6 +95,6 @@@ config MACH_MX2
  config ARCH_MX5
        bool
  
- config ARCH_MX50
-       bool
  config ARCH_MX51
        bool
  
@@@ -164,11 -161,6 +161,6 @@@ config SOC_IMX
        select CPU_V7
        select MXC_TZIC
  
- config SOC_IMX50
-       bool
-       select ARCH_MX50
-       select SOC_IMX5
  config        SOC_IMX51
        bool
        select ARCH_MX5
@@@ -488,7 -480,7 +480,7 @@@ config MACH_MX31ADS_WM1133_EV
        bool "Support Wolfson Microelectronics 1133-EV1 module"
        depends on MACH_MX31ADS
        depends on MFD_WM8350_I2C
 -      depends on REGULATOR_WM8350
 +      depends on REGULATOR_WM8350 = y
        select MFD_WM8350_CONFIG_MODE_0
        select MFD_WM8352_CONFIG_MODE_0
        help
@@@ -738,25 -730,10 +730,10 @@@ endi
  
  if ARCH_MULTI_V7
  
- comment "i.MX5 platforms:"
- config MACH_MX50_RDP
-       bool "Support MX50 reference design platform"
-       depends on BROKEN
-       select IMX_HAVE_PLATFORM_IMX_I2C
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select IMX_HAVE_PLATFORM_SPI_IMX
-       select SOC_IMX50
-       help
-         Include support for MX50 reference design platform (RDP) board. This
-         includes specific configurations for the board and its peripherals.
  comment "i.MX51 machines:"
  
  config MACH_IMX51_DT
        bool "Support i.MX51 platforms from device tree"
-       select MACH_MX51_BABBAGE
        select SOC_IMX51
        help
          Include support for Freescale i.MX51 based platforms
@@@ -777,19 -754,6 +754,6 @@@ config MACH_MX51_BABBAG
          u-boot. This includes specific configurations for the board and its
          peripherals.
  
- config MACH_MX51_3DS
-       bool "Support MX51PDK (3DS)"
-       select IMX_HAVE_PLATFORM_IMX2_WDT
-       select IMX_HAVE_PLATFORM_IMX_KEYPAD
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select IMX_HAVE_PLATFORM_SPI_IMX
-       select MXC_DEBUG_BOARD
-       select SOC_IMX51
-       help
-         Include support for MX51PDK (3DS) platform. This includes specific
-         configurations for the board and its peripherals.
  config MACH_EUKREA_CPUIMX51SD
        bool "Support Eukrea CPUIMX51SD module"
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
index 592c168f4b62873f9f7403d14a55f99ffdfdd594,78f1b3814f774edcd96de440ec655fda40682798..ea961445e0e993a6f244b8bc70cd5a79c59108c4
@@@ -94,7 -94,7 +94,7 @@@ void __iomem *ap_syscon_base
   * f1b00000   1b000000        GPIO
   */
  
 -static struct map_desc ap_io_desc[] __initdata = {
 +static struct map_desc ap_io_desc[] __initdata __maybe_unused = {
        {
                .virtual        = IO_ADDRESS(INTEGRATOR_HDR_BASE),
                .pfn            = __phys_to_pfn(INTEGRATOR_HDR_BASE),
@@@ -425,7 -425,7 +425,7 @@@ void __init ap_init_early(void
  
  #ifdef CONFIG_OF
  
- static void __init ap_init_timer_of(void)
+ static void __init ap_of_timer_init(void)
  {
        struct device_node *node;
        const char *path;
        integrator_clockevent_init(rate, base, irq);
  }
  
- static struct sys_timer ap_of_timer = {
-       .init           = ap_init_timer_of,
- };
  static const struct of_device_id fpga_irq_of_match[] __initconst = {
        { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
        { /* Sentinel */ }
@@@ -586,7 -582,7 +582,7 @@@ DT_MACHINE_START(INTEGRATOR_AP_DT, "AR
        .init_early     = ap_init_early,
        .init_irq       = ap_init_irq_of,
        .handle_irq     = fpga_handle_irq,
-       .timer          = &ap_of_timer,
+       .init_time      = ap_of_timer_init,
        .init_machine   = ap_init_of,
        .restart        = integrator_restart,
        .dt_compat      = ap_dt_board_compat,
@@@ -613,6 -609,7 +609,6 @@@ static struct map_desc ap_io_desc_atag[
  static void __init ap_map_io_atag(void)
  {
        iotable_init(ap_io_desc_atag, ARRAY_SIZE(ap_io_desc_atag));
 -      ap_syscon_base = __io_address(INTEGRATOR_SC_BASE);
        ap_map_io();
  }
  
@@@ -637,7 -634,7 +633,7 @@@ static struct platform_device cfi_flash
        .resource       = &cfi_flash_resource,
  };
  
- static void __init ap_init_timer(void)
+ static void __init ap_timer_init(void)
  {
        struct clk *clk;
        unsigned long rate;
                                IRQ_TIMERINT1);
  }
  
- static struct sys_timer ap_timer = {
-       .init           = ap_init_timer,
- };
  #define INTEGRATOR_SC_VALID_INT       0x003fffff
  
  static void __init ap_init_irq(void)
@@@ -684,7 -677,6 +676,7 @@@ static void __init ap_init(void
  
        platform_device_register(&cfi_flash_device);
  
 +      ap_syscon_base = __io_address(INTEGRATOR_SC_BASE);
        sc_dec = readl(ap_syscon_base + INTEGRATOR_SC_DEC_OFFSET);
        for (i = 0; i < 4; i++) {
                struct lm_device *lmdev;
@@@ -716,7 -708,7 +708,7 @@@ MACHINE_START(INTEGRATOR, "ARM-Integrat
        .init_early     = ap_init_early,
        .init_irq       = ap_init_irq,
        .handle_irq     = fpga_handle_irq,
-       .timer          = &ap_timer,
+       .init_time      = ap_timer_init,
        .init_machine   = ap_init,
        .restart        = integrator_restart,
  MACHINE_END
index 01a888d7b0b85fec94d4bf019c4110c9371cb6ca,4cef9a0ebbb940398f64335531f987e08e6fa80b..2b0db82a53819e58d98b89131fd05f07317515e6
@@@ -78,7 -78,7 +78,7 @@@ static void __iomem *intcp_con_base
   * fcb00000   cb000000        CP system control
   */
  
 -static struct map_desc intcp_io_desc[] __initdata = {
 +static struct map_desc intcp_io_desc[] __initdata __maybe_unused = {
        {
                .virtual        = IO_ADDRESS(INTEGRATOR_HDR_BASE),
                .pfn            = __phys_to_pfn(INTEGRATOR_HDR_BASE),
@@@ -251,7 -251,7 +251,7 @@@ static void __init intcp_init_early(voi
  
  #ifdef CONFIG_OF
  
- static void __init intcp_timer_init_of(void)
+ static void __init cp_of_timer_init(void)
  {
        struct device_node *node;
        const char *path;
        sp804_clockevents_init(base, irq, node->name);
  }
  
- static struct sys_timer cp_of_timer = {
-       .init           = intcp_timer_init_of,
- };
  static const struct of_device_id fpga_irq_of_match[] __initconst = {
        { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
        { /* Sentinel */ }
@@@ -390,7 -386,7 +386,7 @@@ DT_MACHINE_START(INTEGRATOR_CP_DT, "AR
        .init_early     = intcp_init_early,
        .init_irq       = intcp_init_irq_of,
        .handle_irq     = fpga_handle_irq,
-       .timer          = &cp_of_timer,
+       .init_time      = cp_of_timer_init,
        .init_machine   = intcp_init_of,
        .restart        = integrator_restart,
        .dt_compat      = intcp_dt_board_compat,
@@@ -512,7 -508,7 +508,7 @@@ static void __init intcp_init_irq(void
  #define TIMER1_VA_BASE __io_address(INTEGRATOR_TIMER1_BASE)
  #define TIMER2_VA_BASE __io_address(INTEGRATOR_TIMER2_BASE)
  
- static void __init intcp_timer_init(void)
+ static void __init cp_timer_init(void)
  {
        writel(0, TIMER0_VA_BASE + TIMER_CTRL);
        writel(0, TIMER1_VA_BASE + TIMER_CTRL);
        sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, "timer1");
  }
  
- static struct sys_timer cp_timer = {
-       .init           = intcp_timer_init,
- };
  #define INTEGRATOR_CP_MMC_IRQS        { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 }
  #define INTEGRATOR_CP_AACI_IRQS       { IRQ_CP_AACIINT }
  
@@@ -565,7 -557,7 +557,7 @@@ MACHINE_START(CINTEGRATOR, "ARM-Integra
        .init_early     = intcp_init_early,
        .init_irq       = intcp_init_irq,
        .handle_irq     = fpga_handle_irq,
-       .timer          = &cp_timer,
+       .init_time      = cp_timer_init,
        .init_machine   = intcp_init,
        .restart        = integrator_restart,
  MACHINE_END
index 1337f2c51f9e7a0fd71837afc66547d63b12066b,5f413968d568a167e461443d9d58fb1bd8b4b9e1..a3e0aaa4886b9c4954160d585115a219d1ba3a95
@@@ -27,7 -27,6 +27,7 @@@
  #include <linux/clk.h>
  #include <linux/io.h>
  #include <linux/gpio.h>
 +#include <linux/usb/phy.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -264,7 -263,6 +264,7 @@@ static void __init omap_2430sdp_init(vo
        omap_hsmmc_init(mmc);
  
        omap_mux_init_signal("usb0hs_stp", OMAP_PULL_ENA | OMAP_PULL_UP);
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
  
        board_smc91x_init();
@@@ -286,6 -284,6 +286,6 @@@ MACHINE_START(OMAP_2430SDP, "OMAP2430 s
        .handle_irq     = omap2_intc_handle_irq,
        .init_machine   = omap_2430sdp_init,
        .init_late      = omap2430_init_late,
-       .timer          = &omap2_timer,
+       .init_time      = omap2_sync32k_timer_init,
        .restart        = omap2xxx_restart,
  MACHINE_END
index 8a2e242910ebc7ac3f0fbb5e25cf6187bcbe72eb,8e2513f6a282cc0cb18bbd68a49ac48e82eb2bcf..e71ebdefc6796f122777935453047a27da953840
@@@ -25,7 -25,6 +25,7 @@@
  #include <linux/gpio.h>
  #include <linux/mmc/host.h>
  #include <linux/platform_data/spi-omap2-mcspi.h>
 +#include <linux/usb/phy.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -580,7 -579,6 +580,7 @@@ static void __init omap_3430sdp_init(vo
        omap_ads7846_init(1, gpio_pendown, 310, NULL);
        omap_serial_init();
        omap_sdrc_init(hyb18m512160af6_sdrc_params, NULL);
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        board_smc91x_init();
        board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
@@@ -599,6 -597,6 +599,6 @@@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_3430sdp_init,
        .init_late      = omap3430_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index 8e8efccf762f10f4ded80104080215cbe46b9af1,f8eeef40efe8e1cdae47e5d748bb58d396d4381a..508e2752b7de28291a5f1fcddce8bf097575c8b5
  #include <linux/regulator/fixed.h>
  #include <linux/leds.h>
  #include <linux/leds_pwm.h>
+ #include <linux/irqchip/arm-gic.h>
  #include <linux/platform_data/omap4-keypad.h>
  #include <linux/usb/musb.h>
 +#include <linux/usb/phy.h>
  
- #include <asm/hardware/gic.h>
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
@@@ -697,7 -696,6 +697,7 @@@ static void __init omap_4430sdp_init(vo
        omap4_sdp4430_wifi_init();
        omap4_twl6030_hsmmc_init(mmc);
  
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "omap-usb2.1.auto");
        usb_musb_init(&musb_board_data);
  
        status = omap_ethernet_init();
@@@ -724,9 -722,8 +724,8 @@@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4
        .map_io         = omap4_map_io,
        .init_early     = omap4430_init_early,
        .init_irq       = gic_init_irq,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = omap_4430sdp_init,
        .init_late      = omap4430_init_late,
-       .timer          = &omap4_timer,
+       .init_time      = omap4_local_timer_init,
        .restart        = omap44xx_restart,
  MACHINE_END
index f1172f2f1a7edd2591009564b966e7bac02867b8,68647c3891901022a6afa378b104bf7b2759d524..231a7d825f997e9b87d2ace13b401e62e1d8f6e8
@@@ -30,7 -30,6 +30,7 @@@
  #include <linux/regulator/fixed.h>
  #include <linux/regulator/machine.h>
  #include <linux/mmc/host.h>
 +#include <linux/usb/phy.h>
  
  #include <linux/spi/spi.h>
  #include <linux/spi/tdo24m.h>
@@@ -725,7 -724,6 +725,7 @@@ static void __init cm_t3x_common_init(v
        cm_t35_init_display();
        omap_twl4030_audio_init("cm-t3x");
  
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        cm_t35_init_usbh();
        cm_t35_init_camera();
@@@ -753,7 -751,7 +753,7 @@@ MACHINE_START(CM_T35, "Compulab CM-T35"
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = cm_t35_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
  
@@@ -766,6 -764,6 +766,6 @@@ MACHINE_START(CM_T3730, "Compulab CM-T3
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = cm_t3730_init,
        .init_late     = omap3630_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index 77cade52b022cd7a56bafae16a83d9faecee45bf,0b1d8f75808812fdd9b6c60cfb8606173e997348..a37514ecc38538b96473376f8c7f45388c1bf6ad
@@@ -29,7 -29,6 +29,7 @@@
  #include <linux/mtd/partitions.h>
  #include <linux/mtd/nand.h>
  #include <linux/mmc/host.h>
 +#include <linux/usb/phy.h>
  
  #include <linux/regulator/machine.h>
  #include <linux/i2c/twl.h>
@@@ -623,7 -622,6 +623,7 @@@ static void __init devkit8000_init(void
  
        omap_ads7846_init(2, OMAP3_DEVKIT_TS_GPIO, 0, NULL);
  
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
        board_nand_init(devkit8000_nand_partitions,
@@@ -645,6 -643,6 +645,6 @@@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = devkit8000_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_secure_timer,
+       .init_time      = omap3_secure_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index 15e58815a1319f62122cf2d42657e07a9e32e93e,5b447649f5a0017d6e04cd4181c22fe4258d42db..3f97f30d788e599b07a853c7fc6f493e3f9a2a71
@@@ -18,7 -18,6 +18,7 @@@
  #include <linux/gpio.h>
  #include <linux/interrupt.h>
  #include <linux/input.h>
 +#include <linux/usb/phy.h>
  
  #include <linux/regulator/machine.h>
  #include <linux/regulator/fixed.h>
@@@ -626,7 -625,6 +626,7 @@@ static void __init igep_init(void
        omap_serial_init();
        omap_sdrc_init(m65kxxxxam_sdrc_params,
                                  m65kxxxxam_sdrc_params);
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
  
        igep_flash_init();
@@@ -657,7 -655,7 +657,7 @@@ MACHINE_START(IGEP0020, "IGEP v2 board"
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = igep_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
  
@@@ -670,6 -668,6 +670,6 @@@ MACHINE_START(IGEP0030, "IGEP OMAP3 mod
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = igep_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index 3b5510a433f0a7476d2a2cbdd2049bd6a2e4da9d,ff440c0d04dd999a533216bc2657f054706cd40d..b12fe966a7b9efc4d64ecc4cc368fa0b3ec64234
@@@ -28,7 -28,6 +28,7 @@@
  #include <linux/io.h>
  #include <linux/smsc911x.h>
  #include <linux/mmc/host.h>
 +#include <linux/usb/phy.h>
  #include <linux/platform_data/spi-omap2-mcspi.h>
  
  #include <asm/mach-types.h>
@@@ -419,7 -418,6 +419,7 @@@ static void __init omap_ldp_init(void
        omap_ads7846_init(1, 54, 310, NULL);
        omap_serial_init();
        omap_sdrc_init(NULL, NULL);
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        board_nand_init(ldp_nand_partitions, ARRAY_SIZE(ldp_nand_partitions),
                        ZOOM_NAND_CS, 0, nand_default_timings);
@@@ -437,6 -435,6 +437,6 @@@ MACHINE_START(OMAP_LDP, "OMAP LDP board
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap_ldp_init,
        .init_late      = omap3430_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index 4616f9269d0007061e24ea7f4a942182d53889e9,b81b4585f46ff7904035698c1bb19ee45ea7761a..d07058b9c2840c9b940e0122213b89eb17ca47a3
@@@ -30,7 -30,6 +30,7 @@@
  #include <linux/mtd/partitions.h>
  #include <linux/mtd/nand.h>
  #include <linux/mmc/host.h>
 +#include <linux/usb/phy.h>
  
  #include <linux/regulator/machine.h>
  #include <linux/i2c/twl.h>
@@@ -520,7 -519,6 +520,7 @@@ static void __init omap3_beagle_init(vo
        omap_sdrc_init(mt46h32m32lf6_sdrc_params,
                                  mt46h32m32lf6_sdrc_params);
  
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
        board_nand_init(omap3beagle_nand_partitions,
@@@ -546,6 -544,6 +546,6 @@@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beag
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3_beagle_init,
        .init_late      = omap3_init_late,
-       .timer          = &omap3_secure_timer,
+       .init_time      = omap3_secure_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index 2023895034570c28cce355852098e30efa190634,f2f636b19762706e3e631adb4f56d7ed07a015fe..f43763647d5842b239bdda982429c01b40961233
@@@ -41,7 -41,6 +41,7 @@@
  #include <linux/regulator/machine.h>
  #include <linux/mmc/host.h>
  #include <linux/export.h>
 +#include <linux/usb/phy.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -310,7 -309,7 +310,7 @@@ static struct omap2_hsmmc_info mmc[] = 
                .gpio_wp        = 63,
                .deferred       = true,
        },
 -#ifdef CONFIG_WL12XX_PLATFORM_DATA
 +#ifdef CONFIG_WILINK_PLATFORM_DATA
        {
                .name           = "wl1271",
                .mmc            = 2,
@@@ -451,7 -450,7 +451,7 @@@ static struct regulator_init_data omap3
        .consumer_supplies      = omap3evm_vio_supply,
  };
  
 -#ifdef CONFIG_WL12XX_PLATFORM_DATA
 +#ifdef CONFIG_WILINK_PLATFORM_DATA
  
  #define OMAP3EVM_WLAN_PMENA_GPIO      (150)
  #define OMAP3EVM_WLAN_IRQ_GPIO                (149)
@@@ -564,7 -563,7 +564,7 @@@ static struct omap_board_mux omap35x_bo
                                OMAP_PIN_OFF_NONE),
        OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
                                OMAP_PIN_OFF_NONE),
 -#ifdef CONFIG_WL12XX_PLATFORM_DATA
 +#ifdef CONFIG_WILINK_PLATFORM_DATA
        /* WLAN IRQ - GPIO 149 */
        OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
  
@@@ -602,7 -601,7 +602,7 @@@ static struct omap_board_mux omap36x_bo
        OMAP3_MUX(SYS_BOOT4, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
        OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
        OMAP3_MUX(SYS_BOOT6, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
 -#ifdef CONFIG_WL12XX_PLATFORM_DATA
 +#ifdef CONFIG_WILINK_PLATFORM_DATA
        /* WLAN IRQ - GPIO 149 */
        OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
  
@@@ -638,7 -637,7 +638,7 @@@ static struct gpio omap3_evm_ehci_gpios
  
  static void __init omap3_evm_wl12xx_init(void)
  {
 -#ifdef CONFIG_WL12XX_PLATFORM_DATA
 +#ifdef CONFIG_WILINK_PLATFORM_DATA
        int ret;
  
        /* WL12xx WLAN Init */
@@@ -735,7 -734,6 +735,7 @@@ static void __init omap3_evm_init(void
                omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
                usbhs_bdata.reset_gpio_port[1] = 135;
        }
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(&musb_board_data);
        usbhs_init(&usbhs_bdata);
        board_nand_init(omap3evm_nand_partitions,
@@@ -759,6 -757,6 +759,6 @@@ MACHINE_START(OMAP3EVM, "OMAP3 EVM"
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3_evm_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index 9409eb897e2fe050e641c7f57581bbcb08eec3f7,0fba43a9b07dc72025a4c75df730c3828520cfb3..bab51e64c4b5c76dbd2b6a88c48c010d91ee9e8e
@@@ -29,7 -29,6 +29,7 @@@
  
  #include <linux/i2c/twl.h>
  #include <linux/mmc/host.h>
 +#include <linux/usb/phy.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -216,7 -215,6 +216,7 @@@ static void __init omap3logic_init(void
        board_mmc_init();
        board_smsc911x_init();
  
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
  
        /* Ensure SDRC pins are mux'd for self-refresh */
@@@ -233,7 -231,7 +233,7 @@@ MACHINE_START(OMAP3_TORPEDO, "Logic OMA
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3logic_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
  
@@@ -246,6 -244,6 +246,6 @@@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Lo
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3logic_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index 1ac3e81969e0731955cdc459bbdd45ad30c4c47f,12e181689340970acf8f0dfe4d13a627f5f2e74d..07cc0884e7614f7ab027e7767e2ad4d66b9ff2e8
@@@ -35,7 -35,6 +35,7 @@@
  #include <linux/mmc/host.h>
  #include <linux/mmc/card.h>
  #include <linux/regulator/fixed.h>
 +#include <linux/usb/phy.h>
  #include <linux/platform_data/spi-omap2-mcspi.h>
  
  #include <asm/mach-types.h>
@@@ -602,7 -601,6 +602,7 @@@ static void __init omap3pandora_init(vo
                        ARRAY_SIZE(omap3pandora_spi_board_info));
        omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
        usbhs_init(&usbhs_bdata);
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        gpmc_nand_init(&pandora_nand_data, NULL);
  
@@@ -620,6 -618,6 +620,6 @@@ MACHINE_START(OMAP3_PANDORA, "Pandora H
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3pandora_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index 63cb204e0811c9d91f6ca9ddeb70127d39894560,13ee40545604cd7c1f9f171f88de7012f21377ef..0490acbc43314914c0b9f2b265fc546631cf5d8d
@@@ -33,7 -33,6 +33,7 @@@
  #include <linux/interrupt.h>
  #include <linux/smsc911x.h>
  #include <linux/i2c/at24.h>
 +#include <linux/usb/phy.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -405,7 -404,6 +405,7 @@@ static void __init omap3_stalker_init(v
  
        omap_serial_init();
        omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL);
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
        omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL);
@@@ -429,6 -427,6 +429,6 @@@ MACHINE_START(SBC3530, "OMAP3 STALKER"
        .handle_irq             = omap3_intc_handle_irq,
        .init_machine           = omap3_stalker_init,
        .init_late              = omap35xx_init_late,
-       .timer                  = &omap3_secure_timer,
+       .init_time              = omap3_secure_sync32k_timer_init,
        .restart                = omap3xxx_restart,
  MACHINE_END
index 6b22ce3581d776c2889f37431067691db5d529b7,36c455c85ed926a30c8ad0a6db057e31ce3f527b..91daf71190cf292c1d19ed9bda9a2ec1be7c8ede
@@@ -28,7 -28,6 +28,7 @@@
  #include <linux/mtd/partitions.h>
  #include <linux/mtd/nand.h>
  #include <linux/mmc/host.h>
 +#include <linux/usb/phy.h>
  
  #include <linux/platform_data/spi-omap2-mcspi.h>
  #include <linux/spi/spi.h>
@@@ -366,7 -365,6 +366,7 @@@ static void __init omap3_touchbook_init
  
        /* Touchscreen and accelerometer */
        omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
        board_nand_init(omap3touchbook_nand_partitions,
@@@ -388,6 -386,6 +388,6 @@@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbo
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = omap3_touchbook_init,
        .init_late      = omap3430_init_late,
-       .timer          = &omap3_secure_timer,
+       .init_time      = omap3_secure_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index 40184cc494f97e8cfbad5a3b9d61c2ba8de1f309,b62317906b39f539baf394afe2b27308619353c9..7b152d04a602a1f041ea5e4d5d3848f24715d2f4
  #include <linux/regulator/fixed.h>
  #include <linux/ti_wilink_st.h>
  #include <linux/usb/musb.h>
 +#include <linux/usb/phy.h>
  #include <linux/wl12xx.h>
+ #include <linux/irqchip/arm-gic.h>
  #include <linux/platform_data/omap-abe-twl6040.h>
  
- #include <asm/hardware/gic.h>
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
@@@ -448,7 -447,6 +448,7 @@@ static void __init omap4_panda_init(voi
        omap_sdrc_init(NULL, NULL);
        omap4_twl6030_hsmmc_init(mmc);
        omap4_ehci_init();
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "omap-usb2.1.auto");
        usb_musb_init(&musb_board_data);
        omap4_panda_display_init();
  }
@@@ -461,9 -459,8 +461,8 @@@ MACHINE_START(OMAP4_PANDA, "OMAP4 Pand
        .map_io         = omap4_map_io,
        .init_early     = omap4430_init_early,
        .init_irq       = gic_init_irq,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = omap4_panda_init,
        .init_late      = omap4430_init_late,
-       .timer          = &omap4_timer,
+       .init_time      = omap4_local_timer_init,
        .restart        = omap44xx_restart,
  MACHINE_END
index 7e43ff3f704c168c814adce25b4b7aec299d0162,233a37d541c3118749dc5a2609548712160080e6..6975a8585daea4fbf083317af1bbafaae52aeaa0
@@@ -36,7 -36,6 +36,7 @@@
  #include <linux/mtd/nand.h>
  #include <linux/mtd/partitions.h>
  #include <linux/mmc/host.h>
 +#include <linux/usb/phy.h>
  
  #include <linux/platform_data/mtd-nand-omap2.h>
  #include <linux/platform_data/spi-omap2-mcspi.h>
@@@ -500,7 -499,6 +500,7 @@@ static void __init overo_init(void
                                  mt46h32m32lf6_sdrc_params);
        board_nand_init(overo_nand_partitions,
                        ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        usbhs_init(&usbhs_bdata);
        overo_spi_init();
@@@ -553,6 -551,6 +553,6 @@@ MACHINE_START(OVERO, "Gumstix Overo"
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = overo_init,
        .init_late      = omap35xx_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index f8a272c253f56b0a5083d97cc079f9df7c1602f9,386a2ddc1173d3d2688d5178f9459a767a1c738b..345e8c4b873158ecef548a5d4ca0d4bc9943be65
@@@ -18,7 -18,6 +18,7 @@@
  #include <linux/regulator/machine.h>
  #include <linux/regulator/consumer.h>
  #include <linux/platform_data/mtd-onenand-omap2.h>
 +#include <linux/usb/phy.h>
  
  #include <asm/mach/arch.h>
  #include <asm/mach-types.h>
@@@ -135,7 -134,6 +135,7 @@@ static void __init rm680_init(void
        sdrc_params = nokia_get_sdram_timings();
        omap_sdrc_init(sdrc_params, sdrc_params);
  
 +      usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
        rm680_peripherals_init();
  }
@@@ -149,7 -147,7 +149,7 @@@ MACHINE_START(NOKIA_RM680, "Nokia RM-68
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = rm680_init,
        .init_late      = omap3630_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
  
@@@ -162,6 -160,6 +162,6 @@@ MACHINE_START(NOKIA_RM696, "Nokia RM-69
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = rm680_init,
        .init_late      = omap3630_init_late,
-       .timer          = &omap3_timer,
+       .init_time      = omap3_sync32k_timer_init,
        .restart        = omap3xxx_restart,
  MACHINE_END
index 8633a43acae28bb54cb5a88e08363d36d0475f8d,8c5b5e3e3541441d6cf87076b3caddee054fea3a..f8bb3b9b6a76238af322ea1e9ee4fde52b7ac46b
@@@ -24,8 -24,7 +24,7 @@@
  #include <linux/cpu.h>
  #include <linux/notifier.h>
  #include <linux/cpu_pm.h>
- #include <asm/hardware/gic.h>
+ #include <linux/irqchip/arm-gic.h>
  
  #include "omap-wakeupgen.h"
  #include "omap-secure.h"
@@@ -46,7 -45,7 +45,7 @@@
  
  static void __iomem *wakeupgen_base;
  static void __iomem *sar_base;
 -static DEFINE_SPINLOCK(wakeupgen_lock);
 +static DEFINE_RAW_SPINLOCK(wakeupgen_lock);
  static unsigned int irq_target_cpu[MAX_IRQS];
  static unsigned int irq_banks = MAX_NR_REG_BANKS;
  static unsigned int max_irqs = MAX_IRQS;
@@@ -134,9 -133,9 +133,9 @@@ static void wakeupgen_mask(struct irq_d
  {
        unsigned long flags;
  
 -      spin_lock_irqsave(&wakeupgen_lock, flags);
 +      raw_spin_lock_irqsave(&wakeupgen_lock, flags);
        _wakeupgen_clear(d->irq, irq_target_cpu[d->irq]);
 -      spin_unlock_irqrestore(&wakeupgen_lock, flags);
 +      raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
  }
  
  /*
@@@ -146,9 -145,9 +145,9 @@@ static void wakeupgen_unmask(struct irq
  {
        unsigned long flags;
  
 -      spin_lock_irqsave(&wakeupgen_lock, flags);
 +      raw_spin_lock_irqsave(&wakeupgen_lock, flags);
        _wakeupgen_set(d->irq, irq_target_cpu[d->irq]);
 -      spin_unlock_irqrestore(&wakeupgen_lock, flags);
 +      raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
  }
  
  #ifdef CONFIG_HOTPLUG_CPU
@@@ -189,7 -188,7 +188,7 @@@ static void wakeupgen_irqmask_all(unsig
  {
        unsigned long flags;
  
 -      spin_lock_irqsave(&wakeupgen_lock, flags);
 +      raw_spin_lock_irqsave(&wakeupgen_lock, flags);
        if (set) {
                _wakeupgen_save_masks(cpu);
                _wakeupgen_set_all(cpu, WKG_MASK_ALL);
                _wakeupgen_set_all(cpu, WKG_UNMASK_ALL);
                _wakeupgen_restore_masks(cpu);
        }
 -      spin_unlock_irqrestore(&wakeupgen_lock, flags);
 +      raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
  }
  #endif
  
index 265de51b43d9a2dd498672d32544dd27d1946a82,d86074745c5071bf45f50df5f90ecc41a9d7f948..71729888ff03ed5e9f77bb003e89b0cd047e4945
@@@ -131,7 -131,6 +131,6 @@@ static void omap2_gp_timer_set_mode(enu
  static struct clock_event_device clockevent_gpt = {
        .name           = "gp_timer",
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-       .shift          = 32,
        .rating         = 300,
        .set_next_event = omap2_gp_timer_set_next_event,
        .set_mode       = omap2_gp_timer_set_mode,
@@@ -228,7 -227,7 +227,7 @@@ static int __init omap_dm_timer_init_on
        int r = 0;
  
        if (of_have_populated_dt()) {
 -              np = omap_get_timer_dt(omap_timer_match, NULL);
 +              np = omap_get_timer_dt(omap_timer_match, property);
                if (!np)
                        return -ENODEV;
  
@@@ -336,17 -335,11 +335,11 @@@ static void __init omap2_gp_clockevent_
  
        __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW);
  
-       clockevent_gpt.mult = div_sc(clkev.rate, NSEC_PER_SEC,
-                                    clockevent_gpt.shift);
-       clockevent_gpt.max_delta_ns =
-               clockevent_delta2ns(0xffffffff, &clockevent_gpt);
-       clockevent_gpt.min_delta_ns =
-               clockevent_delta2ns(3, &clockevent_gpt);
-               /* Timer internal resynch latency. */
        clockevent_gpt.cpumask = cpu_possible_mask;
        clockevent_gpt.irq = omap_dm_timer_get_irq(&clkev);
-       clockevents_register_device(&clockevent_gpt);
+       clockevents_config_and_register(&clockevent_gpt, clkev.rate,
+                                       3, /* Timer internal resynch latency */
+                                       0xffffffff);
  
        pr_info("OMAP clockevent source: GPTIMER%d at %lu Hz\n",
                gptimer_id, clkev.rate);
@@@ -552,7 -545,7 +545,7 @@@ static inline void __init realtime_coun
  
  #define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \
                               clksrc_nr, clksrc_src)                   \
static void __init omap##name##_gptimer_timer_init(void)              \
void __init omap##name##_gptimer_timer_init(void)                     \
  {                                                                     \
        omap_dmtimer_init();                                            \
        omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop);    \
  
  #define OMAP_SYS_32K_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop,        \
                                clksrc_nr, clksrc_src)                  \
static void __init omap##name##_sync32k_timer_init(void)              \
void __init omap##name##_sync32k_timer_init(void)             \
  {                                                                     \
        omap_dmtimer_init();                                            \
        omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop);    \
                omap2_sync32k_clocksource_init();                       \
  }
  
- #define OMAP_SYS_TIMER(name, clksrc)                                  \
- struct sys_timer omap##name##_timer = {                                       \
-       .init   = omap##name##_##clksrc##_timer_init,                   \
- };
  #ifdef CONFIG_ARCH_OMAP2
  OMAP_SYS_32K_TIMER_INIT(2, 1, OMAP2_32K_SOURCE, "ti,timer-alwon",
                        2, OMAP2_MPU_SOURCE);
- OMAP_SYS_TIMER(2, sync32k);
  #endif /* CONFIG_ARCH_OMAP2 */
  
  #ifdef CONFIG_ARCH_OMAP3
  OMAP_SYS_32K_TIMER_INIT(3, 1, OMAP3_32K_SOURCE, "ti,timer-alwon",
                        2, OMAP3_MPU_SOURCE);
- OMAP_SYS_TIMER(3, sync32k);
  OMAP_SYS_32K_TIMER_INIT(3_secure, 12, OMAP3_32K_SOURCE, "ti,timer-secure",
                        2, OMAP3_MPU_SOURCE);
- OMAP_SYS_TIMER(3_secure, sync32k);
  OMAP_SYS_GP_TIMER_INIT(3_gp, 1, OMAP3_MPU_SOURCE, "ti,timer-alwon",
                       2, OMAP3_MPU_SOURCE);
- OMAP_SYS_TIMER(3_gp, gptimer);
  #endif /* CONFIG_ARCH_OMAP3 */
  
  #ifdef CONFIG_SOC_AM33XX
  OMAP_SYS_GP_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, "ti,timer-alwon",
                       2, OMAP4_MPU_SOURCE);
- OMAP_SYS_TIMER(3_am33xx, gptimer);
  #endif /* CONFIG_SOC_AM33XX */
  
  #ifdef CONFIG_ARCH_OMAP4
@@@ -606,7 -589,7 +589,7 @@@ OMAP_SYS_32K_TIMER_INIT(4, 1, OMAP4_32K
                        2, OMAP4_MPU_SOURCE);
  #ifdef CONFIG_LOCAL_TIMERS
  static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, OMAP44XX_LOCAL_TWD_BASE, 29);
static void __init omap4_local_timer_init(void)
+ void __init omap4_local_timer_init(void)
  {
        omap4_sync32k_timer_init();
        /* Local timers are not supprted on OMAP4430 ES1.0 */
        }
  }
  #else /* CONFIG_LOCAL_TIMERS */
static void __init omap4_local_timer_init(void)
+ void __init omap4_local_timer_init(void)
  {
        omap4_sync32k_timer_init();
  }
  #endif /* CONFIG_LOCAL_TIMERS */
- OMAP_SYS_TIMER(4, local);
  #endif /* CONFIG_ARCH_OMAP4 */
  
  #ifdef CONFIG_SOC_OMAP5
  OMAP_SYS_32K_TIMER_INIT(5, 1, OMAP4_32K_SOURCE, "ti,timer-alwon",
                        2, OMAP4_MPU_SOURCE);
static void __init omap5_realtime_timer_init(void)
+ void __init omap5_realtime_timer_init(void)
  {
        int err;
  
        if (err)
                pr_err("%s: arch_timer_register failed %d\n", __func__, err);
  }
- OMAP_SYS_TIMER(5, realtime);
  #endif /* CONFIG_SOC_OMAP5 */
  
  /**
index 7079a70b1ab894db66888e7fdd3b8764c35e55fe,31eacad5b3e9d2409dad5c288590cd67971b58cd..37f513d1588ece1db569d02bdeda76980b6a65e1
@@@ -9,6 -9,15 +9,15 @@@
  
  if ARCH_S3C24XX
  
+ config PLAT_S3C24XX
+       def_bool y
+       select ARCH_REQUIRE_GPIOLIB
+       select NO_IOPORT
+       select S3C_DEV_NAND
+       select IRQ_DOMAIN
+       help
+         Base platform code for any Samsung S3C24XX device
  menu "SAMSUNG S3C24XX SoCs Support"
  
  comment "S3C24XX SoCs"
@@@ -83,6 -92,17 +92,17 @@@ config CPU_S3C244
  
  # common code
  
+ config S3C2410_CLOCK
+       bool
+       help
+         Clock code for the S3C2410, and similar processors which
+         is currently includes the S3C2410, S3C2440, S3C2442.
+ config S3C24XX_DCLK
+       bool
+       help
+         Clock code for supporting DCLK/CLKOUT on S3C24XX architectures
  config S3C24XX_SMDK
        bool
        help
@@@ -111,6 -131,22 +131,22 @@@ config S3C24XX_SETUP_T
        help
          Compile in platform device definition for Samsung TouchScreen.
  
+ config S3C24XX_DMA
+       bool "S3C2410 DMA support"
+       depends on ARCH_S3C24XX
+       select S3C_DMA
+       help
+         S3C2410 DMA support. This is needed for drivers like sound which
+         use the S3C2410's DMA system to move data to and from the
+         peripheral blocks.
+ config S3C2410_DMA_DEBUG
+       bool "S3C2410 DMA support debug"
+       depends on ARCH_S3C24XX && S3C2410_DMA
+       help
+         Enable debugging output for the DMA code. This option sends info
+         to the kernel log, at priority KERN_DEBUG.
  config S3C2410_DMA
        bool
        depends on S3C24XX_DMA && (CPU_S3C2410 || CPU_S3C2442)
@@@ -123,10 -159,92 +159,92 @@@ config S3C2410_P
        help
          Power Management code common to S3C2410 and better
  
+ # low-level serial option nodes
+ config CPU_LLSERIAL_S3C2410_ONLY
+       bool
+       default y if CPU_LLSERIAL_S3C2410 && !CPU_LLSERIAL_S3C2440
+ config CPU_LLSERIAL_S3C2440_ONLY
+       bool
+       default y if CPU_LLSERIAL_S3C2440 && !CPU_LLSERIAL_S3C2410
+ config CPU_LLSERIAL_S3C2410
+       bool
+       help
+         Selected if there is an S3C2410 (or register compatible) serial
+         low-level implementation needed
+ config CPU_LLSERIAL_S3C2440
+       bool
+       help
+         Selected if there is an S3C2440 (or register compatible) serial
+         low-level implementation needed
+ # gpio configurations
+ config S3C24XX_GPIO_EXTRA
+       int
+       default 128 if S3C24XX_GPIO_EXTRA128
+       default 64 if S3C24XX_GPIO_EXTRA64
+       default 16 if ARCH_H1940
+       default 0
+ config S3C24XX_GPIO_EXTRA64
+       bool
+       help
+         Add an extra 64 gpio numbers to the available GPIO pool. This is
+         available for boards that need extra gpios for external devices.
+ config S3C24XX_GPIO_EXTRA128
+       bool
+       help
+         Add an extra 128 gpio numbers to the available GPIO pool. This is
+         available for boards that need extra gpios for external devices.
+ # cpu frequency items common between s3c2410 and s3c2440/s3c2442
+ config S3C2410_IOTIMING
+       bool
+       depends on CPU_FREQ_S3C24XX
+       help
+         Internal node to select io timing code that is common to the s3c2410
+         and s3c2440/s3c2442 cpu frequency support.
+ config S3C2410_CPUFREQ_UTILS
+       bool
+       depends on CPU_FREQ_S3C24XX
+       help
+         Internal node to select timing code that is common to the s3c2410
+         and s3c2440/s3c244 cpu frequency support.
+ # cpu frequency support common to s3c2412, s3c2413 and s3c2442
+ config S3C2412_IOTIMING
+       bool
+       depends on CPU_FREQ_S3C24XX && (CPU_S3C2412 || CPU_S3C2443)
+       help
+         Intel node to select io timing code that is common to the s3c2412
+         and the s3c2443.
  # cpu-specific sections
  
  if CPU_S3C2410
  
+ config S3C2410_CPUFREQ
+       bool
+       depends on CPU_FREQ_S3C24XX && CPU_S3C2410
+       select S3C2410_CPUFREQ_UTILS
+       help
+         CPU Frequency scaling support for S3C2410
+ config S3C2410_PLL
+       bool
+       depends on S3C2410_CPUFREQ && CPU_FREQ_S3C24XX_PLL
+       default y
+       help
+         Select the PLL table for the S3C2410
  config S3C24XX_SIMTEC_NOR
        bool
        help
@@@ -226,7 -344,6 +344,7 @@@ config MACH_QT241
  config ARCH_SMDK2410
        bool "SMDK2410/A9M2410"
        select S3C24XX_SMDK
 +      select S3C_DEV_USB_HOST
        help
          Say Y here if you are using the SMDK2410 or the derived module A9M2410
          <http://www.fsforth.de>
@@@ -267,6 -384,14 +385,14 @@@ config CPU_S3C2412_ONL
                   !CPU_S3C2443 && CPU_S3C2412
        default y
  
+ config S3C2412_CPUFREQ
+       bool
+       depends on CPU_FREQ_S3C24XX && CPU_S3C2412
+       default y
+       select S3C2412_IOTIMING
+       help
+         CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs.
  config S3C2412_DMA
        bool
        help
  
  config S3C2412_PM
        bool
 +      select S3C2412_PM_SLEEP
        help
          Internal config node to apply S3C2412 power management
  
@@@ -293,8 -417,8 +419,8 @@@ config MACH_JIV
          Say Y here if you are using the Logitech Jive.
  
  config MACH_JIVE_SHOW_BOOTLOADER
 -      bool "Allow access to bootloader partitions in MTD (EXPERIMENTAL)"
 -      depends on MACH_JIVE && EXPERIMENTAL
 +      bool "Allow access to bootloader partitions in MTD"
 +      depends on MACH_JIVE
  
  config MACH_S3C2413
        bool
@@@ -367,11 -491,45 +493,45 @@@ endif   # CPU_S3C241
  
  if CPU_S3C2440
  
+ config S3C2440_CPUFREQ
+       bool "S3C2440/S3C2442 CPU Frequency scaling support"
+       depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442)
+       default y
+       select S3C2410_CPUFREQ_UTILS
+       help
+         CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs.
  config S3C2440_DMA
        bool
        help
          Support for S3C2440 specific DMA code5A
  
+ config S3C2440_XTAL_12000000
+       bool
+       help
+         Indicate that the build needs to support 12MHz system
+         crystal.
+ config S3C2440_XTAL_16934400
+       bool
+       help
+         Indicate that the build needs to support 16.9344MHz system
+         crystal.
+ config S3C2440_PLL_12000000
+       bool
+       depends on S3C2440_CPUFREQ && S3C2440_XTAL_12000000
+       default y if CPU_FREQ_S3C24XX_PLL
+       help
+         PLL tables for S3C2440 or S3C2442 CPUs with 12MHz crystals.
+ config S3C2440_PLL_16934400
+       bool
+       depends on S3C2440_CPUFREQ && S3C2440_XTAL_16934400
+       default y if CPU_FREQ_S3C24XX_PLL
+       help
+         PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals.
  comment "S3C2440 Boards"
  
  #
index c52100ef2322a7304098457f50e4fbe052a05fca,f60f749d709cda07c4668f95575d938dbe1df6f4..ae2cbdf3e3ca536e9a184342979ee3829b963bb6
@@@ -1,5 -1,4 +1,4 @@@
- /* linux/arch/arm/mach-s3c2440/mach-osiris.c
-  *
+ /*
   * Copyright (c) 2005-2008 Simtec Electronics
   *    http://armlinux.simtec.co.uk/
   *    Ben Dooks <ben@simtec.co.uk>
  #include <linux/clk.h>
  #include <linux/i2c.h>
  #include <linux/io.h>
 +#include <linux/platform_device.h>
  
  #include <linux/i2c/tps65010.h>
  
+ #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
  #include <asm/mach/irq.h>
- #include <mach/osiris-map.h>
- #include <mach/osiris-cpld.h>
- #include <mach/hardware.h>
  #include <asm/irq.h>
- #include <asm/mach-types.h>
  
- #include <plat/cpu-freq.h>
- #include <plat/regs-serial.h>
- #include <mach/regs-gpio.h>
- #include <mach/regs-mem.h>
- #include <mach/regs-lcd.h>
  #include <linux/platform_data/mtd-nand-s3c2410.h>
  #include <linux/platform_data/i2c-s3c2410.h>
  
  #include <linux/mtd/nand_ecc.h>
  #include <linux/mtd/partitions.h>
  
- #include <plat/gpio-cfg.h>
  #include <plat/clock.h>
- #include <plat/devs.h>
  #include <plat/cpu.h>
+ #include <plat/cpu-freq.h>
+ #include <plat/devs.h>
+ #include <plat/gpio-cfg.h>
+ #include <plat/regs-serial.h>
+ #include <mach/hardware.h>
+ #include <mach/regs-gpio.h>
+ #include <mach/regs-lcd.h>
  
  #include "common.h"
+ #include "osiris.h"
+ #include "regs-mem.h"
  
  /* onboard perihperal map */
  
@@@ -429,6 -425,6 +426,6 @@@ MACHINE_START(OSIRIS, "Simtec-OSIRIS"
        .map_io         = osiris_map_io,
        .init_irq       = s3c24xx_init_irq,
        .init_machine   = osiris_init,
-       .timer          = &s3c24xx_timer,
+       .init_time      = s3c24xx_timer_init,
        .restart        = s3c244x_restart,
  MACHINE_END
index f5dc2b254a5a0b1a072aac5687c1cc3c86c708f9,2ce86a4fa7602ac7848d798758c1d84f0be3b154..668a78a8b19518a07dff82f4e6cc8e702d6e8be5
  #include <linux/platform_device.h>
  #include <linux/io.h>
  
- #include <mach/hardware.h>
  #include <asm/cacheflush.h>
  #include <asm/irq.h>
  
- #include <mach/regs-power.h>
+ #include <mach/hardware.h>
  #include <mach/regs-gpio.h>
- #include <mach/regs-dsc.h>
  
  #include <plat/cpu.h>
  #include <plat/pm.h>
  #include <plat/s3c2412.h>
  
+ #include "regs-dsc.h"
+ #include "s3c2412-power.h"
  extern void s3c2412_sleep_enter(void);
  
  static int s3c2412_cpu_suspend(unsigned long arg)
@@@ -48,8 -48,7 +48,8 @@@
  
        s3c2412_sleep_enter();
  
 -      panic("sleep resumed to originator?");
 +      pr_info("Failed to suspend the system\n");
 +      return 1; /* Aborting suspend */
  }
  
  static void s3c2412_pm_prepare(void)
index 1a9e8dd194ff87b09025990d89a3774ad12156b8,db7435a9905c0cf5836aedcd83d1186bb067e2b1..44923895f558633251adc07ce589cfbcb8d86480
  
  #include <asm/cacheflush.h>
  
- #include <mach/regs-power.h>
  #include <mach/regs-s3c2443-clock.h>
  
  #include <plat/cpu.h>
  #include <plat/pm.h>
  
+ #include "s3c2412-power.h"
  extern void s3c2412_sleep_enter(void);
  
  static int s3c2416_cpu_suspend(unsigned long arg)
@@@ -34,8 -35,7 +35,8 @@@
  
        s3c2412_sleep_enter();
  
 -      panic("sleep resumed to originator?");
 +      pr_info("Failed to suspend the system\n");
 +      return 1; /* Aborting suspend */
  }
  
  static void s3c2416_pm_prepare(void)
index 65200ae72c908d24eaf4df1a0dc7edcf6dd316b6,25b212180bf5da6a508b94a6e89dc6de0aaee2a7..dd47c8fa07fae7b17e8d9a48c58c3f0d22c13397
  
  #include <mach/regs-gpio.h>
  #include <mach/regs-clock.h>
- #include <mach/regs-mem.h>
  #include <plat/regs-serial.h>
  
+ #include "regs-mem.h"
        /* s3c2410_cpu_suspend
         *
         * put the cpu into sleep mode
@@@ -45,9 -46,9 +46,9 @@@ ENTRY(s3c2410_cpu_suspend
        ldr     r4, =S3C2410_REFRESH
        ldr     r5, =S3C24XX_MISCCR
        ldr     r6, =S3C2410_CLKCON
 -      ldr     r7, [ r4 ]              @ get REFRESH (and ensure in TLB)
 -      ldr     r8, [ r5 ]              @ get MISCCR (and ensure in TLB)
 -      ldr     r9, [ r6 ]              @ get CLKCON (and ensure in TLB)
 +      ldr     r7, [r4]                @ get REFRESH (and ensure in TLB)
 +      ldr     r8, [r5]                @ get MISCCR (and ensure in TLB)
 +      ldr     r9, [r6]                @ get CLKCON (and ensure in TLB)
  
        orr     r7, r7, #S3C2410_REFRESH_SELF   @ SDRAM sleep command
        orr     r8, r8, #S3C2410_MISCCR_SDSLEEP @ SDRAM power-down signals
@@@ -61,8 -62,8 +62,8 @@@
        @@ align next bit of code to cache line
        .align  5
  s3c2410_do_sleep:
 -      streq   r7, [ r4 ]                      @ SDRAM sleep command
 -      streq   r8, [ r5 ]                      @ SDRAM power-down config
 -      streq   r9, [ r6 ]                      @ CPU sleep
 +      streq   r7, [r4]                        @ SDRAM sleep command
 +      streq   r8, [r5]                        @ SDRAM power-down config
 +      streq   r9, [r6]                        @ CPU sleep
  1:    beq     1b
        mov     pc, r14
index ce8499063228eadadff2df6e1a3790152bab9616,a6d7c6cf45e776a640697b04f27e4b1b46d1f6ba..6a1f91fea678e471fdbf5a161ed2bdbd08a26108
  #include <plat/pm.h>
  #include <plat/wakeup-mask.h>
  
- #include <mach/regs-sys.h>
  #include <mach/regs-gpio.h>
  #include <mach/regs-clock.h>
- #include <mach/regs-syscon-power.h>
- #include <mach/regs-gpio-memport.h>
- #include <mach/regs-modem.h>
+ #include "regs-gpio-memport.h"
+ #include "regs-modem.h"
+ #include "regs-sys.h"
+ #include "regs-syscon-power.h"
  
  struct s3c64xx_pm_domain {
        char *const name;
@@@ -296,8 -297,7 +297,8 @@@ static int s3c64xx_cpu_suspend(unsigne
  
        /* we should never get past here */
  
 -      panic("sleep resumed to originator?");
 +      pr_info("Failed to suspend the system\n");
 +      return 1; /* Aborting suspend */
  }
  
  /* mapping of interrupts to parts of the wakeup mask */
index 442497363db96840287cad48b913e7f394d650bd,b38d2525d5dbdd21f985126d0874e72540fd3f4f..e838ba27e443c1dd0b54042c3e4afd882ae22265
@@@ -16,7 -16,6 +16,7 @@@
  #include <linux/ioport.h>
  #include <linux/platform_data/sa11x0-serial.h>
  #include <linux/serial_core.h>
 +#include <linux/platform_device.h>
  #include <linux/mfd/ucb1x00.h>
  #include <linux/mtd/mtd.h>
  #include <linux/mtd/partitions.h>
@@@ -622,7 -621,7 +622,7 @@@ MACHINE_START(ASSABET, "Intel-Assabet"
        .map_io         = assabet_map_io,
        .nr_irqs        = SA1100_NR_IRQS,
        .init_irq       = sa1100_init_irq,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .init_machine   = assabet_init,
        .init_late      = sa11x0_init_late,
  #ifdef CONFIG_SA1111
index bca7e60b24d3ec4fbb6c3b209f4c6a5b4f82a062,a89917653884642f1219fb7f4c820fcbe56e19ee..51b0eb52c0141b8b134b7e3ae6c2a81b5e7f25fb
@@@ -24,6 -24,9 +24,6 @@@
  
  #include "generic.h"
  
 -
 -#warning "include/asm/arch-sa1100/ide.h needs fixing for lart"
 -
  static struct mcp_plat_data lart_mcp_data = {
        .mccr0          = MCCR0_ADM,
        .sclk_rate      = 11981000,
@@@ -171,6 -174,6 +171,6 @@@ MACHINE_START(LART, "LART"
        .init_irq       = sa1100_init_irq,
        .init_machine   = lart_init,
        .init_late      = sa11x0_init_late,
-       .timer          = &sa1100_timer,
+       .init_time      = sa1100_timer_init,
        .restart        = sa11x0_restart,
  MACHINE_END
index 08294fa9e0d47a84b4f478298dba40b865dcf5ba,c1d4ab630214088d34497a8f50c80f80a157758b..2928cd6868081833469cfde2d6f64fe8440ac2af
@@@ -657,8 -657,14 +657,8 @@@ static struct platform_device lcdc_devi
  /* FSI */
  #define IRQ_FSI               evt2irq(0x1840)
  static struct sh_fsi_platform_info fsi_info = {
 -      .port_a = {
 -              .flags          = SH_FSI_BRS_INV,
 -      },
        .port_b = {
 -              .flags          = SH_FSI_BRS_INV |
 -                                SH_FSI_BRM_INV |
 -                                SH_FSI_LRS_INV |
 -                                SH_FSI_CLK_CPG |
 +              .flags          = SH_FSI_CLK_CPG |
                                  SH_FSI_FMT_SPDIF,
        },
  };
@@@ -686,21 -692,21 +686,21 @@@ static struct platform_device fsi_devic
        },
  };
  
 -static struct asoc_simple_dai_init_info fsi2_ak4643_init_info = {
 -      .fmt            = SND_SOC_DAIFMT_LEFT_J,
 -      .codec_daifmt   = SND_SOC_DAIFMT_CBM_CFM,
 -      .cpu_daifmt     = SND_SOC_DAIFMT_CBS_CFS,
 -      .sysclk         = 11289600,
 -};
 -
  static struct asoc_simple_card_info fsi2_ak4643_info = {
        .name           = "AK4643",
        .card           = "FSI2A-AK4643",
 -      .cpu_dai        = "fsia-dai",
        .codec          = "ak4642-codec.0-0013",
        .platform       = "sh_fsi2",
 -      .codec_dai      = "ak4642-hifi",
 -      .init           = &fsi2_ak4643_init_info,
 +      .daifmt         = SND_SOC_DAIFMT_LEFT_J,
 +      .cpu_dai = {
 +              .name   = "fsia-dai",
 +              .fmt    = SND_SOC_DAIFMT_CBS_CFS,
 +      },
 +      .codec_dai = {
 +              .name   = "ak4642-hifi",
 +              .fmt    = SND_SOC_DAIFMT_CBM_CFM,
 +              .sysclk = 11289600,
 +      },
  };
  
  static struct platform_device fsi_ak4643_device = {
@@@ -809,18 -815,18 +809,18 @@@ static struct platform_device lcdc1_dev
        },
  };
  
 -static struct asoc_simple_dai_init_info fsi2_hdmi_init_info = {
 -      .cpu_daifmt     = SND_SOC_DAIFMT_CBM_CFM,
 -};
 -
  static struct asoc_simple_card_info fsi2_hdmi_info = {
        .name           = "HDMI",
        .card           = "FSI2B-HDMI",
 -      .cpu_dai        = "fsib-dai",
        .codec          = "sh-mobile-hdmi",
        .platform       = "sh_fsi2",
 -      .codec_dai      = "sh_mobile_hdmi-hifi",
 -      .init           = &fsi2_hdmi_init_info,
 +      .cpu_dai = {
 +              .name   = "fsib-dai",
 +              .fmt    = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF,
 +      },
 +      .codec_dai = {
 +              .name   = "sh_mobile_hdmi-hifi",
 +      },
  };
  
  static struct platform_device fsi_hdmi_device = {
@@@ -1344,5 -1350,5 +1344,5 @@@ MACHINE_START(AP4EVB, "ap4evb"
        .handle_irq     = shmobile_handle_irq_intc,
        .init_machine   = ap4evb_init,
        .init_late      = sh7372_pm_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = sh7372_earlytimer_init,
  MACHINE_END
index 0679ca6bf1f67bfaf64c0d1d118a6c908b044655,e7912447ad504f86e9ae4535b60e5adbb72c6860..6bcf3cbd922382c6b79040adc8f3eaef9f72ef7d
@@@ -806,21 -806,21 +806,21 @@@ static struct platform_device fsi_devic
  };
  
  /* FSI-WM8978 */
 -static struct asoc_simple_dai_init_info fsi_wm8978_init_info = {
 -      .fmt            = SND_SOC_DAIFMT_I2S,
 -      .codec_daifmt   = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_NB_NF,
 -      .cpu_daifmt     = SND_SOC_DAIFMT_CBS_CFS,
 -      .sysclk         = 12288000,
 -};
 -
  static struct asoc_simple_card_info fsi_wm8978_info = {
        .name           = "wm8978",
        .card           = "FSI2A-WM8978",
 -      .cpu_dai        = "fsia-dai",
        .codec          = "wm8978.0-001a",
        .platform       = "sh_fsi2",
 -      .codec_dai      = "wm8978-hifi",
 -      .init           = &fsi_wm8978_init_info,
 +      .daifmt         = SND_SOC_DAIFMT_I2S,
 +      .cpu_dai = {
 +              .name   = "fsia-dai",
 +              .fmt    = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_IB_NF,
 +      },
 +      .codec_dai = {
 +              .name   = "wm8978-hifi",
 +              .fmt    = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_NB_NF,
 +              .sysclk = 12288000,
 +      },
  };
  
  static struct platform_device fsi_wm8978_device = {
  };
  
  /* FSI-HDMI */
 -static struct asoc_simple_dai_init_info fsi2_hdmi_init_info = {
 -      .cpu_daifmt     = SND_SOC_DAIFMT_CBM_CFM,
 -};
 -
  static struct asoc_simple_card_info fsi2_hdmi_info = {
        .name           = "HDMI",
        .card           = "FSI2B-HDMI",
 -      .cpu_dai        = "fsib-dai",
        .codec          = "sh-mobile-hdmi",
        .platform       = "sh_fsi2",
 -      .codec_dai      = "sh_mobile_hdmi-hifi",
 -      .init           = &fsi2_hdmi_init_info,
 +      .cpu_dai = {
 +              .name   = "fsib-dai",
 +              .fmt    = SND_SOC_DAIFMT_CBM_CFM,
 +      },
 +      .codec_dai = {
 +              .name = "sh_mobile_hdmi-hifi",
 +      },
  };
  
  static struct platform_device fsi_hdmi_device = {
@@@ -1192,9 -1192,6 +1192,6 @@@ static void __init eva_earlytimer_init(
  static void __init eva_add_early_devices(void)
  {
        r8a7740_add_early_devices();
-       /* override timer setup with board-specific code */
-       shmobile_timer.init = eva_earlytimer_init;
  }
  
  #define RESCNT2 IOMEM(0xe6188020)
@@@ -1216,7 -1213,7 +1213,7 @@@ DT_MACHINE_START(ARMADILLO800EVA_DT, "a
        .handle_irq     = shmobile_handle_irq_intc,
        .init_machine   = eva_init,
        .init_late      = shmobile_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = eva_earlytimer_init,
        .dt_compat      = eva_boards_compat_dt,
        .restart        = eva_restart,
  MACHINE_END
index f41b71e8df3eb331eedd4816ea876cd3b10313c5,ac9428530d7b5254b30ad33e9b81e1dd458e47c6..5394d804a716619a5c73232564e344faa1690b1a
@@@ -25,6 -25,7 +25,7 @@@
  #include <linux/i2c.h>
  #include <linux/i2c/pcf857x.h>
  #include <linux/input.h>
+ #include <linux/irqchip/arm-gic.h>
  #include <linux/mmc/host.h>
  #include <linux/mmc/sh_mmcif.h>
  #include <linux/mmc/sh_mobile_sdhi.h>
@@@ -42,7 -43,6 +43,6 @@@
  #include <mach/sh73a0.h>
  #include <mach/common.h>
  #include <asm/hardware/cache-l2x0.h>
- #include <asm/hardware/gic.h>
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <video/sh_mobile_lcdc.h>
@@@ -525,21 -525,21 +525,21 @@@ static struct platform_device fsi_devic
        },
  };
  
 -static struct asoc_simple_dai_init_info fsi2_ak4648_init_info = {
 -      .fmt            = SND_SOC_DAIFMT_LEFT_J,
 -      .codec_daifmt   = SND_SOC_DAIFMT_CBM_CFM,
 -      .cpu_daifmt     = SND_SOC_DAIFMT_CBS_CFS,
 -      .sysclk         = 11289600,
 -};
 -
  static struct asoc_simple_card_info fsi2_ak4648_info = {
        .name           = "AK4648",
        .card           = "FSI2A-AK4648",
 -      .cpu_dai        = "fsia-dai",
        .codec          = "ak4642-codec.0-0012",
        .platform       = "sh_fsi2",
 -      .codec_dai      = "ak4642-hifi",
 -      .init           = &fsi2_ak4648_init_info,
 +      .daifmt         = SND_SOC_DAIFMT_LEFT_J,
 +      .cpu_dai = {
 +              .name   = "fsia-dai",
 +              .fmt    = SND_SOC_DAIFMT_CBS_CFS,
 +      },
 +      .codec_dai = {
 +              .name   = "ak4642-hifi",
 +              .fmt    = SND_SOC_DAIFMT_CBM_CFM,
 +              .sysclk = 11289600,
 +      },
  };
  
  static struct platform_device fsi_ak4648_device = {
@@@ -792,10 -792,9 +792,9 @@@ DT_MACHINE_START(KZM9G_DT, "kzm9g"
        .init_early     = sh73a0_add_early_devices,
        .nr_irqs        = NR_IRQS_LEGACY,
        .init_irq       = sh73a0_init_irq,
-       .handle_irq     = gic_handle_irq,
        .init_machine   = kzm_init,
        .init_late      = shmobile_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = sh73a0_earlytimer_init,
        .restart        = kzm9g_restart,
        .dt_compat      = kzm9g_boards_compat_dt,
  MACHINE_END
index 3fd716dae40544d33f11fe1f45556304446fe165,fe4917f2c1a2887740929bbf1135bf2a5cd79eed..e2fafca9432b79a37a6d479bff61b39c6877021b
@@@ -502,18 -502,18 +502,18 @@@ static struct platform_device hdmi_lcdc
        },
  };
  
 -static struct asoc_simple_dai_init_info fsi2_hdmi_init_info = {
 -      .cpu_daifmt     = SND_SOC_DAIFMT_CBM_CFM,
 -};
 -
  static struct asoc_simple_card_info fsi2_hdmi_info = {
        .name           = "HDMI",
        .card           = "FSI2B-HDMI",
 -      .cpu_dai        = "fsib-dai",
        .codec          = "sh-mobile-hdmi",
        .platform       = "sh_fsi2",
 -      .codec_dai      = "sh_mobile_hdmi-hifi",
 -      .init           = &fsi2_hdmi_init_info,
 +      .cpu_dai = {
 +              .name   = "fsib-dai",
 +              .fmt    = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF,
 +      },
 +      .codec_dai = {
 +              .name   = "sh_mobile_hdmi-hifi",
 +      },
  };
  
  static struct platform_device fsi_hdmi_device = {
@@@ -858,12 -858,16 +858,12 @@@ static struct platform_device leds_devi
  #define IRQ_FSI evt2irq(0x1840)
  static struct sh_fsi_platform_info fsi_info = {
        .port_a = {
 -              .flags = SH_FSI_BRS_INV,
                .tx_id = SHDMA_SLAVE_FSIA_TX,
                .rx_id = SHDMA_SLAVE_FSIA_RX,
        },
        .port_b = {
 -              .flags = SH_FSI_BRS_INV |
 -                      SH_FSI_BRM_INV  |
 -                      SH_FSI_LRS_INV  |
 -                      SH_FSI_CLK_CPG  |
 -                      SH_FSI_FMT_SPDIF,
 +              .flags = SH_FSI_CLK_CPG |
 +                       SH_FSI_FMT_SPDIF,
        }
  };
  
@@@ -892,21 -896,21 +892,21 @@@ static struct platform_device fsi_devic
        },
  };
  
 -static struct asoc_simple_dai_init_info fsi2_ak4643_init_info = {
 -      .fmt            = SND_SOC_DAIFMT_LEFT_J,
 -      .codec_daifmt   = SND_SOC_DAIFMT_CBM_CFM,
 -      .cpu_daifmt     = SND_SOC_DAIFMT_CBS_CFS,
 -      .sysclk         = 11289600,
 -};
 -
  static struct asoc_simple_card_info fsi2_ak4643_info = {
        .name           = "AK4643",
        .card           = "FSI2A-AK4643",
 -      .cpu_dai        = "fsia-dai",
        .codec          = "ak4642-codec.0-0013",
        .platform       = "sh_fsi2",
 -      .codec_dai      = "ak4642-hifi",
 -      .init           = &fsi2_ak4643_init_info,
 +      .daifmt         = SND_SOC_DAIFMT_LEFT_J,
 +      .cpu_dai = {
 +              .name   = "fsia-dai",
 +              .fmt    = SND_SOC_DAIFMT_CBS_CFS,
 +      },
 +      .codec_dai = {
 +              .name   = "ak4642-hifi",
 +              .fmt    = SND_SOC_DAIFMT_CBM_CFM,
 +              .sysclk = 11289600,
 +      },
  };
  
  static struct platform_device fsi_ak4643_device = {
@@@ -1589,6 -1593,6 +1589,6 @@@ DT_MACHINE_START(MACKEREL_DT, "mackerel
        .handle_irq     = shmobile_handle_irq_intc,
        .init_machine   = mackerel_init,
        .init_late      = sh7372_pm_init_late,
-       .timer          = &shmobile_timer,
+       .init_time      = sh7372_earlytimer_init,
        .dt_compat  = mackerel_boards_compat_dt,
  MACHINE_END
index a36a03d3c9a08f8af52d9ad4d679e494cfa7016b,85d4a23bba039e1ce18372dcb283eea1a53f964c..ece29ab15b5914b0d851057cfc2df76192f150ab
@@@ -214,24 -214,6 +214,6 @@@ static int tegra_cpu_init(struct cpufre
        if (policy->cpu >= NUM_CPUS)
                return -EINVAL;
  
-       cpu_clk = clk_get_sys(NULL, "cpu");
-       if (IS_ERR(cpu_clk))
-               return PTR_ERR(cpu_clk);
-       pll_x_clk = clk_get_sys(NULL, "pll_x");
-       if (IS_ERR(pll_x_clk))
-               return PTR_ERR(pll_x_clk);
-       pll_p_clk = clk_get_sys(NULL, "pll_p");
-       if (IS_ERR(pll_p_clk))
-               return PTR_ERR(pll_p_clk);
-       emc_clk = clk_get_sys("cpu", "emc");
-       if (IS_ERR(emc_clk)) {
-               clk_put(cpu_clk);
-               return PTR_ERR(emc_clk);
-       }
        clk_prepare_enable(emc_clk);
        clk_prepare_enable(cpu_clk);
  
        /* FIXME: what's the actual transition time? */
        policy->cpuinfo.transition_latency = 300 * 1000;
  
 -      policy->shared_type = CPUFREQ_SHARED_TYPE_ALL;
 -      cpumask_copy(policy->related_cpus, cpu_possible_mask);
 +      cpumask_copy(policy->cpus, cpu_possible_mask);
  
        if (policy->cpu == 0)
                register_pm_notifier(&tegra_cpu_pm_notifier);
@@@ -255,8 -238,6 +237,6 @@@ static int tegra_cpu_exit(struct cpufre
  {
        cpufreq_frequency_table_cpuinfo(policy, freq_table);
        clk_disable_unprepare(emc_clk);
-       clk_put(emc_clk);
-       clk_put(cpu_clk);
        return 0;
  }
  
@@@ -277,12 -258,32 +257,32 @@@ static struct cpufreq_driver tegra_cpuf
  
  static int __init tegra_cpufreq_init(void)
  {
+       cpu_clk = clk_get_sys(NULL, "cpu");
+       if (IS_ERR(cpu_clk))
+               return PTR_ERR(cpu_clk);
+       pll_x_clk = clk_get_sys(NULL, "pll_x");
+       if (IS_ERR(pll_x_clk))
+               return PTR_ERR(pll_x_clk);
+       pll_p_clk = clk_get_sys(NULL, "pll_p");
+       if (IS_ERR(pll_p_clk))
+               return PTR_ERR(pll_p_clk);
+       emc_clk = clk_get_sys("cpu", "emc");
+       if (IS_ERR(emc_clk)) {
+               clk_put(cpu_clk);
+               return PTR_ERR(emc_clk);
+       }
        return cpufreq_register_driver(&tegra_cpufreq_driver);
  }
  
  static void __exit tegra_cpufreq_exit(void)
  {
          cpufreq_unregister_driver(&tegra_cpufreq_driver);
+       clk_put(emc_clk);
+       clk_put(cpu_clk);
  }
  
  
index b8781caa54b8b28d43c7504e61d85711729259e4,bf04b783b6d0e470df91e05650b8e54541470f7e..3868aa4ff15e3c925e232c3b9ab6ab382785fabd
@@@ -40,7 -40,6 +40,6 @@@
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
- #include <asm/hardware/gic.h>
  
  #include <mach/hardware.h>
  #include <mach/setup.h>
@@@ -90,8 -89,26 +89,8 @@@ static struct platform_device snowball_
         },
  };
  
 -static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
 +static struct abx500_gpio_platform_data ab8500_gpio_pdata = {
        .gpio_base              = MOP500_AB8500_PIN_GPIO(1),
 -      .irq_base               = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
 -      /* config_reg is the initial configuration of ab8500 pins.
 -       * The pins can be configured as GPIO or alt functions based
 -       * on value present in GpioSel1 to GpioSel6 and AlternatFunction
 -       * register. This is the array of 7 configuration settings.
 -       * One has to compile time decide these settings. Below is the
 -       * explanation of these setting
 -       * GpioSel1 = 0x00 => Pins GPIO1 to GPIO8 are not used as GPIO
 -       * GpioSel2 = 0x1E => Pins GPIO10 to GPIO13 are configured as GPIO
 -       * GpioSel3 = 0x80 => Pin GPIO24 is configured as GPIO
 -       * GpioSel4 = 0x01 => Pin GPIo25 is configured as GPIO
 -       * GpioSel5 = 0x7A => Pins GPIO34, GPIO36 to GPIO39 are conf as GPIO
 -       * GpioSel6 = 0x00 => Pins GPIO41 & GPIo42 are not configured as GPIO
 -       * AlternaFunction = 0x00 => If Pins GPIO10 to 13 are not configured
 -       * as GPIO then this register selectes the alternate fucntions
 -       */
 -      .config_reg             = {0x00, 0x1E, 0x80, 0x01,
 -                                      0x7A, 0x00, 0x00},
  };
  
  /* ab8500-codec */
@@@ -197,7 -214,7 +196,7 @@@ static struct platform_device snowball_
        },
  };
  
- static struct ab8500_platform_data ab8500_platdata = {
+ struct ab8500_platform_data ab8500_platdata = {
        .irq_base       = MOP500_AB8500_IRQ_BASE,
        .regulator_reg_init = ab8500_regulator_reg_init,
        .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init),
@@@ -633,6 -650,7 +632,7 @@@ static void __init mop500_init_machine(
        int i2c0_devs;
        int i;
  
+       platform_device_register(&db8500_prcmu_device);
        mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
  
        mop500_pinmaps_init();
@@@ -667,6 -685,7 +667,7 @@@ static void __init snowball_init_machin
        struct device *parent = NULL;
        int i;
  
+       platform_device_register(&db8500_prcmu_device);
        snowball_pinmaps_init();
        parent = u8500_init_devices(&ab8500_platdata);
  
@@@ -692,6 -711,7 +693,7 @@@ static void __init hrefv60_init_machine
        int i2c0_devs;
        int i;
  
+       platform_device_register(&db8500_prcmu_device);
        /*
         * The HREFv60 board removed a GPIO expander and routed
         * all these GPIO pins to the internal GPIO controller
@@@ -733,8 -753,7 +735,7 @@@ MACHINE_START(U8500, "ST-Ericsson MOP50
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
-       .timer          = &ux500_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = ux500_timer_init,
        .init_machine   = mop500_init_machine,
        .init_late      = ux500_init_late,
  MACHINE_END
@@@ -743,8 -762,7 +744,7 @@@ MACHINE_START(U8520, "ST-Ericsson U852
        .atag_offset    = 0x100,
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
-       .timer          = &ux500_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = ux500_timer_init,
        .init_machine   = mop500_init_machine,
        .init_late      = ux500_init_late,
  MACHINE_END
@@@ -754,8 -772,7 +754,7 @@@ MACHINE_START(HREFV60, "ST-Ericsson U85
        .smp            = smp_ops(ux500_smp_ops),
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
-       .timer          = &ux500_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = ux500_timer_init,
        .init_machine   = hrefv60_init_machine,
        .init_late      = ux500_init_late,
  MACHINE_END
@@@ -766,8 -783,7 +765,7 @@@ MACHINE_START(SNOWBALL, "Calao Systems 
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
-       .timer          = &ux500_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = ux500_timer_init,
        .init_machine   = snowball_init_machine,
        .init_late      = NULL,
  MACHINE_END
index b80ad9610e9752e3c1d9740f03ddaf5f7e0ec5d1,6f42b6087df52d2b2363d292e0179ce6c3f0790f..19235cf7bbe3f33c4fe4d63eee73d779624dbb69
@@@ -27,7 -27,6 +27,6 @@@
  #include <asm/pmu.h>
  #include <asm/mach/map.h>
  #include <asm/mach/arch.h>
- #include <asm/hardware/gic.h>
  
  #include <mach/hardware.h>
  #include <mach/setup.h>
@@@ -37,7 -36,9 +36,9 @@@
  
  #include "devices-db8500.h"
  #include "ste-dma40-db8500.h"
  #include "board-mop500.h"
+ #include "id.h"
  
  /* minimum static i/o mapping required to boot U8500 platforms */
  static struct map_desc u8500_uart_io_desc[] __initdata = {
@@@ -137,14 -138,9 +138,9 @@@ static struct platform_device db8500_pm
        .dev.platform_data      = &db8500_pmu_platdata,
  };
  
- static struct platform_device db8500_prcmu_device = {
-       .name                   = "db8500-prcmu",
- };
  static struct platform_device *platform_devs[] __initdata = {
        &u8500_dma40_device,
        &db8500_pmu_device,
-       &db8500_prcmu_device,
  };
  
  static resource_size_t __initdata db8500_gpio_base[] = {
@@@ -284,8 -280,10 +280,10 @@@ static struct of_dev_auxdata u8500_auxd
        OF_DEV_AUXDATA("st,nomadik-i2c", 0x80128000, "nmk-i2c.2", NULL),
        OF_DEV_AUXDATA("st,nomadik-i2c", 0x80110000, "nmk-i2c.3", NULL),
        OF_DEV_AUXDATA("st,nomadik-i2c", 0x8012a000, "nmk-i2c.4", NULL),
+       OF_DEV_AUXDATA("stericsson,db8500-prcmu", 0x80157000, "db8500-prcmu",
+                       &db8500_prcmu_pdata),
        /* Requires device name bindings. */
 -      OF_DEV_AUXDATA("stericsson,nmk_pinctrl", U8500_PRCMU_BASE,
 +      OF_DEV_AUXDATA("stericsson,nmk-pinctrl", U8500_PRCMU_BASE,
                "pinctrl-db8500", NULL),
        /* Requires clock name and DMA bindings. */
        OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80123000,
@@@ -341,8 -339,7 +339,7 @@@ DT_MACHINE_START(U8500_DT, "ST-Ericsso
        .map_io         = u8500_map_io,
        .init_irq       = ux500_init_irq,
        /* we re-use nomadik timer here */
-       .timer          = &ux500_timer,
-       .handle_irq     = gic_handle_irq,
+       .init_time      = ux500_timer_init,
        .init_machine   = u8500_init_machine,
        .init_late      = NULL,
        .dt_compat      = stericsson_dt_platform_compat,
index d4dcec53171ac7abef0bfee7eb8061bb1fe90db5,506c5b2d0fad612786b3276f35a689da2c229653..537870d3fea87a5df90eb733969ce81dcac8a538
  #include <linux/of.h>
  #include <linux/of_irq.h>
  #include <linux/irq.h>
+ #include <linux/irqchip.h>
+ #include <linux/irqchip/arm-gic.h>
  #include <linux/platform_data/clk-ux500.h>
  
- #include <asm/hardware/gic.h>
  #include <asm/mach/map.h>
  
  #include <mach/hardware.h>
@@@ -27,6 -28,7 +28,7 @@@
  #include <mach/devices.h>
  
  #include "board-mop500.h"
+ #include "id.h"
  
  void __iomem *_PRCMU_BASE;
  
   * This feels fragile because it depends on the gpio device getting probed
   * _before_ any device uses the gpio interrupts.
  */
- static const struct of_device_id ux500_dt_irq_match[] = {
-       { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
-       {},
- };
  void __init ux500_init_irq(void)
  {
        void __iomem *dist_base;
@@@ -62,7 -59,7 +59,7 @@@
  
  #ifdef CONFIG_OF
        if (of_have_populated_dt())
-               of_irq_init(ux500_dt_irq_match);
+               irqchip_init();
        else
  #endif
                gic_init(0, 29, dist_base, cpu_base);
         * Init clocks here so that they are available for system timer
         * initialization.
         */
 -      if (cpu_is_u8500_family())
 +      if (cpu_is_u8500_family() || cpu_is_u9540())
                db8500_prcmu_early_init();
  
 -      if (cpu_is_u8500_family())
 +      if (cpu_is_u8500_family() || cpu_is_u9540())
                u8500_clk_init();
 -      else if (cpu_is_u9540())
 -              u9540_clk_init();
        else if (cpu_is_u8540())
                u8540_clk_init();
  }
index 43478c299cc816ad379e8ef10c7e780b0a826c48,a42b89083eb25c8ce6d8e551dc4082e977085cc7..25160aeaa3b7fe30b9e0cd26cc5e5449b444ca5f
  #include <linux/amba/mmci.h>
  #include <linux/amba/pl022.h>
  #include <linux/io.h>
+ #include <linux/irqchip/arm-vic.h>
  #include <linux/irqchip/versatile-fpga.h>
  #include <linux/gfp.h>
  #include <linux/clkdev.h>
  #include <linux/mtd/physmap.h>
 +#include <linux/bitops.h>
  
  #include <asm/irq.h>
  #include <asm/hardware/arm_timer.h>
  #include <asm/hardware/icst.h>
- #include <asm/hardware/vic.h>
  #include <asm/mach-types.h>
  
  #include <asm/mach/arch.h>
  #define VA_VIC_BASE           __io_address(VERSATILE_VIC_BASE)
  #define VA_SIC_BASE           __io_address(VERSATILE_SIC_BASE)
  
 +/* These PIC IRQs are valid in each configuration */
 +#define PIC_VALID_ALL BIT(SIC_INT_KMI0) | BIT(SIC_INT_KMI1) | \
 +                      BIT(SIC_INT_SCI3) | BIT(SIC_INT_UART3) | \
 +                      BIT(SIC_INT_CLCD) | BIT(SIC_INT_TOUCH) | \
 +                      BIT(SIC_INT_KEYPAD) | BIT(SIC_INT_DoC) | \
 +                      BIT(SIC_INT_USB) | BIT(SIC_INT_PCI0) | \
 +                      BIT(SIC_INT_PCI1) | BIT(SIC_INT_PCI2) | \
 +                      BIT(SIC_INT_PCI3)
  #if 1
  #define IRQ_MMCI0A    IRQ_VICSOURCE22
  #define IRQ_AACI      IRQ_VICSOURCE24
  #define IRQ_ETH               IRQ_VICSOURCE25
  #define PIC_MASK      0xFFD00000
 +#define PIC_VALID     PIC_VALID_ALL
  #else
  #define IRQ_MMCI0A    IRQ_SIC_MMCI0A
  #define IRQ_AACI      IRQ_SIC_AACI
  #define IRQ_ETH               IRQ_SIC_ETH
  #define PIC_MASK      0
 +#define PIC_VALID     PIC_VALID_ALL | BIT(SIC_INT_MMCI0A) | \
 +                      BIT(SIC_INT_MMCI1A) | BIT(SIC_INT_AACI) | \
 +                      BIT(SIC_INT_ETH)
  #endif
  
  /* Lookup table for finding a DT node that represents the vic instance */
@@@ -115,7 -102,7 +115,7 @@@ void __init versatile_init_irq(void
                                              VERSATILE_SIC_BASE);
  
        fpga_irq_init(VA_SIC_BASE, "SIC", IRQ_SIC_START,
 -              IRQ_VICSOURCE31, ~PIC_MASK, np);
 +              IRQ_VICSOURCE31, PIC_VALID, np);
  
        /*
         * Interrupts on secondary controller from 0 to 8 are routed to
        writel(PIC_MASK, VA_SIC_BASE + SIC_INT_PIC_ENABLE);
  }
  
 -static struct map_desc versatile_io_desc[] __initdata = {
 +static struct map_desc versatile_io_desc[] __initdata __maybe_unused = {
        {
                .virtual        =  IO_ADDRESS(VERSATILE_SYS_BASE),
                .pfn            = __phys_to_pfn(VERSATILE_SYS_BASE),
@@@ -783,7 -770,7 +783,7 @@@ void __init versatile_init(void
  /*
   * Set up timer interrupt, and return the current time in seconds.
   */
static void __init versatile_timer_init(void)
+ void __init versatile_timer_init(void)
  {
        u32 val;
  
        sp804_clocksource_init(TIMER3_VA_BASE, "timer3");
        sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1, "timer0");
  }
- struct sys_timer versatile_timer = {
-       .init           = versatile_timer_init,
- };
index 93d09d0e009fc9e344ad32807479cb8bb514bd34,0ce85e29769b80ac7c9e2b958e84bf87505c09eb..4086b9167159391d07418e0d8b75509779bad6df
@@@ -23,7 -23,7 +23,7 @@@
  #include <linux/of_address.h>
  #include <linux/of_irq.h>
  #include <linux/sunxi_timer.h>
 -#include <linux/clk/sunxi.h>
 +#include <linux/clk-provider.h>
  
  #define TIMER_CTL_REG         0x00
  #define TIMER_CTL_ENABLE              (1 << 0)
@@@ -74,7 -74,6 +74,6 @@@ static int sunxi_clkevt_next_event(unsi
  
  static struct clock_event_device sunxi_clockevent = {
        .name = "sunxi_tick",
-       .shift = 32,
        .rating = 300,
        .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
        .set_mode = sunxi_clkevt_mode,
@@@ -104,7 -103,7 +103,7 @@@ static struct of_device_id sunxi_timer_
        { }
  };
  
static void __init sunxi_timer_init(void)
+ void __init sunxi_timer_init(void)
  {
        struct device_node *node;
        unsigned long rate = 0;
        if (irq <= 0)
                panic("Can't parse IRQ");
  
 -      sunxi_init_clocks();
 +      of_clk_init(NULL);
  
        clk = of_clk_get(node, 0);
        if (IS_ERR(clk))
        val = readl(timer_base + TIMER_CTL_REG);
        writel(val | TIMER_CTL_ENABLE, timer_base + TIMER_CTL_REG);
  
-       sunxi_clockevent.mult = div_sc(rate / TIMER_SCAL,
-                               NSEC_PER_SEC,
-                               sunxi_clockevent.shift);
-       sunxi_clockevent.max_delta_ns = clockevent_delta2ns(0xff,
-                                                           &sunxi_clockevent);
-       sunxi_clockevent.min_delta_ns = clockevent_delta2ns(0x1,
-                                                           &sunxi_clockevent);
        sunxi_clockevent.cpumask = cpumask_of(0);
  
-       clockevents_register_device(&sunxi_clockevent);
+       clockevents_config_and_register(&sunxi_clockevent, rate / TIMER_SCAL,
+                                       0x1, 0xff);
  }
- struct sys_timer sunxi_timer = {
-       .init = sunxi_timer_init,
- };
index 79a84860ea56e3a5b119b4181d512fddbb7e93cb,87130e219505d310053078c2a237e033df808d11..48a1988149d8c4441dbfbb60344568f05563e847
@@@ -15,7 -15,6 +15,6 @@@
  #include <linux/slab.h>
  #include <linux/platform_device.h>
  #include <linux/clk.h>
- #include <mach/id.h>
  
  static struct cpufreq_frequency_table *freq_table;
  static struct clk *armss_clk;
@@@ -128,7 -127,9 +127,7 @@@ static int __cpuinit db8500_cpufreq_ini
        policy->cpuinfo.transition_latency = 20 * 1000; /* in ns */
  
        /* policy sharing between dual CPUs */
 -      cpumask_copy(policy->cpus, cpu_present_mask);
 -
 -      policy->shared_type = CPUFREQ_SHARED_TYPE_ALL;
 +      cpumask_setall(policy->cpus);
  
        return 0;
  }
@@@ -165,9 -166,6 +164,6 @@@ static struct platform_driver db8500_cp
  
  static int __init db8500_cpufreq_register(void)
  {
-       if (!cpu_is_u8500_family())
-               return -ENODEV;
        pr_info("cpufreq for DB8500 started\n");
        return platform_driver_register(&db8500_cpufreq_plat_driver);
  }
index 69b676dd3358e2c806cf1587cad6d2215e1e9a4e,caf638b585b58fbe9e352f7b3a18296da695ed35..78057a357ddba9cc9b2a94272ac25ac42855d370
  #include <linux/cpufreq.h>
  #include <linux/suspend.h>
  
- #include <mach/cpufreq.h>
  #include <plat/cpu.h>
  
+ #include "exynos-cpufreq.h"
  static struct exynos_dvfs_info *exynos_info;
  
  static struct regulator *arm_regulator;
@@@ -42,56 -42,51 +42,56 @@@ static unsigned int exynos_getspeed(uns
        return clk_get_rate(exynos_info->cpu_clk) / 1000;
  }
  
 -static int exynos_target(struct cpufreq_policy *policy,
 -                        unsigned int target_freq,
 -                        unsigned int relation)
 +static int exynos_cpufreq_get_index(unsigned int freq)
 +{
 +      struct cpufreq_frequency_table *freq_table = exynos_info->freq_table;
 +      int index;
 +
 +      for (index = 0;
 +              freq_table[index].frequency != CPUFREQ_TABLE_END; index++)
 +              if (freq_table[index].frequency == freq)
 +                      break;
 +
 +      if (freq_table[index].frequency == CPUFREQ_TABLE_END)
 +              return -EINVAL;
 +
 +      return index;
 +}
 +
 +static int exynos_cpufreq_scale(unsigned int target_freq)
  {
 -      unsigned int index, old_index;
 -      unsigned int arm_volt, safe_arm_volt = 0;
 -      int ret = 0;
        struct cpufreq_frequency_table *freq_table = exynos_info->freq_table;
        unsigned int *volt_table = exynos_info->volt_table;
 +      struct cpufreq_policy *policy = cpufreq_cpu_get(0);
 +      unsigned int arm_volt, safe_arm_volt = 0;
        unsigned int mpll_freq_khz = exynos_info->mpll_freq_khz;
 -
 -      mutex_lock(&cpufreq_lock);
 +      int index, old_index;
 +      int ret = 0;
  
        freqs.old = policy->cur;
 +      freqs.new = target_freq;
 +      freqs.cpu = policy->cpu;
  
 -      if (frequency_locked && target_freq != locking_frequency) {
 -              ret = -EAGAIN;
 +      if (freqs.new == freqs.old)
                goto out;
 -      }
  
        /*
         * The policy max have been changed so that we cannot get proper
         * old_index with cpufreq_frequency_table_target(). Thus, ignore
         * policy and get the index from the raw freqeuncy table.
         */
 -      for (old_index = 0;
 -              freq_table[old_index].frequency != CPUFREQ_TABLE_END;
 -              old_index++)
 -              if (freq_table[old_index].frequency == freqs.old)
 -                      break;
 -
 -      if (freq_table[old_index].frequency == CPUFREQ_TABLE_END) {
 -              ret = -EINVAL;
 +      old_index = exynos_cpufreq_get_index(freqs.old);
 +      if (old_index < 0) {
 +              ret = old_index;
                goto out;
        }
  
 -      if (cpufreq_frequency_table_target(policy, freq_table,
 -                                         target_freq, relation, &index)) {
 -              ret = -EINVAL;
 +      index = exynos_cpufreq_get_index(target_freq);
 +      if (index < 0) {
 +              ret = index;
                goto out;
        }
  
 -      freqs.new = freq_table[index].frequency;
 -      freqs.cpu = policy->cpu;
 -
        /*
         * ARM clock source will be changed APLL to MPLL temporary
         * To support this level, need to control regulator for
        /* When the new frequency is higher than current frequency */
        if ((freqs.new > freqs.old) && !safe_arm_volt) {
                /* Firstly, voltage up to increase frequency */
 -              regulator_set_voltage(arm_regulator, arm_volt,
 -                              arm_volt);
 +              ret = regulator_set_voltage(arm_regulator, arm_volt, arm_volt);
 +              if (ret) {
 +                      pr_err("%s: failed to set cpu voltage to %d\n",
 +                              __func__, arm_volt);
 +                      goto out;
 +              }
        }
  
 -      if (safe_arm_volt)
 -              regulator_set_voltage(arm_regulator, safe_arm_volt,
 +      if (safe_arm_volt) {
 +              ret = regulator_set_voltage(arm_regulator, safe_arm_volt,
                                      safe_arm_volt);
 -      if (freqs.new != freqs.old)
 -              exynos_info->set_freq(old_index, index);
 +              if (ret) {
 +                      pr_err("%s: failed to set cpu voltage to %d\n",
 +                              __func__, safe_arm_volt);
 +                      goto out;
 +              }
 +      }
 +
 +      exynos_info->set_freq(old_index, index);
  
        for_each_cpu(freqs.cpu, policy->cpus)
                cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
                /* down the voltage after frequency change */
                regulator_set_voltage(arm_regulator, arm_volt,
                                arm_volt);
 +              if (ret) {
 +                      pr_err("%s: failed to set cpu voltage to %d\n",
 +                              __func__, arm_volt);
 +                      goto out;
 +              }
 +      }
 +
 +out:
 +
 +      cpufreq_cpu_put(policy);
 +
 +      return ret;
 +}
 +
 +static int exynos_target(struct cpufreq_policy *policy,
 +                        unsigned int target_freq,
 +                        unsigned int relation)
 +{
 +      struct cpufreq_frequency_table *freq_table = exynos_info->freq_table;
 +      unsigned int index;
 +      unsigned int new_freq;
 +      int ret = 0;
 +
 +      mutex_lock(&cpufreq_lock);
 +
 +      if (frequency_locked)
 +              goto out;
 +
 +      if (cpufreq_frequency_table_target(policy, freq_table,
 +                                         target_freq, relation, &index)) {
 +              ret = -EINVAL;
 +              goto out;
        }
  
 +      new_freq = freq_table[index].frequency;
 +
 +      ret = exynos_cpufreq_scale(new_freq);
 +
  out:
        mutex_unlock(&cpufreq_lock);
  
@@@ -214,26 -163,51 +214,26 @@@ static int exynos_cpufreq_resume(struc
  static int exynos_cpufreq_pm_notifier(struct notifier_block *notifier,
                                       unsigned long pm_event, void *v)
  {
 -      struct cpufreq_policy *policy = cpufreq_cpu_get(0); /* boot CPU */
 -      static unsigned int saved_frequency;
 -      unsigned int temp;
 +      int ret;
  
 -      mutex_lock(&cpufreq_lock);
        switch (pm_event) {
        case PM_SUSPEND_PREPARE:
 -              if (frequency_locked)
 -                      goto out;
 -
 +              mutex_lock(&cpufreq_lock);
                frequency_locked = true;
 +              mutex_unlock(&cpufreq_lock);
  
 -              if (locking_frequency) {
 -                      saved_frequency = exynos_getspeed(0);
 +              ret = exynos_cpufreq_scale(locking_frequency);
 +              if (ret < 0)
 +                      return NOTIFY_BAD;
  
 -                      mutex_unlock(&cpufreq_lock);
 -                      exynos_target(policy, locking_frequency,
 -                                    CPUFREQ_RELATION_H);
 -                      mutex_lock(&cpufreq_lock);
 -              }
                break;
  
        case PM_POST_SUSPEND:
 -              if (saved_frequency) {
 -                      /*
 -                       * While frequency_locked, only locking_frequency
 -                       * is valid for target(). In order to use
 -                       * saved_frequency while keeping frequency_locked,
 -                       * we temporarly overwrite locking_frequency.
 -                       */
 -                      temp = locking_frequency;
 -                      locking_frequency = saved_frequency;
 -
 -                      mutex_unlock(&cpufreq_lock);
 -                      exynos_target(policy, locking_frequency,
 -                                    CPUFREQ_RELATION_H);
 -                      mutex_lock(&cpufreq_lock);
 -
 -                      locking_frequency = temp;
 -              }
 +              mutex_lock(&cpufreq_lock);
                frequency_locked = false;
 +              mutex_unlock(&cpufreq_lock);
                break;
        }
 -out:
 -      mutex_unlock(&cpufreq_lock);
  
        return NOTIFY_OK;
  }
@@@ -248,34 -222,35 +248,34 @@@ static int exynos_cpufreq_cpu_init(stru
  
        cpufreq_frequency_table_get_attr(exynos_info->freq_table, policy->cpu);
  
 -      locking_frequency = exynos_getspeed(0);
 -
        /* set the transition latency value */
        policy->cpuinfo.transition_latency = 100000;
  
 -      /*
 -       * EXYNOS4 multi-core processors has 2 cores
 -       * that the frequency cannot be set independently.
 -       * Each cpu is bound to the same speed.
 -       * So the affected cpu is all of the cpus.
 -       */
 -      if (num_online_cpus() == 1) {
 -              cpumask_copy(policy->related_cpus, cpu_possible_mask);
 -              cpumask_copy(policy->cpus, cpu_online_mask);
 -      } else {
 -              policy->shared_type = CPUFREQ_SHARED_TYPE_ANY;
 -              cpumask_setall(policy->cpus);
 -      }
 +      cpumask_setall(policy->cpus);
  
        return cpufreq_frequency_table_cpuinfo(policy, exynos_info->freq_table);
  }
  
 +static int exynos_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 +{
 +      cpufreq_frequency_table_put_attr(policy->cpu);
 +      return 0;
 +}
 +
 +static struct freq_attr *exynos_cpufreq_attr[] = {
 +      &cpufreq_freq_attr_scaling_available_freqs,
 +      NULL,
 +};
 +
  static struct cpufreq_driver exynos_driver = {
        .flags          = CPUFREQ_STICKY,
        .verify         = exynos_verify_speed,
        .target         = exynos_target,
        .get            = exynos_getspeed,
        .init           = exynos_cpufreq_cpu_init,
 +      .exit           = exynos_cpufreq_cpu_exit,
        .name           = "exynos_cpufreq",
 +      .attr           = exynos_cpufreq_attr,
  #ifdef CONFIG_PM
        .suspend        = exynos_cpufreq_suspend,
        .resume         = exynos_cpufreq_resume,
@@@ -313,8 -288,6 +313,8 @@@ static int __init exynos_cpufreq_init(v
                goto err_vdd_arm;
        }
  
 +      locking_frequency = exynos_getspeed(0);
 +
        register_pm_notifier(&exynos_cpufreq_nb);
  
        if (cpufreq_register_driver(&exynos_driver)) {
  err_cpufreq:
        unregister_pm_notifier(&exynos_cpufreq_nb);
  
 -      if (!IS_ERR(arm_regulator))
 -              regulator_put(arm_regulator);
 +      regulator_put(arm_regulator);
  err_vdd_arm:
        kfree(exynos_info);
        pr_debug("%s: failed initialization\n", __func__);
index b5d39dd03b2ae20fb96d135dd46b8b3597ae0021,25c748b9b9104f9a10488728a2781d3f938ca4ba..92b852ee5ddcca037bcbf9d2376ff3a4cb3a62c2
@@@ -1,5 -1,4 +1,4 @@@
- /* linux/arch/arm/mach-exynos/include/mach/cpufreq.h
-  *
+ /*
   * Copyright (c) 2010 Samsung Electronics Co., Ltd.
   *            http://www.samsung.com
   *
@@@ -18,25 -17,12 +17,25 @@@ enum cpufreq_level_index 
        L20,
  };
  
 +#define APLL_FREQ(f, a0, a1, a2, a3, a4, a5, a6, a7, b0, b1, b2, m, p, s) \
 +      { \
 +              .freq = (f) * 1000, \
 +              .clk_div_cpu0 = ((a0) | (a1) << 4 | (a2) << 8 | (a3) << 12 | \
 +                      (a4) << 16 | (a5) << 20 | (a6) << 24 | (a7) << 28), \
 +              .clk_div_cpu1 = (b0 << 0 | b1 << 4 | b2 << 8), \
 +              .mps = ((m) << 16 | (p) << 8 | (s)), \
 +      }
 +
 +struct apll_freq {
 +      unsigned int freq;
 +      u32 clk_div_cpu0;
 +      u32 clk_div_cpu1;
 +      u32 mps;
 +};
 +
  struct exynos_dvfs_info {
        unsigned long   mpll_freq_khz;
        unsigned int    pll_safe_idx;
 -      unsigned int    pm_lock_idx;
 -      unsigned int    max_support_idx;
 -      unsigned int    min_support_idx;
        struct clk      *cpu_clk;
        unsigned int    *volt_table;
        struct cpufreq_frequency_table  *freq_table;
index de91755e2556b0311d9da8327d7db4f7803b49af,a5d0a8184220feac77aa6c38e1362ed6e12e0e24..add7fbec4fc9af5ca3060e925cfe662a25d21eb4
  #include <linux/cpufreq.h>
  
  #include <mach/regs-clock.h>
- #include <mach/cpufreq.h>
+ #include "exynos-cpufreq.h"
  
 -#define CPUFREQ_LEVEL_END     L5
 -
 -static int max_support_idx = L0;
 -static int min_support_idx = (CPUFREQ_LEVEL_END - 1);
 -
  static struct clk *cpu_clk;
  static struct clk *moutcore;
  static struct clk *mout_mpll;
  static struct clk *mout_apll;
  
 -struct cpufreq_clkdiv {
 -      unsigned int index;
 -      unsigned int clkdiv;
 -};
 -
 -static unsigned int exynos4210_volt_table[CPUFREQ_LEVEL_END] = {
 +static unsigned int exynos4210_volt_table[] = {
        1250000, 1150000, 1050000, 975000, 950000,
  };
  
 -
 -static struct cpufreq_clkdiv exynos4210_clkdiv_table[CPUFREQ_LEVEL_END];
 -
  static struct cpufreq_frequency_table exynos4210_freq_table[] = {
 -      {L0, 1200*1000},
 -      {L1, 1000*1000},
 -      {L2, 800*1000},
 -      {L3, 500*1000},
 -      {L4, 200*1000},
 +      {L0, 1200 * 1000},
 +      {L1, 1000 * 1000},
 +      {L2,  800 * 1000},
 +      {L3,  500 * 1000},
 +      {L4,  200 * 1000},
        {0, CPUFREQ_TABLE_END},
  };
  
 -static unsigned int clkdiv_cpu0[CPUFREQ_LEVEL_END][7] = {
 +static struct apll_freq apll_freq_4210[] = {
        /*
 -       * Clock divider value for following
 -       * { DIVCORE, DIVCOREM0, DIVCOREM1, DIVPERIPH,
 -       *              DIVATB, DIVPCLK_DBG, DIVAPLL }
 +       * values:
 +       * freq
 +       * clock divider for CORE, COREM0, COREM1, PERIPH, ATB, PCLK_DBG, APLL, RESERVED
 +       * clock divider for COPY, HPM, RESERVED
 +       * PLL M, P, S
         */
 -
 -      /* ARM L0: 1200MHz */
 -      { 0, 3, 7, 3, 4, 1, 7 },
 -
 -      /* ARM L1: 1000MHz */
 -      { 0, 3, 7, 3, 4, 1, 7 },
 -
 -      /* ARM L2: 800MHz */
 -      { 0, 3, 7, 3, 3, 1, 7 },
 -
 -      /* ARM L3: 500MHz */
 -      { 0, 3, 7, 3, 3, 1, 7 },
 -
 -      /* ARM L4: 200MHz */
 -      { 0, 1, 3, 1, 3, 1, 0 },
 -};
 -
 -static unsigned int clkdiv_cpu1[CPUFREQ_LEVEL_END][2] = {
 -      /*
 -       * Clock divider value for following
 -       * { DIVCOPY, DIVHPM }
 -       */
 -
 -      /* ARM L0: 1200MHz */
 -      { 5, 0 },
 -
 -      /* ARM L1: 1000MHz */
 -      { 4, 0 },
 -
 -      /* ARM L2: 800MHz */
 -      { 3, 0 },
 -
 -      /* ARM L3: 500MHz */
 -      { 3, 0 },
 -
 -      /* ARM L4: 200MHz */
 -      { 3, 0 },
 -};
 -
 -static unsigned int exynos4210_apll_pms_table[CPUFREQ_LEVEL_END] = {
 -      /* APLL FOUT L0: 1200MHz */
 -      ((150 << 16) | (3 << 8) | 1),
 -
 -      /* APLL FOUT L1: 1000MHz */
 -      ((250 << 16) | (6 << 8) | 1),
 -
 -      /* APLL FOUT L2: 800MHz */
 -      ((200 << 16) | (6 << 8) | 1),
 -
 -      /* APLL FOUT L3: 500MHz */
 -      ((250 << 16) | (6 << 8) | 2),
 -
 -      /* APLL FOUT L4: 200MHz */
 -      ((200 << 16) | (6 << 8) | 3),
 +      APLL_FREQ(1200, 0, 3, 7, 3, 4, 1, 7, 0, 5, 0, 0, 150, 3, 1),
 +      APLL_FREQ(1000, 0, 3, 7, 3, 4, 1, 7, 0, 4, 0, 0, 250, 6, 1),
 +      APLL_FREQ(800,  0, 3, 7, 3, 3, 1, 7, 0, 3, 0, 0, 200, 6, 1),
 +      APLL_FREQ(500,  0, 3, 7, 3, 3, 1, 7, 0, 3, 0, 0, 250, 6, 2),
 +      APLL_FREQ(200,  0, 1, 3, 1, 3, 1, 0, 0, 3, 0, 0, 200, 6, 3),
  };
  
  static void exynos4210_set_clkdiv(unsigned int div_index)
  
        /* Change Divider - CPU0 */
  
 -      tmp = exynos4210_clkdiv_table[div_index].clkdiv;
 +      tmp = apll_freq_4210[div_index].clk_div_cpu0;
  
        __raw_writel(tmp, EXYNOS4_CLKDIV_CPU);
  
  
        /* Change Divider - CPU1 */
  
 -      tmp = __raw_readl(EXYNOS4_CLKDIV_CPU1);
 -
 -      tmp &= ~((0x7 << 4) | 0x7);
 -
 -      tmp |= ((clkdiv_cpu1[div_index][0] << 4) |
 -              (clkdiv_cpu1[div_index][1] << 0));
 +      tmp = apll_freq_4210[div_index].clk_div_cpu1;
  
        __raw_writel(tmp, EXYNOS4_CLKDIV_CPU1);
  
@@@ -97,7 -163,7 +98,7 @@@ static void exynos4210_set_apll(unsigne
        /* 3. Change PLL PMS values */
        tmp = __raw_readl(EXYNOS4_APLL_CON0);
        tmp &= ~((0x3ff << 16) | (0x3f << 8) | (0x7 << 0));
 -      tmp |= exynos4210_apll_pms_table[index];
 +      tmp |= apll_freq_4210[index].mps;
        __raw_writel(tmp, EXYNOS4_APLL_CON0);
  
        /* 4. wait_lock_time */
        } while (tmp != (0x1 << EXYNOS4_CLKSRC_CPU_MUXCORE_SHIFT));
  }
  
 -bool exynos4210_pms_change(unsigned int old_index, unsigned int new_index)
 +static bool exynos4210_pms_change(unsigned int old_index, unsigned int new_index)
  {
 -      unsigned int old_pm = (exynos4210_apll_pms_table[old_index] >> 8);
 -      unsigned int new_pm = (exynos4210_apll_pms_table[new_index] >> 8);
 +      unsigned int old_pm = apll_freq_4210[old_index].mps >> 8;
 +      unsigned int new_pm = apll_freq_4210[new_index].mps >> 8;
  
        return (old_pm == new_pm) ? 0 : 1;
  }
@@@ -135,7 -201,7 +136,7 @@@ static void exynos4210_set_frequency(un
                        /* 2. Change just s value in apll m,p,s value */
                        tmp = __raw_readl(EXYNOS4_APLL_CON0);
                        tmp &= ~(0x7 << 0);
 -                      tmp |= (exynos4210_apll_pms_table[new_index] & 0x7);
 +                      tmp |= apll_freq_4210[new_index].mps & 0x7;
                        __raw_writel(tmp, EXYNOS4_APLL_CON0);
                } else {
                        /* Clock Configuration Procedure */
                        /* 1. Change just s value in apll m,p,s value */
                        tmp = __raw_readl(EXYNOS4_APLL_CON0);
                        tmp &= ~(0x7 << 0);
 -                      tmp |= (exynos4210_apll_pms_table[new_index] & 0x7);
 +                      tmp |= apll_freq_4210[new_index].mps & 0x7;
                        __raw_writel(tmp, EXYNOS4_APLL_CON0);
  
                        /* 2. Change the system clock divider values */
  
  int exynos4210_cpufreq_init(struct exynos_dvfs_info *info)
  {
 -      int i;
 -      unsigned int tmp;
        unsigned long rate;
  
        cpu_clk = clk_get(NULL, "armclk");
        if (IS_ERR(mout_apll))
                goto err_mout_apll;
  
 -      tmp = __raw_readl(EXYNOS4_CLKDIV_CPU);
 -
 -      for (i = L0; i <  CPUFREQ_LEVEL_END; i++) {
 -              tmp &= ~(EXYNOS4_CLKDIV_CPU0_CORE_MASK |
 -                      EXYNOS4_CLKDIV_CPU0_COREM0_MASK |
 -                      EXYNOS4_CLKDIV_CPU0_COREM1_MASK |
 -                      EXYNOS4_CLKDIV_CPU0_PERIPH_MASK |
 -                      EXYNOS4_CLKDIV_CPU0_ATB_MASK |
 -                      EXYNOS4_CLKDIV_CPU0_PCLKDBG_MASK |
 -                      EXYNOS4_CLKDIV_CPU0_APLL_MASK);
 -
 -              tmp |= ((clkdiv_cpu0[i][0] << EXYNOS4_CLKDIV_CPU0_CORE_SHIFT) |
 -                      (clkdiv_cpu0[i][1] << EXYNOS4_CLKDIV_CPU0_COREM0_SHIFT) |
 -                      (clkdiv_cpu0[i][2] << EXYNOS4_CLKDIV_CPU0_COREM1_SHIFT) |
 -                      (clkdiv_cpu0[i][3] << EXYNOS4_CLKDIV_CPU0_PERIPH_SHIFT) |
 -                      (clkdiv_cpu0[i][4] << EXYNOS4_CLKDIV_CPU0_ATB_SHIFT) |
 -                      (clkdiv_cpu0[i][5] << EXYNOS4_CLKDIV_CPU0_PCLKDBG_SHIFT) |
 -                      (clkdiv_cpu0[i][6] << EXYNOS4_CLKDIV_CPU0_APLL_SHIFT));
 -
 -              exynos4210_clkdiv_table[i].clkdiv = tmp;
 -      }
 -
        info->mpll_freq_khz = rate;
 -      info->pm_lock_idx = L2;
 +      /* 800Mhz */
        info->pll_safe_idx = L2;
 -      info->max_support_idx = max_support_idx;
 -      info->min_support_idx = min_support_idx;
        info->cpu_clk = cpu_clk;
        info->volt_table = exynos4210_volt_table;
        info->freq_table = exynos4210_freq_table;
        return 0;
  
  err_mout_apll:
 -      if (!IS_ERR(mout_mpll))
 -              clk_put(mout_mpll);
 +      clk_put(mout_mpll);
  err_mout_mpll:
 -      if (!IS_ERR(moutcore))
 -              clk_put(moutcore);
 +      clk_put(moutcore);
  err_moutcore:
 -      if (!IS_ERR(cpu_clk))
 -              clk_put(cpu_clk);
 +      clk_put(cpu_clk);
  
        pr_debug("%s: failed initialization\n", __func__);
        return -EINVAL;
index 0661039e5d4a709d6422f76fd819c7b45be0785e,63ff74eec5213ad01738bd699a25addae7c76cd2..08b7477b0aa23ea139faa00aef4d6eca601d173c
  #include <linux/cpufreq.h>
  
  #include <mach/regs-clock.h>
- #include <mach/cpufreq.h>
+ #include "exynos-cpufreq.h"
  
 -#define CPUFREQ_LEVEL_END     (L13 + 1)
 -
 -static int max_support_idx;
 -static int min_support_idx = (CPUFREQ_LEVEL_END - 1);
 -
  static struct clk *cpu_clk;
  static struct clk *moutcore;
  static struct clk *mout_mpll;
  static struct clk *mout_apll;
  
 -struct cpufreq_clkdiv {
 -      unsigned int    index;
 -      unsigned int    clkdiv;
 -      unsigned int    clkdiv1;
 +static unsigned int exynos4x12_volt_table[] = {
 +      1350000, 1287500, 1250000, 1187500, 1137500, 1087500, 1037500,
 +      1000000,  987500,  975000,  950000,  925000,  900000,  900000
  };
  
 -static unsigned int exynos4x12_volt_table[CPUFREQ_LEVEL_END];
 -
  static struct cpufreq_frequency_table exynos4x12_freq_table[] = {
 -      {L0, 1500 * 1000},
 +      {L0, CPUFREQ_ENTRY_INVALID},
        {L1, 1400 * 1000},
        {L2, 1300 * 1000},
        {L3, 1200 * 1000},
        {0, CPUFREQ_TABLE_END},
  };
  
 -static struct cpufreq_clkdiv exynos4x12_clkdiv_table[CPUFREQ_LEVEL_END];
 +static struct apll_freq *apll_freq_4x12;
  
 -static unsigned int clkdiv_cpu0_4212[CPUFREQ_LEVEL_END][8] = {
 +static struct apll_freq apll_freq_4212[] = {
        /*
 -       * Clock divider value for following
 -       * { DIVCORE, DIVCOREM0, DIVCOREM1, DIVPERIPH,
 -       *              DIVATB, DIVPCLK_DBG, DIVAPLL, DIVCORE2 }
 +       * values:
 +       * freq
 +       * clock divider for CORE, COREM0, COREM1, PERIPH, ATB, PCLK_DBG, APLL, CORE2
 +       * clock divider for COPY, HPM, RESERVED
 +       * PLL M, P, S
         */
 -      /* ARM L0: 1500 MHz */
 -      { 0, 3, 7, 0, 6, 1, 2, 0 },
 -
 -      /* ARM L1: 1400 MHz */
 -      { 0, 3, 7, 0, 6, 1, 2, 0 },
 -
 -      /* ARM L2: 1300 MHz */
 -      { 0, 3, 7, 0, 5, 1, 2, 0 },
 -
 -      /* ARM L3: 1200 MHz */
 -      { 0, 3, 7, 0, 5, 1, 2, 0 },
 -
 -      /* ARM L4: 1100 MHz */
 -      { 0, 3, 6, 0, 4, 1, 2, 0 },
 -
 -      /* ARM L5: 1000 MHz */
 -      { 0, 2, 5, 0, 4, 1, 1, 0 },
 -
 -      /* ARM L6: 900 MHz */
 -      { 0, 2, 5, 0, 3, 1, 1, 0 },
 -
 -      /* ARM L7: 800 MHz */
 -      { 0, 2, 5, 0, 3, 1, 1, 0 },
 -
 -      /* ARM L8: 700 MHz */
 -      { 0, 2, 4, 0, 3, 1, 1, 0 },
 -
 -      /* ARM L9: 600 MHz */
 -      { 0, 2, 4, 0, 3, 1, 1, 0 },
 -
 -      /* ARM L10: 500 MHz */
 -      { 0, 2, 4, 0, 3, 1, 1, 0 },
 -
 -      /* ARM L11: 400 MHz */
 -      { 0, 2, 4, 0, 3, 1, 1, 0 },
 -
 -      /* ARM L12: 300 MHz */
 -      { 0, 2, 4, 0, 2, 1, 1, 0 },
 -
 -      /* ARM L13: 200 MHz */
 -      { 0, 1, 3, 0, 1, 1, 1, 0 },
 +      APLL_FREQ(1500, 0, 3, 7, 0, 6, 1, 2, 0, 6, 2, 0, 250, 4, 0),
 +      APLL_FREQ(1400, 0, 3, 7, 0, 6, 1, 2, 0, 6, 2, 0, 175, 3, 0),
 +      APLL_FREQ(1300, 0, 3, 7, 0, 5, 1, 2, 0, 5, 2, 0, 325, 6, 0),
 +      APLL_FREQ(1200, 0, 3, 7, 0, 5, 1, 2, 0, 5, 2, 0, 200, 4, 0),
 +      APLL_FREQ(1100, 0, 3, 6, 0, 4, 1, 2, 0, 4, 2, 0, 275, 6, 0),
 +      APLL_FREQ(1000, 0, 2, 5, 0, 4, 1, 1, 0, 4, 2, 0, 125, 3, 0),
 +      APLL_FREQ(900,  0, 2, 5, 0, 3, 1, 1, 0, 3, 2, 0, 150, 4, 0),
 +      APLL_FREQ(800,  0, 2, 5, 0, 3, 1, 1, 0, 3, 2, 0, 100, 3, 0),
 +      APLL_FREQ(700,  0, 2, 4, 0, 3, 1, 1, 0, 3, 2, 0, 175, 3, 1),
 +      APLL_FREQ(600,  0, 2, 4, 0, 3, 1, 1, 0, 3, 2, 0, 200, 4, 1),
 +      APLL_FREQ(500,  0, 2, 4, 0, 3, 1, 1, 0, 3, 2, 0, 125, 3, 1),
 +      APLL_FREQ(400,  0, 2, 4, 0, 3, 1, 1, 0, 3, 2, 0, 100, 3, 1),
 +      APLL_FREQ(300,  0, 2, 4, 0, 2, 1, 1, 0, 3, 2, 0, 200, 4, 2),
 +      APLL_FREQ(200,  0, 1, 3, 0, 1, 1, 1, 0, 3, 2, 0, 100, 3, 2),
  };
  
 -static unsigned int clkdiv_cpu0_4412[CPUFREQ_LEVEL_END][8] = {
 +static struct apll_freq apll_freq_4412[] = {
        /*
 -       * Clock divider value for following
 -       * { DIVCORE, DIVCOREM0, DIVCOREM1, DIVPERIPH,
 -       *              DIVATB, DIVPCLK_DBG, DIVAPLL, DIVCORE2 }
 -       */
 -      /* ARM L0: 1500 MHz */
 -      { 0, 3, 7, 0, 6, 1, 2, 0 },
 -
 -      /* ARM L1: 1400 MHz */
 -      { 0, 3, 7, 0, 6, 1, 2, 0 },
 -
 -      /* ARM L2: 1300 MHz */
 -      { 0, 3, 7, 0, 5, 1, 2, 0 },
 -
 -      /* ARM L3: 1200 MHz */
 -      { 0, 3, 7, 0, 5, 1, 2, 0 },
 -
 -      /* ARM L4: 1100 MHz */
 -      { 0, 3, 6, 0, 4, 1, 2, 0 },
 -
 -      /* ARM L5: 1000 MHz */
 -      { 0, 2, 5, 0, 4, 1, 1, 0 },
 -
 -      /* ARM L6: 900 MHz */
 -      { 0, 2, 5, 0, 3, 1, 1, 0 },
 -
 -      /* ARM L7: 800 MHz */
 -      { 0, 2, 5, 0, 3, 1, 1, 0 },
 -
 -      /* ARM L8: 700 MHz */
 -      { 0, 2, 4, 0, 3, 1, 1, 0 },
 -
 -      /* ARM L9: 600 MHz */
 -      { 0, 2, 4, 0, 3, 1, 1, 0 },
 -
 -      /* ARM L10: 500 MHz */
 -      { 0, 2, 4, 0, 3, 1, 1, 0 },
 -
 -      /* ARM L11: 400 MHz */
 -      { 0, 2, 4, 0, 3, 1, 1, 0 },
 -
 -      /* ARM L12: 300 MHz */
 -      { 0, 2, 4, 0, 2, 1, 1, 0 },
 -
 -      /* ARM L13: 200 MHz */
 -      { 0, 1, 3, 0, 1, 1, 1, 0 },
 -};
 -
 -static unsigned int clkdiv_cpu1_4212[CPUFREQ_LEVEL_END][2] = {
 -      /* Clock divider value for following
 -       * { DIVCOPY, DIVHPM }
 -       */
 -      /* ARM L0: 1500 MHz */
 -      { 6, 0 },
 -
 -      /* ARM L1: 1400 MHz */
 -      { 6, 0 },
 -
 -      /* ARM L2: 1300 MHz */
 -      { 5, 0 },
 -
 -      /* ARM L3: 1200 MHz */
 -      { 5, 0 },
 -
 -      /* ARM L4: 1100 MHz */
 -      { 4, 0 },
 -
 -      /* ARM L5: 1000 MHz */
 -      { 4, 0 },
 -
 -      /* ARM L6: 900 MHz */
 -      { 3, 0 },
 -
 -      /* ARM L7: 800 MHz */
 -      { 3, 0 },
 -
 -      /* ARM L8: 700 MHz */
 -      { 3, 0 },
 -
 -      /* ARM L9: 600 MHz */
 -      { 3, 0 },
 -
 -      /* ARM L10: 500 MHz */
 -      { 3, 0 },
 -
 -      /* ARM L11: 400 MHz */
 -      { 3, 0 },
 -
 -      /* ARM L12: 300 MHz */
 -      { 3, 0 },
 -
 -      /* ARM L13: 200 MHz */
 -      { 3, 0 },
 -};
 -
 -static unsigned int clkdiv_cpu1_4412[CPUFREQ_LEVEL_END][3] = {
 -      /* Clock divider value for following
 -       * { DIVCOPY, DIVHPM, DIVCORES }
 +       * values:
 +       * freq
 +       * clock divider for CORE, COREM0, COREM1, PERIPH, ATB, PCLK_DBG, APLL, CORE2
 +       * clock divider for COPY, HPM, CORES
 +       * PLL M, P, S
         */
 -      /* ARM L0: 1500 MHz */
 -      { 6, 0, 7 },
 -
 -      /* ARM L1: 1400 MHz */
 -      { 6, 0, 6 },
 -
 -      /* ARM L2: 1300 MHz */
 -      { 5, 0, 6 },
 -
 -      /* ARM L3: 1200 MHz */
 -      { 5, 0, 5 },
 -
 -      /* ARM L4: 1100 MHz */
 -      { 4, 0, 5 },
 -
 -      /* ARM L5: 1000 MHz */
 -      { 4, 0, 4 },
 -
 -      /* ARM L6: 900 MHz */
 -      { 3, 0, 4 },
 -
 -      /* ARM L7: 800 MHz */
 -      { 3, 0, 3 },
 -
 -      /* ARM L8: 700 MHz */
 -      { 3, 0, 3 },
 -
 -      /* ARM L9: 600 MHz */
 -      { 3, 0, 2 },
 -
 -      /* ARM L10: 500 MHz */
 -      { 3, 0, 2 },
 -
 -      /* ARM L11: 400 MHz */
 -      { 3, 0, 1 },
 -
 -      /* ARM L12: 300 MHz */
 -      { 3, 0, 1 },
 -
 -      /* ARM L13: 200 MHz */
 -      { 3, 0, 0 },
 -};
 -
 -static unsigned int exynos4x12_apll_pms_table[CPUFREQ_LEVEL_END] = {
 -      /* APLL FOUT L0: 1500 MHz */
 -      ((250 << 16) | (4 << 8) | (0x0)),
 -
 -      /* APLL FOUT L1: 1400 MHz */
 -      ((175 << 16) | (3 << 8) | (0x0)),
 -
 -      /* APLL FOUT L2: 1300 MHz */
 -      ((325 << 16) | (6 << 8) | (0x0)),
 -
 -      /* APLL FOUT L3: 1200 MHz */
 -      ((200 << 16) | (4 << 8) | (0x0)),
 -
 -      /* APLL FOUT L4: 1100 MHz */
 -      ((275 << 16) | (6 << 8) | (0x0)),
 -
 -      /* APLL FOUT L5: 1000 MHz */
 -      ((125 << 16) | (3 << 8) | (0x0)),
 -
 -      /* APLL FOUT L6: 900 MHz */
 -      ((150 << 16) | (4 << 8) | (0x0)),
 -
 -      /* APLL FOUT L7: 800 MHz */
 -      ((100 << 16) | (3 << 8) | (0x0)),
 -
 -      /* APLL FOUT L8: 700 MHz */
 -      ((175 << 16) | (3 << 8) | (0x1)),
 -
 -      /* APLL FOUT L9: 600 MHz */
 -      ((200 << 16) | (4 << 8) | (0x1)),
 -
 -      /* APLL FOUT L10: 500 MHz */
 -      ((125 << 16) | (3 << 8) | (0x1)),
 -
 -      /* APLL FOUT L11 400 MHz */
 -      ((100 << 16) | (3 << 8) | (0x1)),
 -
 -      /* APLL FOUT L12: 300 MHz */
 -      ((200 << 16) | (4 << 8) | (0x2)),
 -
 -      /* APLL FOUT L13: 200 MHz */
 -      ((100 << 16) | (3 << 8) | (0x2)),
 -};
 -
 -static const unsigned int asv_voltage_4x12[CPUFREQ_LEVEL_END] = {
 -      1350000, 1287500, 1250000, 1187500, 1137500, 1087500, 1037500,
 -      1000000,  987500,  975000,  950000,  925000,  900000,  900000
 +      APLL_FREQ(1500, 0, 3, 7, 0, 6, 1, 2, 0, 6, 0, 7, 250, 4, 0),
 +      APLL_FREQ(1400, 0, 3, 7, 0, 6, 1, 2, 0, 6, 0, 6, 175, 3, 0),
 +      APLL_FREQ(1300, 0, 3, 7, 0, 5, 1, 2, 0, 5, 0, 6, 325, 6, 0),
 +      APLL_FREQ(1200, 0, 3, 7, 0, 5, 1, 2, 0, 5, 0, 5, 200, 4, 0),
 +      APLL_FREQ(1100, 0, 3, 6, 0, 4, 1, 2, 0, 4, 0, 5, 275, 6, 0),
 +      APLL_FREQ(1000, 0, 2, 5, 0, 4, 1, 1, 0, 4, 0, 4, 125, 3, 0),
 +      APLL_FREQ(900,  0, 2, 5, 0, 3, 1, 1, 0, 3, 0, 4, 150, 4, 0),
 +      APLL_FREQ(800,  0, 2, 5, 0, 3, 1, 1, 0, 3, 0, 3, 100, 3, 0),
 +      APLL_FREQ(700,  0, 2, 4, 0, 3, 1, 1, 0, 3, 0, 3, 175, 3, 1),
 +      APLL_FREQ(600,  0, 2, 4, 0, 3, 1, 1, 0, 3, 0, 2, 200, 4, 1),
 +      APLL_FREQ(500,  0, 2, 4, 0, 3, 1, 1, 0, 3, 0, 2, 125, 3, 1),
 +      APLL_FREQ(400,  0, 2, 4, 0, 3, 1, 1, 0, 3, 0, 1, 100, 3, 1),
 +      APLL_FREQ(300,  0, 2, 4, 0, 2, 1, 1, 0, 3, 0, 1, 200, 4, 2),
 +      APLL_FREQ(200,  0, 1, 3, 0, 1, 1, 1, 0, 3, 0, 0, 100, 3, 2),
  };
  
  static void exynos4x12_set_clkdiv(unsigned int div_index)
  
        /* Change Divider - CPU0 */
  
 -      tmp = exynos4x12_clkdiv_table[div_index].clkdiv;
 +      tmp = apll_freq_4x12[div_index].clk_div_cpu0;
  
        __raw_writel(tmp, EXYNOS4_CLKDIV_CPU);
  
                cpu_relax();
  
        /* Change Divider - CPU1 */
 -      tmp = exynos4x12_clkdiv_table[div_index].clkdiv1;
 +      tmp = apll_freq_4x12[div_index].clk_div_cpu1;
  
        __raw_writel(tmp, EXYNOS4_CLKDIV_CPU1);
        if (soc_is_exynos4212())
@@@ -140,14 -342,14 +141,14 @@@ static void exynos4x12_set_apll(unsigne
        } while (tmp != 0x2);
  
        /* 2. Set APLL Lock time */
 -      pdiv = ((exynos4x12_apll_pms_table[index] >> 8) & 0x3f);
 +      pdiv = ((apll_freq_4x12[index].mps >> 8) & 0x3f);
  
        __raw_writel((pdiv * 250), EXYNOS4_APLL_LOCK);
  
        /* 3. Change PLL PMS values */
        tmp = __raw_readl(EXYNOS4_APLL_CON0);
        tmp &= ~((0x3ff << 16) | (0x3f << 8) | (0x7 << 0));
 -      tmp |= exynos4x12_apll_pms_table[index];
 +      tmp |= apll_freq_4x12[index].mps;
        __raw_writel(tmp, EXYNOS4_APLL_CON0);
  
        /* 4. wait_lock_time */
        } while (tmp != (0x1 << EXYNOS4_CLKSRC_CPU_MUXCORE_SHIFT));
  }
  
 -bool exynos4x12_pms_change(unsigned int old_index, unsigned int new_index)
 +static bool exynos4x12_pms_change(unsigned int old_index, unsigned int new_index)
  {
 -      unsigned int old_pm = exynos4x12_apll_pms_table[old_index] >> 8;
 -      unsigned int new_pm = exynos4x12_apll_pms_table[new_index] >> 8;
 +      unsigned int old_pm = apll_freq_4x12[old_index].mps >> 8;
 +      unsigned int new_pm = apll_freq_4x12[new_index].mps >> 8;
  
        return (old_pm == new_pm) ? 0 : 1;
  }
@@@ -186,7 -388,7 +187,7 @@@ static void exynos4x12_set_frequency(un
                        /* 2. Change just s value in apll m,p,s value */
                        tmp = __raw_readl(EXYNOS4_APLL_CON0);
                        tmp &= ~(0x7 << 0);
 -                      tmp |= (exynos4x12_apll_pms_table[new_index] & 0x7);
 +                      tmp |= apll_freq_4x12[new_index].mps & 0x7;
                        __raw_writel(tmp, EXYNOS4_APLL_CON0);
  
                } else {
                        /* 1. Change just s value in apll m,p,s value */
                        tmp = __raw_readl(EXYNOS4_APLL_CON0);
                        tmp &= ~(0x7 << 0);
 -                      tmp |= (exynos4x12_apll_pms_table[new_index] & 0x7);
 +                      tmp |= apll_freq_4x12[new_index].mps & 0x7;
                        __raw_writel(tmp, EXYNOS4_APLL_CON0);
                        /* 2. Change the system clock divider values */
                        exynos4x12_set_clkdiv(new_index);
        }
  }
  
 -static void __init set_volt_table(void)
 -{
 -      unsigned int i;
 -
 -      max_support_idx = L1;
 -
 -      /* Not supported */
 -      exynos4x12_freq_table[L0].frequency = CPUFREQ_ENTRY_INVALID;
 -
 -      for (i = 0 ; i < CPUFREQ_LEVEL_END ; i++)
 -              exynos4x12_volt_table[i] = asv_voltage_4x12[i];
 -}
 -
  int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info)
  {
 -      int i;
 -      unsigned int tmp;
        unsigned long rate;
  
 -      set_volt_table();
 -
        cpu_clk = clk_get(NULL, "armclk");
        if (IS_ERR(cpu_clk))
                return PTR_ERR(cpu_clk);
        if (IS_ERR(mout_apll))
                goto err_mout_apll;
  
 -      for (i = L0; i <  CPUFREQ_LEVEL_END; i++) {
 -
 -              exynos4x12_clkdiv_table[i].index = i;
 -
 -              tmp = __raw_readl(EXYNOS4_CLKDIV_CPU);
 -
 -              tmp &= ~(EXYNOS4_CLKDIV_CPU0_CORE_MASK |
 -                      EXYNOS4_CLKDIV_CPU0_COREM0_MASK |
 -                      EXYNOS4_CLKDIV_CPU0_COREM1_MASK |
 -                      EXYNOS4_CLKDIV_CPU0_PERIPH_MASK |
 -                      EXYNOS4_CLKDIV_CPU0_ATB_MASK |
 -                      EXYNOS4_CLKDIV_CPU0_PCLKDBG_MASK |
 -                      EXYNOS4_CLKDIV_CPU0_APLL_MASK);
 -
 -              if (soc_is_exynos4212()) {
 -                      tmp |= ((clkdiv_cpu0_4212[i][0] << EXYNOS4_CLKDIV_CPU0_CORE_SHIFT) |
 -                              (clkdiv_cpu0_4212[i][1] << EXYNOS4_CLKDIV_CPU0_COREM0_SHIFT) |
 -                              (clkdiv_cpu0_4212[i][2] << EXYNOS4_CLKDIV_CPU0_COREM1_SHIFT) |
 -                              (clkdiv_cpu0_4212[i][3] << EXYNOS4_CLKDIV_CPU0_PERIPH_SHIFT) |
 -                              (clkdiv_cpu0_4212[i][4] << EXYNOS4_CLKDIV_CPU0_ATB_SHIFT) |
 -                              (clkdiv_cpu0_4212[i][5] << EXYNOS4_CLKDIV_CPU0_PCLKDBG_SHIFT) |
 -                              (clkdiv_cpu0_4212[i][6] << EXYNOS4_CLKDIV_CPU0_APLL_SHIFT));
 -              } else {
 -                      tmp &= ~EXYNOS4_CLKDIV_CPU0_CORE2_MASK;
 -
 -                      tmp |= ((clkdiv_cpu0_4412[i][0] << EXYNOS4_CLKDIV_CPU0_CORE_SHIFT) |
 -                              (clkdiv_cpu0_4412[i][1] << EXYNOS4_CLKDIV_CPU0_COREM0_SHIFT) |
 -                              (clkdiv_cpu0_4412[i][2] << EXYNOS4_CLKDIV_CPU0_COREM1_SHIFT) |
 -                              (clkdiv_cpu0_4412[i][3] << EXYNOS4_CLKDIV_CPU0_PERIPH_SHIFT) |
 -                              (clkdiv_cpu0_4412[i][4] << EXYNOS4_CLKDIV_CPU0_ATB_SHIFT) |
 -                              (clkdiv_cpu0_4412[i][5] << EXYNOS4_CLKDIV_CPU0_PCLKDBG_SHIFT) |
 -                              (clkdiv_cpu0_4412[i][6] << EXYNOS4_CLKDIV_CPU0_APLL_SHIFT) |
 -                              (clkdiv_cpu0_4412[i][7] << EXYNOS4_CLKDIV_CPU0_CORE2_SHIFT));
 -              }
 -
 -              exynos4x12_clkdiv_table[i].clkdiv = tmp;
 -
 -              tmp = __raw_readl(EXYNOS4_CLKDIV_CPU1);
 -
 -              if (soc_is_exynos4212()) {
 -                      tmp &= ~(EXYNOS4_CLKDIV_CPU1_COPY_MASK |
 -                              EXYNOS4_CLKDIV_CPU1_HPM_MASK);
 -                      tmp |= ((clkdiv_cpu1_4212[i][0] << EXYNOS4_CLKDIV_CPU1_COPY_SHIFT) |
 -                              (clkdiv_cpu1_4212[i][1] << EXYNOS4_CLKDIV_CPU1_HPM_SHIFT));
 -              } else {
 -                      tmp &= ~(EXYNOS4_CLKDIV_CPU1_COPY_MASK |
 -                              EXYNOS4_CLKDIV_CPU1_HPM_MASK |
 -                              EXYNOS4_CLKDIV_CPU1_CORES_MASK);
 -                      tmp |= ((clkdiv_cpu1_4412[i][0] << EXYNOS4_CLKDIV_CPU1_COPY_SHIFT) |
 -                              (clkdiv_cpu1_4412[i][1] << EXYNOS4_CLKDIV_CPU1_HPM_SHIFT) |
 -                              (clkdiv_cpu1_4412[i][2] << EXYNOS4_CLKDIV_CPU1_CORES_SHIFT));
 -              }
 -              exynos4x12_clkdiv_table[i].clkdiv1 = tmp;
 -      }
 +      if (soc_is_exynos4212())
 +              apll_freq_4x12 = apll_freq_4212;
 +      else
 +              apll_freq_4x12 = apll_freq_4412;
  
        info->mpll_freq_khz = rate;
 -      info->pm_lock_idx = L5;
 +      /* 800Mhz */
        info->pll_safe_idx = L7;
 -      info->max_support_idx = max_support_idx;
 -      info->min_support_idx = min_support_idx;
        info->cpu_clk = cpu_clk;
        info->volt_table = exynos4x12_volt_table;
        info->freq_table = exynos4x12_freq_table;
index b9344869f822a5bf4845337a60bc5d60afb7412d,407126c2d7c6ac4a32b18bf1afb6ad884ce39120..9fae466d7746a5fed781edb17f4838b6931ed8f0
  
  #include <mach/map.h>
  #include <mach/regs-clock.h>
- #include <mach/cpufreq.h>
+ #include "exynos-cpufreq.h"
  
 -#define CPUFREQ_LEVEL_END     (L15 + 1)
 -
 -static int max_support_idx;
 -static int min_support_idx = (CPUFREQ_LEVEL_END - 1);
  static struct clk *cpu_clk;
  static struct clk *moutcore;
  static struct clk *mout_mpll;
  static struct clk *mout_apll;
  
 -struct cpufreq_clkdiv {
 -      unsigned int    index;
 -      unsigned int    clkdiv;
 -      unsigned int    clkdiv1;
 +static unsigned int exynos5250_volt_table[] = {
 +      1300000, 1250000, 1225000, 1200000, 1150000,
 +      1125000, 1100000, 1075000, 1050000, 1025000,
 +      1012500, 1000000,  975000,  950000,  937500,
 +      925000
  };
  
 -static unsigned int exynos5250_volt_table[CPUFREQ_LEVEL_END];
 -
  static struct cpufreq_frequency_table exynos5250_freq_table[] = {
        {L0, 1700 * 1000},
        {L1, 1600 * 1000},
@@@ -42,8 -48,8 +43,8 @@@
        {L5, 1200 * 1000},
        {L6, 1100 * 1000},
        {L7, 1000 * 1000},
 -      {L8, 900 * 1000},
 -      {L9, 800 * 1000},
 +      {L8,  900 * 1000},
 +      {L9,  800 * 1000},
        {L10, 700 * 1000},
        {L11, 600 * 1000},
        {L12, 500 * 1000},
        {0, CPUFREQ_TABLE_END},
  };
  
 -static struct cpufreq_clkdiv exynos5250_clkdiv_table[CPUFREQ_LEVEL_END];
 -
 -static unsigned int clkdiv_cpu0_5250[CPUFREQ_LEVEL_END][8] = {
 +static struct apll_freq apll_freq_5250[] = {
        /*
 -       * Clock divider value for following
 -       * { ARM, CPUD, ACP, PERIPH, ATB, PCLK_DBG, APLL, ARM2 }
 -       */
 -      { 0, 3, 7, 7, 7, 3, 5, 0 },     /* 1700 MHz */
 -      { 0, 3, 7, 7, 7, 1, 4, 0 },     /* 1600 MHz */
 -      { 0, 2, 7, 7, 7, 1, 4, 0 },     /* 1500 MHz */
 -      { 0, 2, 7, 7, 6, 1, 4, 0 },     /* 1400 MHz */
 -      { 0, 2, 7, 7, 6, 1, 3, 0 },     /* 1300 MHz */
 -      { 0, 2, 7, 7, 5, 1, 3, 0 },     /* 1200 MHz */
 -      { 0, 3, 7, 7, 5, 1, 3, 0 },     /* 1100 MHz */
 -      { 0, 1, 7, 7, 4, 1, 2, 0 },     /* 1000 MHz */
 -      { 0, 1, 7, 7, 4, 1, 2, 0 },     /* 900 MHz */
 -      { 0, 1, 7, 7, 4, 1, 2, 0 },     /* 800 MHz */
 -      { 0, 1, 7, 7, 3, 1, 1, 0 },     /* 700 MHz */
 -      { 0, 1, 7, 7, 3, 1, 1, 0 },     /* 600 MHz */
 -      { 0, 1, 7, 7, 2, 1, 1, 0 },     /* 500 MHz */
 -      { 0, 1, 7, 7, 2, 1, 1, 0 },     /* 400 MHz */
 -      { 0, 1, 7, 7, 1, 1, 1, 0 },     /* 300 MHz */
 -      { 0, 1, 7, 7, 1, 1, 1, 0 },     /* 200 MHz */
 -};
 -
 -static unsigned int clkdiv_cpu1_5250[CPUFREQ_LEVEL_END][2] = {
 -      /* Clock divider value for following
 -       * { COPY, HPM }
 +       * values:
 +       * freq
 +       * clock divider for ARM, CPUD, ACP, PERIPH, ATB, PCLK_DBG, APLL, ARM2
 +       * clock divider for COPY, HPM, RESERVED
 +       * PLL M, P, S
         */
 -      { 0, 2 },       /* 1700 MHz */
 -      { 0, 2 },       /* 1600 MHz */
 -      { 0, 2 },       /* 1500 MHz */
 -      { 0, 2 },       /* 1400 MHz */
 -      { 0, 2 },       /* 1300 MHz */
 -      { 0, 2 },       /* 1200 MHz */
 -      { 0, 2 },       /* 1100 MHz */
 -      { 0, 2 },       /* 1000 MHz */
 -      { 0, 2 },       /* 900 MHz */
 -      { 0, 2 },       /* 800 MHz */
 -      { 0, 2 },       /* 700 MHz */
 -      { 0, 2 },       /* 600 MHz */
 -      { 0, 2 },       /* 500 MHz */
 -      { 0, 2 },       /* 400 MHz */
 -      { 0, 2 },       /* 300 MHz */
 -      { 0, 2 },       /* 200 MHz */
 -};
 -
 -static unsigned int exynos5_apll_pms_table[CPUFREQ_LEVEL_END] = {
 -      ((425 << 16) | (6 << 8) | 0),   /* 1700 MHz */
 -      ((200 << 16) | (3 << 8) | 0),   /* 1600 MHz */
 -      ((250 << 16) | (4 << 8) | 0),   /* 1500 MHz */
 -      ((175 << 16) | (3 << 8) | 0),   /* 1400 MHz */
 -      ((325 << 16) | (6 << 8) | 0),   /* 1300 MHz */
 -      ((200 << 16) | (4 << 8) | 0),   /* 1200 MHz */
 -      ((275 << 16) | (6 << 8) | 0),   /* 1100 MHz */
 -      ((125 << 16) | (3 << 8) | 0),   /* 1000 MHz */
 -      ((150 << 16) | (4 << 8) | 0),   /* 900 MHz */
 -      ((100 << 16) | (3 << 8) | 0),   /* 800 MHz */
 -      ((175 << 16) | (3 << 8) | 1),   /* 700 MHz */
 -      ((200 << 16) | (4 << 8) | 1),   /* 600 MHz */
 -      ((125 << 16) | (3 << 8) | 1),   /* 500 MHz */
 -      ((100 << 16) | (3 << 8) | 1),   /* 400 MHz */
 -      ((200 << 16) | (4 << 8) | 2),   /* 300 MHz */
 -      ((100 << 16) | (3 << 8) | 2),   /* 200 MHz */
 -};
 -
 -/* ASV group voltage table */
 -static const unsigned int asv_voltage_5250[CPUFREQ_LEVEL_END] = {
 -      1300000, 1250000, 1225000, 1200000, 1150000,
 -      1125000, 1100000, 1075000, 1050000, 1025000,
 -      1012500, 1000000,  975000,  950000,  937500,
 -      925000
 +      APLL_FREQ(1700, 0, 3, 7, 7, 7, 3, 5, 0, 0, 2, 0, 425, 6, 0),
 +      APLL_FREQ(1600, 0, 3, 7, 7, 7, 1, 4, 0, 0, 2, 0, 200, 3, 0),
 +      APLL_FREQ(1500, 0, 2, 7, 7, 7, 1, 4, 0, 0, 2, 0, 250, 4, 0),
 +      APLL_FREQ(1400, 0, 2, 7, 7, 6, 1, 4, 0, 0, 2, 0, 175, 3, 0),
 +      APLL_FREQ(1300, 0, 2, 7, 7, 6, 1, 3, 0, 0, 2, 0, 325, 6, 0),
 +      APLL_FREQ(1200, 0, 2, 7, 7, 5, 1, 3, 0, 0, 2, 0, 200, 4, 0),
 +      APLL_FREQ(1100, 0, 3, 7, 7, 5, 1, 3, 0, 0, 2, 0, 275, 6, 0),
 +      APLL_FREQ(1000, 0, 1, 7, 7, 4, 1, 2, 0, 0, 2, 0, 125, 3, 0),
 +      APLL_FREQ(900,  0, 1, 7, 7, 4, 1, 2, 0, 0, 2, 0, 150, 4, 0),
 +      APLL_FREQ(800,  0, 1, 7, 7, 4, 1, 2, 0, 0, 2, 0, 100, 3, 0),
 +      APLL_FREQ(700,  0, 1, 7, 7, 3, 1, 1, 0, 0, 2, 0, 175, 3, 1),
 +      APLL_FREQ(600,  0, 1, 7, 7, 3, 1, 1, 0, 0, 2, 0, 200, 4, 1),
 +      APLL_FREQ(500,  0, 1, 7, 7, 2, 1, 1, 0, 0, 2, 0, 125, 3, 1),
 +      APLL_FREQ(400,  0, 1, 7, 7, 2, 1, 1, 0, 0, 2, 0, 100, 3, 1),
 +      APLL_FREQ(300,  0, 1, 7, 7, 1, 1, 1, 0, 0, 2, 0, 200, 4, 2),
 +      APLL_FREQ(200,  0, 1, 7, 7, 1, 1, 1, 0, 0, 2, 0, 100, 3, 2),
  };
  
  static void set_clkdiv(unsigned int div_index)
  
        /* Change Divider - CPU0 */
  
 -      tmp = exynos5250_clkdiv_table[div_index].clkdiv;
 +      tmp = apll_freq_5250[div_index].clk_div_cpu0;
  
        __raw_writel(tmp, EXYNOS5_CLKDIV_CPU0);
  
                cpu_relax();
  
        /* Change Divider - CPU1 */
 -      tmp = exynos5250_clkdiv_table[div_index].clkdiv1;
 +      tmp = apll_freq_5250[div_index].clk_div_cpu1;
  
        __raw_writel(tmp, EXYNOS5_CLKDIV_CPU1);
  
@@@ -116,14 -170,14 +117,14 @@@ static void set_apll(unsigned int new_i
        } while (tmp != 0x2);
  
        /* 2. Set APLL Lock time */
 -      pdiv = ((exynos5_apll_pms_table[new_index] >> 8) & 0x3f);
 +      pdiv = ((apll_freq_5250[new_index].mps >> 8) & 0x3f);
  
        __raw_writel((pdiv * 250), EXYNOS5_APLL_LOCK);
  
        /* 3. Change PLL PMS values */
        tmp = __raw_readl(EXYNOS5_APLL_CON0);
        tmp &= ~((0x3ff << 16) | (0x3f << 8) | (0x7 << 0));
 -      tmp |= exynos5_apll_pms_table[new_index];
 +      tmp |= apll_freq_5250[new_index].mps;
        __raw_writel(tmp, EXYNOS5_APLL_CON0);
  
        /* 4. wait_lock_time */
  
  }
  
 -bool exynos5250_pms_change(unsigned int old_index, unsigned int new_index)
 +static bool exynos5250_pms_change(unsigned int old_index, unsigned int new_index)
  {
 -      unsigned int old_pm = (exynos5_apll_pms_table[old_index] >> 8);
 -      unsigned int new_pm = (exynos5_apll_pms_table[new_index] >> 8);
 +      unsigned int old_pm = apll_freq_5250[old_index].mps >> 8;
 +      unsigned int new_pm = apll_freq_5250[new_index].mps >> 8;
  
        return (old_pm == new_pm) ? 0 : 1;
  }
@@@ -163,7 -217,7 +164,7 @@@ static void exynos5250_set_frequency(un
                        /* 2. Change just s value in apll m,p,s value */
                        tmp = __raw_readl(EXYNOS5_APLL_CON0);
                        tmp &= ~(0x7 << 0);
 -                      tmp |= (exynos5_apll_pms_table[new_index] & 0x7);
 +                      tmp |= apll_freq_5250[new_index].mps & 0x7;
                        __raw_writel(tmp, EXYNOS5_APLL_CON0);
  
                } else {
                        /* 1. Change just s value in apll m,p,s value */
                        tmp = __raw_readl(EXYNOS5_APLL_CON0);
                        tmp &= ~(0x7 << 0);
 -                      tmp |= (exynos5_apll_pms_table[new_index] & 0x7);
 +                      tmp |= apll_freq_5250[new_index].mps & 0x7;
                        __raw_writel(tmp, EXYNOS5_APLL_CON0);
                        /* 2. Change the system clock divider values */
                        set_clkdiv(new_index);
        }
  }
  
 -static void __init set_volt_table(void)
 -{
 -      unsigned int i;
 -
 -      max_support_idx = L0;
 -
 -      for (i = 0 ; i < CPUFREQ_LEVEL_END ; i++)
 -              exynos5250_volt_table[i] = asv_voltage_5250[i];
 -}
 -
  int exynos5250_cpufreq_init(struct exynos_dvfs_info *info)
  {
 -      int i;
 -      unsigned int tmp;
        unsigned long rate;
  
 -      set_volt_table();
 -
        cpu_clk = clk_get(NULL, "armclk");
        if (IS_ERR(cpu_clk))
                return PTR_ERR(cpu_clk);
        if (IS_ERR(mout_apll))
                goto err_mout_apll;
  
 -      for (i = L0; i < CPUFREQ_LEVEL_END; i++) {
 -
 -              exynos5250_clkdiv_table[i].index = i;
 -
 -              tmp = __raw_readl(EXYNOS5_CLKDIV_CPU0);
 -
 -              tmp &= ~((0x7 << 0) | (0x7 << 4) | (0x7 << 8) |
 -                      (0x7 << 12) | (0x7 << 16) | (0x7 << 20) |
 -                      (0x7 << 24) | (0x7 << 28));
 -
 -              tmp |= ((clkdiv_cpu0_5250[i][0] << 0) |
 -                      (clkdiv_cpu0_5250[i][1] << 4) |
 -                      (clkdiv_cpu0_5250[i][2] << 8) |
 -                      (clkdiv_cpu0_5250[i][3] << 12) |
 -                      (clkdiv_cpu0_5250[i][4] << 16) |
 -                      (clkdiv_cpu0_5250[i][5] << 20) |
 -                      (clkdiv_cpu0_5250[i][6] << 24) |
 -                      (clkdiv_cpu0_5250[i][7] << 28));
 -
 -              exynos5250_clkdiv_table[i].clkdiv = tmp;
 -
 -              tmp = __raw_readl(EXYNOS5_CLKDIV_CPU1);
 -
 -              tmp &= ~((0x7 << 0) | (0x7 << 4));
 -
 -              tmp |= ((clkdiv_cpu1_5250[i][0] << 0) |
 -                      (clkdiv_cpu1_5250[i][1] << 4));
 -
 -              exynos5250_clkdiv_table[i].clkdiv1 = tmp;
 -      }
 -
        info->mpll_freq_khz = rate;
 -      /* 1000Mhz */
 -      info->pm_lock_idx = L7;
        /* 800Mhz */
        info->pll_safe_idx = L9;
 -      info->max_support_idx = max_support_idx;
 -      info->min_support_idx = min_support_idx;
        info->cpu_clk = cpu_clk;
        info->volt_table = exynos5250_volt_table;
        info->freq_table = exynos5250_freq_table;
index b2016ed941ac250178cadcb69a4e0112faf95832,edf1eb5cb125eacdc2371049c378fd9a76ba85ff..b3643ff007e4772285731443e15c485b54ccbbda
@@@ -38,7 -38,6 +38,6 @@@
  #include <plat/gpio-core.h>
  #include <plat/gpio-cfg.h>
  #include <plat/gpio-cfg-helpers.h>
- #include <plat/gpio-fns.h>
  #include <plat/pm.h>
  
  int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip,
@@@ -3023,9 -3022,9 +3022,9 @@@ static __init int samsung_gpiolib_init(
        */
        struct device_node *pctrl_np;
        static const struct of_device_id exynos_pinctrl_ids[] = {
 -              { .compatible = "samsung,pinctrl-exynos4210", },
 -              { .compatible = "samsung,pinctrl-exynos4x12", },
 -              { .compatible = "samsung,pinctrl-exynos5440", },
 +              { .compatible = "samsung,exynos4210-pinctrl", },
 +              { .compatible = "samsung,exynos4x12-pinctrl", },
 +              { .compatible = "samsung,exynos5440-pinctrl", },
        };
        for_each_matching_node(pctrl_np, exynos_pinctrl_ids)
                if (pctrl_np && of_device_is_available(pctrl_np))
index 87dfa9026c5bdcb1ba9d57d718d00da671c8fe21,69d9a395d54c671e0e1068c710cca76b92a2a5f5..644d724684232d9b389fcc056f78aaab1e155817
  #include <linux/interrupt.h>
  #include <linux/percpu.h>
  #include <linux/slab.h>
+ #include <linux/irqchip/arm-gic.h>
  
  #include <asm/irq.h>
  #include <asm/exception.h>
  #include <asm/smp_plat.h>
  #include <asm/mach/irq.h>
- #include <asm/hardware/gic.h>
+ #include "irqchip.h"
  
  union gic_base {
        void __iomem *common_base;
@@@ -276,7 -278,7 +278,7 @@@ static int gic_set_wake(struct irq_dat
  #define gic_set_wake  NULL
  #endif
  
- asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
  {
        u32 irqstat, irqnr;
        struct gic_chip_data *gic = &gic_data[0];
@@@ -351,25 -353,6 +353,25 @@@ void __init gic_cascade_irq(unsigned in
        irq_set_chained_handler(irq, gic_handle_cascade_irq);
  }
  
 +static u8 gic_get_cpumask(struct gic_chip_data *gic)
 +{
 +      void __iomem *base = gic_data_dist_base(gic);
 +      u32 mask, i;
 +
 +      for (i = mask = 0; i < 32; i += 4) {
 +              mask = readl_relaxed(base + GIC_DIST_TARGET + i);
 +              mask |= mask >> 16;
 +              mask |= mask >> 8;
 +              if (mask)
 +                      break;
 +      }
 +
 +      if (!mask)
 +              pr_crit("GIC CPU mask not found - kernel will fail to boot.\n");
 +
 +      return mask;
 +}
 +
  static void __init gic_dist_init(struct gic_chip_data *gic)
  {
        unsigned int i;
        /*
         * Set all global interrupts to this CPU only.
         */
 -      cpumask = readl_relaxed(base + GIC_DIST_TARGET + 0);
 +      cpumask = gic_get_cpumask(gic);
 +      cpumask |= cpumask << 8;
 +      cpumask |= cpumask << 16;
        for (i = 32; i < gic_irqs; i += 4)
                writel_relaxed(cpumask, base + GIC_DIST_TARGET + i * 4 / 4);
  
@@@ -421,7 -402,7 +423,7 @@@ static void __cpuinit gic_cpu_init(stru
         * Get what the GIC says our CPU mask is.
         */
        BUG_ON(cpu >= NR_GIC_CPU_IF);
 -      cpu_mask = readl_relaxed(dist_base + GIC_DIST_TARGET + 0);
 +      cpu_mask = gic_get_cpumask(gic);
        gic_cpu_map[cpu] = cpu_mask;
  
        /*
@@@ -638,6 -619,27 +640,27 @@@ static void __init gic_pm_init(struct g
  }
  #endif
  
+ #ifdef CONFIG_SMP
+ void gic_raise_softirq(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();
+       /* this always happens on GIC0 */
+       writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
+ }
+ #endif
  static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
                                irq_hw_number_t hw)
  {
@@@ -764,6 -766,12 +787,12 @@@ void __init gic_init_bases(unsigned in
        if (WARN_ON(!gic->domain))
                return;
  
+ #ifdef CONFIG_SMP
+       set_smp_cross_call(gic_raise_softirq);
+ #endif
+       set_handle_irq(gic_handle_irq);
        gic_chip.flags |= gic_arch_extn.flags;
        gic_dist_init(gic);
        gic_cpu_init(gic);
@@@ -777,27 -785,6 +806,6 @@@ void __cpuinit gic_secondary_init(unsig
        gic_cpu_init(&gic_data[gic_nr]);
  }
  
- #ifdef CONFIG_SMP
- void gic_raise_softirq(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 |= gic_cpu_map[cpu];
-       /*
-        * Ensure that stores to Normal memory are visible to the
-        * other CPUs before issuing the IPI.
-        */
-       dsb();
-       /* this always happens on GIC0 */
-       writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
- }
- #endif
  #ifdef CONFIG_OF
  static int gic_cnt __initdata = 0;
  
@@@ -829,4 -816,9 +837,9 @@@ int __init gic_of_init(struct device_no
        gic_cnt++;
        return 0;
  }
+ IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init);
+ IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init);
+ IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init);
+ IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init);
  #endif
index c1fe60ad1540a0f922458cda1a6609c51de2c42e,fc62ac5c6d4fa5324712cc3578be327261a6872c..afa12c7a025c4ea72dac8a0d6eb12b9c593536b1
  #define TRACE_SYSCALLS()
  #endif
  
+ #ifdef CONFIG_CLKSRC_OF
+ #define CLKSRC_OF_TABLES() . = ALIGN(8);                              \
+                          VMLINUX_SYMBOL(__clksrc_of_table) = .;       \
+                          *(__clksrc_of_table)                         \
+                          *(__clksrc_of_table_end)
+ #else
+ #define CLKSRC_OF_TABLES()
+ #endif
+ #ifdef CONFIG_IRQCHIP
+ #define IRQCHIP_OF_MATCH_TABLE()                                      \
+       . = ALIGN(8);                                                   \
+       VMLINUX_SYMBOL(__irqchip_begin) = .;                            \
+       *(__irqchip_of_table)                                           \
+       *(__irqchip_of_end)
+ #else
+ #define IRQCHIP_OF_MATCH_TABLE()
+ #endif
  
 +#ifdef CONFIG_COMMON_CLK
 +#define CLK_OF_TABLES() . = ALIGN(8);                         \
 +                      VMLINUX_SYMBOL(__clk_of_table) = .;     \
 +                      *(__clk_of_table)                       \
 +                      *(__clk_of_table_end)
 +#else
 +#define CLK_OF_TABLES()
 +#endif
 +
  #define KERNEL_DTB()                                                  \
        STRUCT_ALIGN();                                                 \
        VMLINUX_SYMBOL(__dtb_start) = .;                                \
        DEV_DISCARD(init.rodata)                                        \
        CPU_DISCARD(init.rodata)                                        \
        MEM_DISCARD(init.rodata)                                        \
-       KERNEL_DTB()
 +      CLK_OF_TABLES()                                                 \
+       CLKSRC_OF_TABLES()                                              \
+       KERNEL_DTB()                                                    \
+       IRQCHIP_OF_MATCH_TABLE()
  
  #define INIT_TEXT                                                     \
        *(.init.text)                                                   \
diff --combined include/linux/time.h
index a3ab6a814a9cb0d6093875b36d0e62207fefb09e,05e32a72103c68a059602101e82c05ad3c80027e..d4835dfdf25e505f87c59956f09af0a203aba95a
@@@ -115,20 -115,8 +115,20 @@@ static inline bool timespec_valid_stric
        return true;
  }
  
 +extern bool persistent_clock_exist;
 +
 +#ifdef ALWAYS_USE_PERSISTENT_CLOCK
 +#define has_persistent_clock()        true
 +#else
 +static inline bool has_persistent_clock(void)
 +{
 +      return persistent_clock_exist;
 +}
 +#endif
 +
  extern void read_persistent_clock(struct timespec *ts);
  extern void read_boot_clock(struct timespec *ts);
 +extern int persistent_clock_is_local;
  extern int update_persistent_clock(struct timespec now);
  void timekeeping_init(void);
  extern int timekeeping_suspended;
@@@ -154,9 -142,7 +154,7 @@@ void timekeeping_inject_sleeptime(struc
   * finer then tick granular time.
   */
  #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
- extern u32 arch_gettimeoffset(void);
- #else
- static inline u32 arch_gettimeoffset(void) { return 0; }
+ extern u32 (*arch_gettimeoffset)(void);
  #endif
  
  extern void do_gettimeofday(struct timeval *tv);
@@@ -170,7 -156,6 +168,7 @@@ extern int do_setitimer(int which, stru
                        struct itimerval *ovalue);
  extern unsigned int alarm_setitimer(unsigned int seconds);
  extern int do_getitimer(int which, struct itimerval *value);
 +extern int __getnstimeofday(struct timespec *tv);
  extern void getnstimeofday(struct timespec *tv);
  extern void getrawmonotonic(struct timespec *ts);
  extern void getnstime_raw_and_real(struct timespec *ts_raw,
index 1e35515a875e86966e08a47737c6dfb070956309,8ed9346015879ddb3851bbed8a908151b6f887a9..9a0bc98fbe1db40208b9025bbfcf51f34057f1dc
@@@ -29,9 -29,6 +29,9 @@@ static struct timekeeper timekeeper
  /* flag for if timekeeping is suspended */
  int __read_mostly timekeeping_suspended;
  
 +/* Flag for if there is a persistent clock on this platform */
 +bool __read_mostly persistent_clock_exist = false;
 +
  static inline void tk_normalize_xtime(struct timekeeper *tk)
  {
        while (tk->xtime_nsec >= ((u64)NSEC_PER_SEC << tk->shift)) {
@@@ -138,6 -135,20 +138,20 @@@ static void tk_setup_internals(struct t
  }
  
  /* Timekeeper helper functions. */
+ #ifdef CONFIG_ARCH_USES_GETTIMEOFFSET
+ u32 (*arch_gettimeoffset)(void);
+ u32 get_arch_timeoffset(void)
+ {
+       if (likely(arch_gettimeoffset))
+               return arch_gettimeoffset();
+       return 0;
+ }
+ #else
+ static inline u32 get_arch_timeoffset(void) { return 0; }
+ #endif
  static inline s64 timekeeping_get_ns(struct timekeeper *tk)
  {
        cycle_t cycle_now, cycle_delta;
        nsec = cycle_delta * tk->mult + tk->xtime_nsec;
        nsec >>= tk->shift;
  
-       /* If arch requires, add in gettimeoffset() */
-       return nsec + arch_gettimeoffset();
+       /* If arch requires, add in get_arch_timeoffset() */
+       return nsec + get_arch_timeoffset();
  }
  
  static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk)
        /* convert delta to nanoseconds. */
        nsec = clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift);
  
-       /* If arch requires, add in gettimeoffset() */
-       return nsec + arch_gettimeoffset();
+       /* If arch requires, add in get_arch_timeoffset() */
+       return nsec + get_arch_timeoffset();
  }
  
  static RAW_NOTIFIER_HEAD(pvclock_gtod_chain);
@@@ -257,8 -268,8 +271,8 @@@ static void timekeeping_forward_now(str
  
        tk->xtime_nsec += cycle_delta * tk->mult;
  
-       /* If arch requires, add in gettimeoffset() */
-       tk->xtime_nsec += (u64)arch_gettimeoffset() << tk->shift;
+       /* If arch requires, add in get_arch_timeoffset() */
+       tk->xtime_nsec += (u64)get_arch_timeoffset() << tk->shift;
  
        tk_normalize_xtime(tk);
  
  }
  
  /**
 - * getnstimeofday - Returns the time of day in a timespec
 + * __getnstimeofday - Returns the time of day in a timespec.
   * @ts:               pointer to the timespec to be set
   *
 - * Returns the time of day in a timespec.
 + * Updates the time of day in the timespec.
 + * Returns 0 on success, or -ve when suspended (timespec will be undefined).
   */
 -void getnstimeofday(struct timespec *ts)
 +int __getnstimeofday(struct timespec *ts)
  {
        struct timekeeper *tk = &timekeeper;
        unsigned long seq;
        s64 nsecs = 0;
  
 -      WARN_ON(timekeeping_suspended);
 -
        do {
                seq = read_seqbegin(&tk->lock);
  
  
        ts->tv_nsec = 0;
        timespec_add_ns(ts, nsecs);
 +
 +      /*
 +       * Do not bail out early, in case there were callers still using
 +       * the value, even in the face of the WARN_ON.
 +       */
 +      if (unlikely(timekeeping_suspended))
 +              return -EAGAIN;
 +      return 0;
 +}
 +EXPORT_SYMBOL(__getnstimeofday);
 +
 +/**
 + * getnstimeofday - Returns the time of day in a timespec.
 + * @ts:               pointer to the timespec to be set
 + *
 + * Returns the time of day in a timespec (WARN if suspended).
 + */
 +void getnstimeofday(struct timespec *ts)
 +{
 +      WARN_ON(__getnstimeofday(ts));
  }
  EXPORT_SYMBOL(getnstimeofday);
  
@@@ -662,14 -654,12 +676,14 @@@ void __init timekeeping_init(void
        struct timespec now, boot, tmp;
  
        read_persistent_clock(&now);
 +
        if (!timespec_valid_strict(&now)) {
                pr_warn("WARNING: Persistent clock returned invalid value!\n"
                        "         Check your CMOS/BIOS settings.\n");
                now.tv_sec = 0;
                now.tv_nsec = 0;
 -      }
 +      } else if (now.tv_sec || now.tv_nsec)
 +              persistent_clock_exist = true;
  
        read_boot_clock(&boot);
        if (!timespec_valid_strict(&boot)) {
@@@ -742,12 -732,11 +756,12 @@@ void timekeeping_inject_sleeptime(struc
  {
        struct timekeeper *tk = &timekeeper;
        unsigned long flags;
 -      struct timespec ts;
  
 -      /* Make sure we don't set the clock twice */
 -      read_persistent_clock(&ts);
 -      if (!(ts.tv_sec == 0 && ts.tv_nsec == 0))
 +      /*
 +       * Make sure we don't set the clock twice, as timekeeping_resume()
 +       * already did it
 +       */
 +      if (has_persistent_clock())
                return;
  
        write_seqlock_irqsave(&tk->lock, flags);