Merge tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 May 2013 16:31:45 +0000 (09:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 May 2013 16:31:45 +0000 (09:31 -0700)
Pull ARM SoC platform updates from Olof Johansson:
 "This branch contains part 1 of the platform updates for 3.10.  Among
  the highlights:

   - Support for the new Atmel Cortex-A5 based platforms (SAMA5D3)
   - New support for CSR SiRFatlas6 SoCs
   - A handful of updates for NVidia T114 (a.k.a. Tegra 4)
   - A bunch of updates for the shmobile platforms
   - A handful of updates for davinci
   - A few updates for Qualcomm MSM
   - Plus a handful of other patches, defconfig updates, etc."

* tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (135 commits)
  ARM: tegra: pm: fix build error w/o PM_SLEEP
  ARM: davinci: ensure global variables are declared
  ARM: davinci: sram.c: fix incorrect type in assignment
  ARM: davinci: da8xx dt: make file local symbols static
  ARM: davinci: da8xx: add remoteproc support
  ARM: socfpga: Upgrade clk driver for socfpga to make use of dts clock entries
  ARM: socfpga: Add clock entries into device tree
  ARM: socfpga: Enable soft reset
  ARM: EXYNOS: replace cpumask by the corresponding macro
  ARM: EXYNOS: handle properly the return values
  ARM: EXYNOS: factor out the idle states
  ARM: OMAP4: Enable fix for Cortex-A9 erratas
  ARM: OMAP2+: Export SoC information to userspace
  ARM: OMAP2+: SoC name and revision unification
  ARM: OMAP2+: Move common part of late init into common function
  ARM: tegra: pm: remove duplicated include from pm.c
  ARM: davinci: da850: override mmc DT node device name
  ARM: davinci: da850: add mmc DT entries
  mmc: davinci_mmc: add DT support
  ARM: SAMSUNG: check processor type before cache restoration in resume
  ...

32 files changed:
1  2 
Documentation/kernel-parameters.txt
arch/arm/Kconfig
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/msm8660-surf.dts
arch/arm/boot/dts/msm8960-cdp.dts
arch/arm/configs/lpc32xx_defconfig
arch/arm/configs/mxs_defconfig
arch/arm/mach-at91/at91rm9200.c
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9n12.c
arch/arm/mach-at91/at91sam9x5.c
arch/arm/mach-at91/setup.c
arch/arm/mach-davinci/board-dm355-evm.c
arch/arm/mach-davinci/board-dm365-evm.c
arch/arm/mach-davinci/board-dm644x-evm.c
arch/arm/mach-davinci/dm355.c
arch/arm/mach-davinci/dm365.c
arch/arm/mach-davinci/dm644x.c
arch/arm/mach-exynos/common.c
arch/arm/mach-exynos/cpuidle.c
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/cclock33xx_data.c
arch/arm/mach-omap2/common.h
arch/arm/mach-omap2/id.c
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/omap_hwmod_33xx_data.c
arch/arm/mach-shmobile/include/mach/common.h
arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/cpuidle-tegra20.c
arch/arm/mach-tegra/cpuidle-tegra30.c
arch/arm/mach-tegra/pm.c

index 8c01a0218a1e0e9e08470215e495d7ae0c0be7c0,4a6d96214eedfad0c9382cd1c493239fb3298aaa..9653cf2f97279e5fda2257ed3221ce50fb6129c2
@@@ -44,7 -44,7 +44,8 @@@ parameter is applicable
        AVR32   AVR32 architecture is enabled.
        AX25    Appropriate AX.25 support is enabled.
        BLACKFIN Blackfin architecture is enabled.
 +      CLK     Common clock infrastructure is enabled.
+       CMA     Contiguous Memory Area support is enabled.
        DRM     Direct Rendering Management support is enabled.
        DYNAMIC_DEBUG Build in debug messages and enable them at runtime
        EDD     BIOS Enhanced Disk Drive Services (EDD) is enabled
@@@ -321,13 -321,6 +322,13 @@@ bytes respectively. Such letter suffixe
                        on: enable for both 32- and 64-bit processes
                        off: disable for both 32- and 64-bit processes
  
 +      alloc_snapshot  [FTRACE]
 +                      Allocate the ftrace snapshot buffer on boot up when the
 +                      main buffer is allocated. This is handy if debugging
 +                      and you need to use tracing_snapshot() on boot up, and
 +                      do not want to use tracing_snapshot_alloc() as it needs
 +                      to be done where GFP_KERNEL allocations are allowed.
 +
        amd_iommu=      [HW,X86-64]
                        Pass parameters to the AMD IOMMU driver in the system.
                        Possible values are:
  
        cio_ignore=     [S390]
                        See Documentation/s390/CommonIO for details.
 +      clk_ignore_unused
 +                      [CLK]
 +                      Keep all clocks already enabled by bootloader on,
 +                      even if no driver has claimed them. This is useful
 +                      for debug and development, but should not be
 +                      needed on a platform with proper driver support.
 +                      For more information, see Documentation/clk.txt.
  
        clock=          [BUGS=X86-32, HW] gettimeofday clocksource override.
                        [Deprecated]
                        is selected automatically. Check
                        Documentation/kdump/kdump.txt for further details.
  
 -      crashkernel_low=size[KMG]
 -                      [KNL, x86] parts under 4G.
 -
        crashkernel=range1:size1[,range2:size2,...][@offset]
                        [KNL] Same as above, but depends on the memory
                        in the running system. The syntax of range is
                        a memory unit (amount[KMG]). See also
                        Documentation/kdump/kdump.txt for an example.
  
 +      crashkernel=size[KMG],high
 +                      [KNL, x86_64] range could be above 4G. Allow kernel
 +                      to allocate physical memory region from top, so could
 +                      be above 4G if system have more than 4G ram installed.
 +                      Otherwise memory region will be allocated below 4G, if
 +                      available.
 +                      It will be ignored if crashkernel=X is specified.
 +      crashkernel=size[KMG],low
 +                      [KNL, x86_64] range under 4G. When crashkernel=X,high
 +                      is passed, kernel could allocate physical memory region
 +                      above 4G, that cause second kernel crash on system
 +                      that require some amount of low memory, e.g. swiotlb
 +                      requires at least 64M+32K low memory.  Kernel would
 +                      try to allocate 72M below 4G automatically.
 +                      This one let user to specify own low range under 4G
 +                      for second kernel instead.
 +                      0: to disable low allocation.
 +                      It will be ignored when crashkernel=X,high is not used
 +                      or memory reserved is below 4G.
 +
        cs89x0_dma=     [HW,NET]
                        Format: <dma>
  
                        (mmio) or 32-bit (mmio32).
                        The options are the same as for ttyS, above.
  
 -      earlyprintk=    [X86,SH,BLACKFIN]
 +      earlyprintk=    [X86,SH,BLACKFIN,ARM]
                        earlyprintk=vga
                        earlyprintk=xen
                        earlyprintk=serial[,ttySn[,baudrate]]
 +                      earlyprintk=serial[,0x...[,baudrate]]
                        earlyprintk=ttySn[,baudrate]
                        earlyprintk=dbgp[debugController#]
  
 +                      earlyprintk is useful when the kernel crashes before
 +                      the normal console is initialized. It is not enabled by
 +                      default because it has some cosmetic problems.
 +
                        Append ",keep" to not disable it when the real console
                        takes over.
  
                        Only vga or serial or usb debug port at a time.
  
 -                      Currently only ttyS0 and ttyS1 are supported.
 +                      Currently only ttyS0 and ttyS1 may be specified by
 +                      name.  Other I/O ports may be explicitly specified
 +                      on some architectures (x86 and arm at least) by
 +                      replacing ttySn with an I/O port address, like this:
 +                              earlyprintk=serial,0x1008,115200
 +                      You can find the port for a given device in
 +                      /proc/tty/driver/serial:
 +                              2: uart:ST16650V2 port:00001008 irq:18 ...
  
                        Interaction with the standard serial driver is not
                        very good.
        edd=            [EDD]
                        Format: {"off" | "on" | "skip[mbr]"}
  
 +      efi_no_storage_paranoia [EFI; X86]
 +                      Using this parameter you can use more than 50% of
 +                      your efi variable storage. Use this parameter only if
 +                      you are really sure that your UEFI does sane gc and
 +                      fulfills the spec otherwise your board may brick.
 +
        eisa_irq_edge=  [PARISC,HW]
                        See header of drivers/parisc/eisa.c.
  
        module.sig_enforce
                        [KNL] When CONFIG_MODULE_SIG is set, this means that
                        modules without (valid) signatures will fail to load.
 -                      Note that if CONFIG_MODULE_SIG_ENFORCE is set, that
 +                      Note that if CONFIG_MODULE_SIG_FORCE is set, that
                        is always true, so this option does nothing.
  
        mousedev.tap_time=
        noreplace-smp   [X86-32,SMP] Don't replace SMP instructions
                        with UP alternatives
  
 -      noresidual      [PPC] Don't use residual data on PReP machines.
 -
        nordrand        [X86] Disable the direct use of the RDRAND
                        instruction even if it is supported by the
                        processor.  RDRAND is still available to user
                        In kernels built with CONFIG_RCU_NOCB_CPU=y, set
                        the specified list of CPUs to be no-callback CPUs.
                        Invocation of these CPUs' RCU callbacks will
 -                      be offloaded to "rcuoN" kthreads created for
 -                      that purpose.  This reduces OS jitter on the
 +                      be offloaded to "rcuox/N" kthreads created for
 +                      that purpose, where "x" is "b" for RCU-bh, "p"
 +                      for RCU-preempt, and "s" for RCU-sched, and "N"
 +                      is the CPU number.  This reduces OS jitter on the
                        offloaded CPUs, which can be useful for HPC and
 +
                        real-time workloads.  It can also improve energy
                        efficiency for asymmetric multiprocessors.
  
                        leaf rcu_node structure.  Useful for very large
                        systems.
  
 +      rcutree.jiffies_till_first_fqs= [KNL,BOOT]
 +                      Set delay from grace-period initialization to
 +                      first attempt to force quiescent states.
 +                      Units are jiffies, minimum value is zero,
 +                      and maximum value is HZ.
 +
 +      rcutree.jiffies_till_next_fqs= [KNL,BOOT]
 +                      Set delay between subsequent attempts to force
 +                      quiescent states.  Units are jiffies, minimum
 +                      value is one, and maximum value is HZ.
 +
        rcutree.qhimark=        [KNL,BOOT]
                        Set threshold of queued
                        RCU callbacks over which batch limiting is disabled.
        rcutree.rcu_cpu_stall_timeout= [KNL,BOOT]
                        Set timeout for RCU CPU stall warning messages.
  
 -      rcutree.jiffies_till_first_fqs= [KNL,BOOT]
 -                      Set delay from grace-period initialization to
 -                      first attempt to force quiescent states.
 -                      Units are jiffies, minimum value is zero,
 -                      and maximum value is HZ.
 +      rcutree.rcu_idle_gp_delay=      [KNL,BOOT]
 +                      Set wakeup interval for idle CPUs that have
 +                      RCU callbacks (RCU_FAST_NO_HZ=y).
  
 -      rcutree.jiffies_till_next_fqs= [KNL,BOOT]
 -                      Set delay between subsequent attempts to force
 -                      quiescent states.  Units are jiffies, minimum
 -                      value is one, and maximum value is HZ.
 +      rcutree.rcu_idle_lazy_gp_delay= [KNL,BOOT]
 +                      Set wakeup interval for idle CPUs that have
 +                      only "lazy" RCU callbacks (RCU_FAST_NO_HZ=y).
 +                      Lazy RCU callbacks are those which RCU can
 +                      prove do nothing more than free memory.
  
        rcutorture.fqs_duration= [KNL,BOOT]
                        Set duration of force_quiescent_state bursts.
                        Useful for devices that are detected asynchronously
                        (e.g. USB and MMC devices).
  
+       rproc_mem=nn[KMG][@address]
+                       [KNL,ARM,CMA] Remoteproc physical memory block.
+                       Memory area to be used by remote processor image,
+                       managed by CMA.
        rw              [KNL] Mount root device read-write on boot
  
        S               [KNL] Run init in single mode
                        or other driver-specific files in the
                        Documentation/watchdog/ directory.
  
 +      workqueue.disable_numa
 +                      By default, all work items queued to unbound
 +                      workqueues are affine to the NUMA nodes they're
 +                      issued on, which results in better behavior in
 +                      general.  If NUMA affinity needs to be disabled for
 +                      whatever reason, this option can be used.  Note
 +                      that this also can be controlled per-workqueue for
 +                      workqueues visible under /sys/bus/workqueue/.
 +
        x2apic_phys     [X86-64,APIC] Use x2apic physical mode instead of
                        default x2apic cluster mode on platforms
                        supporting x2apic.
diff --combined arch/arm/Kconfig
index 7af7d1368942a5463a6d0c47216b7ae1f4c4b249,f11182598b447dca472879b63f2dfb9ac8e038b6..bf11bf5427da02d688795e6cec0ae5ba777d70b7
@@@ -15,7 -15,6 +15,7 @@@ config AR
        select GENERIC_IRQ_SHOW
        select GENERIC_PCI_IOMAP
        select GENERIC_SMP_IDLE_THREAD
 +      select GENERIC_IDLE_POLL_SETUP
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_STRNLEN_USER
        select HARDIRQS_SW_RESEND
@@@ -411,7 -410,6 +411,7 @@@ config ARCH_GEMIN
        bool "Cortina Systems Gemini"
        select ARCH_REQUIRE_GPIOLIB
        select ARCH_USES_GETTIMEOFFSET
 +      select NEED_MACH_GPIO_H
        select CPU_FA526
        help
          Support for the Cortina Systems Gemini family SoCs
@@@ -475,14 -473,12 +475,14 @@@ config ARCH_MX
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
 +      select CLKSRC_OF
        select COMMON_CLK
        select GENERIC_CLOCKEVENTS
        select HAVE_CLK_PREPARE
        select MULTI_IRQ_HANDLER
        select PINCTRL
        select SPARSE_IRQ
 +      select STMP_DEVICE
        select USE_OF
        help
          Support for Freescale MXS-based family of processors
@@@ -496,6 -492,14 +496,6 @@@ config ARCH_NET
        help
          This enables support for systems based on the Hilscher NetX Soc
  
 -config ARCH_H720X
 -      bool "Hynix HMS720x-based"
 -      select ARCH_USES_GETTIMEOFFSET
 -      select CPU_ARM720T
 -      select ISA_DMA_API
 -      help
 -        This enables support for systems based on the Hynix HMS720x
 -
  config ARCH_IOP13XX
        bool "IOP13xx-based"
        depends on MMU
@@@ -545,8 -549,6 +545,8 @@@ config ARCH_IXP4X
        select GENERIC_CLOCKEVENTS
        select MIGHT_HAVE_PCI
        select NEED_MACH_IO_H
 +      select USB_EHCI_BIG_ENDIAN_MMIO
 +      select USB_EHCI_BIG_ENDIAN_DESC
        help
          Support for Intel's IXP4XX (XScale) family of processors.
  
@@@ -671,6 -673,7 +671,7 @@@ config ARCH_TEGR
        select HAVE_CLK
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
+       select SOC_BUS
        select SPARSE_IRQ
        select USE_OF
        help
@@@ -1049,6 -1052,8 +1050,6 @@@ source "arch/arm/mach-footbridge/Kconfi
  
  source "arch/arm/mach-gemini/Kconfig"
  
 -source "arch/arm/mach-h720x/Kconfig"
 -
  source "arch/arm/mach-highbank/Kconfig"
  
  source "arch/arm/mach-integrator/Kconfig"
@@@ -1169,6 -1174,7 +1170,6 @@@ config PLAT_VERSATIL
  config ARM_TIMER_SP804
        bool
        select CLKSRC_MMIO
 -      select HAVE_SCHED_CLOCK
  
  source arch/arm/mm/Kconfig
  
@@@ -1598,7 -1604,6 +1599,7 @@@ config HAVE_ARM_ARCH_TIME
  config HAVE_ARM_TWD
        bool
        depends on SMP
 +      select CLKSRC_OF if OF
        help
          This options enables support for the ARM timer and watchdog unit
  
@@@ -1666,7 -1671,7 +1667,7 @@@ config ARCH_NR_GPI
        int
        default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
        default 512 if SOC_OMAP5
-       default 355 if ARCH_U8500
+       default 392 if ARCH_U8500
        default 288 if ARCH_VT8500 || ARCH_SUNXI
        default 264 if MACH_H4700
        default 0
@@@ -2156,8 -2161,40 +2157,8 @@@ endmen
  menu "CPU Power Management"
  
  if ARCH_HAS_CPUFREQ
 -
  source "drivers/cpufreq/Kconfig"
  
 -config CPU_FREQ_IMX
 -      tristate "CPUfreq driver for i.MX CPUs"
 -      depends on ARCH_MXC && CPU_FREQ
 -      select CPU_FREQ_TABLE
 -      help
 -        This enables the CPUfreq driver for i.MX CPUs.
 -
 -config CPU_FREQ_SA1100
 -      bool
 -
 -config CPU_FREQ_SA1110
 -      bool
 -
 -config CPU_FREQ_INTEGRATOR
 -      tristate "CPUfreq driver for ARM Integrator CPUs"
 -      depends on ARCH_INTEGRATOR && CPU_FREQ
 -      default y
 -      help
 -        This enables the CPUfreq driver for ARM Integrator CPUs.
 -
 -        For details, take a look at <file:Documentation/cpu-freq>.
 -
 -        If in doubt, say Y.
 -
 -config CPU_FREQ_PXA
 -      bool
 -      depends on CPU_FREQ && ARCH_PXA && PXA25x
 -      default y
 -      select CPU_FREQ_DEFAULT_GOV_USERSPACE
 -      select CPU_FREQ_TABLE
 -
  config CPU_FREQ_S3C
        bool
        help
index 2be254709dcbce9981d14da4a86fac35d54f6125,234e78f7014eda644326423b2aaad44d1c024abf..20358fb43450e7c4fbb6c1b126a350a49d91fb1b
@@@ -3,7 -3,6 +3,7 @@@ ifeq ($(CONFIG_OF),y
  # Keep at91 dtb files sorted alphabetically for each SoC
  # rm9200
  dtb-$(CONFIG_ARCH_AT91) += at91rm9200ek.dtb
 +dtb-$(CONFIG_ARCH_AT91) += mpa1600.dtb
  # sam9260
  dtb-$(CONFIG_ARCH_AT91) += animeo_ip.dtb
  dtb-$(CONFIG_ARCH_AT91) += aks-cdu.dtb
@@@ -27,12 -26,16 +27,17 @@@ dtb-$(CONFIG_ARCH_AT91) += pm9g45.dt
  # sam9n12
  dtb-$(CONFIG_ARCH_AT91) += at91sam9n12ek.dtb
  # sam9x5
 +dtb-$(CONFIG_ARCH_AT91) += at91-ariag25.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9g15ek.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9g25ek.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9g35ek.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9x25ek.dtb
  dtb-$(CONFIG_ARCH_AT91) += at91sam9x35ek.dtb
+ # sama5d3
+ dtb-$(CONFIG_ARCH_AT91)       += sama5d31ek.dtb
+ dtb-$(CONFIG_ARCH_AT91)       += sama5d33ek.dtb
+ dtb-$(CONFIG_ARCH_AT91)       += sama5d34ek.dtb
+ dtb-$(CONFIG_ARCH_AT91)       += sama5d35ek.dtb
  
  dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
  dtb-$(CONFIG_ARCH_BCM) += bcm11351-brt.dtb
@@@ -89,26 -92,19 +94,26 @@@ dtb-$(CONFIG_ARCH_MXC) += 
        imx25-karo-tx25.dtb \
        imx25-pdk.dtb \
        imx27-apf27.dtb \
 +      imx27-apf27dev.dtb \
        imx27-pdk.dtb \
 +      imx27-phytec-phycore.dtb \
        imx31-bug.dtb \
        imx51-apf51.dtb \
 +      imx51-apf51dev.dtb \
        imx51-babbage.dtb \
        imx53-ard.dtb \
        imx53-evk.dtb \
        imx53-mba53.dtb \
        imx53-qsb.dtb \
        imx53-smd.dtb \
 +      imx6dl-sabreauto.dtb \
 +      imx6dl-sabresd.dtb \
 +      imx6dl-wandboard.dtb \
        imx6q-arm2.dtb \
        imx6q-sabreauto.dtb \
        imx6q-sabrelite.dtb \
 -      imx6q-sabresd.dtb
 +      imx6q-sabresd.dtb \
 +      imx6q-sbc6x.dtb
  dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
        imx23-olinuxino.dtb \
        imx23-stmp378x_devb.dtb \
index 67f8670c4d6a2c16f714bbcf9154c21d7d8557a6,743ef42df23ee7d8dbe213be9863c5be18f1fd91..9bf49b3826eaf72dcf5cac5d56ac55e3462c9cf0
        };
  
        timer@2000004 {
-               compatible = "qcom,msm-gpt", "qcom,msm-timer";
-               interrupts = <1 1 0x301>;
-               reg = <0x02000004 0x10>;
-               clock-frequency = <32768>;
-               cpu-offset = <0x40000>;
-       };
-       timer@2000024 {
-               compatible = "qcom,msm-dgt", "qcom,msm-timer";
-               interrupts = <1 0 0x301>;
-               reg = <0x02000024 0x10>,
-                     <0x02000034 0x4>;
-               clock-frequency = <6750000>;
+               compatible = "qcom,scss-timer", "qcom,msm-timer";
+               interrupts = <1 0 0x301>,
+                            <1 1 0x301>,
+                            <1 2 0x301>;
+               reg = <0x02000000 0x100>;
+               clock-frequency = <27000000>,
+                                 <32768>;
                cpu-offset = <0x40000>;
        };
  
                      <0x19c00000 0x1000>;
                interrupts = <0 195 0x0>;
        };
 +
 +      qcom,ssbi@500000 {
 +              compatible = "qcom,ssbi";
 +              reg = <0x500000 0x1000>;
 +              qcom,controller-type = "pmic-arbiter";
 +      };
  };
index c9b09a813a4bca886bf18fb86e79b76a8bb3d4ae,3ae51fb02e17c75e9fa425ddc0cd9798cd4e1347..2e4d87a125d6a25b9582edd5c68c1e43a349f9cf
                      < 0x02002000 0x1000 >;
        };
  
-       timer@200a004 {
-               compatible = "qcom,msm-gpt", "qcom,msm-timer";
-               interrupts = <1 2 0x301>;
-               reg = <0x0200a004 0x10>;
-               clock-frequency = <32768>;
-               cpu-offset = <0x80000>;
-       };
-       timer@200a024 {
-               compatible = "qcom,msm-dgt", "qcom,msm-timer";
-               interrupts = <1 1 0x301>;
-               reg = <0x0200a024 0x10>,
-                     <0x0200a034 0x4>;
-               clock-frequency = <6750000>;
+       timer@200a000 {
+               compatible = "qcom,kpss-timer", "qcom,msm-timer";
+               interrupts = <1 1 0x301>,
+                            <1 2 0x301>,
+                            <1 3 0x301>;
+               reg = <0x0200a000 0x100>;
+               clock-frequency = <27000000>,
+                                 <32768>;
                cpu-offset = <0x80000>;
        };
  
                      <0x16400000 0x1000>;
                interrupts = <0 154 0x0>;
        };
 +
 +      qcom,ssbi@500000 {
 +              compatible = "qcom,ssbi";
 +              reg = <0x500000 0x1000>;
 +              qcom,controller-type = "pmic-arbiter";
 +      };
  };
index afa7249fac6e57d9ed6dc99e31863d493b2c500d,8fee514ee4b66082e9ed558d31d2f3d4c708028d..398a367ffce8539839c9cdf29c8a6238ba9d9d44
@@@ -1,4 -1,3 +1,3 @@@
- CONFIG_EXPERIMENTAL=y
  CONFIG_SYSVIPC=y
  CONFIG_NO_HZ=y
  CONFIG_HIGH_RES_TIMERS=y
@@@ -18,6 -17,7 +17,7 @@@ CONFIG_MODULE_UNLOAD=
  # CONFIG_BLK_DEV_BSG is not set
  CONFIG_PARTITION_ADVANCED=y
  CONFIG_ARCH_LPC32XX=y
+ CONFIG_GPIO_PCA953X=y
  CONFIG_KEYBOARD_GPIO_POLLED=y
  CONFIG_PREEMPT=y
  CONFIG_AEABI=y
@@@ -48,6 -48,8 +48,8 @@@ CONFIG_IPV6=
  CONFIG_IPV6_PRIVACY=y
  # CONFIG_WIRELESS is not set
  CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+ CONFIG_DEVTMPFS=y
+ CONFIG_DEVTMPFS_MOUNT=y
  # CONFIG_FW_LOADER is not set
  CONFIG_MTD=y
  CONFIG_MTD_CMDLINE_PARTS=y
@@@ -55,7 -57,6 +57,6 @@@ CONFIG_MTD_CHAR=
  CONFIG_MTD_BLOCK=y
  CONFIG_MTD_M25P80=y
  CONFIG_MTD_NAND=y
- CONFIG_MTD_NAND_MUSEUM_IDS=y
  CONFIG_MTD_NAND_SLC_LPC32XX=y
  CONFIG_MTD_NAND_MLC_LPC32XX=y
  CONFIG_BLK_DEV_LOOP=y
@@@ -70,7 -71,6 +71,6 @@@ CONFIG_BLK_DEV_SD=
  CONFIG_NETDEVICES=y
  CONFIG_MII=y
  # CONFIG_NET_VENDOR_BROADCOM is not set
- # CONFIG_NET_VENDOR_CHELSIO is not set
  # CONFIG_NET_VENDOR_CIRRUS is not set
  # CONFIG_NET_VENDOR_FARADAY is not set
  # CONFIG_NET_VENDOR_INTEL is not set
@@@ -84,7 -84,6 +84,6 @@@ CONFIG_LPC_ENET=
  # CONFIG_NET_VENDOR_STMICRO is not set
  CONFIG_SMSC_PHY=y
  # CONFIG_WLAN is not set
- CONFIG_INPUT_MATRIXKMAP=y
  # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
  CONFIG_INPUT_MOUSEDEV_SCREEN_X=240
  CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
@@@ -108,6 -107,19 +107,19 @@@ CONFIG_I2C_PNX=
  CONFIG_SPI=y
  CONFIG_SPI_PL022=y
  CONFIG_GPIO_SYSFS=y
+ CONFIG_GPIO_GENERIC_PLATFORM=y
+ CONFIG_GPIO_EM=y
+ CONFIG_GPIO_PL061=y
+ CONFIG_GPIO_MAX7300=y
+ CONFIG_GPIO_MAX732X=y
+ CONFIG_GPIO_PCF857X=y
+ CONFIG_GPIO_SX150X=y
+ CONFIG_GPIO_ADP5588=y
+ CONFIG_GPIO_ADNP=y
+ CONFIG_GPIO_MAX7301=y
+ CONFIG_GPIO_MCP23S08=y
+ CONFIG_GPIO_MC33880=y
+ CONFIG_GPIO_74X164=y
  CONFIG_SENSORS_DS620=y
  CONFIG_SENSORS_MAX6639=y
  CONFIG_WATCHDOG=y
@@@ -134,7 -146,6 +146,7 @@@ CONFIG_SND_DEBUG_VERBOSE=
  # CONFIG_SND_SPI is not set
  CONFIG_SND_SOC=y
  CONFIG_USB=y
 +CONFIG_USB_PHY=y
  CONFIG_USB_OHCI_HCD=y
  CONFIG_USB_STORAGE=y
  CONFIG_USB_GADGET=y
@@@ -144,6 -155,7 +156,7 @@@ CONFIG_USB_G_SERIAL=
  CONFIG_MMC=y
  # CONFIG_MMC_BLOCK_BOUNCE is not set
  CONFIG_MMC_ARMMMCI=y
+ CONFIG_MMC_SPI=y
  CONFIG_NEW_LEDS=y
  CONFIG_LEDS_CLASS=y
  CONFIG_LEDS_PCA9532=y
index 87924d671115928509d5bd360f1ea92a8c50acc6,e9b1f6d4be5d8c2057e2627fefc12d259a5052ca..7ba48d22bcd9e803280d77eae926ae33bdd07984
@@@ -75,7 -75,7 +75,7 @@@ CONFIG_REALTEK_PHY=
  CONFIG_MICREL_PHY=y
  # CONFIG_WLAN is not set
  # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
- CONFIG_INPUT_EVDEV=m
+ CONFIG_INPUT_EVDEV=y
  # CONFIG_INPUT_KEYBOARD is not set
  # CONFIG_INPUT_MOUSE is not set
  CONFIG_INPUT_TOUCHSCREEN=y
@@@ -99,6 -99,8 +99,8 @@@ CONFIG_SPI_MXS=
  CONFIG_DEBUG_GPIO=y
  CONFIG_GPIO_SYSFS=y
  # CONFIG_HWMON is not set
+ CONFIG_WATCHDOG=y
+ CONFIG_STMP3XXX_RTC_WATCHDOG=y
  CONFIG_REGULATOR=y
  CONFIG_REGULATOR_FIXED_VOLTAGE=y
  CONFIG_FB=y
@@@ -120,9 -122,9 +122,10 @@@ CONFIG_USB_EHCI_HCD=
  CONFIG_USB_CHIPIDEA=y
  CONFIG_USB_CHIPIDEA_HOST=y
  CONFIG_USB_STORAGE=y
 +CONFIG_USB_PHY=y
  CONFIG_USB_MXS_PHY=y
  CONFIG_MMC=y
+ CONFIG_MMC_UNSAFE_RESUME=y
  CONFIG_MMC_MXS=y
  CONFIG_NEW_LEDS=y
  CONFIG_LEDS_CLASS=y
index 36b05fc288162182613148bdbc859eed1fabf2a0,ccce7592dbd301082c12baedd2465eabd9827b5f..d193a409bc4519d291f71a4225c59e7e6cb0d60d
@@@ -212,7 -212,6 +212,7 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID("t2_clk", "fffa4000.timer", &tc5_clk),
        CLKDEV_CON_DEV_ID("mci_clk", "fffb4000.mmc", &mmc_clk),
        CLKDEV_CON_DEV_ID("emac_clk", "fffbc000.ethernet", &ether_clk),
 +      CLKDEV_CON_DEV_ID(NULL, "fffb8000.i2c", &twi_clk),
        CLKDEV_CON_DEV_ID("hclk", "300000.ohci", &ohci_clk),
        CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioA_clk),
        CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk),
@@@ -385,7 -384,7 +385,7 @@@ static unsigned int at91rm9200_default_
        0       /* Advanced Interrupt Controller (IRQ6) */
  };
  
- AT91_SOC_START(rm9200)
+ AT91_SOC_START(at91rm9200)
        .map_io = at91rm9200_map_io,
        .default_irq_priority = at91rm9200_default_irq_priority,
        .ioremap_registers = at91rm9200_ioremap_registers,
index 44199bc2c6657003f32fd459f76548a50b449662,1833b4c365df5fd760a1027b1a40ca3d8774b71e..a8ce24538da62ea8c5dd9fa1d89a2214508ae996
@@@ -232,8 -232,6 +232,8 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID("t2_clk", "fffdc000.timer", &tc5_clk),
        CLKDEV_CON_DEV_ID("hclk", "500000.ohci", &ohci_clk),
        CLKDEV_CON_DEV_ID("mci_clk", "fffa8000.mmc", &mmc_clk),
 +      CLKDEV_CON_DEV_ID("spi_clk", "fffc8000.spi", &spi0_clk),
 +      CLKDEV_CON_DEV_ID("spi_clk", "fffcc000.spi", &spi1_clk),
        /* fake hclk clock */
        CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
        CLKDEV_CON_ID("pioA", &pioA_clk),
@@@ -397,7 -395,7 +397,7 @@@ static unsigned int at91sam9260_default
        0,      /* Advanced Interrupt Controller */
  };
  
- AT91_SOC_START(sam9260)
+ AT91_SOC_START(at91sam9260)
        .map_io = at91sam9260_map_io,
        .default_irq_priority = at91sam9260_default_irq_priority,
        .ioremap_registers = at91sam9260_ioremap_registers,
index 2ec5efea3f031ed0e947a150185c340f3dd72b0a,4fcbe7b5b58deae7b4780ed310d7e9fdb37160a1..a6c224fc9542a26c4a7a50508bf0331682ddbd91
@@@ -262,8 -262,6 +262,8 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID("mci_clk", "fffd0000.mmc", &mmc1_clk),
        CLKDEV_CON_DEV_ID(NULL, "fff84000.i2c", &twi0_clk),
        CLKDEV_CON_DEV_ID(NULL, "fff88000.i2c", &twi1_clk),
 +      CLKDEV_CON_DEV_ID("spi_clk", "fffa4000.spi", &spi0_clk),
 +      CLKDEV_CON_DEV_ID("spi_clk", "fffa8000.spi", &spi1_clk),
        /* fake hclk clock */
        CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk),
        CLKDEV_CON_DEV_ID(NULL, "fffff200.gpio", &pioA_clk),
@@@ -420,7 -418,7 +420,7 @@@ static unsigned int at91sam9g45_default
        0,      /* Advanced Interrupt Controller (IRQ0) */
  };
  
- AT91_SOC_START(sam9g45)
+ AT91_SOC_START(at91sam9g45)
        .map_io = at91sam9g45_map_io,
        .default_irq_priority = at91sam9g45_default_irq_priority,
        .ioremap_registers = at91sam9g45_ioremap_registers,
index ccd078355eed0772f7a7330ba8329b3fe7bcdec3,2c7a2f4a75687dcad375770d6d809b5880a45ba1..13cdbcd48f51eca105add53d8a674a2ea0e5fa45
@@@ -172,8 -172,6 +172,8 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma_clk),
        CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk),
        CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk),
 +      CLKDEV_CON_DEV_ID("spi_clk", "f0000000.spi", &spi0_clk),
 +      CLKDEV_CON_DEV_ID("spi_clk", "f0004000.spi", &spi1_clk),
        CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioAB_clk),
        CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioAB_clk),
        CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioCD_clk),
@@@ -228,7 -226,7 +228,7 @@@ void __init at91sam9n12_initialize(void
        at91_extern_irq = (1 << AT91SAM9N12_ID_IRQ0);
  }
  
- AT91_SOC_START(sam9n12)
+ AT91_SOC_START(at91sam9n12)
        .map_io = at91sam9n12_map_io,
        .register_clocks = at91sam9n12_register_clocks,
        .init = at91sam9n12_initialize,
index a200d8a17123ac9bdb41b18b82f0e63fd9b02317,3a1a7993c125df9072a19d5240652d42d127cf7e..e631fec040ce069390cd916a8ed0e185537d2dc4
@@@ -237,8 -237,6 +237,8 @@@ static struct clk_lookup periph_clocks_
        CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk),
        CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk),
        CLKDEV_CON_DEV_ID(NULL, "f8018000.i2c", &twi2_clk),
 +      CLKDEV_CON_DEV_ID("spi_clk", "f0000000.spi", &spi0_clk),
 +      CLKDEV_CON_DEV_ID("spi_clk", "f0004000.spi", &spi1_clk),
        CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioAB_clk),
        CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioAB_clk),
        CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioCD_clk),
@@@ -322,7 -320,7 +322,7 @@@ static void __init at91sam9x5_map_io(vo
   *  Interrupt initialization
   * -------------------------------------------------------------------- */
  
- AT91_SOC_START(sam9x5)
+ AT91_SOC_START(at91sam9x5)
        .map_io = at91sam9x5_map_io,
        .register_clocks = at91sam9x5_register_clocks,
  AT91_SOC_END
index 9e7c1e1528e52ac85b3ce231bdcb0870deebb05c,2ecd1693c804f68ccca3c09ec4dda6dffcf23d00..e8491e77b1f78629d87ba4383483a31700939239
@@@ -151,6 -151,11 +151,11 @@@ static void __init soc_detect(u32 dbgu_
                at91_soc_initdata.type = AT91_SOC_SAM9N12;
                at91_boot_soc = at91sam9n12_soc;
                break;
+       case ARCH_ID_SAMA5D3:
+               at91_soc_initdata.type = AT91_SOC_SAMA5D3;
+               at91_boot_soc = sama5d3_soc;
+               break;
        }
  
        /* at91sam9g10 */
                        break;
                }
        }
+       if (at91_soc_initdata.type == AT91_SOC_SAMA5D3) {
+               switch (at91_soc_initdata.exid) {
+               case ARCH_EXID_SAMA5D31:
+                       at91_soc_initdata.subtype = AT91_SOC_SAMA5D31;
+                       break;
+               case ARCH_EXID_SAMA5D33:
+                       at91_soc_initdata.subtype = AT91_SOC_SAMA5D33;
+                       break;
+               case ARCH_EXID_SAMA5D34:
+                       at91_soc_initdata.subtype = AT91_SOC_SAMA5D34;
+                       break;
+               case ARCH_EXID_SAMA5D35:
+                       at91_soc_initdata.subtype = AT91_SOC_SAMA5D35;
+                       break;
+               }
+       }
  }
  
  static const char *soc_name[] = {
        [AT91_SOC_SAM9RL]       = "at91sam9rl",
        [AT91_SOC_SAM9X5]       = "at91sam9x5",
        [AT91_SOC_SAM9N12]      = "at91sam9n12",
+       [AT91_SOC_SAMA5D3]      = "sama5d3",
        [AT91_SOC_NONE]         = "Unknown"
  };
  
@@@ -241,6 -264,10 +264,10 @@@ static const char *soc_subtype_name[] 
        [AT91_SOC_SAM9X35]      = "at91sam9x35",
        [AT91_SOC_SAM9G25]      = "at91sam9g25",
        [AT91_SOC_SAM9X25]      = "at91sam9x25",
+       [AT91_SOC_SAMA5D31]     = "sama5d31",
+       [AT91_SOC_SAMA5D33]     = "sama5d33",
+       [AT91_SOC_SAMA5D34]     = "sama5d34",
+       [AT91_SOC_SAMA5D35]     = "sama5d35",
        [AT91_SOC_SUBTYPE_NONE] = "Unknown"
  };
  
@@@ -333,7 -360,7 +360,7 @@@ static void at91_dt_rstc(void
  
        of_id = of_match_node(rstc_ids, np);
        if (!of_id)
 -              panic("AT91: rtsc no restart function availlable\n");
 +              panic("AT91: rtsc no restart function available\n");
  
        arm_pm_restart = of_id->data;
  
@@@ -353,7 -380,7 +380,7 @@@ static void at91_dt_ramc(void
  
        np = of_find_matching_node(NULL, ramc_ids);
        if (!np)
 -              panic("unable to find compatible ram conroller node in dtb\n");
 +              panic("unable to find compatible ram controller node in dtb\n");
  
        at91_ramc_base[0] = of_iomap(np, 0);
        if (!at91_ramc_base[0])
@@@ -403,7 -430,7 +430,7 @@@ static void at91_dt_shdwc(void
  
        np = of_find_matching_node(NULL, shdwc_ids);
        if (!np) {
 -              pr_debug("AT91: unable to find compatible shutdown (shdwc) conroller node in dtb\n");
 +              pr_debug("AT91: unable to find compatible shutdown (shdwc) controller node in dtb\n");
                return;
        }
  
  
        if (!of_property_read_u32(np, "atmel,wakeup-counter", &reg)) {
                if (reg > AT91_SHDW_CPTWK0_MAX) {
 -                      pr_warn("AT91: shdwc wakeup conter 0x%x > 0x%x reduce it to 0x%x\n",
 +                      pr_warn("AT91: shdwc wakeup counter 0x%x > 0x%x reduce it to 0x%x\n",
                                reg, AT91_SHDW_CPTWK0_MAX, AT91_SHDW_CPTWK0_MAX);
                        reg = AT91_SHDW_CPTWK0_MAX;
                }
index 886481c12173c7d8edbf974eebde08ad6fe4c2cf,bfdf8b979a64d1e0219738a2a020bb5f0b6527a3..c2a0a67d09e011446a60d8de0e913459f6139d86
@@@ -242,73 -242,6 +242,73 @@@ static struct vpfe_config vpfe_cfg = 
        .ccdc = "DM355 CCDC",
  };
  
 +/* venc standards timings */
 +static struct vpbe_enc_mode_info dm355evm_enc_preset_timing[] = {
 +      {
 +              .name           = "ntsc",
 +              .timings_type   = VPBE_ENC_STD,
 +              .std_id         = V4L2_STD_NTSC,
 +              .interlaced     = 1,
 +              .xres           = 720,
 +              .yres           = 480,
 +              .aspect         = {11, 10},
 +              .fps            = {30000, 1001},
 +              .left_margin    = 0x79,
 +              .upper_margin   = 0x10,
 +      },
 +      {
 +              .name           = "pal",
 +              .timings_type   = VPBE_ENC_STD,
 +              .std_id         = V4L2_STD_PAL,
 +              .interlaced     = 1,
 +              .xres           = 720,
 +              .yres           = 576,
 +              .aspect         = {54, 59},
 +              .fps            = {25, 1},
 +              .left_margin    = 0x7E,
 +              .upper_margin   = 0x16
 +      },
 +};
 +
 +#define VENC_STD_ALL  (V4L2_STD_NTSC | V4L2_STD_PAL)
 +
 +/*
 + * The outputs available from VPBE + ecnoders. Keep the
 + * the order same as that of encoders. First those from venc followed by that
 + * from encoders. Index in the output refers to index on a particular encoder.
 + * Driver uses this index to pass it to encoder when it supports more than
 + * one output. Application uses index of the array to set an output.
 + */
 +static struct vpbe_output dm355evm_vpbe_outputs[] = {
 +      {
 +              .output         = {
 +                      .index          = 0,
 +                      .name           = "Composite",
 +                      .type           = V4L2_OUTPUT_TYPE_ANALOG,
 +                      .std            = VENC_STD_ALL,
 +                      .capabilities   = V4L2_OUT_CAP_STD,
 +              },
 +              .subdev_name    = DM355_VPBE_VENC_SUBDEV_NAME,
 +              .default_mode   = "ntsc",
 +              .num_modes      = ARRAY_SIZE(dm355evm_enc_preset_timing),
 +              .modes          = dm355evm_enc_preset_timing,
 +              .if_params      = V4L2_MBUS_FMT_FIXED,
 +      },
 +};
 +
 +static struct vpbe_config dm355evm_display_cfg = {
 +      .module_name    = "dm355-vpbe-display",
 +      .i2c_adapter_id = 1,
 +      .osd            = {
 +              .module_name    = DM355_VPBE_OSD_SUBDEV_NAME,
 +      },
 +      .venc           = {
 +              .module_name    = DM355_VPBE_VENC_SUBDEV_NAME,
 +      },
 +      .num_outputs    = ARRAY_SIZE(dm355evm_vpbe_outputs),
 +      .outputs        = dm355evm_vpbe_outputs,
 +};
 +
  static struct platform_device *davinci_evm_devices[] __initdata = {
        &dm355evm_dm9000,
        &davinci_nand_device,
@@@ -320,6 -253,8 +320,6 @@@ static struct davinci_uart_config uart_
  
  static void __init dm355_evm_map_io(void)
  {
 -      /* setup input configuration for VPFE input devices */
 -      dm355_set_vpfe_config(&vpfe_cfg);
        dm355_init();
  }
  
@@@ -345,7 -280,6 +345,6 @@@ static struct davinci_mmc_config dm355e
        .wires          = 4,
        .max_freq       = 50000000,
        .caps           = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
-       .version        = MMC_CTLR_VERSION_1,
  };
  
  /* Don't connect anything to J10 unless you're only using USB host
@@@ -409,8 -343,6 +408,8 @@@ static __init void dm355_evm_init(void
        davinci_setup_mmc(0, &dm355evm_mmc_config);
        davinci_setup_mmc(1, &dm355evm_mmc_config);
  
 +      dm355_init_video(&vpfe_cfg, &dm355evm_display_cfg);
 +
        dm355_init_spi0(BIT(0), dm355_evm_spi_info,
                        ARRAY_SIZE(dm355_evm_spi_info));
  
index 2a6674356585f47ea4e2cc8e38d582589d045e02,4cfdd9109e19fe362252f83d21bcf1595b131aee..fd38c8d22e3cd88393dc97ad85c86e4e31de9922
@@@ -27,7 -27,6 +27,7 @@@
  #include <linux/input.h>
  #include <linux/spi/spi.h>
  #include <linux/spi/eeprom.h>
 +#include <linux/v4l2-dv-timings.h>
  
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
@@@ -40,7 -39,6 +40,7 @@@
  #include <linux/platform_data/mtd-davinci.h>
  #include <linux/platform_data/keyscan-davinci.h>
  
 +#include <media/ths7303.h>
  #include <media/tvp514x.h>
  
  #include "davinci.h"
@@@ -255,7 -253,6 +255,6 @@@ static struct davinci_mmc_config dm365e
        .wires          = 4,
        .max_freq       = 50000000,
        .caps           = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
-       .version        = MMC_CTLR_VERSION_2,
  };
  
  static void dm365evm_emac_configure(void)
@@@ -376,166 -373,6 +375,166 @@@ static struct vpfe_config vpfe_cfg = 
        .ccdc = "ISIF",
  };
  
 +/* venc standards timings */
 +static struct vpbe_enc_mode_info dm365evm_enc_std_timing[] = {
 +      {
 +              .name           = "ntsc",
 +              .timings_type   = VPBE_ENC_STD,
 +              .std_id         = V4L2_STD_NTSC,
 +              .interlaced     = 1,
 +              .xres           = 720,
 +              .yres           = 480,
 +              .aspect         = {11, 10},
 +              .fps            = {30000, 1001},
 +              .left_margin    = 0x79,
 +              .upper_margin   = 0x10,
 +      },
 +      {
 +              .name           = "pal",
 +              .timings_type   = VPBE_ENC_STD,
 +              .std_id         = V4L2_STD_PAL,
 +              .interlaced     = 1,
 +              .xres           = 720,
 +              .yres           = 576,
 +              .aspect         = {54, 59},
 +              .fps            = {25, 1},
 +              .left_margin    = 0x7E,
 +              .upper_margin   = 0x16,
 +      },
 +};
 +
 +/* venc dv timings */
 +static struct vpbe_enc_mode_info dm365evm_enc_preset_timing[] = {
 +      {
 +              .name           = "480p59_94",
 +              .timings_type   = VPBE_ENC_DV_TIMINGS,
 +              .dv_timings     = V4L2_DV_BT_CEA_720X480P59_94,
 +              .interlaced     = 0,
 +              .xres           = 720,
 +              .yres           = 480,
 +              .aspect         = {1, 1},
 +              .fps            = {5994, 100},
 +              .left_margin    = 0x8F,
 +              .upper_margin   = 0x2D,
 +      },
 +      {
 +              .name           = "576p50",
 +              .timings_type   = VPBE_ENC_DV_TIMINGS,
 +              .dv_timings     = V4L2_DV_BT_CEA_720X576P50,
 +              .interlaced     = 0,
 +              .xres           = 720,
 +              .yres           = 576,
 +              .aspect         = {1, 1},
 +              .fps            = {50, 1},
 +              .left_margin    = 0x8C,
 +              .upper_margin   = 0x36,
 +      },
 +      {
 +              .name           = "720p60",
 +              .timings_type   = VPBE_ENC_DV_TIMINGS,
 +              .dv_timings     = V4L2_DV_BT_CEA_1280X720P60,
 +              .interlaced     = 0,
 +              .xres           = 1280,
 +              .yres           = 720,
 +              .aspect         = {1, 1},
 +              .fps            = {60, 1},
 +              .left_margin    = 0x117,
 +              .right_margin   = 70,
 +              .upper_margin   = 38,
 +              .lower_margin   = 3,
 +              .hsync_len      = 80,
 +              .vsync_len      = 5,
 +      },
 +      {
 +              .name           = "1080i60",
 +              .timings_type   = VPBE_ENC_DV_TIMINGS,
 +              .dv_timings     = V4L2_DV_BT_CEA_1920X1080I60,
 +              .interlaced     = 1,
 +              .xres           = 1920,
 +              .yres           = 1080,
 +              .aspect         = {1, 1},
 +              .fps            = {30, 1},
 +              .left_margin    = 0xc9,
 +              .right_margin   = 80,
 +              .upper_margin   = 30,
 +              .lower_margin   = 3,
 +              .hsync_len      = 88,
 +              .vsync_len      = 5,
 +      },
 +};
 +
 +#define VENC_STD_ALL  (V4L2_STD_NTSC | V4L2_STD_PAL)
 +
 +/*
 + * The outputs available from VPBE + ecnoders. Keep the
 + * the order same as that of encoders. First those from venc followed by that
 + * from encoders. Index in the output refers to index on a particular
 + * encoder.Driver uses this index to pass it to encoder when it supports more
 + * than one output. Application uses index of the array to set an output.
 + */
 +static struct vpbe_output dm365evm_vpbe_outputs[] = {
 +      {
 +              .output         = {
 +                      .index          = 0,
 +                      .name           = "Composite",
 +                      .type           = V4L2_OUTPUT_TYPE_ANALOG,
 +                      .std            = VENC_STD_ALL,
 +                      .capabilities   = V4L2_OUT_CAP_STD,
 +              },
 +              .subdev_name    = DM365_VPBE_VENC_SUBDEV_NAME,
 +              .default_mode   = "ntsc",
 +              .num_modes      = ARRAY_SIZE(dm365evm_enc_std_timing),
 +              .modes          = dm365evm_enc_std_timing,
 +              .if_params      = V4L2_MBUS_FMT_FIXED,
 +      },
 +      {
 +              .output         = {
 +                      .index          = 1,
 +                      .name           = "Component",
 +                      .type           = V4L2_OUTPUT_TYPE_ANALOG,
 +                      .capabilities   = V4L2_OUT_CAP_DV_TIMINGS,
 +              },
 +              .subdev_name    = DM365_VPBE_VENC_SUBDEV_NAME,
 +              .default_mode   = "480p59_94",
 +              .num_modes      = ARRAY_SIZE(dm365evm_enc_preset_timing),
 +              .modes          = dm365evm_enc_preset_timing,
 +              .if_params      = V4L2_MBUS_FMT_FIXED,
 +      },
 +};
 +
 +/*
 + * Amplifiers on the board
 + */
 +struct ths7303_platform_data ths7303_pdata = {
 +      .ch_1 = 3,
 +      .ch_2 = 3,
 +      .ch_3 = 3,
 +      .init_enable = 1,
 +};
 +
 +static struct amp_config_info vpbe_amp = {
 +      .module_name    = "ths7303",
 +      .is_i2c         = 1,
 +      .board_info     = {
 +              I2C_BOARD_INFO("ths7303", 0x2c),
 +              .platform_data = &ths7303_pdata,
 +      }
 +};
 +
 +static struct vpbe_config dm365evm_display_cfg = {
 +      .module_name    = "dm365-vpbe-display",
 +      .i2c_adapter_id = 1,
 +      .amp            = &vpbe_amp,
 +      .osd            = {
 +              .module_name    = DM365_VPBE_OSD_SUBDEV_NAME,
 +      },
 +      .venc           = {
 +              .module_name    = DM365_VPBE_VENC_SUBDEV_NAME,
 +      },
 +      .num_outputs    = ARRAY_SIZE(dm365evm_vpbe_outputs),
 +      .outputs        = dm365evm_vpbe_outputs,
 +};
 +
  static void __init evm_init_i2c(void)
  {
        davinci_init_i2c(&i2c_pdata);
@@@ -726,6 -563,8 +725,6 @@@ static struct davinci_uart_config uart_
  
  static void __init dm365_evm_map_io(void)
  {
 -      /* setup input configuration for VPFE input devices */
 -      dm365_set_vpfe_config(&vpfe_cfg);
        dm365_init();
  }
  
@@@ -757,8 -596,6 +756,8 @@@ static __init void dm365_evm_init(void
  
        davinci_setup_mmc(0, &dm365evm_mmc_config);
  
 +      dm365_init_video(&vpfe_cfg, &dm365evm_display_cfg);
 +
        /* maybe setup mmc1/etc ... _after_ mmc0 */
        evm_init_cpld();
  
index 745280d4144ca7b447ec0c614cc766777fefd9cc,c0206d5f2bf6e54c4760375daf4e763e6de0ba6a..e62108fd7926f0da8f636d5513b0c911de73f51e
@@@ -570,7 -570,6 +570,6 @@@ static struct davinci_mmc_config dm6446
        .get_cd         = dm6444evm_mmc_get_cd,
        .get_ro         = dm6444evm_mmc_get_ro,
        .wires          = 4,
-       .version        = MMC_CTLR_VERSION_1
  };
  
  static struct i2c_board_info __initdata i2c_info[] =  {
@@@ -622,7 -621,7 +621,7 @@@ static struct vpbe_enc_mode_info dm644x
        {
                .name           = "ntsc",
                .timings_type   = VPBE_ENC_STD,
 -              .std_id         = V4L2_STD_525_60,
 +              .std_id         = V4L2_STD_NTSC,
                .interlaced     = 1,
                .xres           = 720,
                .yres           = 480,
        {
                .name           = "pal",
                .timings_type   = VPBE_ENC_STD,
 -              .std_id         = V4L2_STD_625_50,
 +              .std_id         = V4L2_STD_PAL,
                .interlaced     = 1,
                .xres           = 720,
                .yres           = 576,
  static struct vpbe_enc_mode_info dm644xevm_enc_preset_timing[] = {
        {
                .name           = "480p59_94",
 -              .timings_type   = VPBE_ENC_CUSTOM_TIMINGS,
 +              .timings_type   = VPBE_ENC_DV_TIMINGS,
                .dv_timings     = V4L2_DV_BT_CEA_720X480P59_94,
                .interlaced     = 0,
                .xres           = 720,
        },
        {
                .name           = "576p50",
 -              .timings_type   = VPBE_ENC_CUSTOM_TIMINGS,
 +              .timings_type   = VPBE_ENC_DV_TIMINGS,
                .dv_timings     = V4L2_DV_BT_CEA_720X576P50,
                .interlaced     = 0,
                .xres           = 720,
index bf9a9d4ad9f5ec425edd00704aaa1ad2ad408c23,87e6104f45e657eaec9026d22120aba25de93b7b..a11034a358f19977131f96645fbaa558e51d4712
@@@ -35,8 -35,6 +35,8 @@@
  #include "asp.h"
  
  #define DM355_UART2_BASE      (IO_PHYS + 0x206000)
 +#define DM355_OSD_BASE                (IO_PHYS + 0x70200)
 +#define DM355_VENC_BASE               (IO_PHYS + 0x70400)
  
  /*
   * Device specific clocks
@@@ -347,8 -345,8 +347,8 @@@ static struct clk_lookup dm355_clks[] 
        CLK(NULL, "pll1_aux", &pll1_aux_clk),
        CLK(NULL, "pll1_sysclkbp", &pll1_sysclkbp),
        CLK(NULL, "vpss_dac", &vpss_dac_clk),
 -      CLK(NULL, "vpss_master", &vpss_master_clk),
 -      CLK(NULL, "vpss_slave", &vpss_slave_clk),
 +      CLK("vpss", "master", &vpss_master_clk),
 +      CLK("vpss", "slave", &vpss_slave_clk),
        CLK(NULL, "clkout1", &clkout1_clk),
        CLK(NULL, "clkout2", &clkout2_clk),
        CLK(NULL, "pll2", &pll2_clk),
        CLK("i2c_davinci.1", NULL, &i2c_clk),
        CLK("davinci-mcbsp.0", NULL, &asp0_clk),
        CLK("davinci-mcbsp.1", NULL, &asp1_clk),
-       CLK("davinci_mmc.0", NULL, &mmcsd0_clk),
-       CLK("davinci_mmc.1", NULL, &mmcsd1_clk),
+       CLK("dm6441-mmc.0", NULL, &mmcsd0_clk),
+       CLK("dm6441-mmc.1", NULL, &mmcsd1_clk),
        CLK("spi_davinci.0", NULL, &spi0_clk),
        CLK("spi_davinci.1", NULL, &spi1_clk),
        CLK("spi_davinci.2", NULL, &spi2_clk),
@@@ -746,146 -744,11 +746,146 @@@ static struct platform_device vpfe_capt
        },
  };
  
 -void dm355_set_vpfe_config(struct vpfe_config *cfg)
 +static struct resource dm355_osd_resources[] = {
 +      {
 +              .start  = DM355_OSD_BASE,
 +              .end    = DM355_OSD_BASE + 0x17f,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +};
 +
 +static struct platform_device dm355_osd_dev = {
 +      .name           = DM355_VPBE_OSD_SUBDEV_NAME,
 +      .id             = -1,
 +      .num_resources  = ARRAY_SIZE(dm355_osd_resources),
 +      .resource       = dm355_osd_resources,
 +      .dev            = {
 +              .dma_mask               = &vpfe_capture_dma_mask,
 +              .coherent_dma_mask      = DMA_BIT_MASK(32),
 +      },
 +};
 +
 +static struct resource dm355_venc_resources[] = {
 +      {
 +              .start  = IRQ_VENCINT,
 +              .end    = IRQ_VENCINT,
 +              .flags  = IORESOURCE_IRQ,
 +      },
 +      /* venc registers io space */
 +      {
 +              .start  = DM355_VENC_BASE,
 +              .end    = DM355_VENC_BASE + 0x17f,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      /* VDAC config register io space */
 +      {
 +              .start  = DAVINCI_SYSTEM_MODULE_BASE + SYSMOD_VDAC_CONFIG,
 +              .end    = DAVINCI_SYSTEM_MODULE_BASE + SYSMOD_VDAC_CONFIG + 3,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +};
 +
 +static struct resource dm355_v4l2_disp_resources[] = {
 +      {
 +              .start  = IRQ_VENCINT,
 +              .end    = IRQ_VENCINT,
 +              .flags  = IORESOURCE_IRQ,
 +      },
 +      /* venc registers io space */
 +      {
 +              .start  = DM355_VENC_BASE,
 +              .end    = DM355_VENC_BASE + 0x17f,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +};
 +
 +static int dm355_vpbe_setup_pinmux(enum v4l2_mbus_pixelcode if_type,
 +                          int field)
 +{
 +      switch (if_type) {
 +      case V4L2_MBUS_FMT_SGRBG8_1X8:
 +              davinci_cfg_reg(DM355_VOUT_FIELD_G70);
 +              break;
 +      case V4L2_MBUS_FMT_YUYV10_1X20:
 +              if (field)
 +                      davinci_cfg_reg(DM355_VOUT_FIELD);
 +              else
 +                      davinci_cfg_reg(DM355_VOUT_FIELD_G70);
 +              break;
 +      default:
 +              return -EINVAL;
 +      }
 +
 +      davinci_cfg_reg(DM355_VOUT_COUTL_EN);
 +      davinci_cfg_reg(DM355_VOUT_COUTH_EN);
 +
 +      return 0;
 +}
 +
 +static int dm355_venc_setup_clock(enum vpbe_enc_timings_type type,
 +                                 unsigned int pclock)
  {
 -      vpfe_capture_dev.dev.platform_data = cfg;
 +      void __iomem *vpss_clk_ctrl_reg;
 +
 +      vpss_clk_ctrl_reg = DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL);
 +
 +      switch (type) {
 +      case VPBE_ENC_STD:
 +              writel(VPSS_DACCLKEN_ENABLE | VPSS_VENCCLKEN_ENABLE,
 +                     vpss_clk_ctrl_reg);
 +              break;
 +      case VPBE_ENC_DV_TIMINGS:
 +              if (pclock > 27000000)
 +                      /*
 +                       * For HD, use external clock source since we cannot
 +                       * support HD mode with internal clocks.
 +                       */
 +                      writel(VPSS_MUXSEL_EXTCLK_ENABLE, vpss_clk_ctrl_reg);
 +              break;
 +      default:
 +              return -EINVAL;
 +      }
 +
 +      return 0;
  }
  
 +static struct platform_device dm355_vpbe_display = {
 +      .name           = "vpbe-v4l2",
 +      .id             = -1,
 +      .num_resources  = ARRAY_SIZE(dm355_v4l2_disp_resources),
 +      .resource       = dm355_v4l2_disp_resources,
 +      .dev            = {
 +              .dma_mask               = &vpfe_capture_dma_mask,
 +              .coherent_dma_mask      = DMA_BIT_MASK(32),
 +      },
 +};
 +
 +struct venc_platform_data dm355_venc_pdata = {
 +      .setup_pinmux   = dm355_vpbe_setup_pinmux,
 +      .setup_clock    = dm355_venc_setup_clock,
 +};
 +
 +static struct platform_device dm355_venc_dev = {
 +      .name           = DM355_VPBE_VENC_SUBDEV_NAME,
 +      .id             = -1,
 +      .num_resources  = ARRAY_SIZE(dm355_venc_resources),
 +      .resource       = dm355_venc_resources,
 +      .dev            = {
 +              .dma_mask               = &vpfe_capture_dma_mask,
 +              .coherent_dma_mask      = DMA_BIT_MASK(32),
 +              .platform_data          = (void *)&dm355_venc_pdata,
 +      },
 +};
 +
 +static struct platform_device dm355_vpbe_dev = {
 +      .name           = "vpbe_controller",
 +      .id             = -1,
 +      .dev            = {
 +              .dma_mask               = &vpfe_capture_dma_mask,
 +              .coherent_dma_mask      = DMA_BIT_MASK(32),
 +      },
 +};
 +
  /*----------------------------------------------------------------------*/
  
  static struct map_desc dm355_io_desc[] = {
@@@ -1005,36 -868,19 +1005,36 @@@ void __init dm355_init(void
        davinci_map_sysmod();
  }
  
 +int __init dm355_init_video(struct vpfe_config *vpfe_cfg,
 +                              struct vpbe_config *vpbe_cfg)
 +{
 +      if (vpfe_cfg || vpbe_cfg)
 +              platform_device_register(&dm355_vpss_device);
 +
 +      if (vpfe_cfg) {
 +              vpfe_capture_dev.dev.platform_data = vpfe_cfg;
 +              platform_device_register(&dm355_ccdc_dev);
 +              platform_device_register(&vpfe_capture_dev);
 +      }
 +
 +      if (vpbe_cfg) {
 +              dm355_vpbe_dev.dev.platform_data = vpbe_cfg;
 +              platform_device_register(&dm355_osd_dev);
 +              platform_device_register(&dm355_venc_dev);
 +              platform_device_register(&dm355_vpbe_dev);
 +              platform_device_register(&dm355_vpbe_display);
 +      }
 +
 +      return 0;
 +}
 +
  static int __init dm355_init_devices(void)
  {
        if (!cpu_is_davinci_dm355())
                return 0;
  
 -      /* Add ccdc clock aliases */
 -      clk_add_alias("master", dm355_ccdc_dev.name, "vpss_master", NULL);
 -      clk_add_alias("slave", dm355_ccdc_dev.name, "vpss_master", NULL);
        davinci_cfg_reg(DM355_INT_EDMA_CC);
        platform_device_register(&dm355_edma_device);
 -      platform_device_register(&dm355_vpss_device);
 -      platform_device_register(&dm355_ccdc_dev);
 -      platform_device_register(&vpfe_capture_dev);
  
        return 0;
  }
index ff771ceac3f16e562a9b1d45290c5bd80e571724,2791df9187b3f8acfd18ead5ad3e238ad8d9414d..40fa4fee93313b578f06d0c16b8a32c726ccee45
  #include "asp.h"
  
  #define DM365_REF_FREQ                24000000        /* 24 MHz on the DM365 EVM */
 -
 -/* Base of key scan register bank */
 -#define DM365_KEYSCAN_BASE            0x01c69400
 -
  #define DM365_RTC_BASE                        0x01c69000
 -
 +#define DM365_KEYSCAN_BASE            0x01c69400
 +#define DM365_OSD_BASE                        0x01c71c00
 +#define DM365_VENC_BASE                       0x01c71e00
  #define DAVINCI_DM365_VC_BASE         0x01d0c000
  #define DAVINCI_DMA_VC_TX             2
  #define DAVINCI_DMA_VC_RX             3
 -
  #define DM365_EMAC_BASE                       0x01d07000
  #define DM365_EMAC_MDIO_BASE          (DM365_EMAC_BASE + 0x4000)
  #define DM365_EMAC_CNTRL_OFFSET               0x0000
@@@ -254,12 -257,6 +254,12 @@@ static struct clk vpss_master_clk = 
        .flags          = CLK_PSC,
  };
  
 +static struct clk vpss_slave_clk = {
 +      .name           = "vpss_slave",
 +      .parent         = &pll1_sysclk5,
 +      .lpsc           = DAVINCI_LPSC_VPSSSLV,
 +};
 +
  static struct clk arm_clk = {
        .name           = "arm_clk",
        .parent         = &pll2_sysclk2,
@@@ -452,14 -449,13 +452,14 @@@ static struct clk_lookup dm365_clks[] 
        CLK(NULL, "pll2_sysclk8", &pll2_sysclk8),
        CLK(NULL, "pll2_sysclk9", &pll2_sysclk9),
        CLK(NULL, "vpss_dac", &vpss_dac_clk),
 -      CLK(NULL, "vpss_master", &vpss_master_clk),
 +      CLK("vpss", "master", &vpss_master_clk),
 +      CLK("vpss", "slave", &vpss_slave_clk),
        CLK(NULL, "arm", &arm_clk),
        CLK(NULL, "uart0", &uart0_clk),
        CLK(NULL, "uart1", &uart1_clk),
        CLK("i2c_davinci.1", NULL, &i2c_clk),
-       CLK("davinci_mmc.0", NULL, &mmcsd0_clk),
-       CLK("davinci_mmc.1", NULL, &mmcsd1_clk),
+       CLK("da830-mmc.0", NULL, &mmcsd0_clk),
+       CLK("da830-mmc.1", NULL, &mmcsd1_clk),
        CLK("spi_davinci.0", NULL, &spi0_clk),
        CLK("spi_davinci.1", NULL, &spi1_clk),
        CLK("spi_davinci.2", NULL, &spi2_clk),
@@@ -1230,173 -1226,6 +1230,173 @@@ static struct platform_device dm365_isi
        },
  };
  
 +static struct resource dm365_osd_resources[] = {
 +      {
 +              .start = DM365_OSD_BASE,
 +              .end   = DM365_OSD_BASE + 0xff,
 +              .flags = IORESOURCE_MEM,
 +      },
 +};
 +
 +static u64 dm365_video_dma_mask = DMA_BIT_MASK(32);
 +
 +static struct platform_device dm365_osd_dev = {
 +      .name           = DM365_VPBE_OSD_SUBDEV_NAME,
 +      .id             = -1,
 +      .num_resources  = ARRAY_SIZE(dm365_osd_resources),
 +      .resource       = dm365_osd_resources,
 +      .dev            = {
 +              .dma_mask               = &dm365_video_dma_mask,
 +              .coherent_dma_mask      = DMA_BIT_MASK(32),
 +      },
 +};
 +
 +static struct resource dm365_venc_resources[] = {
 +      {
 +              .start = IRQ_VENCINT,
 +              .end   = IRQ_VENCINT,
 +              .flags = IORESOURCE_IRQ,
 +      },
 +      /* venc registers io space */
 +      {
 +              .start = DM365_VENC_BASE,
 +              .end   = DM365_VENC_BASE + 0x177,
 +              .flags = IORESOURCE_MEM,
 +      },
 +      /* vdaccfg registers io space */
 +      {
 +              .start = DAVINCI_SYSTEM_MODULE_BASE + SYSMOD_VDAC_CONFIG,
 +              .end   = DAVINCI_SYSTEM_MODULE_BASE + SYSMOD_VDAC_CONFIG + 3,
 +              .flags = IORESOURCE_MEM,
 +      },
 +};
 +
 +static struct resource dm365_v4l2_disp_resources[] = {
 +      {
 +              .start = IRQ_VENCINT,
 +              .end   = IRQ_VENCINT,
 +              .flags = IORESOURCE_IRQ,
 +      },
 +      /* venc registers io space */
 +      {
 +              .start = DM365_VENC_BASE,
 +              .end   = DM365_VENC_BASE + 0x177,
 +              .flags = IORESOURCE_MEM,
 +      },
 +};
 +
 +static int dm365_vpbe_setup_pinmux(enum v4l2_mbus_pixelcode if_type,
 +                          int field)
 +{
 +      switch (if_type) {
 +      case V4L2_MBUS_FMT_SGRBG8_1X8:
 +              davinci_cfg_reg(DM365_VOUT_FIELD_G81);
 +              davinci_cfg_reg(DM365_VOUT_COUTL_EN);
 +              davinci_cfg_reg(DM365_VOUT_COUTH_EN);
 +              break;
 +      case V4L2_MBUS_FMT_YUYV10_1X20:
 +              if (field)
 +                      davinci_cfg_reg(DM365_VOUT_FIELD);
 +              else
 +                      davinci_cfg_reg(DM365_VOUT_FIELD_G81);
 +              davinci_cfg_reg(DM365_VOUT_COUTL_EN);
 +              davinci_cfg_reg(DM365_VOUT_COUTH_EN);
 +              break;
 +      default:
 +              return -EINVAL;
 +      }
 +
 +      return 0;
 +}
 +
 +static int dm365_venc_setup_clock(enum vpbe_enc_timings_type type,
 +                                unsigned int pclock)
 +{
 +      void __iomem *vpss_clkctl_reg;
 +      u32 val;
 +
 +      vpss_clkctl_reg = DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL);
 +
 +      switch (type) {
 +      case VPBE_ENC_STD:
 +              val = VPSS_VENCCLKEN_ENABLE | VPSS_DACCLKEN_ENABLE;
 +              break;
 +      case VPBE_ENC_DV_TIMINGS:
 +              if (pclock <= 27000000) {
 +                      val = VPSS_VENCCLKEN_ENABLE | VPSS_DACCLKEN_ENABLE;
 +              } else {
 +                      /* set sysclk4 to output 74.25 MHz from pll1 */
 +                      val = VPSS_PLLC2SYSCLK5_ENABLE | VPSS_DACCLKEN_ENABLE |
 +                            VPSS_VENCCLKEN_ENABLE;
 +              }
 +              break;
 +      default:
 +              return -EINVAL;
 +      }
 +      writel(val, vpss_clkctl_reg);
 +
 +      return 0;
 +}
 +
 +static struct platform_device dm365_vpbe_display = {
 +      .name           = "vpbe-v4l2",
 +      .id             = -1,
 +      .num_resources  = ARRAY_SIZE(dm365_v4l2_disp_resources),
 +      .resource       = dm365_v4l2_disp_resources,
 +      .dev            = {
 +              .dma_mask               = &dm365_video_dma_mask,
 +              .coherent_dma_mask      = DMA_BIT_MASK(32),
 +      },
 +};
 +
 +struct venc_platform_data dm365_venc_pdata = {
 +      .setup_pinmux   = dm365_vpbe_setup_pinmux,
 +      .setup_clock    = dm365_venc_setup_clock,
 +};
 +
 +static struct platform_device dm365_venc_dev = {
 +      .name           = DM365_VPBE_VENC_SUBDEV_NAME,
 +      .id             = -1,
 +      .num_resources  = ARRAY_SIZE(dm365_venc_resources),
 +      .resource       = dm365_venc_resources,
 +      .dev            = {
 +              .dma_mask               = &dm365_video_dma_mask,
 +              .coherent_dma_mask      = DMA_BIT_MASK(32),
 +              .platform_data          = (void *)&dm365_venc_pdata,
 +      },
 +};
 +
 +static struct platform_device dm365_vpbe_dev = {
 +      .name           = "vpbe_controller",
 +      .id             = -1,
 +      .dev            = {
 +              .dma_mask               = &dm365_video_dma_mask,
 +              .coherent_dma_mask      = DMA_BIT_MASK(32),
 +      },
 +};
 +
 +int __init dm365_init_video(struct vpfe_config *vpfe_cfg,
 +                              struct vpbe_config *vpbe_cfg)
 +{
 +      if (vpfe_cfg || vpbe_cfg)
 +              platform_device_register(&dm365_vpss_device);
 +
 +      if (vpfe_cfg) {
 +              vpfe_capture_dev.dev.platform_data = vpfe_cfg;
 +              platform_device_register(&dm365_isif_dev);
 +              platform_device_register(&vpfe_capture_dev);
 +      }
 +      if (vpbe_cfg) {
 +              dm365_vpbe_dev.dev.platform_data = vpbe_cfg;
 +              platform_device_register(&dm365_osd_dev);
 +              platform_device_register(&dm365_venc_dev);
 +              platform_device_register(&dm365_vpbe_dev);
 +              platform_device_register(&dm365_vpbe_display);
 +      }
 +
 +      return 0;
 +}
 +
  static int __init dm365_init_devices(void)
  {
        if (!cpu_is_davinci_dm365())
        clk_add_alias(NULL, dev_name(&dm365_mdio_device.dev),
                      NULL, &dm365_emac_device.dev);
  
 -      /* Add isif clock alias */
 -      clk_add_alias("master", dm365_isif_dev.name, "vpss_master", NULL);
 -      platform_device_register(&dm365_vpss_device);
 -      platform_device_register(&dm365_isif_dev);
 -      platform_device_register(&vpfe_capture_dev);
        return 0;
  }
  postcore_initcall(dm365_init_devices);
 -
 -void dm365_set_vpfe_config(struct vpfe_config *cfg)
 -{
 -       vpfe_capture_dev.dev.platform_data = cfg;
 -}
index c2a9273330bfbd221752fb0857a2445025c13035,ab6bf54c65c7c7451f1457d99bdd556a4dee1bbf..4d37d3e2a193df25555c7408483d9c98e08d5da7
@@@ -300,8 -300,8 +300,8 @@@ static struct clk_lookup dm644x_clks[] 
        CLK(NULL, "dsp", &dsp_clk),
        CLK(NULL, "arm", &arm_clk),
        CLK(NULL, "vicp", &vicp_clk),
 -      CLK(NULL, "vpss_master", &vpss_master_clk),
 -      CLK(NULL, "vpss_slave", &vpss_slave_clk),
 +      CLK("vpss", "master", &vpss_master_clk),
 +      CLK("vpss", "slave", &vpss_slave_clk),
        CLK(NULL, "arm", &arm_clk),
        CLK(NULL, "uart0", &uart0_clk),
        CLK(NULL, "uart1", &uart1_clk),
        CLK("i2c_davinci.1", NULL, &i2c_clk),
        CLK("palm_bk3710", NULL, &ide_clk),
        CLK("davinci-mcbsp", NULL, &asp_clk),
-       CLK("davinci_mmc.0", NULL, &mmcsd_clk),
+       CLK("dm6441-mmc.0", NULL, &mmcsd_clk),
        CLK(NULL, "spi", &spi_clk),
        CLK(NULL, "gpio", &gpio_clk),
        CLK(NULL, "usb", &usb_clk),
@@@ -706,7 -706,7 +706,7 @@@ static int dm644x_venc_setup_clock(enu
                v |= DM644X_VPSS_DACCLKEN;
                writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
                break;
 -      case VPBE_ENC_CUSTOM_TIMINGS:
 +      case VPBE_ENC_DV_TIMINGS:
                if (pclock <= 27000000) {
                        v |= DM644X_VPSS_DACCLKEN;
                        writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
@@@ -901,6 -901,11 +901,6 @@@ int __init dm644x_init_video(struct vpf
                dm644x_vpfe_dev.dev.platform_data = vpfe_cfg;
                platform_device_register(&dm644x_ccdc_dev);
                platform_device_register(&dm644x_vpfe_dev);
 -              /* Add ccdc clock aliases */
 -              clk_add_alias("master", dm644x_ccdc_dev.name,
 -                            "vpss_master", NULL);
 -              clk_add_alias("slave", dm644x_ccdc_dev.name,
 -                            "vpss_slave", NULL);
        }
  
        if (vpbe_cfg) {
index 1b0fa7afc7f8bc9d9dce45f0e61fb76755d831c8,99b7f1cbbb8babf48d09a7b35e43895b3cdac00a..15718da30c4570f59d7be48dd9dca54be46cf2a2
@@@ -23,6 -23,7 +23,6 @@@
  #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 <linux/irqchip/chained_irq.h>
@@@ -463,6 -464,8 +463,8 @@@ void __init exynos4_init_irq(void
         * uses GIC instead of VIC.
         */
        s5p_init_irq(NULL, 0);
+       gic_arch_extn.irq_set_wake = s3c_irq_wake;
  }
  
  void __init exynos5_init_irq(void)
index 498a7a23e2607dfca7dd5db35e3c4eeab3c1027c,e2689d1133b9dc62963212ac405b3ca93741b531..17a18ff3d71e289df9909cb3976d6e414c768dff
@@@ -41,23 -41,25 +41,24 @@@ static int exynos4_enter_lowpower(struc
                                struct cpuidle_driver *drv,
                                int index);
  
- static struct cpuidle_state exynos4_cpuidle_set[] __initdata = {
-       [0] = ARM_CPUIDLE_WFI_STATE,
-       [1] = {
-               .enter                  = exynos4_enter_lowpower,
-               .exit_latency           = 300,
-               .target_residency       = 100000,
-               .flags                  = CPUIDLE_FLAG_TIME_VALID,
-               .name                   = "C1",
-               .desc                   = "ARM power down",
-       },
- };
  static DEFINE_PER_CPU(struct cpuidle_device, exynos4_cpuidle_device);
  
  static struct cpuidle_driver exynos4_idle_driver = {
        .name                   = "exynos4_idle",
        .owner                  = THIS_MODULE,
 -      .en_core_tk_irqen       = 1,
+       .states = {
+               [0] = ARM_CPUIDLE_WFI_STATE,
+               [1] = {
+                       .enter                  = exynos4_enter_lowpower,
+                       .exit_latency           = 300,
+                       .target_residency       = 100000,
+                       .flags                  = CPUIDLE_FLAG_TIME_VALID,
+                       .name                   = "C1",
+                       .desc                   = "ARM power down",
+               },
+       },
+       .state_count = 2,
+       .safe_state_index = 0,
  };
  
  /* Ext-GIC nIRQ/nFIQ is the only wakeup source in AFTR */
@@@ -192,37 -194,30 +193,30 @@@ static void __init exynos5_core_down_cl
  
  static int __init exynos4_init_cpuidle(void)
  {
-       int i, max_cpuidle_state, cpu_id;
+       int cpu_id, ret;
        struct cpuidle_device *device;
-       struct cpuidle_driver *drv = &exynos4_idle_driver;
  
        if (soc_is_exynos5250())
                exynos5_core_down_clk();
  
-       /* Setup cpuidle driver */
-       drv->state_count = (sizeof(exynos4_cpuidle_set) /
-                                      sizeof(struct cpuidle_state));
-       max_cpuidle_state = drv->state_count;
-       for (i = 0; i < max_cpuidle_state; i++) {
-               memcpy(&drv->states[i], &exynos4_cpuidle_set[i],
-                               sizeof(struct cpuidle_state));
+       ret = cpuidle_register_driver(&exynos4_idle_driver);
+       if (ret) {
+               printk(KERN_ERR "CPUidle failed to register driver\n");
+               return ret;
        }
-       drv->safe_state_index = 0;
-       cpuidle_register_driver(&exynos4_idle_driver);
  
-       for_each_cpu(cpu_id, cpu_online_mask) {
+       for_each_online_cpu(cpu_id) {
                device = &per_cpu(exynos4_cpuidle_device, cpu_id);
                device->cpu = cpu_id;
  
-               if (cpu_id == 0)
-                       device->state_count = (sizeof(exynos4_cpuidle_set) /
-                                              sizeof(struct cpuidle_state));
-               else
-                       device->state_count = 1;        /* Support IDLE only */
+               /* Support IDLE only */
+               if (cpu_id != 0)
+                       device->state_count = 1;
  
-               if (cpuidle_register_device(device)) {
-                       printk(KERN_ERR "CPUidle register device failed\n,");
-                       return -EIO;
+               ret = cpuidle_register_device(device);
+               if (ret) {
+                       printk(KERN_ERR "CPUidle register device failed\n");
+                       return ret;
                }
        }
  
index 4dc34ae6a857dc119b8516b3720ee280410d321d,b56530cb5fa835723cb2c11b419a5f15b1eff8b3..5c27c47474693d14cc92bb6a322a6d04549b1d4c
@@@ -15,6 -15,7 +15,7 @@@ config ARCH_OMAP2PLU
        select OMAP_DM_TIMER
        select PINCTRL
        select PROC_DEVICETREE if PROC_FS
+       select SOC_BUS
        select SPARSE_IRQ
        select USE_OF
        help
@@@ -55,7 -56,6 +56,7 @@@ config SOC_HAS_REALTIME_COUNTE
  config ARCH_OMAP2
        bool "TI OMAP2"
        depends on ARCH_OMAP2PLUS
 +      depends on ARCH_MULTI_V6
        default y
        select CPU_V6
        select MULTI_IRQ_HANDLER
@@@ -65,7 -65,6 +66,7 @@@
  config ARCH_OMAP3
        bool "TI OMAP3"
        depends on ARCH_OMAP2PLUS
 +      depends on ARCH_MULTI_V7
        default y
        select ARCH_HAS_OPP
        select ARM_CPU_SUSPEND if PM
@@@ -82,7 -81,6 +83,7 @@@ config ARCH_OMAP
        bool "TI OMAP4"
        default y
        depends on ARCH_OMAP2PLUS
 +      depends on ARCH_MULTI_V7
        select ARCH_HAS_OPP
        select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP
        select ARM_CPU_SUSPEND if PM
        select PM_RUNTIME if CPU_IDLE
        select USB_ARCH_HAS_EHCI if USB_SUPPORT
        select COMMON_CLK
+       select ARM_ERRATA_754322
+       select ARM_ERRATA_775420
  
  config SOC_OMAP5
        bool "TI OMAP5"
 +      depends on ARCH_MULTI_V7
        select ARM_CPU_SUSPEND if PM
        select ARM_GIC
        select CPU_V7
@@@ -139,7 -138,6 +142,7 @@@ config SOC_TI81X
  
  config SOC_AM33XX
        bool "AM33XX support"
 +      depends on ARCH_MULTI_V7
        default y
        select ARM_CPU_SUSPEND if PM
        select CPU_V7
@@@ -413,7 -411,7 +416,7 @@@ config OMAP3_SDRC_AC_TIMIN
  
  config OMAP4_ERRATA_I688
        bool "OMAP4 errata: Async Bridge Corruption"
 -      depends on ARCH_OMAP4 && !ARCH_MULTIPLATFORM
 +      depends on (ARCH_OMAP4 || SOC_OMAP5) && !ARCH_MULTIPLATFORM
        select ARCH_HAS_BARRIERS
        help
          If a data is stalled inside asynchronous bridge because of back
index 332c6d3e55a9c8fee9323ea33c860fced1d140da,c8dcc523c31af6c3e7a77c96cd8fb286b5a80305..6ebc7803bc3e37b48ff9c1b394a39e2a3dff9a28
@@@ -413,6 -413,14 +413,14 @@@ static struct clk smartreflex1_fck
  DEFINE_STRUCT_CLK_HW_OMAP(smartreflex1_fck, NULL);
  DEFINE_STRUCT_CLK(smartreflex1_fck, dpll_core_ck_parents, clk_ops_null);
  
+ static struct clk sha0_fck;
+ DEFINE_STRUCT_CLK_HW_OMAP(sha0_fck, NULL);
+ DEFINE_STRUCT_CLK(sha0_fck, dpll_core_ck_parents, clk_ops_null);
+ static struct clk aes0_fck;
+ DEFINE_STRUCT_CLK_HW_OMAP(aes0_fck, NULL);
+ DEFINE_STRUCT_CLK(aes0_fck, dpll_core_ck_parents, clk_ops_null);
  /*
   * Modules clock nodes
   *
@@@ -878,6 -886,8 +886,8 @@@ static struct omap_clk am33xx_clks[] = 
        CLK(NULL,       "mmu_fck",              &mmu_fck),
        CLK(NULL,       "smartreflex0_fck",     &smartreflex0_fck),
        CLK(NULL,       "smartreflex1_fck",     &smartreflex1_fck),
+       CLK(NULL,       "sha0_fck",             &sha0_fck),
+       CLK(NULL,       "aes0_fck",             &aes0_fck),
        CLK(NULL,       "timer1_fck",           &timer1_fck),
        CLK(NULL,       "timer2_fck",           &timer2_fck),
        CLK(NULL,       "timer3_fck",           &timer3_fck),
@@@ -947,14 -957,6 +957,14 @@@ int __init am33xx_clk_init(void
  
        clk_set_parent(&timer3_fck, &sys_clkin_ck);
        clk_set_parent(&timer6_fck, &sys_clkin_ck);
 +      /*
 +       * The On-Chip 32K RC Osc clock is not an accurate clock-source as per
 +       * the design/spec, so as a result, for example, timer which supposed
 +       * to get expired @60Sec, but will expire somewhere ~@40Sec, which is
 +       * not expected by any use-case, so change WDT1 clock source to PRCM
 +       * 32KHz clock.
 +       */
 +      clk_set_parent(&wdt1_fck, &clkdiv32k_ick);
  
        return 0;
  }
index 14522d077c889e23a51b4ab11848639d90b1f086,1ddd0cb5fab9181dd1aa125e7cb4c1f149908f76..df00e7580aa777738c0ef619ad4d6e80d7b8c0ee
@@@ -110,6 -110,14 +110,14 @@@ void am35xx_init_late(void)
  void ti81xx_init_late(void);
  int omap2_common_pm_late_init(void);
  
+ #ifdef CONFIG_SOC_BUS
+ void omap_soc_device_init(void);
+ #else
+ static inline void omap_soc_device_init(void)
+ {
+ }
+ #endif
  #if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)
  void omap2xxx_restart(char mode, const char *cmd);
  #else
@@@ -249,6 -257,7 +257,6 @@@ extern int omap4_enter_lowpower(unsigne
  extern int omap4_finish_suspend(unsigned long cpu_state);
  extern void omap4_cpu_resume(void);
  extern int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state);
 -extern u32 omap4_mpuss_read_prev_context_state(void);
  #else
  static inline int omap4_enter_lowpower(unsigned int cpu,
                                        unsigned int power_state)
@@@ -276,6 -285,10 +284,6 @@@ static inline int omap4_finish_suspend(
  static inline void omap4_cpu_resume(void)
  {}
  
 -static inline u32 omap4_mpuss_read_prev_context_state(void)
 -{
 -      return 0;
 -}
  #endif
  
  struct omap_sdrc_params;
diff --combined arch/arm/mach-omap2/id.c
index ff0bc9e51aa777ad42a9d7661fc575624c21960c,098e94e3133608128bf8c14242c7a07a53fc83ff..2fb17caa86834ce7f2bc3df26a4fba15b3387a36
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/io.h>
+ #include <linux/slab.h>
+ #ifdef CONFIG_SOC_BUS
+ #include <linux/sys_soc.h>
+ #endif
  
  #include <asm/cputype.h>
  
  #define OMAP4_SILICON_TYPE_STANDARD           0x01
  #define OMAP4_SILICON_TYPE_PERFORMANCE                0x02
  
+ #define OMAP_SOC_MAX_NAME_LENGTH              16
  static unsigned int omap_revision;
- static const char *cpu_rev;
+ static char soc_name[OMAP_SOC_MAX_NAME_LENGTH];
+ static char soc_rev[OMAP_SOC_MAX_NAME_LENGTH];
  u32 omap_features;
  
  unsigned int omap_rev(void)
@@@ -169,9 -177,12 +177,12 @@@ void __init omap2xxx_check_revision(voi
                j = i;
        }
  
-       pr_info("OMAP%04x", omap_rev() >> 16);
+       sprintf(soc_name, "OMAP%04x", omap_rev() >> 16);
+       sprintf(soc_rev, "ES%x", (omap_rev() >> 12) & 0xf);
+       pr_info("%s", soc_name);
        if ((omap_rev() >> 8) & 0x0f)
-               pr_info("ES%x", (omap_rev() >> 12) & 0xf);
+               pr_info("%s", soc_rev);
        pr_info("\n");
  }
  
@@@ -211,8 -222,10 +222,10 @@@ static void __init omap3_cpuinfo(void
                cpu_name = "OMAP3503";
        }
  
+       sprintf(soc_name, "%s", cpu_name);
        /* Print verbose information */
-       pr_info("%s ES%s (", cpu_name, cpu_rev);
+       pr_info("%s %s (", soc_name, soc_rev);
  
        OMAP3_SHOW_FEATURE(l2cache);
        OMAP3_SHOW_FEATURE(iva);
@@@ -291,6 -304,7 +304,7 @@@ void __init ti81xx_check_features(void
  
  void __init omap3xxx_check_revision(void)
  {
+       const char *cpu_rev;
        u32 cpuid, idcode;
        u16 hawkeye;
        u8 rev;
                cpu_rev = "1.2";
                pr_warn("Warning: unknown chip type; assuming OMAP3630ES1.2\n");
        }
+       sprintf(soc_rev, "ES%s", cpu_rev);
  }
  
  void __init omap4xxx_check_revision(void)
                omap_revision = OMAP4430_REV_ES2_3;
        }
  
-       pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16,
-               ((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf));
+       sprintf(soc_name, "OMAP%04x", omap_rev() >> 16);
+       sprintf(soc_rev, "ES%d.%d", (omap_rev() >> 12) & 0xf,
+                                               (omap_rev() >> 8) & 0xf);
+       pr_info("%s %s\n", soc_name, soc_rev);
  }
  
  void __init omap5xxx_check_revision(void)
        case 0xb942:
                switch (rev) {
                case 0:
 -              default:
                        omap_revision = OMAP5430_REV_ES1_0;
 +                      break;
 +              case 1:
 +              default:
 +                      omap_revision = OMAP5430_REV_ES2_0;
                }
                break;
  
        case 0xb998:
                switch (rev) {
                case 0:
 -              default:
                        omap_revision = OMAP5432_REV_ES1_0;
 +                      break;
 +              case 1:
 +              default:
 +                      omap_revision = OMAP5432_REV_ES2_0;
                }
                break;
  
        default:
                /* Unknown default to latest silicon rev as default*/
 -              omap_revision = OMAP5430_REV_ES1_0;
 +              omap_revision = OMAP5430_REV_ES2_0;
        }
  
-       pr_info("OMAP%04x ES%d.0\n",
-                       omap_rev() >> 16, ((omap_rev() >> 12) & 0xf));
+       sprintf(soc_name, "OMAP%04x", omap_rev() >> 16);
+       sprintf(soc_rev, "ES%d.0", (omap_rev() >> 12) & 0xf);
+       pr_info("%s %s\n", soc_name, soc_rev);
  }
  
  /*
@@@ -575,3 -588,63 +594,63 @@@ void __init omap2_set_globals_tap(u32 c
        else
                tap_prod_id = 0x0208;
  }
+ #ifdef CONFIG_SOC_BUS
+ static const char const *omap_types[] = {
+       [OMAP2_DEVICE_TYPE_TEST]        = "TST",
+       [OMAP2_DEVICE_TYPE_EMU]         = "EMU",
+       [OMAP2_DEVICE_TYPE_SEC]         = "HS",
+       [OMAP2_DEVICE_TYPE_GP]          = "GP",
+       [OMAP2_DEVICE_TYPE_BAD]         = "BAD",
+ };
+ static const char * __init omap_get_family(void)
+ {
+       if (cpu_is_omap24xx())
+               return kasprintf(GFP_KERNEL, "OMAP2");
+       else if (cpu_is_omap34xx())
+               return kasprintf(GFP_KERNEL, "OMAP3");
+       else if (cpu_is_omap44xx())
+               return kasprintf(GFP_KERNEL, "OMAP4");
+       else if (soc_is_omap54xx())
+               return kasprintf(GFP_KERNEL, "OMAP5");
+       else
+               return kasprintf(GFP_KERNEL, "Unknown");
+ }
+ static ssize_t omap_get_type(struct device *dev,
+                                       struct device_attribute *attr,
+                                       char *buf)
+ {
+       return sprintf(buf, "%s\n", omap_types[omap_type()]);
+ }
+ static struct device_attribute omap_soc_attr =
+       __ATTR(type,  S_IRUGO, omap_get_type,  NULL);
+ void __init omap_soc_device_init(void)
+ {
+       struct device *parent;
+       struct soc_device *soc_dev;
+       struct soc_device_attribute *soc_dev_attr;
+       soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
+       if (!soc_dev_attr)
+               return;
+       soc_dev_attr->machine  = soc_name;
+       soc_dev_attr->family   = omap_get_family();
+       soc_dev_attr->revision = soc_rev;
+       soc_dev = soc_device_register(soc_dev_attr);
+       if (IS_ERR_OR_NULL(soc_dev)) {
+               kfree(soc_dev_attr);
+               return;
+       }
+       parent = soc_device_to_device(soc_dev);
+       if (!IS_ERR_OR_NULL(parent))
+               device_create_file(parent, &omap_soc_attr);
+ }
+ #endif /* CONFIG_SOC_BUS */
diff --combined arch/arm/mach-omap2/io.c
index e210fa830f8d7d076fdec7a23202bdab8b1a2089,3241f23afe098b04c79d765dd3b1ea9be1af469d..09abf99e9e57bcc68af773e32cd1c26253144f1d
@@@ -277,14 -277,6 +277,14 @@@ static struct map_desc omap54xx_io_desc
                .length         = L4_PER_54XX_SIZE,
                .type           = MT_DEVICE,
        },
 +#ifdef CONFIG_OMAP4_ERRATA_I688
 +      {
 +              .virtual        = OMAP4_SRAM_VA,
 +              .pfn            = __phys_to_pfn(OMAP4_SRAM_PA),
 +              .length         = PAGE_SIZE,
 +              .type           = MT_MEMORY_SO,
 +      },
 +#endif
  };
  #endif
  
@@@ -337,7 -329,6 +337,7 @@@ void __init omap4_map_io(void
  void __init omap5_map_io(void)
  {
        iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc));
 +      omap_barriers_init();
  }
  #endif
  /*
@@@ -394,6 -385,13 +394,13 @@@ static void __init omap_hwmod_init_post
        omap_pm_if_early_init();
  }
  
+ static void __init omap_common_late_init(void)
+ {
+       omap_mux_late_init();
+       omap2_common_pm_late_init();
+       omap_soc_device_init();
+ }
  #ifdef CONFIG_SOC_OMAP2420
  void __init omap2420_init_early(void)
  {
  
  void __init omap2420_init_late(void)
  {
-       omap_mux_late_init();
-       omap2_common_pm_late_init();
+       omap_common_late_init();
        omap2_pm_init();
        omap2_clk_enable_autoidle_all();
  }
@@@ -447,8 -444,7 +453,7 @@@ void __init omap2430_init_early(void
  
  void __init omap2430_init_late(void)
  {
-       omap_mux_late_init();
-       omap2_common_pm_late_init();
+       omap_common_late_init();
        omap2_pm_init();
        omap2_clk_enable_autoidle_all();
  }
@@@ -520,48 -516,42 +525,42 @@@ void __init ti81xx_init_early(void
  
  void __init omap3_init_late(void)
  {
-       omap_mux_late_init();
-       omap2_common_pm_late_init();
+       omap_common_late_init();
        omap3_pm_init();
        omap2_clk_enable_autoidle_all();
  }
  
  void __init omap3430_init_late(void)
  {
-       omap_mux_late_init();
-       omap2_common_pm_late_init();
+       omap_common_late_init();
        omap3_pm_init();
        omap2_clk_enable_autoidle_all();
  }
  
  void __init omap35xx_init_late(void)
  {
-       omap_mux_late_init();
-       omap2_common_pm_late_init();
+       omap_common_late_init();
        omap3_pm_init();
        omap2_clk_enable_autoidle_all();
  }
  
  void __init omap3630_init_late(void)
  {
-       omap_mux_late_init();
-       omap2_common_pm_late_init();
+       omap_common_late_init();
        omap3_pm_init();
        omap2_clk_enable_autoidle_all();
  }
  
  void __init am35xx_init_late(void)
  {
-       omap_mux_late_init();
-       omap2_common_pm_late_init();
+       omap_common_late_init();
        omap3_pm_init();
        omap2_clk_enable_autoidle_all();
  }
  
  void __init ti81xx_init_late(void)
  {
-       omap_mux_late_init();
-       omap2_common_pm_late_init();
+       omap_common_late_init();
        omap3_pm_init();
        omap2_clk_enable_autoidle_all();
  }
@@@ -613,8 -603,7 +612,7 @@@ void __init omap4430_init_early(void
  
  void __init omap4430_init_late(void)
  {
-       omap_mux_late_init();
-       omap2_common_pm_late_init();
+       omap_common_late_init();
        omap4_pm_init();
        omap2_clk_enable_autoidle_all();
  }
index 31bea1ce3de10a7049d49b917b616c1f52701401,556a1222fde6e6b7ab5a05e980040a777fac9a56..01d8f324450a951f89174b4cebdf82f8b9dad6b1
@@@ -28,7 -28,6 +28,7 @@@
  #include "prm-regbits-33xx.h"
  #include "i2c.h"
  #include "mmc.h"
 +#include "wd_timer.h"
  
  /*
   * IP blocks
@@@ -418,8 -417,6 +418,6 @@@ static struct omap_hwmod am33xx_adc_tsc
   *    - clkdiv32k
   *    - debugss
   *    - ocp watch point
-  *    - aes0
-  *    - sha0
   */
  #if 0
  /*
@@@ -500,25 -497,41 +498,41 @@@ static struct omap_hwmod am33xx_ocpwp_h
                },
        },
  };
+ #endif
  
  /*
-  * 'aes' class
+  * 'aes0' class
   */
- static struct omap_hwmod_class am33xx_aes_hwmod_class = {
-       .name           = "aes",
+ static struct omap_hwmod_class_sysconfig am33xx_aes0_sysc = {
+       .rev_offs       = 0x80,
+       .sysc_offs      = 0x84,
+       .syss_offs      = 0x88,
+       .sysc_flags     = SYSS_HAS_RESET_STATUS,
+ };
+ static struct omap_hwmod_class am33xx_aes0_hwmod_class = {
+       .name           = "aes0",
+       .sysc           = &am33xx_aes0_sysc,
  };
  
  static struct omap_hwmod_irq_info am33xx_aes0_irqs[] = {
-       { .irq = 102 + OMAP_INTC_START, },
+       { .irq = 103 + OMAP_INTC_START, },
        { .irq = -1 },
  };
  
+ static struct omap_hwmod_dma_info am33xx_aes0_edma_reqs[] = {
+       { .name = "tx", .dma_req = 6, },
+       { .name = "rx", .dma_req = 5, },
+       { .dma_req = -1 }
+ };
  static struct omap_hwmod am33xx_aes0_hwmod = {
-       .name           = "aes0",
-       .class          = &am33xx_aes_hwmod_class,
+       .name           = "aes",
+       .class          = &am33xx_aes0_hwmod_class,
        .clkdm_name     = "l3_clkdm",
        .mpu_irqs       = am33xx_aes0_irqs,
-       .main_clk       = "l3_gclk",
+       .sdma_reqs      = am33xx_aes0_edma_reqs,
+       .main_clk       = "aes0_fck",
        .prcm           = {
                .omap4  = {
                        .clkctrl_offs   = AM33XX_CM_PER_AES0_CLKCTRL_OFFSET,
        },
  };
  
- /* sha0 */
+ /* sha0 HIB2 (the 'P' (public) device) */
+ static struct omap_hwmod_class_sysconfig am33xx_sha0_sysc = {
+       .rev_offs       = 0x100,
+       .sysc_offs      = 0x110,
+       .syss_offs      = 0x114,
+       .sysc_flags     = SYSS_HAS_RESET_STATUS,
+ };
  static struct omap_hwmod_class am33xx_sha0_hwmod_class = {
        .name           = "sha0",
+       .sysc           = &am33xx_sha0_sysc,
  };
  
  static struct omap_hwmod_irq_info am33xx_sha0_irqs[] = {
-       { .irq = 108 + OMAP_INTC_START, },
+       { .irq = 109 + OMAP_INTC_START, },
        { .irq = -1 },
  };
  
+ static struct omap_hwmod_dma_info am33xx_sha0_edma_reqs[] = {
+       { .name = "rx", .dma_req = 36, },
+       { .dma_req = -1 }
+ };
  static struct omap_hwmod am33xx_sha0_hwmod = {
-       .name           = "sha0",
+       .name           = "sham",
        .class          = &am33xx_sha0_hwmod_class,
        .clkdm_name     = "l3_clkdm",
        .mpu_irqs       = am33xx_sha0_irqs,
+       .sdma_reqs      = am33xx_sha0_edma_reqs,
        .main_clk       = "l3_gclk",
        .prcm           = {
                .omap4  = {
        },
  };
  
- #endif
  /* ocmcram */
  static struct omap_hwmod_class am33xx_ocmcram_hwmod_class = {
        .name = "ocmcram",
@@@ -2088,21 -2113,8 +2114,21 @@@ static struct omap_hwmod am33xx_uart6_h
  };
  
  /* 'wd_timer' class */
 +static struct omap_hwmod_class_sysconfig wdt_sysc = {
 +      .rev_offs       = 0x0,
 +      .sysc_offs      = 0x10,
 +      .syss_offs      = 0x14,
 +      .sysc_flags     = (SYSC_HAS_EMUFREE | SYSC_HAS_SIDLEMODE |
 +                      SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
 +      .idlemodes      = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
 +                      SIDLE_SMART_WKUP),
 +      .sysc_fields    = &omap_hwmod_sysc_type1,
 +};
 +
  static struct omap_hwmod_class am33xx_wd_timer_hwmod_class = {
        .name           = "wd_timer",
 +      .sysc           = &wdt_sysc,
 +      .pre_shutdown   = &omap2_wd_timer_disable,
  };
  
  /*
@@@ -2113,7 -2125,6 +2139,7 @@@ static struct omap_hwmod am33xx_wd_time
        .name           = "wd_timer2",
        .class          = &am33xx_wd_timer_hwmod_class,
        .clkdm_name     = "l4_wkup_clkdm",
 +      .flags          = HWMOD_SWSUP_SIDLE,
        .main_clk       = "wdt1_fck",
        .prcm           = {
                .omap4  = {
@@@ -3449,6 -3460,42 +3475,42 @@@ static struct omap_hwmod_ocp_if am33xx_
        .user           = OCP_USER_MPU | OCP_USER_SDMA,
  };
  
+ /* l3 main -> sha0 HIB2 */
+ static struct omap_hwmod_addr_space am33xx_sha0_addrs[] = {
+       {
+               .pa_start       = 0x53100000,
+               .pa_end         = 0x53100000 + SZ_512 - 1,
+               .flags          = ADDR_TYPE_RT
+       },
+       { }
+ };
+ static struct omap_hwmod_ocp_if am33xx_l3_main__sha0 = {
+       .master         = &am33xx_l3_main_hwmod,
+       .slave          = &am33xx_sha0_hwmod,
+       .clk            = "sha0_fck",
+       .addr           = am33xx_sha0_addrs,
+       .user           = OCP_USER_MPU | OCP_USER_SDMA,
+ };
+ /* l3 main -> AES0 HIB2 */
+ static struct omap_hwmod_addr_space am33xx_aes0_addrs[] = {
+       {
+               .pa_start       = 0x53500000,
+               .pa_end         = 0x53500000 + SZ_1M - 1,
+               .flags          = ADDR_TYPE_RT
+       },
+       { }
+ };
+ static struct omap_hwmod_ocp_if am33xx_l3_main__aes0 = {
+       .master         = &am33xx_l3_main_hwmod,
+       .slave          = &am33xx_aes0_hwmod,
+       .clk            = "aes0_fck",
+       .addr           = am33xx_aes0_addrs,
+       .user           = OCP_USER_MPU | OCP_USER_SDMA,
+ };
  static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
        &am33xx_l4_fw__emif_fw,
        &am33xx_l3_main__emif,
        &am33xx_l3_s__usbss,
        &am33xx_l4_hs__cpgmac0,
        &am33xx_cpgmac0__mdio,
+       &am33xx_l3_main__sha0,
+       &am33xx_l3_main__aes0,
        NULL,
  };
  
index 362f9b2d2c022318400f348998fd465d0050e7c5,86fcdf9fde1bc8aa142bd261400a3a5dce9fadde..62c04c252418635b950b9c88609a89a7e4e83e76
@@@ -8,11 -8,15 +8,12 @@@ extern void shmobile_setup_delay(unsign
  struct twd_local_timer;
  extern void shmobile_setup_console(void);
  extern void shmobile_secondary_vector(void);
+ extern void shmobile_secondary_vector_scu(void);
  struct clk;
  extern int shmobile_clk_init(void);
  extern void shmobile_handle_irq_intc(struct pt_regs *);
  extern struct platform_suspend_ops shmobile_suspend_ops;
  struct cpuidle_driver;
 -struct cpuidle_device;
 -extern int shmobile_enter_wfi(struct cpuidle_device *dev,
 -                            struct cpuidle_driver *drv, int index);
  extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv);
  
  extern void sh7372_init_irq(void);
@@@ -30,23 -34,23 +31,23 @@@ extern int sh7372_do_idle_sysc(unsigne
  extern struct clk sh7372_extal1_clk;
  extern struct clk sh7372_extal2_clk;
  
+ extern void sh73a0_init_delay(void);
  extern void sh73a0_init_irq(void);
  extern void sh73a0_init_irq_dt(void);
  extern void sh73a0_map_io(void);
  extern void sh73a0_earlytimer_init(void);
  extern void sh73a0_add_early_devices(void);
- extern void sh73a0_add_early_devices_dt(void);
  extern void sh73a0_add_standard_devices(void);
  extern void sh73a0_add_standard_devices_dt(void);
  extern void sh73a0_clock_init(void);
  extern void sh73a0_pinmux_init(void);
  extern void sh73a0_pm_init(void);
- extern void sh73a0_secondary_vector(void);
  extern struct clk sh73a0_extal1_clk;
  extern struct clk sh73a0_extal2_clk;
  extern struct clk sh73a0_extcki_clk;
  extern struct clk sh73a0_extalr_clk;
  
+ extern void r8a7740_meram_workaround(void);
  extern void r8a7740_init_irq(void);
  extern void r8a7740_map_io(void);
  extern void r8a7740_add_early_devices(void);
@@@ -55,16 -59,17 +56,17 @@@ extern void r8a7740_clock_init(u8 md_ck
  extern void r8a7740_pinmux_init(void);
  extern void r8a7740_pm_init(void);
  
+ extern void r8a7779_init_delay(void);
  extern void r8a7779_init_irq(void);
+ extern void r8a7779_init_irq_dt(void);
  extern void r8a7779_map_io(void);
  extern void r8a7779_earlytimer_init(void);
  extern void r8a7779_add_early_devices(void);
  extern void r8a7779_add_standard_devices(void);
+ extern void r8a7779_add_standard_devices_dt(void);
  extern void r8a7779_clock_init(void);
  extern void r8a7779_pinmux_init(void);
  extern void r8a7779_pm_init(void);
- extern void r8a7740_meram_workaround(void);
  extern void r8a7779_register_twd(void);
  
  #ifdef CONFIG_SUSPEND
@@@ -79,16 -84,7 +81,7 @@@ int shmobile_cpuidle_init(void)
  static inline int shmobile_cpuidle_init(void) { return 0; }
  #endif
  
- extern void shmobile_cpu_die(unsigned int cpu);
- extern int shmobile_cpu_disable(unsigned int cpu);
- extern int shmobile_cpu_disable_any(unsigned int cpu);
- #ifdef CONFIG_HOTPLUG_CPU
- extern int shmobile_cpu_is_dead(unsigned int cpu);
- #else
- static inline int shmobile_cpu_is_dead(unsigned int cpu) { return 1; }
- #endif
+ extern void __iomem *shmobile_scu_base;
  extern void shmobile_smp_init_cpus(unsigned int ncores);
  
  static inline void __init shmobile_init_late(void)
index c1970005f8056d0c54e6480487efb91c9f90def8,e40326d0e29fa8fb6dff8e694f8539ca09e8e31f..b78f0d71b328b929696b7592bd68fa7e597e552a
@@@ -25,8 -25,10 +25,9 @@@ obj-$(CONFIG_ARCH_TEGRA_3x_SOC)              += cpu
  endif
  obj-$(CONFIG_SMP)                     += platsmp.o headsmp.o
  obj-$(CONFIG_HOTPLUG_CPU)               += hotplug.o
 -obj-$(CONFIG_CPU_FREQ)                  += cpu-tegra.o
  obj-$(CONFIG_TEGRA_PCI)                       += pcie.o
  
+ obj-$(CONFIG_ARCH_TEGRA_114_SOC)      += tegra114_speedo.o
  ifeq ($(CONFIG_CPU_IDLE),y)
  obj-$(CONFIG_ARCH_TEGRA_114_SOC)      += cpuidle-tegra114.o
  endif
index 590ec25855ddeb23c1824f93da17e1e174d7909d,8bbbdebed882fb7a49e8de19fb30b363858af8b6..0cdba8de8c77b2f576a415648d762fff82fb81da
@@@ -43,33 -43,32 +43,33 @@@ static atomic_t abort_barrier
  static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev,
                                    struct cpuidle_driver *drv,
                                    int index);
 +#define TEGRA20_MAX_STATES 2
 +#else
 +#define TEGRA20_MAX_STATES 1
  #endif
  
 -static struct cpuidle_state tegra_idle_states[] = {
 -      [0] = ARM_CPUIDLE_WFI_STATE_PWR(600),
 -#ifdef CONFIG_PM_SLEEP
 -      [1] = {
 -              .enter                  = tegra20_idle_lp2_coupled,
 -              .exit_latency           = 5000,
 -              .target_residency       = 10000,
 -              .power_usage            = 0,
 -              .flags                  = CPUIDLE_FLAG_TIME_VALID |
 -                                        CPUIDLE_FLAG_COUPLED,
 -              .name                   = "powered-down",
 -              .desc                   = "CPU power gated",
 -      },
 -#endif
 -};
 -
  static struct cpuidle_driver tegra_idle_driver = {
        .name = "tegra_idle",
        .owner = THIS_MODULE,
 -      .en_core_tk_irqen = 1,
 +      .states = {
 +              ARM_CPUIDLE_WFI_STATE_PWR(600),
 +#ifdef CONFIG_PM_SLEEP
 +              {
 +                      .enter            = tegra20_idle_lp2_coupled,
 +                      .exit_latency     = 5000,
 +                      .target_residency = 10000,
 +                      .power_usage      = 0,
 +                      .flags            = CPUIDLE_FLAG_TIME_VALID |
 +                      CPUIDLE_FLAG_COUPLED,
 +                      .name             = "powered-down",
 +                      .desc             = "CPU power gated",
 +              },
 +#endif
 +      },
 +      .state_count = TEGRA20_MAX_STATES,
 +      .safe_state_index = 0,
  };
  
 -static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device);
 -
  #ifdef CONFIG_PM_SLEEP
  #ifdef CONFIG_SMP
  static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
@@@ -131,10 -130,6 +131,6 @@@ static bool tegra20_cpu_cluster_power_d
                                           struct cpuidle_driver *drv,
                                           int index)
  {
-       struct cpuidle_state *state = &drv->states[index];
-       u32 cpu_on_time = state->exit_latency;
-       u32 cpu_off_time = state->target_residency - state->exit_latency;
        while (tegra20_cpu_is_resettable_soon())
                cpu_relax();
  
  
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
  
-       tegra_idle_lp2_last(cpu_on_time, cpu_off_time);
+       tegra_idle_lp2_last();
  
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
  
@@@ -218,8 -213,39 +214,8 @@@ static int tegra20_idle_lp2_coupled(str
  
  int __init tegra20_cpuidle_init(void)
  {
 -      int ret;
 -      unsigned int cpu;
 -      struct cpuidle_device *dev;
 -      struct cpuidle_driver *drv = &tegra_idle_driver;
 -
  #ifdef CONFIG_PM_SLEEP
        tegra_tear_down_cpu = tegra20_tear_down_cpu;
  #endif
 -
 -      drv->state_count = ARRAY_SIZE(tegra_idle_states);
 -      memcpy(drv->states, tegra_idle_states,
 -                      drv->state_count * sizeof(drv->states[0]));
 -
 -      ret = cpuidle_register_driver(&tegra_idle_driver);
 -      if (ret) {
 -              pr_err("CPUidle driver registration failed\n");
 -              return ret;
 -      }
 -
 -      for_each_possible_cpu(cpu) {
 -              dev = &per_cpu(tegra_idle_device, cpu);
 -              dev->cpu = cpu;
 -#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
 -              dev->coupled_cpus = *cpu_possible_mask;
 -#endif
 -
 -              dev->state_count = drv->state_count;
 -              ret = cpuidle_register_device(dev);
 -              if (ret) {
 -                      pr_err("CPU%u: CPUidle device registration failed\n",
 -                              cpu);
 -                      return ret;
 -              }
 -      }
 -      return 0;
 +      return cpuidle_register(&tegra_idle_driver, cpu_possible_mask);
  }
index 9387daeeadc8371b48faa3b180669c7e53d1b0f8,c0931c8bb3e5f12c65aebef545c01e9305cb963d..3cf9aca5f3ea9de1266d11b67a1e7c4ae62a0ee8
@@@ -43,6 -43,7 +43,6 @@@ static int tegra30_idle_lp2(struct cpui
  static struct cpuidle_driver tegra_idle_driver = {
        .name = "tegra_idle",
        .owner = THIS_MODULE,
 -      .en_core_tk_irqen = 1,
  #ifdef CONFIG_PM_SLEEP
        .state_count = 2,
  #else
        },
  };
  
 -static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device);
 -
  #ifdef CONFIG_PM_SLEEP
  static bool tegra30_cpu_cluster_power_down(struct cpuidle_device *dev,
                                           struct cpuidle_driver *drv,
                                           int index)
  {
-       struct cpuidle_state *state = &drv->states[index];
-       u32 cpu_on_time = state->exit_latency;
-       u32 cpu_off_time = state->target_residency - state->exit_latency;
        /* All CPUs entering LP2 is not working.
         * Don't let CPU0 enter LP2 when any secondary CPU is online.
         */
@@@ -83,7 -82,7 +79,7 @@@
  
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
  
-       tegra_idle_lp2_last(cpu_on_time, cpu_off_time);
+       tegra_idle_lp2_last();
  
        clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
  
@@@ -150,8 -149,32 +146,8 @@@ static int tegra30_idle_lp2(struct cpui
  
  int __init tegra30_cpuidle_init(void)
  {
 -      int ret;
 -      unsigned int cpu;
 -      struct cpuidle_device *dev;
 -      struct cpuidle_driver *drv = &tegra_idle_driver;
 -
  #ifdef CONFIG_PM_SLEEP
        tegra_tear_down_cpu = tegra30_tear_down_cpu;
  #endif
 -
 -      ret = cpuidle_register_driver(&tegra_idle_driver);
 -      if (ret) {
 -              pr_err("CPUidle driver registration failed\n");
 -              return ret;
 -      }
 -
 -      for_each_possible_cpu(cpu) {
 -              dev = &per_cpu(tegra_idle_device, cpu);
 -              dev->cpu = cpu;
 -
 -              dev->state_count = drv->state_count;
 -              ret = cpuidle_register_device(dev);
 -              if (ret) {
 -                      pr_err("CPU%u: CPUidle device registration failed\n",
 -                              cpu);
 -                      return ret;
 -              }
 -      }
 -      return 0;
 +      return cpuidle_register(&tegra_idle_driver, NULL);
  }
diff --combined arch/arm/mach-tegra/pm.c
index 891fb70d0aa7f8a05bf65f3f3606790c70010ab6,d647e9e0e1970e70ffe4e4ed7a11225aff6f89e9..45cf52c7e528684f2400416298f161f9ffea4d34
@@@ -22,7 -22,7 +22,7 @@@
  #include <linux/cpumask.h>
  #include <linux/delay.h>
  #include <linux/cpu_pm.h>
- #include <linux/clk.h>
+ #include <linux/suspend.h>
  #include <linux/err.h>
  #include <linux/clk/tegra.h>
  
  #include "reset.h"
  #include "flowctrl.h"
  #include "fuse.h"
+ #include "pmc.h"
  #include "sleep.h"
  
- #define TEGRA_POWER_CPU_PWRREQ_OE     (1 << 16)  /* CPU pwr req enable */
- #define PMC_CTRL              0x0
- #define PMC_CPUPWRGOOD_TIMER  0xc8
- #define PMC_CPUPWROFF_TIMER   0xcc
  #ifdef CONFIG_PM_SLEEP
  static DEFINE_SPINLOCK(tegra_lp2_lock);
- static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
- static struct clk *tegra_pclk;
  void (*tegra_tear_down_cpu)(void);
  
- static void set_power_timers(unsigned long us_on, unsigned long us_off)
- {
-       unsigned long long ticks;
-       unsigned long long pclk;
-       unsigned long rate;
-       static unsigned long tegra_last_pclk;
-       if (tegra_pclk == NULL) {
-               tegra_pclk = clk_get_sys(NULL, "pclk");
-               WARN_ON(IS_ERR(tegra_pclk));
-       }
-       rate = clk_get_rate(tegra_pclk);
-       if (WARN_ON_ONCE(rate <= 0))
-               pclk = 100000000;
-       else
-               pclk = rate;
-       if ((rate != tegra_last_pclk)) {
-               ticks = (us_on * pclk) + 999999ull;
-               do_div(ticks, 1000000);
-               writel((unsigned long)ticks, pmc + PMC_CPUPWRGOOD_TIMER);
-               ticks = (us_off * pclk) + 999999ull;
-               do_div(ticks, 1000000);
-               writel((unsigned long)ticks, pmc + PMC_CPUPWROFF_TIMER);
-               wmb();
-       }
-       tegra_last_pclk = pclk;
- }
  /*
   * restore_cpu_complex
   *
@@@ -162,11 -123,6 +123,11 @@@ bool tegra_set_cpu_in_lp2(int phy_cpu_i
        return last_cpu;
  }
  
 +int tegra_cpu_do_idle(void)
 +{
 +      return cpu_do_idle();
 +}
 +
  static int tegra_sleep_cpu(unsigned long v2p)
  {
        setup_mm_for_reboot();
        return 0;
  }
  
- void tegra_idle_lp2_last(u32 cpu_on_time, u32 cpu_off_time)
+ void tegra_idle_lp2_last(void)
  {
-       u32 mode;
-       /* Only the last cpu down does the final suspend steps */
-       mode = readl(pmc + PMC_CTRL);
-       mode |= TEGRA_POWER_CPU_PWRREQ_OE;
-       writel(mode, pmc + PMC_CTRL);
-       set_power_timers(cpu_on_time, cpu_off_time);
+       tegra_pmc_pm_set(TEGRA_SUSPEND_LP2);
  
        cpu_cluster_pm_enter();
        suspend_cpu_complex();
        restore_cpu_complex();
        cpu_cluster_pm_exit();
  }
+ enum tegra_suspend_mode tegra_pm_validate_suspend_mode(
+                               enum tegra_suspend_mode mode)
+ {
+       /* Tegra114 didn't support any suspending mode yet. */
+       if (tegra_chip_id == TEGRA114)
+               return TEGRA_SUSPEND_NONE;
+       /*
+        * The Tegra devices only support suspending to LP2 currently.
+        */
+       if (mode > TEGRA_SUSPEND_LP2)
+               return TEGRA_SUSPEND_LP2;
+       return mode;
+ }
+ static const char *lp_state[TEGRA_MAX_SUSPEND_MODE] = {
+       [TEGRA_SUSPEND_NONE] = "none",
+       [TEGRA_SUSPEND_LP2] = "LP2",
+       [TEGRA_SUSPEND_LP1] = "LP1",
+       [TEGRA_SUSPEND_LP0] = "LP0",
+ };
+ static int __cpuinit tegra_suspend_enter(suspend_state_t state)
+ {
+       enum tegra_suspend_mode mode = tegra_pmc_get_suspend_mode();
+       if (WARN_ON(mode < TEGRA_SUSPEND_NONE ||
+                   mode >= TEGRA_MAX_SUSPEND_MODE))
+               return -EINVAL;
+       pr_info("Entering suspend state %s\n", lp_state[mode]);
+       tegra_pmc_pm_set(mode);
+       local_fiq_disable();
+       suspend_cpu_complex();
+       switch (mode) {
+       case TEGRA_SUSPEND_LP2:
+               tegra_set_cpu_in_lp2(0);
+               break;
+       default:
+               break;
+       }
+       cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, &tegra_sleep_cpu);
+       switch (mode) {
+       case TEGRA_SUSPEND_LP2:
+               tegra_clear_cpu_in_lp2(0);
+               break;
+       default:
+               break;
+       }
+       restore_cpu_complex();
+       local_fiq_enable();
+       return 0;
+ }
+ static const struct platform_suspend_ops tegra_suspend_ops = {
+       .valid          = suspend_valid_only_mem,
+       .enter          = tegra_suspend_enter,
+ };
+ void __init tegra_init_suspend(void)
+ {
+       if (tegra_pmc_get_suspend_mode() == TEGRA_SUSPEND_NONE)
+               return;
+       tegra_pmc_suspend_init();
+       suspend_set_ops(&tegra_suspend_ops);
+ }
  #endif