Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Feb 2013 23:38:49 +0000 (15:38 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 21 Feb 2013 23:38:49 +0000 (15:38 -0800)
Pull ARM SoC device tree conversions from Arnd Bergmann:
 "These are device tree conversions for a number of platforms, with the
  intention of turning code from board files into device tree
  descriptions.  Notable changes are:

   - davinci bindings for pinctrl, MTD, RTC, watchdog and i2c

   - nomadik bindings for all devices, removing the board files

   - bcm2835 bindings for mmc and i2c

   - tegra bindings for hdmi, keyboard, audio, as well as some updates

   - at91 bindings for hardware ecc and for devices on RM9200

   - mxs bindings for cfa100xx

   - sunxi support for Miniand Hackberry board"

* tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (72 commits)
  Revert "sunxi: a10-cubieboard: Add user LEDs to the device tree"
  Revert "sunxi: a13-olinuxino: Add user LED to the device tree"
  clk: tegra: initialise parent of uart clocks
  ARM: tegra: remove clock-frequency properties from serial nodes
  clk: tegra: fix driver to match DT binding
  clk: tegra: local arrays should be static
  clk: tegra: Add missing spinlock for hclk and pclk
  clk: tegra: Implement locking for super clock
  clk: tegra: fix wrong clock index between se to sata_cold
  sunxi: a13-olinuxino: Add user LED to the device tree
  ARM: davinci: da850 DT: add support for machine reboot
  ARM: davinci: da850: add wdt DT node
  ARM: davinci: da850: add DT node for I2C0
  ARM: at91: at91sam9n12: add DT parameters to enable PMECC
  ARM: at91: at91sam9x5: add DT parameters to enable PMECC
  ARM: at91: add EMAC bindings to RM9200 DT
  ARM: at91: add SSC bindings to RM9200 DT
  ARM: at91: add MMC bindings to RM9200 DT
  ARM: at91: Animeo IP: enable watchdog support
  ARM: nomadik: fix OF compilation regression
  ...

1  2 
arch/arm/Kconfig
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/at91sam9n12.dtsi
arch/arm/boot/dts/at91sam9x5.dtsi
arch/arm/configs/da8xx_omapl_defconfig
arch/arm/mach-nomadik/include/mach/uncompress.h
drivers/mtd/nand/fsmc_nand.c
drivers/pinctrl/pinctrl-nomadik.c

diff --combined arch/arm/Kconfig
@@@ -36,6 -36,7 +36,6 @@@ config AR
        select HAVE_GENERIC_HARDIRQS
        select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
        select HAVE_IDE if PCI || ISA || PCMCIA
 -      select HAVE_IRQ_WORK
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_LZMA
        select HAVE_KERNEL_LZO
@@@ -260,8 -261,7 +260,8 @@@ config MM
  #
  choice
        prompt "ARM system type"
 -      default ARCH_MULTIPLATFORM
 +      default ARCH_VERSATILE if !MMU
 +      default ARCH_MULTIPLATFORM if MMU
  
  config ARCH_MULTIPLATFORM
        bool "Allow multiple platforms to be selected"
@@@ -344,10 -344,10 +344,10 @@@ config ARCH_BCM283
        select ARM_ERRATA_411920
        select ARM_TIMER_SP804
        select CLKDEV_LOOKUP
 +      select CLKSRC_OF
        select COMMON_CLK
        select CPU_V6
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select MULTI_IRQ_HANDLER
        select PINCTRL
        select PINCTRL_BCM2835
@@@ -641,12 -641,12 +641,12 @@@ config ARCH_LPC32X
  config ARCH_TEGRA
        bool "NVIDIA Tegra"
        select ARCH_HAS_CPUFREQ
 +      select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select CLKSRC_OF
        select COMMON_CLK
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
@@@ -700,7 -700,6 +700,7 @@@ config ARCH_SHMOBIL
        select MULTI_IRQ_HANDLER
        select NEED_MACH_MEMORY_H
        select NO_IOPORT
 +      select PINCTRL
        select PM_GENERIC_DOMAINS if PM
        select SPARSE_IRQ
        help
@@@ -747,6 -746,7 +747,6 @@@ config ARCH_S3C24X
        select ARCH_HAS_CPUFREQ
        select ARCH_USES_GETTIMEOFFSET
        select CLKDEV_LOOKUP
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -789,6 -789,7 +789,6 @@@ config ARCH_S5P64X
        select CLKSRC_MMIO
        select CPU_V6
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -803,6 -804,7 +803,6 @@@ config ARCH_S5PC10
        select ARCH_USES_GETTIMEOFFSET
        select CLKDEV_LOOKUP
        select CPU_V7
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -820,6 -822,7 +820,6 @@@ config ARCH_S5PV21
        select CLKSRC_MMIO
        select CPU_V7
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -837,6 -840,7 +837,6 @@@ config ARCH_EXYNO
        select CLKDEV_LOOKUP
        select CPU_V7
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
@@@ -871,6 -875,7 +871,6 @@@ config ARCH_U30
        select COMMON_CLK
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
 -      select GENERIC_GPIO
        select HAVE_TCM
        select SPARSE_IRQ
        help
@@@ -896,10 -901,12 +896,12 @@@ config ARCH_NOMADI
        select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
        select ARM_VIC
+       select CLKSRC_NOMADIK_MTU
        select COMMON_CLK
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
        select MIGHT_HAVE_CACHE_L2X0
+       select USE_OF
        select PINCTRL
        select PINCTRL_STN8815
        select SPARSE_IRQ
@@@ -934,24 -941,17 +936,24 @@@ config ARCH_DAVINC
        help
          Support for TI's DaVinci platform.
  
 -config ARCH_OMAP
 -      bool "TI OMAP"
 +config ARCH_OMAP1
 +      bool "TI OMAP1"
        depends on MMU
        select ARCH_HAS_CPUFREQ
        select ARCH_HAS_HOLES_MEMORYMODEL
 +      select ARCH_OMAP
        select ARCH_REQUIRE_GPIOLIB
 +      select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
 +      select GENERIC_IRQ_CHIP
        select HAVE_CLK
 +      select HAVE_IDE
 +      select IRQ_DOMAIN
 +      select NEED_MACH_IO_H if PCCARD
 +      select NEED_MACH_MEMORY_H
        help
 -        Support for TI's OMAP platform (OMAP1/2/3/4).
 +        Support for older TI OMAP1 (omap7xx, omap15xx or omap16xx)
  
  endchoice
  
@@@ -1074,12 -1074,17 +1076,12 @@@ source "arch/arm/mach-realview/Kconfig
  source "arch/arm/mach-sa1100/Kconfig"
  
  source "arch/arm/plat-samsung/Kconfig"
 -source "arch/arm/plat-s3c24xx/Kconfig"
  
  source "arch/arm/mach-socfpga/Kconfig"
  
  source "arch/arm/plat-spear/Kconfig"
  
  source "arch/arm/mach-s3c24xx/Kconfig"
 -if ARCH_S3C24XX
 -source "arch/arm/mach-s3c2412/Kconfig"
 -source "arch/arm/mach-s3c2440/Kconfig"
 -endif
  
  if ARCH_S3C64XX
  source "arch/arm/mach-s3c64xx/Kconfig"
@@@ -1433,10 -1438,6 +1435,10 @@@ config ISA_DM
        bool
        select ISA_DMA_API
  
 +config ARCH_NO_VIRT_TO_BUS
 +      def_bool y
 +      depends on !ARCH_RPC && !ARCH_NETWINDER && !ARCH_SHARK
 +
  # Select ISA DMA interface
  config ISA_DMA_API
        bool
@@@ -1518,6 -1519,7 +1520,6 @@@ config SM
  
  config SMP_ON_UP
        bool "Allow booting SMP kernel on uniprocessor systems (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
        depends on SMP && !XIP_KERNEL
        default y
        help
@@@ -1606,16 -1608,6 +1608,16 @@@ config HOTPLUG_CP
          Say Y here to experiment with turning CPUs off and on.  CPUs
          can be controlled through /sys/devices/system/cpu.
  
 +config ARM_PSCI
 +      bool "Support for the ARM Power State Coordination Interface (PSCI)"
 +      depends on CPU_V7
 +      help
 +        Say Y here if you want Linux to communicate with system firmware
 +        implementing the PSCI specification for CPU-centric power
 +        management operations described in ARM document number ARM DEN
 +        0022A ("Power State Coordination Interface System Software on
 +        ARM processors").
 +
  config LOCAL_TIMERS
        bool "Use local timer interrupts"
        depends on SMP
@@@ -1633,7 -1625,7 +1635,7 @@@ config ARCH_NR_GPI
        default 355 if ARCH_U8500
        default 264 if MACH_H4700
        default 512 if SOC_OMAP5
 -      default 288 if ARCH_VT8500
 +      default 288 if ARCH_VT8500 || ARCH_SUNXI
        default 0
        help
          Maximum number of GPIOs in the system.
@@@ -1651,9 -1643,6 +1653,9 @@@ config H
        default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE
        default 100
  
 +config SCHED_HRTICK
 +      def_bool HIGH_RES_TIMERS
 +
  config THUMB2_KERNEL
        bool "Compile the kernel in Thumb-2 mode"
        depends on CPU_V7 && !CPU_V6 && !CPU_V6K
@@@ -1718,7 -1707,7 +1720,7 @@@ config AEAB
  
  config OABI_COMPAT
        bool "Allow old ABI binaries to run with this kernel (EXPERIMENTAL)"
 -      depends on AEABI && EXPERIMENTAL && !THUMB2_KERNEL
 +      depends on AEABI && !THUMB2_KERNEL
        default y
        help
          This option preserves the old syscall interface along with the
@@@ -1842,6 -1831,7 +1844,6 @@@ config SECCOM
  
  config CC_STACKPROTECTOR
        bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
        help
          This option turns on the -fstack-protector GCC feature. This
          feature puts, at the beginning of functions, a canary value on
@@@ -1858,7 -1848,7 +1860,7 @@@ config XEN_DOM
  
  config XEN
        bool "Xen guest support on ARM (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL && ARM && OF
 +      depends on ARM && OF
        depends on CPU_V7 && !CPU_V6
        help
          Say Y if you want to run Linux in a Virtual Machine on Xen on ARM.
@@@ -1927,7 -1917,7 +1929,7 @@@ config ZBOOT_RO
  
  choice
        prompt "Include SD/MMC loader in zImage (EXPERIMENTAL)"
 -      depends on ZBOOT_ROM && ARCH_SH7372 && EXPERIMENTAL
 +      depends on ZBOOT_ROM && ARCH_SH7372
        default ZBOOT_ROM_NONE
        help
          Include experimental SD/MMC loading code in the ROM-able zImage.
@@@ -1956,7 -1946,7 +1958,7 @@@ endchoic
  
  config ARM_APPENDED_DTB
        bool "Use appended device tree blob to zImage (EXPERIMENTAL)"
 -      depends on OF && !ZBOOT_ROM && EXPERIMENTAL
 +      depends on OF && !ZBOOT_ROM
        help
          With this option, the boot code will look for a device tree binary
          (DTB) appended to zImage
@@@ -2074,7 -2064,7 +2076,7 @@@ config XIP_PHYS_ADD
  
  config KEXEC
        bool "Kexec system call (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL && (!SMP || HOTPLUG_CPU)
 +      depends on (!SMP || HOTPLUG_CPU)
        help
          kexec is a system call that implements the ability to shutdown your
          current kernel, and to start another kernel.  It is like a reboot
@@@ -2096,6 -2086,7 +2098,6 @@@ config ATAGS_PRO
  
  config CRASH_DUMP
        bool "Build kdump crash kernel (EXPERIMENTAL)"
 -      depends on EXPERIMENTAL
        help
          Generate crash dump after being started by kexec. This should
          be normally only set in special crash dump kernels which are
@@@ -2162,7 -2153,7 +2164,7 @@@ config CPU_FREQ_S3
  
  config CPU_FREQ_S3C24XX
        bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)"
 -      depends on ARCH_S3C24XX && CPU_FREQ && EXPERIMENTAL
 +      depends on ARCH_S3C24XX && CPU_FREQ
        select CPU_FREQ_S3C
        help
          This enables the CPUfreq driver for the Samsung S3C24XX family
  
  config CPU_FREQ_S3C24XX_PLL
        bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)"
 -      depends on CPU_FREQ_S3C24XX && EXPERIMENTAL
 +      depends on CPU_FREQ_S3C24XX
        help
          Compile in support for changing the PLL frequency from the
          S3C24XX series CPUfreq driver. The PLL takes time to settle
@@@ -2237,7 -2228,7 +2239,7 @@@ config FPE_NWFPE_X
  
  config FPE_FASTFPE
        bool "FastFPE math emulation (EXPERIMENTAL)"
 -      depends on (!AEABI || OABI_COMPAT) && !CPU_32v3 && EXPERIMENTAL
 +      depends on (!AEABI || OABI_COMPAT) && !CPU_32v3
        ---help---
          Say Y here to include the FAST floating point emulator in the kernel.
          This is an experimental much faster emulator which now also has full
@@@ -2319,5 -2310,3 +2321,5 @@@ source "security/Kconfig
  source "crypto/Kconfig"
  
  source "lib/Kconfig"
 +
 +source "arch/arm/kvm/Kconfig"
@@@ -96,11 -96,13 +96,13 @@@ dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dt
        imx28-apf28dev.dtb \
        imx28-apx4devkit.dtb \
        imx28-cfa10036.dtb \
+       imx28-cfa10037.dtb \
        imx28-cfa10049.dtb \
        imx28-evk.dtb \
        imx28-m28evk.dtb \
        imx28-sps1.dtb \
        imx28-tx28.dtb
+ dtb-$(CONFIG_ARCH_NOMADIK) += ste-nomadik-s8815.dtb
  dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
        omap3-beagle.dtb \
        omap3-beagle-xm.dtb \
@@@ -125,8 -127,6 +127,8 @@@ dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kz
        r8a7740-armadillo800eva.dtb \
        sh73a0-kzm9g.dtb \
        sh7372-mackerel.dtb
 +dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_cyclone5.dtb \
 +      socfpga_vt.dtb
  dtb-$(CONFIG_ARCH_SPEAR13XX) += spear1310-evb.dtb \
        spear1340-evb.dtb
  dtb-$(CONFIG_ARCH_SPEAR3XX)+= spear300-evb.dtb \
        spear320-hmi.dtb
  dtb-$(CONFIG_ARCH_SPEAR6XX)+= spear600-evb.dtb
  dtb-$(CONFIG_ARCH_SUNXI) += sun4i-a10-cubieboard.dtb \
+       sun4i-a10-hackberry.dtb \
        sun5i-a13-olinuxino.dtb
  dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
+       tegra20-iris-512.dtb \
        tegra20-medcom-wide.dtb \
        tegra20-paz00.dtb \
        tegra20-plutux.dtb \
        tegra20-trimslice.dtb \
        tegra20-ventana.dtb \
        tegra20-whistler.dtb \
+       tegra30-beaver.dtb \
        tegra30-cardhu-a02.dtb \
        tegra30-cardhu-a04.dtb \
        tegra114-dalmore.dtb \
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf801c000 0x4000>;
                                interrupts = <5 4 5>;
 -                              atmel,use-dma-rx;
 -                              atmel,use-dma-tx;
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_usart0>;
                                status = "disabled";
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf8020000 0x4000>;
                                interrupts = <6 4 5>;
 -                              atmel,use-dma-rx;
 -                              atmel,use-dma-tx;
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_usart1>;
                                status = "disabled";
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf8024000 0x4000>;
                                interrupts = <7 4 5>;
 -                              atmel,use-dma-rx;
 -                              atmel,use-dma-tx;
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_usart2>;
                                status = "disabled";
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf8028000 0x4000>;
                                interrupts = <8 4 5>;
 -                              atmel,use-dma-rx;
 -                              atmel,use-dma-tx;
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_usart3>;
                                status = "disabled";
                        reg = < 0x40000000 0x10000000
                                0xffffe000 0x00000600
                                0xffffe600 0x00000200
-                               0x00100000 0x00100000
+                               0x00108000 0x00018000
                               >;
+                       atmel,pmecc-lookup-table-offset = <0x0 0x8000>;
                        atmel,nand-addr-offset = <21>;
                        atmel,nand-cmd-offset = <22>;
                        pinctrl-names = "default";
                                };
  
                                usart3 {
 -                                      pinctrl_uart3: usart3-0 {
 +                                      pinctrl_usart3: usart3-0 {
                                                atmel,pins =
 -                                                      <2 23 0x2 0x1   /* PC22 periph B with pullup */
 +                                                      <2 22 0x2 0x1   /* PC22 periph B with pullup */
                                                         2 23 0x2 0x0>; /* PC23 periph B */
                                        };
  
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf801c000 0x200>;
                                interrupts = <5 4 5>;
 -                              atmel,use-dma-rx;
 -                              atmel,use-dma-tx;
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_usart0>;
                                status = "disabled";
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf8020000 0x200>;
                                interrupts = <6 4 5>;
 -                              atmel,use-dma-rx;
 -                              atmel,use-dma-tx;
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_usart1>;
                                status = "disabled";
                                compatible = "atmel,at91sam9260-usart";
                                reg = <0xf8024000 0x200>;
                                interrupts = <7 4 5>;
 -                              atmel,use-dma-rx;
 -                              atmel,use-dma-tx;
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_usart2>;
                                status = "disabled";
                        #address-cells = <1>;
                        #size-cells = <1>;
                        reg = <0x40000000 0x10000000
+                              0xffffe000 0x600         /* PMECC Registers */
+                              0xffffe600 0x200         /* PMECC Error Location Registers */
+                              0x00108000 0x18000       /* PMECC looup table in ROM code  */
                              >;
+                       atmel,pmecc-lookup-table-offset = <0x0 0x8000>;
                        atmel,nand-addr-offset = <21>;
                        atmel,nand-cmd-offset = <22>;
                        pinctrl-names = "default";
@@@ -36,7 -36,6 +36,7 @@@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=
  CONFIG_CPU_FREQ_GOV_POWERSAVE=m
  CONFIG_CPU_FREQ_GOV_ONDEMAND=m
  CONFIG_CPU_IDLE=y
 +CONFIG_PM_RUNTIME=y
  CONFIG_NET=y
  CONFIG_PACKET=y
  CONFIG_UNIX=y
@@@ -46,8 -45,6 +46,8 @@@ CONFIG_IP_PNP_DHCP=
  # CONFIG_INET_LRO is not set
  CONFIG_NETFILTER=y
  CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 +CONFIG_DEVTMPFS=y
 +CONFIG_DEVTMPFS_MOUNT=y
  # CONFIG_FW_LOADER is not set
  CONFIG_BLK_DEV_LOOP=m
  CONFIG_BLK_DEV_RAM=y
@@@ -84,6 -81,7 +84,7 @@@ CONFIG_SERIAL_OF_PLATFORM=
  CONFIG_I2C=y
  CONFIG_I2C_CHARDEV=y
  CONFIG_I2C_DAVINCI=y
+ CONFIG_PINCTRL_SINGLE=y
  # CONFIG_HWMON is not set
  CONFIG_WATCHDOG=y
  CONFIG_REGULATOR=y
@@@ -21,7 -21,6 +21,6 @@@
  
  #include <asm/setup.h>
  #include <asm/io.h>
- #include <mach/hardware.h>
  
  /* we need the constants in amba/serial.h, but it refers to amba_device */
  struct amba_device;
@@@ -58,4 -57,6 +57,4 @@@ static inline void arch_decomp_setup(vo
  {
  }
  
 -#define arch_decomp_wdog() /* nothing to do here */
 -
  #endif /* __ASM_ARCH_UNCOMPRESS_H */
@@@ -937,35 -937,42 +937,35 @@@ static int __init fsmc_nand_probe(struc
        if (!res)
                return -EINVAL;
  
 -      host->data_va = devm_request_and_ioremap(&pdev->dev, res);
 -      if (!host->data_va) {
 -              dev_err(&pdev->dev, "data ioremap failed\n");
 -              return -ENOMEM;
 -      }
 +      host->data_va = devm_ioremap_resource(&pdev->dev, res);
 +      if (IS_ERR(host->data_va))
 +              return PTR_ERR(host->data_va);
 +      
        host->data_pa = (dma_addr_t)res->start;
  
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_addr");
        if (!res)
                return -EINVAL;
  
 -      host->addr_va = devm_request_and_ioremap(&pdev->dev, res);
 -      if (!host->addr_va) {
 -              dev_err(&pdev->dev, "ale ioremap failed\n");
 -              return -ENOMEM;
 -      }
 +      host->addr_va = devm_ioremap_resource(&pdev->dev, res);
 +      if (IS_ERR(host->addr_va))
 +              return PTR_ERR(host->addr_va);
  
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_cmd");
        if (!res)
                return -EINVAL;
  
 -      host->cmd_va = devm_request_and_ioremap(&pdev->dev, res);
 -      if (!host->cmd_va) {
 -              dev_err(&pdev->dev, "ale ioremap failed\n");
 -              return -ENOMEM;
 -      }
 +      host->cmd_va = devm_ioremap_resource(&pdev->dev, res);
 +      if (IS_ERR(host->cmd_va))
 +              return PTR_ERR(host->cmd_va);
  
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fsmc_regs");
        if (!res)
                return -EINVAL;
  
 -      host->regs_va = devm_request_and_ioremap(&pdev->dev, res);
 -      if (!host->regs_va) {
 -              dev_err(&pdev->dev, "regs ioremap failed\n");
 -              return -ENOMEM;
 -      }
 +      host->regs_va = devm_ioremap_resource(&pdev->dev, res);
 +      if (IS_ERR(host->regs_va))
 +              return PTR_ERR(host->regs_va);
  
        host->clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(host->clk)) {
@@@ -1211,6 -1218,7 +1211,7 @@@ static SIMPLE_DEV_PM_OPS(fsmc_nand_pm_o
  #ifdef CONFIG_OF
  static const struct of_device_id fsmc_nand_id_table[] = {
        { .compatible = "st,spear600-fsmc-nand" },
+       { .compatible = "stericsson,fsmc-nand" },
        {}
  };
  MODULE_DEVICE_TABLE(of, fsmc_nand_id_table);
@@@ -25,8 -25,6 +25,8 @@@
  #include <linux/irqdomain.h>
  #include <linux/slab.h>
  #include <linux/of_device.h>
 +#include <linux/of_address.h>
 +#include <linux/pinctrl/machine.h>
  #include <linux/pinctrl/pinctrl.h>
  #include <linux/pinctrl/pinmux.h>
  #include <linux/pinctrl/pinconf.h>
@@@ -34,8 -32,8 +34,8 @@@
  #include <linux/pinctrl/consumer.h>
  #include <linux/platform_data/pinctrl-nomadik.h>
  #include <asm/mach/irq.h>
 -#include <mach/irqs.h>
  #include "pinctrl-nomadik.h"
 +#include "core.h"
  
  /*
   * The GPIO module in the Nomadik family of Systems-on-Chip is an
@@@ -218,7 -216,7 +218,7 @@@ nmk_gpio_disable_lazy_irq(struct nmk_gp
        u32 falling = nmk_chip->fimsc & BIT(offset);
        u32 rising = nmk_chip->rimsc & BIT(offset);
        int gpio = nmk_chip->chip.base + offset;
 -      int irq = NOMADIK_GPIO_TO_IRQ(gpio);
 +      int irq = irq_find_mapping(nmk_chip->domain, offset);
        struct irq_data *d = irq_get_irq_data(irq);
  
        if (!rising && !falling)
@@@ -1343,7 -1341,8 +1343,7 @@@ static int nmk_gpio_probe(struct platfo
  
                if (of_property_read_u32(np, "gpio-bank", &dev->id)) {
                        dev_err(&dev->dev, "gpio-bank property not found\n");
 -                      ret = -EINVAL;
 -                      goto out;
 +                      return -EINVAL;
                }
  
                pdata->first_gpio = dev->id * NMK_GPIO_PER_CHIP;
        }
  
        res = platform_get_resource(dev, IORESOURCE_MEM, 0);
 -      if (!res) {
 -              ret = -ENOENT;
 -              goto out;
 -      }
 +      if (!res)
 +              return -ENOENT;
  
        irq = platform_get_irq(dev, 0);
 -      if (irq < 0) {
 -              ret = irq;
 -              goto out;
 -      }
 +      if (irq < 0)
 +              return irq;
  
        secondary_irq = platform_get_irq(dev, 1);
 -      if (secondary_irq >= 0 && !pdata->get_secondary_status) {
 -              ret = -EINVAL;
 -              goto out;
 -      }
 +      if (secondary_irq >= 0 && !pdata->get_secondary_status)
 +              return -EINVAL;
  
 -      base = devm_request_and_ioremap(&dev->dev, res);
 -      if (!base) {
 -              ret = -ENOMEM;
 -              goto out;
 -      }
 +      base = devm_ioremap_resource(&dev->dev, res);
 +      if (IS_ERR(base))
 +              return PTR_ERR(base);
  
        clk = devm_clk_get(&dev->dev, NULL);
 -      if (IS_ERR(clk)) {
 -              ret = PTR_ERR(clk);
 -              goto out;
 -      }
 +      if (IS_ERR(clk))
 +              return PTR_ERR(clk);
        clk_prepare(clk);
  
        nmk_chip = devm_kzalloc(&dev->dev, sizeof(*nmk_chip), GFP_KERNEL);
 -      if (!nmk_chip) {
 -              ret = -ENOMEM;
 -              goto out;
 -      }
 +      if (!nmk_chip)
 +              return -ENOMEM;
  
        /*
         * The virt address in nmk_chip->addr is in the nomadik register space,
  
        ret = gpiochip_add(&nmk_chip->chip);
        if (ret)
 -              goto out;
 +              return ret;
  
        BUG_ON(nmk_chip->bank >= ARRAY_SIZE(nmk_gpio_chips));
  
        platform_set_drvdata(dev, nmk_chip);
  
        if (!np)
 -              irq_start = NOMADIK_GPIO_TO_IRQ(pdata->first_gpio);
 +              irq_start = pdata->first_irq;
        nmk_chip->domain = irq_domain_add_simple(np,
                                NMK_GPIO_PER_CHIP, irq_start,
                                &nmk_gpio_irq_simple_ops, nmk_chip);
        if (!nmk_chip->domain) {
                dev_err(&dev->dev, "failed to create irqdomain\n");
 -              ret = -ENOSYS;
 -              goto out;
 +              /* Just do this, no matter if it fails */
 +              ret = gpiochip_remove(&nmk_chip->chip);
 +              return -ENOSYS;
        }
  
        nmk_gpio_init_irq(nmk_chip);
        dev_info(&dev->dev, "at address %p\n", nmk_chip->addr);
  
        return 0;
 -
 -out:
 -      dev_err(&dev->dev, "Failure %i for GPIO %i-%i\n", ret,
 -                pdata->first_gpio, pdata->first_gpio+31);
 -
 -      return ret;
  }
  
  static int nmk_get_groups_cnt(struct pinctrl_dev *pctldev)
@@@ -1492,285 -1508,11 +1492,285 @@@ static void nmk_pin_dbg_show(struct pin
        nmk_gpio_dbg_show_one(s, pctldev, chip, offset - chip->base, offset);
  }
  
 +static void nmk_pinctrl_dt_free_map(struct pinctrl_dev *pctldev,
 +              struct pinctrl_map *map, unsigned num_maps)
 +{
 +      int i;
 +
 +      for (i = 0; i < num_maps; i++)
 +              if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN)
 +                      kfree(map[i].data.configs.configs);
 +      kfree(map);
 +}
 +
 +static int nmk_dt_reserve_map(struct pinctrl_map **map, unsigned *reserved_maps,
 +              unsigned *num_maps, unsigned reserve)
 +{
 +      unsigned old_num = *reserved_maps;
 +      unsigned new_num = *num_maps + reserve;
 +      struct pinctrl_map *new_map;
 +
 +      if (old_num >= new_num)
 +              return 0;
 +
 +      new_map = krealloc(*map, sizeof(*new_map) * new_num, GFP_KERNEL);
 +      if (!new_map)
 +              return -ENOMEM;
 +
 +      memset(new_map + old_num, 0, (new_num - old_num) * sizeof(*new_map));
 +
 +      *map = new_map;
 +      *reserved_maps = new_num;
 +
 +      return 0;
 +}
 +
 +static int nmk_dt_add_map_mux(struct pinctrl_map **map, unsigned *reserved_maps,
 +              unsigned *num_maps, const char *group,
 +              const char *function)
 +{
 +      if (*num_maps == *reserved_maps)
 +              return -ENOSPC;
 +
 +      (*map)[*num_maps].type = PIN_MAP_TYPE_MUX_GROUP;
 +      (*map)[*num_maps].data.mux.group = group;
 +      (*map)[*num_maps].data.mux.function = function;
 +      (*num_maps)++;
 +
 +      return 0;
 +}
 +
 +static int nmk_dt_add_map_configs(struct pinctrl_map **map,
 +              unsigned *reserved_maps,
 +              unsigned *num_maps, const char *group,
 +              unsigned long *configs, unsigned num_configs)
 +{
 +      unsigned long *dup_configs;
 +
 +      if (*num_maps == *reserved_maps)
 +              return -ENOSPC;
 +
 +      dup_configs = kmemdup(configs, num_configs * sizeof(*dup_configs),
 +                            GFP_KERNEL);
 +      if (!dup_configs)
 +              return -ENOMEM;
 +
 +      (*map)[*num_maps].type = PIN_MAP_TYPE_CONFIGS_PIN;
 +
 +      (*map)[*num_maps].data.configs.group_or_pin = group;
 +      (*map)[*num_maps].data.configs.configs = dup_configs;
 +      (*map)[*num_maps].data.configs.num_configs = num_configs;
 +      (*num_maps)++;
 +
 +      return 0;
 +}
 +
 +#define NMK_CONFIG_PIN(x,y) { .property = x, .config = y, }
 +#define NMK_CONFIG_PIN_ARRAY(x,y) { .property = x, .choice = y, \
 +      .size = ARRAY_SIZE(y), }
 +
 +static const unsigned long nmk_pin_input_modes[] = {
 +      PIN_INPUT_NOPULL,
 +      PIN_INPUT_PULLUP,
 +      PIN_INPUT_PULLDOWN,
 +};
 +
 +static const unsigned long nmk_pin_output_modes[] = {
 +      PIN_OUTPUT_LOW,
 +      PIN_OUTPUT_HIGH,
 +      PIN_DIR_OUTPUT,
 +};
 +
 +static const unsigned long nmk_pin_sleep_modes[] = {
 +      PIN_SLEEPMODE_DISABLED,
 +      PIN_SLEEPMODE_ENABLED,
 +};
 +
 +static const unsigned long nmk_pin_sleep_input_modes[] = {
 +      PIN_SLPM_INPUT_NOPULL,
 +      PIN_SLPM_INPUT_PULLUP,
 +      PIN_SLPM_INPUT_PULLDOWN,
 +      PIN_SLPM_DIR_INPUT,
 +};
 +
 +static const unsigned long nmk_pin_sleep_output_modes[] = {
 +      PIN_SLPM_OUTPUT_LOW,
 +      PIN_SLPM_OUTPUT_HIGH,
 +      PIN_SLPM_DIR_OUTPUT,
 +};
 +
 +static const unsigned long nmk_pin_sleep_wakeup_modes[] = {
 +      PIN_SLPM_WAKEUP_DISABLE,
 +      PIN_SLPM_WAKEUP_ENABLE,
 +};
 +
 +static const unsigned long nmk_pin_gpio_modes[] = {
 +      PIN_GPIOMODE_DISABLED,
 +      PIN_GPIOMODE_ENABLED,
 +};
 +
 +static const unsigned long nmk_pin_sleep_pdis_modes[] = {
 +      PIN_SLPM_PDIS_DISABLED,
 +      PIN_SLPM_PDIS_ENABLED,
 +};
 +
 +struct nmk_cfg_param {
 +      const char *property;
 +      unsigned long config;
 +      const unsigned long *choice;
 +      int size;
 +};
 +
 +static const struct nmk_cfg_param nmk_cfg_params[] = {
 +      NMK_CONFIG_PIN_ARRAY("ste,input",               nmk_pin_input_modes),
 +      NMK_CONFIG_PIN_ARRAY("ste,output",              nmk_pin_output_modes),
 +      NMK_CONFIG_PIN_ARRAY("ste,sleep",               nmk_pin_sleep_modes),
 +      NMK_CONFIG_PIN_ARRAY("ste,sleep-input",         nmk_pin_sleep_input_modes),
 +      NMK_CONFIG_PIN_ARRAY("ste,sleep-output",        nmk_pin_sleep_output_modes),
 +      NMK_CONFIG_PIN_ARRAY("ste,sleep-wakeup",        nmk_pin_sleep_wakeup_modes),
 +      NMK_CONFIG_PIN_ARRAY("ste,gpio",                nmk_pin_gpio_modes),
 +      NMK_CONFIG_PIN_ARRAY("ste,sleep-pull-disable",  nmk_pin_sleep_pdis_modes),
 +};
 +
 +static int nmk_dt_pin_config(int index, int val, unsigned long *config)
 +{
 +      int ret = 0;
 +
 +      if (nmk_cfg_params[index].choice == NULL)
 +              *config = nmk_cfg_params[index].config;
 +      else {
 +              /* test if out of range */
 +              if  (val < nmk_cfg_params[index].size) {
 +                      *config = nmk_cfg_params[index].config |
 +                              nmk_cfg_params[index].choice[val];
 +              }
 +      }
 +      return ret;
 +}
 +
 +static const char *nmk_find_pin_name(struct pinctrl_dev *pctldev, const char *pin_name)
 +{
 +      int i, pin_number;
 +      struct nmk_pinctrl *npct = pinctrl_dev_get_drvdata(pctldev);
 +
 +      if (sscanf((char *)pin_name, "GPIO%d", &pin_number) == 1)
 +              for (i = 0; i < npct->soc->npins; i++)
 +                      if (npct->soc->pins[i].number == pin_number)
 +                              return npct->soc->pins[i].name;
 +      return NULL;
 +}
 +
 +static bool nmk_pinctrl_dt_get_config(struct device_node *np,
 +              unsigned long *configs)
 +{
 +      bool has_config = 0;
 +      unsigned long cfg = 0;
 +      int i, val, ret;
 +
 +      for (i = 0; i < ARRAY_SIZE(nmk_cfg_params); i++) {
 +              ret = of_property_read_u32(np,
 +                              nmk_cfg_params[i].property, &val);
 +              if (ret != -EINVAL) {
 +                      if (nmk_dt_pin_config(i, val, &cfg) == 0) {
 +                              *configs |= cfg;
 +                              has_config = 1;
 +                      }
 +              }
 +      }
 +
 +      return has_config;
 +}
 +
 +int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
 +              struct device_node *np,
 +              struct pinctrl_map **map,
 +              unsigned *reserved_maps,
 +              unsigned *num_maps)
 +{
 +      int ret;
 +      const char *function = NULL;
 +      unsigned long configs = 0;
 +      bool has_config = 0;
 +      unsigned reserve = 0;
 +      struct property *prop;
 +      const char *group, *gpio_name;
 +      struct device_node *np_config;
 +
 +      ret = of_property_read_string(np, "ste,function", &function);
 +      if (ret >= 0)
 +              reserve = 1;
 +
 +      has_config = nmk_pinctrl_dt_get_config(np, &configs);
 +
 +      np_config = of_parse_phandle(np, "ste,config", 0);
 +      if (np_config)
 +              has_config |= nmk_pinctrl_dt_get_config(np_config, &configs);
 +
 +      ret = of_property_count_strings(np, "ste,pins");
 +      if (ret < 0)
 +              goto exit;
 +
 +      if (has_config)
 +              reserve++;
 +
 +      reserve *= ret;
 +
 +      ret = nmk_dt_reserve_map(map, reserved_maps, num_maps, reserve);
 +      if (ret < 0)
 +              goto exit;
 +
 +      of_property_for_each_string(np, "ste,pins", prop, group) {
 +              if (function) {
 +                      ret = nmk_dt_add_map_mux(map, reserved_maps, num_maps,
 +                                        group, function);
 +                      if (ret < 0)
 +                              goto exit;
 +              }
 +              if (has_config) {
 +                      gpio_name = nmk_find_pin_name(pctldev, group);
 +
 +                      ret = nmk_dt_add_map_configs(map, reserved_maps, num_maps,
 +                                            gpio_name, &configs, 1);
 +                      if (ret < 0)
 +                              goto exit;
 +              }
 +
 +      }
 +exit:
 +      return ret;
 +}
 +
 +int nmk_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
 +                               struct device_node *np_config,
 +                               struct pinctrl_map **map, unsigned *num_maps)
 +{
 +      unsigned reserved_maps;
 +      struct device_node *np;
 +      int ret;
 +
 +      reserved_maps = 0;
 +      *map = NULL;
 +      *num_maps = 0;
 +
 +      for_each_child_of_node(np_config, np) {
 +              ret = nmk_pinctrl_dt_subnode_to_map(pctldev, np, map,
 +                              &reserved_maps, num_maps);
 +              if (ret < 0) {
 +                      nmk_pinctrl_dt_free_map(pctldev, *map, *num_maps);
 +                      return ret;
 +              }
 +      }
 +
 +      return 0;
 +}
 +
  static struct pinctrl_ops nmk_pinctrl_ops = {
        .get_groups_count = nmk_get_groups_cnt,
        .get_group_name = nmk_get_group_name,
        .get_group_pins = nmk_get_group_pins,
        .pin_dbg_show = nmk_pin_dbg_show,
 +      .dt_node_to_map = nmk_pinctrl_dt_node_to_map,
 +      .dt_free_map = nmk_pinctrl_dt_free_map,
  };
  
  static int nmk_pmx_get_funcs_cnt(struct pinctrl_dev *pctldev)
@@@ -2104,39 -1846,20 +2104,43 @@@ static struct pinctrl_desc nmk_pinctrl_
  
  static const struct of_device_id nmk_pinctrl_match[] = {
        {
 -              .compatible = "stericsson,nmk_pinctrl",
+               .compatible = "stericsson,nmk-pinctrl-stn8815",
+               .data = (void *)PINCTRL_NMK_STN8815,
+       },
+       {
 +              .compatible = "stericsson,nmk-pinctrl",
                .data = (void *)PINCTRL_NMK_DB8500,
        },
        {},
  };
  
 +static int nmk_pinctrl_suspend(struct platform_device *pdev, pm_message_t state)
 +{
 +      struct nmk_pinctrl *npct;
 +
 +      npct = platform_get_drvdata(pdev);
 +      if (!npct)
 +              return -EINVAL;
 +
 +      return pinctrl_force_sleep(npct->pctl);
 +}
 +
 +static int nmk_pinctrl_resume(struct platform_device *pdev)
 +{
 +      struct nmk_pinctrl *npct;
 +
 +      npct = platform_get_drvdata(pdev);
 +      if (!npct)
 +              return -EINVAL;
 +
 +      return pinctrl_force_default(npct->pctl);
 +}
 +
  static int nmk_pinctrl_probe(struct platform_device *pdev)
  {
        const struct platform_device_id *platid = platform_get_device_id(pdev);
        struct device_node *np = pdev->dev.of_node;
 +      struct device_node *prcm_np;
        struct nmk_pinctrl *npct;
        struct resource *res;
        unsigned int version = 0;
        if (version == PINCTRL_NMK_DB8540)
                nmk_pinctrl_db8540_init(&npct->soc);
  
 +      if (np) {
 +              prcm_np = of_parse_phandle(np, "prcm", 0);
 +              if (prcm_np)
 +                      npct->prcm_base = of_iomap(prcm_np, 0);
 +      }
 +
 +      /* Allow platform passed information to over-write DT. */
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 -      if (res) {
 +      if (res)
                npct->prcm_base = devm_ioremap(&pdev->dev, res->start,
                                               resource_size(res));
 -              if (!npct->prcm_base) {
 -                      dev_err(&pdev->dev,
 -                              "failed to ioremap PRCM registers\n");
 -                      return -ENOMEM;
 +      if (!npct->prcm_base) {
 +              if (version == PINCTRL_NMK_STN8815) {
 +                      dev_info(&pdev->dev,
 +                               "No PRCM base, "
 +                               "assuming no ALT-Cx control is available\n");
 +              } else {
 +                      dev_err(&pdev->dev, "missing PRCM base address\n");
 +                      return -EINVAL;
                }
 -      } else if (version == PINCTRL_NMK_STN8815) {
 -              dev_info(&pdev->dev,
 -                       "No PRCM base, assume no ALT-Cx control is available\n");
 -      } else {
 -              dev_err(&pdev->dev, "missing PRCM base address\n");
 -              return -EINVAL;
        }
  
        /*
@@@ -2249,10 -1967,6 +2253,10 @@@ static struct platform_driver nmk_pinct
        },
        .probe = nmk_pinctrl_probe,
        .id_table = nmk_pinctrl_id,
 +#ifdef CONFIG_PM
 +      .suspend = nmk_pinctrl_suspend,
 +      .resume = nmk_pinctrl_resume,
 +#endif
  };
  
  static int __init nmk_gpio_init(void)