]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge tag 'soc2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 28 Mar 2012 19:24:40 +0000 (12:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 28 Mar 2012 19:24:40 +0000 (12:24 -0700)
Pull "ARM: More SoC support updates" from Olof Johansson:
 "This branch contains a handful of updates of SoC base code that had
  dependencies on other external trees that have now been merged:

   * Support for the new EXYNOS5250 SoC from Samsung
   * SMP and power domain support for Tegra3 from NVIDIA
   * ux500 updates for exporting SoC information through sysfs"

Fix up trivial merge conflicts as per Olof.

* tag 'soc2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (30 commits)
  ARM: mach-shmobile: ap4evb: Reserve DMA memory for the frame buffer
  ARM: EXYNOS: Fix compilation error with mach-exynos4-dt board
  ARM: dts: add initial dts file for EXYNOS5250, SMDK5250
  ARM: EXYNOS: add support device tree enabled board file for EXYNOS5
  ARM: EXYNOS: add support ARCH_EXYNOS5 for EXYNOS5 SoCs
  ARM: EXYNOS: add support get_core_count() for EXYNOS5250
  ARM: EXYNOS: support EINT for EXYNOS4 and EXYNOS5
  ARM: EXYNOS: add interrupt definitions for EXYNOS5250
  ARM: EXYNOS: add support for EXYNOS5250 SoC
  ARM: EXYNOS: add support uart for EXYNOS4 and EXYNOS5
  ARM: EXYNOS: add initial setup-i2c0 for EXYNOS5
  ARM: EXYNOS: add clock part for EXYNOS5250 SoC
  ARM: EXYNOS: use exynos_init_uarts() instead of exynos4_init_uarts()
  ARM: EXYNOS: to declare static for mach-exynos/common.c
  ARM: EXYNOS: Add clkdev lookup entry for lcd clock
  ARM: dt: Explicitly configure all serial ports on Tegra Cardhu
  ARM: tegra: support for secondary cores on Tegra30
  ARM: tegra: support for Tegra30 CPU powerdomains
  ARM: tegra: add support for Tegra30 powerdomains
  ARM: tegra: export tegra_powergate_is_powered()
  ...

20 files changed:
1  2 
arch/arm/Makefile
arch/arm/boot/dts/tegra-cardhu.dts
arch/arm/mach-exynos/Kconfig
arch/arm/mach-exynos/Makefile
arch/arm/mach-exynos/common.c
arch/arm/mach-exynos/include/mach/map.h
arch/arm/mach-exynos/mct.c
arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/mach-shmobile/setup-sh7372.c
arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/board-dt-tegra30.c
arch/arm/mach-tegra/common.c
arch/arm/mach-tegra/fuse.c
arch/arm/mach-ux500/Kconfig
arch/arm/mach-ux500/board-mop500-sdi.c
arch/arm/mach-ux500/board-mop500.c
arch/arm/mach-ux500/board-mop500.h
arch/arm/mach-ux500/cpu.c
arch/arm/mach-ux500/include/mach/setup.h

diff --combined arch/arm/Makefile
index 0106f75530c02a4c52b94ce1edb68a6ded2da09a,a826ffca791d25271c4a697d5c27b9d12905b14a..dcb088e868feaa02eb039947cf658b692a7ed0bc
@@@ -174,12 -174,13 +174,13 @@@ machine-$(CONFIG_ARCH_PRIMA2)           := prima
  machine-$(CONFIG_ARCH_PXA)            := pxa
  machine-$(CONFIG_ARCH_REALVIEW)               := realview
  machine-$(CONFIG_ARCH_RPC)            := rpc
 -machine-$(CONFIG_ARCH_S3C2410)                := s3c2410 s3c2412 s3c2416 s3c2440 s3c2443
 +machine-$(CONFIG_ARCH_S3C24XX)                := s3c24xx s3c2412 s3c2440
  machine-$(CONFIG_ARCH_S3C64XX)                := s3c64xx
  machine-$(CONFIG_ARCH_S5P64X0)                := s5p64x0
  machine-$(CONFIG_ARCH_S5PC100)                := s5pc100
  machine-$(CONFIG_ARCH_S5PV210)                := s5pv210
  machine-$(CONFIG_ARCH_EXYNOS4)                := exynos
+ machine-$(CONFIG_ARCH_EXYNOS5)                := exynos
  machine-$(CONFIG_ARCH_SA1100)         := sa1100
  machine-$(CONFIG_ARCH_SHARK)          := shark
  machine-$(CONFIG_ARCH_SHMOBILE)       := shmobile
index 73263501f581076cdfb6da2103ceec59b0a0fd42,0419690c8784d321a8a3bf8f548bb242a441e15c..ac3fb75584595803cc4e14ff77221f4d63df9456
                clock-frequency = < 408000000 >;
        };
  
+       serial@70006040 {
+               status = "disable";
+       };
+       serial@70006200 {
+               status = "disable";
+       };
+       serial@70006300 {
+               status = "disable";
+       };
+       serial@70006400 {
+               status = "disable";
+       };
        i2c@7000c000 {
                clock-frequency = <100000>;
        };
        i2c@7000d000 {
                clock-frequency = <100000>;
        };
 +
 +      sdhci@78000000 {
 +              cd-gpios = <&gpio 69 0>; /* gpio PI5 */
 +              wp-gpios = <&gpio 155 0>; /* gpio PT3 */
 +              power-gpios = <&gpio 31 0>; /* gpio PD7 */
 +      };
 +
 +      sdhci@78000200 {
 +              status = "disable";
 +      };
 +
 +      sdhci@78000400 {
 +              status = "disable";
 +      };
 +
 +      sdhci@78000400 {
 +              support-8bit;
 +      };
  };
index 2bf7d6e2398981221a23ff0ae600d54a46704d5a,42f072db1145e77af07691a0190721d9f70b9636..0491ceef1cda8a77bbaf60409416d906fc701620
@@@ -11,18 -11,19 +11,19 @@@ if ARCH_EXYNO
  
  menu "SAMSUNG EXYNOS SoCs Support"
  
- choice
-       prompt "EXYNOS System Type"
-       default ARCH_EXYNOS4
  config ARCH_EXYNOS4
        bool "SAMSUNG EXYNOS4"
+       default y
        select HAVE_SMP
        select MIGHT_HAVE_CACHE_L2X0
        help
          Samsung EXYNOS4 SoCs based systems
  
- endchoice
+ config ARCH_EXYNOS5
+       bool "SAMSUNG EXYNOS5"
+       select HAVE_SMP
+       help
+         Samsung EXYNOS5 (Cortex-A15) SoC based systems
  
  comment "EXYNOS SoCs"
  
@@@ -34,7 -35,6 +35,7 @@@ config CPU_EXYNOS421
        select ARM_CPU_SUSPEND if PM
        select S5P_PM if PM
        select S5P_SLEEP if PM
 +      select PM_GENERIC_DOMAINS
        help
          Enable EXYNOS4210 CPU support
  
@@@ -56,6 -56,13 +57,13 @@@ config SOC_EXYNOS441
        help
          Enable EXYNOS4412 SoC support
  
+ config SOC_EXYNOS5250
+       bool "SAMSUNG EXYNOS5250"
+       default y
+       depends on ARCH_EXYNOS5
+       help
+         Enable EXYNOS5250 SoC support
  config EXYNOS4_MCT
        bool
        default y
@@@ -77,6 -84,11 +85,6 @@@ config EXYNOS4_SETUP_FIMD
        help
          Common setup code for FIMD0.
  
 -config EXYNOS4_DEV_PD
 -      bool
 -      help
 -        Compile in platform device definitions for Power Domain
 -
  config EXYNOS4_DEV_SYSMMU
        bool
        help
@@@ -181,9 -193,7 +189,9 @@@ config MACH_SMDKV31
        select S5P_DEV_FIMC1
        select S5P_DEV_FIMC2
        select S5P_DEV_FIMC3
 +      select S5P_DEV_G2D
        select S5P_DEV_I2C_HDMIPHY
 +      select S5P_DEV_JPEG
        select S5P_DEV_MFC
        select S5P_DEV_TV
        select S5P_DEV_USB_EHCI
        select EXYNOS4_DEV_AHCI
        select SAMSUNG_DEV_KEYPAD
        select EXYNOS4_DEV_DMA
 -      select EXYNOS4_DEV_PD
        select SAMSUNG_DEV_PWM
        select EXYNOS4_DEV_USB_OHCI
        select EXYNOS4_DEV_SYSMMU
@@@ -229,9 -240,7 +237,9 @@@ config MACH_UNIVERSAL_C21
        select S5P_DEV_FIMC1
        select S5P_DEV_FIMC2
        select S5P_DEV_FIMC3
 +      select S5P_DEV_G2D
        select S5P_DEV_CSIS0
 +      select S5P_DEV_JPEG
        select S5P_DEV_FIMD0
        select S3C_DEV_HSMMC
        select S3C_DEV_HSMMC2
        select S5P_DEV_ONENAND
        select S5P_DEV_TV
        select EXYNOS4_DEV_DMA
 -      select EXYNOS4_DEV_PD
        select EXYNOS4_SETUP_FIMD0
        select EXYNOS4_SETUP_I2C1
        select EXYNOS4_SETUP_I2C3
@@@ -268,24 -278,21 +276,24 @@@ config MACH_NUR
        select S3C_DEV_I2C1
        select S3C_DEV_I2C3
        select S3C_DEV_I2C5
 +      select S3C_DEV_I2C6
        select S5P_DEV_CSIS0
 +      select S5P_DEV_JPEG
        select S5P_DEV_FIMC0
        select S5P_DEV_FIMC1
        select S5P_DEV_FIMC2
        select S5P_DEV_FIMC3
 +      select S5P_DEV_G2D
        select S5P_DEV_MFC
        select S5P_DEV_USB_EHCI
        select S5P_SETUP_MIPIPHY
        select EXYNOS4_DEV_DMA
 -      select EXYNOS4_DEV_PD
        select EXYNOS4_SETUP_FIMC
        select EXYNOS4_SETUP_FIMD0
        select EXYNOS4_SETUP_I2C1
        select EXYNOS4_SETUP_I2C3
        select EXYNOS4_SETUP_I2C5
 +      select EXYNOS4_SETUP_I2C6
        select EXYNOS4_SETUP_SDHCI
        select EXYNOS4_SETUP_USB_PHY
        select S5P_SETUP_MIPIPHY
@@@ -306,15 -313,14 +314,15 @@@ config MACH_ORIGE
        select S5P_DEV_FIMC2
        select S5P_DEV_FIMC3
        select S5P_DEV_FIMD0
 +      select S5P_DEV_G2D
        select S5P_DEV_I2C_HDMIPHY
 +      select S5P_DEV_JPEG
        select S5P_DEV_MFC
        select S5P_DEV_TV
        select S5P_DEV_USB_EHCI
        select SAMSUNG_DEV_BACKLIGHT
        select SAMSUNG_DEV_PWM
        select EXYNOS4_DEV_DMA
 -      select EXYNOS4_DEV_PD
        select EXYNOS4_DEV_USB_OHCI
        select EXYNOS4_SETUP_FIMD0
        select EXYNOS4_SETUP_SDHCI
@@@ -356,7 -362,7 +364,7 @@@ config MACH_SMDK441
          Machine support for Samsung SMDK4412
  endif
  
- comment "Flattened Device Tree based board for Exynos4 based SoC"
+ comment "Flattened Device Tree based board for EXYNOS SoCs"
  
  config MACH_EXYNOS4_DT
        bool "Samsung Exynos4 Machine using device tree"
          Note: This is under development and not all peripherals can be supported
          with this machine file.
  
+ config MACH_EXYNOS5_DT
+       bool "SAMSUNG EXYNOS5 Machine using device tree"
+       select SOC_EXYNOS5250
+       select USE_OF
+       select ARM_AMBA
+       help
+         Machine support for Samsung Exynos4 machine with device tree enabled.
+         Select this if a fdt blob is available for the EXYNOS4 SoC based board.
  if ARCH_EXYNOS4
  
  comment "Configuration for HSMMC 8-bit bus width"
index 9a4c09896509dec9407d74350dac9a426eb41de9,29967efd262a0a7c74d2a13589200b079001f008..8631840d1b5e85ce8d959430bcdbdeadb339afbb
@@@ -14,11 -14,11 +14,12 @@@ obj-                               :
  
  obj-$(CONFIG_ARCH_EXYNOS)     += common.o
  obj-$(CONFIG_ARCH_EXYNOS4)    += clock-exynos4.o
+ obj-$(CONFIG_ARCH_EXYNOS5)    += clock-exynos5.o
  obj-$(CONFIG_CPU_EXYNOS4210)  += clock-exynos4210.o
  obj-$(CONFIG_SOC_EXYNOS4212)  += clock-exynos4212.o
  
  obj-$(CONFIG_PM)              += pm.o
 +obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
  obj-$(CONFIG_CPU_IDLE)                += cpuidle.o
  
  obj-$(CONFIG_ARCH_EXYNOS4)    += pmu.o
@@@ -42,17 -42,20 +43,19 @@@ obj-$(CONFIG_MACH_SMDK4212)                += mach-sm
  obj-$(CONFIG_MACH_SMDK4412)           += mach-smdk4x12.o
  
  obj-$(CONFIG_MACH_EXYNOS4_DT)         += mach-exynos4-dt.o
+ obj-$(CONFIG_MACH_EXYNOS5_DT)         += mach-exynos5-dt.o
  
  # device support
  
+ obj-y                                 += dev-uart.o
  obj-$(CONFIG_ARCH_EXYNOS4)            += dev-audio.o
  obj-$(CONFIG_EXYNOS4_DEV_AHCI)                += dev-ahci.o
 -obj-$(CONFIG_EXYNOS4_DEV_PD)          += dev-pd.o
  obj-$(CONFIG_EXYNOS4_DEV_SYSMMU)      += dev-sysmmu.o
  obj-$(CONFIG_EXYNOS4_DEV_DWMCI)               += dev-dwmci.o
  obj-$(CONFIG_EXYNOS4_DEV_DMA)         += dma.o
  obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI)    += dev-ohci.o
  
- obj-$(CONFIG_ARCH_EXYNOS4)            += setup-i2c0.o
+ obj-$(CONFIG_ARCH_EXYNOS            += setup-i2c0.o
  obj-$(CONFIG_EXYNOS4_SETUP_FIMC)      += setup-fimc.o
  obj-$(CONFIG_EXYNOS4_SETUP_FIMD0)     += setup-fimd0.o
  obj-$(CONFIG_EXYNOS4_SETUP_I2C1)      += setup-i2c1.o
index d67e21e526e622b324a2685a7dc1fa93d080b425,66742e914641733fe456aad9a54d8616bd22017c..e6cc50e94a58f86cff1e5d60cc1fc9fd5d1eebeb
  static const char name_exynos4210[] = "EXYNOS4210";
  static const char name_exynos4212[] = "EXYNOS4212";
  static const char name_exynos4412[] = "EXYNOS4412";
+ static const char name_exynos5250[] = "EXYNOS5250";
+ static void exynos4_map_io(void);
+ static void exynos5_map_io(void);
+ static void exynos4_init_clocks(int xtal);
+ static void exynos5_init_clocks(int xtal);
+ static void exynos_init_uarts(struct s3c2410_uartcfg *cfg, int no);
+ static int exynos_init(void);
  
  static struct cpu_table cpu_ids[] __initdata = {
        {
@@@ -60,7 -68,7 +68,7 @@@
                .idmask         = EXYNOS4_CPU_MASK,
                .map_io         = exynos4_map_io,
                .init_clocks    = exynos4_init_clocks,
-               .init_uarts     = exynos4_init_uarts,
+               .init_uarts     = exynos_init_uarts,
                .init           = exynos_init,
                .name           = name_exynos4210,
        }, {
@@@ -68,7 -76,7 +76,7 @@@
                .idmask         = EXYNOS4_CPU_MASK,
                .map_io         = exynos4_map_io,
                .init_clocks    = exynos4_init_clocks,
-               .init_uarts     = exynos4_init_uarts,
+               .init_uarts     = exynos_init_uarts,
                .init           = exynos_init,
                .name           = name_exynos4212,
        }, {
                .idmask         = EXYNOS4_CPU_MASK,
                .map_io         = exynos4_map_io,
                .init_clocks    = exynos4_init_clocks,
-               .init_uarts     = exynos4_init_uarts,
+               .init_uarts     = exynos_init_uarts,
                .init           = exynos_init,
                .name           = name_exynos4412,
+       }, {
+               .idcode         = EXYNOS5250_SOC_ID,
+               .idmask         = EXYNOS5_SOC_MASK,
+               .map_io         = exynos5_map_io,
+               .init_clocks    = exynos5_init_clocks,
+               .init_uarts     = exynos_init_uarts,
+               .init           = exynos_init,
+               .name           = name_exynos5250,
        },
  };
  
  static struct map_desc exynos_iodesc[] __initdata = {
        {
                .virtual        = (unsigned long)S5P_VA_CHIPID,
-               .pfn            = __phys_to_pfn(EXYNOS4_PA_CHIPID),
+               .pfn            = __phys_to_pfn(EXYNOS_PA_CHIPID),
                .length         = SZ_4K,
                .type           = MT_DEVICE,
-       }, {
+       },
+ };
+ static struct map_desc exynos4_iodesc[] __initdata = {
+       {
                .virtual        = (unsigned long)S3C_VA_SYS,
                .pfn            = __phys_to_pfn(EXYNOS4_PA_SYSCON),
                .length         = SZ_64K,
                .pfn            = __phys_to_pfn(EXYNOS4_PA_UART),
                .length         = SZ_512K,
                .type           = MT_DEVICE,
-       },
- };
- static struct map_desc exynos4_iodesc[] __initdata = {
-       {
+       }, {
                .virtual        = (unsigned long)S5P_VA_CMU,
                .pfn            = __phys_to_pfn(EXYNOS4_PA_CMU),
                .length         = SZ_128K,
                .pfn            = __phys_to_pfn(EXYNOS4_PA_L2CC),
                .length         = SZ_4K,
                .type           = MT_DEVICE,
 -      }, {
 -              .virtual        = (unsigned long)S5P_VA_GPIO1,
 -              .pfn            = __phys_to_pfn(EXYNOS4_PA_GPIO1),
 -              .length         = SZ_4K,
 -              .type           = MT_DEVICE,
 -      }, {
 -              .virtual        = (unsigned long)S5P_VA_GPIO2,
 -              .pfn            = __phys_to_pfn(EXYNOS4_PA_GPIO2),
 -              .length         = SZ_4K,
 -              .type           = MT_DEVICE,
 -      }, {
 -              .virtual        = (unsigned long)S5P_VA_GPIO3,
 -              .pfn            = __phys_to_pfn(EXYNOS4_PA_GPIO3),
 -              .length         = SZ_256,
 -              .type           = MT_DEVICE,
        }, {
                .virtual        = (unsigned long)S5P_VA_DMC0,
                .pfn            = __phys_to_pfn(EXYNOS4_PA_DMC0),
@@@ -195,11 -226,80 +211,80 @@@ static struct map_desc exynos4_iodesc1[
        },
  };
  
+ static struct map_desc exynos5_iodesc[] __initdata = {
+       {
+               .virtual        = (unsigned long)S3C_VA_SYS,
+               .pfn            = __phys_to_pfn(EXYNOS5_PA_SYSCON),
+               .length         = SZ_64K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S3C_VA_TIMER,
+               .pfn            = __phys_to_pfn(EXYNOS5_PA_TIMER),
+               .length         = SZ_16K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S3C_VA_WATCHDOG,
+               .pfn            = __phys_to_pfn(EXYNOS5_PA_WATCHDOG),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S5P_VA_SROMC,
+               .pfn            = __phys_to_pfn(EXYNOS5_PA_SROMC),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S5P_VA_SYSTIMER,
+               .pfn            = __phys_to_pfn(EXYNOS5_PA_SYSTIMER),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S5P_VA_SYSRAM,
+               .pfn            = __phys_to_pfn(EXYNOS5_PA_SYSRAM),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S5P_VA_CMU,
+               .pfn            = __phys_to_pfn(EXYNOS5_PA_CMU),
+               .length         = 144 * SZ_1K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S5P_VA_PMU,
+               .pfn            = __phys_to_pfn(EXYNOS5_PA_PMU),
+               .length         = SZ_64K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S5P_VA_COMBINER_BASE,
+               .pfn            = __phys_to_pfn(EXYNOS5_PA_COMBINER),
+               .length         = SZ_4K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S3C_VA_UART,
+               .pfn            = __phys_to_pfn(EXYNOS5_PA_UART),
+               .length         = SZ_512K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S5P_VA_GIC_CPU,
+               .pfn            = __phys_to_pfn(EXYNOS5_PA_GIC_CPU),
+               .length         = SZ_64K,
+               .type           = MT_DEVICE,
+       }, {
+               .virtual        = (unsigned long)S5P_VA_GIC_DIST,
+               .pfn            = __phys_to_pfn(EXYNOS5_PA_GIC_DIST),
+               .length         = SZ_64K,
+               .type           = MT_DEVICE,
+       },
+ };
  void exynos4_restart(char mode, const char *cmd)
  {
        __raw_writel(0x1, S5P_SWRESET);
  }
  
+ void exynos5_restart(char mode, const char *cmd)
+ {
+       __raw_writel(0x1, EXYNOS_SWRESET);
+ }
  /*
   * exynos_map_io
   *
@@@ -219,7 -319,7 +304,7 @@@ void __init exynos_init_io(struct map_d
        s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
  }
  
- void __init exynos4_map_io(void)
static void __init exynos4_map_io(void)
  {
        iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc));
  
        s5p_hdmi_setname("exynos4-hdmi");
  }
  
- void __init exynos4_init_clocks(int xtal)
+ static void __init exynos5_map_io(void)
+ {
+       iotable_init(exynos5_iodesc, ARRAY_SIZE(exynos5_iodesc));
+       s3c_device_i2c0.resource[0].start = EXYNOS5_PA_IIC(0);
+       s3c_device_i2c0.resource[0].end   = EXYNOS5_PA_IIC(0) + SZ_4K - 1;
+       s3c_device_i2c0.resource[1].start = EXYNOS5_IRQ_IIC;
+       s3c_device_i2c0.resource[1].end   = EXYNOS5_IRQ_IIC;
+       /* The I2C bus controllers are directly compatible with s3c2440 */
+       s3c_i2c0_setname("s3c2440-i2c");
+       s3c_i2c1_setname("s3c2440-i2c");
+       s3c_i2c2_setname("s3c2440-i2c");
+ }
+ static void __init exynos4_init_clocks(int xtal)
  {
        printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
  
        exynos4_setup_clocks();
  }
  
+ static void __init exynos5_init_clocks(int xtal)
+ {
+       printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
+       s3c24xx_register_baseclocks(xtal);
+       s5p_register_clocks(xtal);
+       exynos5_register_clocks();
+       exynos5_setup_clocks();
+ }
  #define COMBINER_ENABLE_SET   0x0
  #define COMBINER_ENABLE_CLEAR 0x4
  #define COMBINER_INT_STATUS   0xC
@@@ -339,7 -465,14 +450,14 @@@ static struct irq_chip combiner_chip = 
  
  static void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq)
  {
-       if (combiner_nr >= MAX_COMBINER_NR)
+       unsigned int max_nr;
+       if (soc_is_exynos5250())
+               max_nr = EXYNOS5_MAX_COMBINER_NR;
+       else
+               max_nr = EXYNOS4_MAX_COMBINER_NR;
+       if (combiner_nr >= max_nr)
                BUG();
        if (irq_set_handler_data(irq, &combiner_data[combiner_nr]) != 0)
                BUG();
@@@ -350,8 -483,14 +468,14 @@@ static void __init combiner_init(unsign
                          unsigned int irq_start)
  {
        unsigned int i;
+       unsigned int max_nr;
  
-       if (combiner_nr >= MAX_COMBINER_NR)
+       if (soc_is_exynos5250())
+               max_nr = EXYNOS5_MAX_COMBINER_NR;
+       else
+               max_nr = EXYNOS4_MAX_COMBINER_NR;
+       if (combiner_nr >= max_nr)
                BUG();
  
        combiner_data[combiner_nr].base = base;
@@@ -388,14 -527,34 +512,34 @@@ void __init exynos4_init_irq(void
        gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000;
  
        if (!of_have_populated_dt())
 -              gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset);
 +              gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset, NULL);
  #ifdef CONFIG_OF
        else
                of_irq_init(exynos4_dt_irq_match);
  #endif
  
-       for (irq = 0; irq < MAX_COMBINER_NR; irq++) {
+       for (irq = 0; irq < EXYNOS4_MAX_COMBINER_NR; irq++) {
+               combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq),
+                               COMBINER_IRQ(irq, 0));
+               combiner_cascade_irq(irq, IRQ_SPI(irq));
+       }
+       /*
+        * The parameters of s5p_init_irq() are for VIC init.
+        * Theses parameters should be NULL and 0 because EXYNOS4
+        * uses GIC instead of VIC.
+        */
+       s5p_init_irq(NULL, 0);
+ }
+ void __init exynos5_init_irq(void)
+ {
+       int irq;
+       gic_init(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU);
  
+       for (irq = 0; irq < EXYNOS5_MAX_COMBINER_NR; irq++) {
                combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq),
                                COMBINER_IRQ(irq, 0));
                combiner_cascade_irq(irq, IRQ_SPI(irq));
@@@ -414,19 -573,34 +558,34 @@@ struct bus_type exynos4_subsys = 
        .dev_name       = "exynos4-core",
  };
  
+ struct bus_type exynos5_subsys = {
+       .name           = "exynos5-core",
+       .dev_name       = "exynos5-core",
+ };
  static struct device exynos4_dev = {
        .bus    = &exynos4_subsys,
  };
  
- static int __init exynos4_core_init(void)
+ static struct device exynos5_dev = {
+       .bus    = &exynos5_subsys,
+ };
+ static int __init exynos_core_init(void)
  {
-       return subsys_system_register(&exynos4_subsys, NULL);
+       if (soc_is_exynos5250())
+               return subsys_system_register(&exynos5_subsys, NULL);
+       else
+               return subsys_system_register(&exynos4_subsys, NULL);
  }
- core_initcall(exynos4_core_init);
+ core_initcall(exynos_core_init);
  
  #ifdef CONFIG_CACHE_L2X0
  static int __init exynos4_l2x0_cache_init(void)
  {
+       if (soc_is_exynos5250())
+               return 0;
        int ret;
        ret = l2x0_of_init(L2_AUX_VAL, L2_AUX_MASK);
        if (!ret) {
        l2x0_init(S5P_VA_L2CC, L2_AUX_VAL, L2_AUX_MASK);
        return 0;
  }
  early_initcall(exynos4_l2x0_cache_init);
  #endif
  
- int __init exynos_init(void)
+ static int __init exynos5_l2_cache_init(void)
+ {
+       unsigned int val;
+       if (!soc_is_exynos5250())
+               return 0;
+       asm volatile("mrc p15, 0, %0, c1, c0, 0\n"
+                    "bic %0, %0, #(1 << 2)\n"  /* cache disable */
+                    "mcr p15, 0, %0, c1, c0, 0\n"
+                    "mrc p15, 1, %0, c9, c0, 2\n"
+                    : "=r"(val));
+       val |= (1 << 9) | (1 << 5) | (2 << 6) | (2 << 0);
+       asm volatile("mcr p15, 1, %0, c9, c0, 2\n" : : "r"(val));
+       asm volatile("mrc p15, 0, %0, c1, c0, 0\n"
+                    "orr %0, %0, #(1 << 2)\n"  /* cache enable */
+                    "mcr p15, 0, %0, c1, c0, 0\n"
+                    : : "r"(val));
+       return 0;
+ }
+ early_initcall(exynos5_l2_cache_init);
+ static int __init exynos_init(void)
  {
        printk(KERN_INFO "EXYNOS: Initializing architecture\n");
-       return device_register(&exynos4_dev);
+       if (soc_is_exynos5250())
+               return device_register(&exynos5_dev);
+       else
+               return device_register(&exynos4_dev);
  }
  
  /* uart registration process */
  
void __init exynos4_init_uarts(struct s3c2410_uartcfg *cfg, int no)
static void __init exynos_init_uarts(struct s3c2410_uartcfg *cfg, int no)
  {
        struct s3c2410_uartcfg *tcfg = cfg;
        u32 ucnt;
        for (ucnt = 0; ucnt < no; ucnt++, tcfg++)
                tcfg->has_fracval = 1;
  
-       s3c24xx_init_uartdevs("exynos4210-uart", s5p_uart_resources, cfg, no);
+       if (soc_is_exynos5250())
+               s3c24xx_init_uartdevs("exynos4210-uart", exynos5_uart_resources, cfg, no);
+       else
+               s3c24xx_init_uartdevs("exynos4210-uart", exynos4_uart_resources, cfg, no);
  }
  
+ static void __iomem *exynos_eint_base;
  static DEFINE_SPINLOCK(eint_lock);
  
  static unsigned int eint0_15_data[16];
  
- static unsigned int exynos4_get_irq_nr(unsigned int number)
+ static inline int exynos4_irq_to_gpio(unsigned int irq)
  {
-       u32 ret = 0;
+       if (irq < IRQ_EINT(0))
+               return -EINVAL;
  
-       switch (number) {
-       case 0 ... 3:
-               ret = (number + IRQ_EINT0);
-               break;
-       case 4 ... 7:
-               ret = (number + (IRQ_EINT4 - 4));
-               break;
-       case 8 ... 15:
-               ret = (number + (IRQ_EINT8 - 8));
-               break;
-       default:
-               printk(KERN_ERR "number available : %d\n", number);
-       }
+       irq -= IRQ_EINT(0);
+       if (irq < 8)
+               return EXYNOS4_GPX0(irq);
+       irq -= 8;
+       if (irq < 8)
+               return EXYNOS4_GPX1(irq);
+       irq -= 8;
+       if (irq < 8)
+               return EXYNOS4_GPX2(irq);
+       irq -= 8;
+       if (irq < 8)
+               return EXYNOS4_GPX3(irq);
+       return -EINVAL;
+ }
+ static inline int exynos5_irq_to_gpio(unsigned int irq)
+ {
+       if (irq < IRQ_EINT(0))
+               return -EINVAL;
+       irq -= IRQ_EINT(0);
+       if (irq < 8)
+               return EXYNOS5_GPX0(irq);
+       irq -= 8;
+       if (irq < 8)
+               return EXYNOS5_GPX1(irq);
+       irq -= 8;
+       if (irq < 8)
+               return EXYNOS5_GPX2(irq);
  
-       return ret;
+       irq -= 8;
+       if (irq < 8)
+               return EXYNOS5_GPX3(irq);
+       return -EINVAL;
  }
  
- static inline void exynos4_irq_eint_mask(struct irq_data *data)
+ static unsigned int exynos4_eint0_15_src_int[16] = {
+       EXYNOS4_IRQ_EINT0,
+       EXYNOS4_IRQ_EINT1,
+       EXYNOS4_IRQ_EINT2,
+       EXYNOS4_IRQ_EINT3,
+       EXYNOS4_IRQ_EINT4,
+       EXYNOS4_IRQ_EINT5,
+       EXYNOS4_IRQ_EINT6,
+       EXYNOS4_IRQ_EINT7,
+       EXYNOS4_IRQ_EINT8,
+       EXYNOS4_IRQ_EINT9,
+       EXYNOS4_IRQ_EINT10,
+       EXYNOS4_IRQ_EINT11,
+       EXYNOS4_IRQ_EINT12,
+       EXYNOS4_IRQ_EINT13,
+       EXYNOS4_IRQ_EINT14,
+       EXYNOS4_IRQ_EINT15,
+ };
+ static unsigned int exynos5_eint0_15_src_int[16] = {
+       EXYNOS5_IRQ_EINT0,
+       EXYNOS5_IRQ_EINT1,
+       EXYNOS5_IRQ_EINT2,
+       EXYNOS5_IRQ_EINT3,
+       EXYNOS5_IRQ_EINT4,
+       EXYNOS5_IRQ_EINT5,
+       EXYNOS5_IRQ_EINT6,
+       EXYNOS5_IRQ_EINT7,
+       EXYNOS5_IRQ_EINT8,
+       EXYNOS5_IRQ_EINT9,
+       EXYNOS5_IRQ_EINT10,
+       EXYNOS5_IRQ_EINT11,
+       EXYNOS5_IRQ_EINT12,
+       EXYNOS5_IRQ_EINT13,
+       EXYNOS5_IRQ_EINT14,
+       EXYNOS5_IRQ_EINT15,
+ };
+ static inline void exynos_irq_eint_mask(struct irq_data *data)
  {
        u32 mask;
  
        spin_lock(&eint_lock);
-       mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq)));
-       mask |= eint_irq_to_bit(data->irq);
-       __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq)));
+       mask = __raw_readl(EINT_MASK(exynos_eint_base, data->irq));
+       mask |= EINT_OFFSET_BIT(data->irq);
+       __raw_writel(mask, EINT_MASK(exynos_eint_base, data->irq));
        spin_unlock(&eint_lock);
  }
  
- static void exynos4_irq_eint_unmask(struct irq_data *data)
+ static void exynos_irq_eint_unmask(struct irq_data *data)
  {
        u32 mask;
  
        spin_lock(&eint_lock);
-       mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq)));
-       mask &= ~(eint_irq_to_bit(data->irq));
-       __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq)));
+       mask = __raw_readl(EINT_MASK(exynos_eint_base, data->irq));
+       mask &= ~(EINT_OFFSET_BIT(data->irq));
+       __raw_writel(mask, EINT_MASK(exynos_eint_base, data->irq));
        spin_unlock(&eint_lock);
  }
  
- static inline void exynos4_irq_eint_ack(struct irq_data *data)
+ static inline void exynos_irq_eint_ack(struct irq_data *data)
  {
-       __raw_writel(eint_irq_to_bit(data->irq),
-                    S5P_EINT_PEND(EINT_REG_NR(data->irq)));
+       __raw_writel(EINT_OFFSET_BIT(data->irq),
+                    EINT_PEND(exynos_eint_base, data->irq));
  }
  
- static void exynos4_irq_eint_maskack(struct irq_data *data)
+ static void exynos_irq_eint_maskack(struct irq_data *data)
  {
-       exynos4_irq_eint_mask(data);
-       exynos4_irq_eint_ack(data);
+       exynos_irq_eint_mask(data);
+       exynos_irq_eint_ack(data);
  }
  
- static int exynos4_irq_eint_set_type(struct irq_data *data, unsigned int type)
+ static int exynos_irq_eint_set_type(struct irq_data *data, unsigned int type)
  {
        int offs = EINT_OFFSET(data->irq);
        int shift;
        mask = 0x7 << shift;
  
        spin_lock(&eint_lock);
-       ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(data->irq)));
+       ctrl = __raw_readl(EINT_CON(exynos_eint_base, data->irq));
        ctrl &= ~mask;
        ctrl |= newvalue << shift;
-       __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(data->irq)));
+       __raw_writel(ctrl, EINT_CON(exynos_eint_base, data->irq));
        spin_unlock(&eint_lock);
  
-       switch (offs) {
-       case 0 ... 7:
-               s3c_gpio_cfgpin(EINT_GPIO_0(offs & 0x7), EINT_MODE);
-               break;
-       case 8 ... 15:
-               s3c_gpio_cfgpin(EINT_GPIO_1(offs & 0x7), EINT_MODE);
-               break;
-       case 16 ... 23:
-               s3c_gpio_cfgpin(EINT_GPIO_2(offs & 0x7), EINT_MODE);
-               break;
-       case 24 ... 31:
-               s3c_gpio_cfgpin(EINT_GPIO_3(offs & 0x7), EINT_MODE);
-               break;
-       default:
-               printk(KERN_ERR "No such irq number %d", offs);
-       }
+       if (soc_is_exynos5250())
+               s3c_gpio_cfgpin(exynos5_irq_to_gpio(data->irq), S3C_GPIO_SFN(0xf));
+       else
+               s3c_gpio_cfgpin(exynos4_irq_to_gpio(data->irq), S3C_GPIO_SFN(0xf));
  
        return 0;
  }
  
- static struct irq_chip exynos4_irq_eint = {
-       .name           = "exynos4-eint",
-       .irq_mask       = exynos4_irq_eint_mask,
-       .irq_unmask     = exynos4_irq_eint_unmask,
-       .irq_mask_ack   = exynos4_irq_eint_maskack,
-       .irq_ack        = exynos4_irq_eint_ack,
-       .irq_set_type   = exynos4_irq_eint_set_type,
+ static struct irq_chip exynos_irq_eint = {
+       .name           = "exynos-eint",
+       .irq_mask       = exynos_irq_eint_mask,
+       .irq_unmask     = exynos_irq_eint_unmask,
+       .irq_mask_ack   = exynos_irq_eint_maskack,
+       .irq_ack        = exynos_irq_eint_ack,
+       .irq_set_type   = exynos_irq_eint_set_type,
  #ifdef CONFIG_PM
        .irq_set_wake   = s3c_irqext_wake,
  #endif
   *
   * Each EINT pend/mask registers handle eight of them.
   */
- static inline void exynos4_irq_demux_eint(unsigned int start)
+ static inline void exynos_irq_demux_eint(unsigned int start)
  {
        unsigned int irq;
  
-       u32 status = __raw_readl(S5P_EINT_PEND(EINT_REG_NR(start)));
-       u32 mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(start)));
+       u32 status = __raw_readl(EINT_PEND(exynos_eint_base, start));
+       u32 mask = __raw_readl(EINT_MASK(exynos_eint_base, start));
  
        status &= ~mask;
        status &= 0xff;
        }
  }
  
- static void exynos4_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
+ static void exynos_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
  {
        struct irq_chip *chip = irq_get_chip(irq);
        chained_irq_enter(chip, desc);
-       exynos4_irq_demux_eint(IRQ_EINT(16));
-       exynos4_irq_demux_eint(IRQ_EINT(24));
+       exynos_irq_demux_eint(IRQ_EINT(16));
+       exynos_irq_demux_eint(IRQ_EINT(24));
        chained_irq_exit(chip, desc);
  }
  
- static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
+ static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
  {
        u32 *irq_data = irq_get_handler_data(irq);
        struct irq_chip *chip = irq_get_chip(irq);
        chained_irq_exit(chip, desc);
  }
  
- static int __init exynos4_init_irq_eint(void)
+ static int __init exynos_init_irq_eint(void)
  {
        int irq;
  
+       if (soc_is_exynos5250())
+               exynos_eint_base = ioremap(EXYNOS5_PA_GPIO1, SZ_4K);
+       else
+               exynos_eint_base = ioremap(EXYNOS4_PA_GPIO2, SZ_4K);
+       if (exynos_eint_base == NULL) {
+               pr_err("unable to ioremap for EINT base address\n");
+               return -ENOMEM;
+       }
        for (irq = 0 ; irq <= 31 ; irq++) {
-               irq_set_chip_and_handler(IRQ_EINT(irq), &exynos4_irq_eint,
+               irq_set_chip_and_handler(IRQ_EINT(irq), &exynos_irq_eint,
                                         handle_level_irq);
                set_irq_flags(IRQ_EINT(irq), IRQF_VALID);
        }
  
-       irq_set_chained_handler(IRQ_EINT16_31, exynos4_irq_demux_eint16_31);
+       irq_set_chained_handler(EXYNOS_IRQ_EINT16_31, exynos_irq_demux_eint16_31);
  
        for (irq = 0 ; irq <= 15 ; irq++) {
                eint0_15_data[irq] = IRQ_EINT(irq);
  
-               irq_set_handler_data(exynos4_get_irq_nr(irq),
-                                    &eint0_15_data[irq]);
-               irq_set_chained_handler(exynos4_get_irq_nr(irq),
-                                       exynos4_irq_eint0_15);
+               if (soc_is_exynos5250()) {
+                       irq_set_handler_data(exynos5_eint0_15_src_int[irq],
+                                            &eint0_15_data[irq]);
+                       irq_set_chained_handler(exynos5_eint0_15_src_int[irq],
+                                               exynos_irq_eint0_15);
+               } else {
+                       irq_set_handler_data(exynos4_eint0_15_src_int[irq],
+                                            &eint0_15_data[irq]);
+                       irq_set_chained_handler(exynos4_eint0_15_src_int[irq],
+                                               exynos_irq_eint0_15);
+               }
        }
  
        return 0;
  }
- arch_initcall(exynos4_init_irq_eint);
+ arch_initcall(exynos_init_irq_eint);
index 54307b09813a8b8e8f51fd4a40a87b874bf82607,188d87d6ec41eacd65ef0300b13e008daa7f48b8..024d38ff17183fed96447aebcbeb27f1cc04fb62
@@@ -25,6 -25,7 +25,7 @@@
  
  #define EXYNOS4_PA_SYSRAM0            0x02025000
  #define EXYNOS4_PA_SYSRAM1            0x02020000
+ #define EXYNOS5_PA_SYSRAM             0x02020000
  
  #define EXYNOS4_PA_FIMC0              0x11800000
  #define EXYNOS4_PA_FIMC1              0x11810000
  #define EXYNOS4_PA_ONENAND            0x0C000000
  #define EXYNOS4_PA_ONENAND_DMA                0x0C600000
  
- #define EXYNOS4_PA_CHIPID             0x10000000
+ #define EXYNOS_PA_CHIPID              0x10000000
  
  #define EXYNOS4_PA_SYSCON             0x10010000
+ #define EXYNOS5_PA_SYSCON             0x10050100
  #define EXYNOS4_PA_PMU                        0x10020000
+ #define EXYNOS5_PA_PMU                        0x10040000
  #define EXYNOS4_PA_CMU                        0x10030000
+ #define EXYNOS5_PA_CMU                        0x10010000
  
  #define EXYNOS4_PA_SYSTIMER           0x10050000
+ #define EXYNOS5_PA_SYSTIMER           0x101C0000
  #define EXYNOS4_PA_WATCHDOG           0x10060000
+ #define EXYNOS5_PA_WATCHDOG           0x101D0000
  #define EXYNOS4_PA_RTC                        0x10070000
  
  #define EXYNOS4_PA_KEYPAD             0x100A0000
  #define EXYNOS4_PA_DMC1                       0x10410000
  
  #define EXYNOS4_PA_COMBINER           0x10440000
+ #define EXYNOS5_PA_COMBINER           0x10440000
  
  #define EXYNOS4_PA_GIC_CPU            0x10480000
  #define EXYNOS4_PA_GIC_DIST           0x10490000
+ #define EXYNOS5_PA_GIC_CPU            0x10480000
+ #define EXYNOS5_PA_GIC_DIST           0x10490000
  
  #define EXYNOS4_PA_COREPERI           0x10500000
  #define EXYNOS4_PA_TWD                        0x10500600
  #define EXYNOS4_PA_SPI1                       0x13930000
  #define EXYNOS4_PA_SPI2                       0x13940000
  
  #define EXYNOS4_PA_GPIO1              0x11400000
  #define EXYNOS4_PA_GPIO2              0x11000000
  #define EXYNOS4_PA_GPIO3              0x03860000
 +#define EXYNOS5_PA_GPIO1              0x11400000
 +#define EXYNOS5_PA_GPIO2              0x13400000
 +#define EXYNOS5_PA_GPIO3              0x10D10000
 +#define EXYNOS5_PA_GPIO4              0x03860000
  
  #define EXYNOS4_PA_MIPI_CSIS0         0x11880000
  #define EXYNOS4_PA_MIPI_CSIS1         0x11890000
  #define EXYNOS4_PA_SATAPHY_CTRL               0x126B0000
  
  #define EXYNOS4_PA_SROMC              0x12570000
+ #define EXYNOS5_PA_SROMC              0x12250000
  
  #define EXYNOS4_PA_EHCI                       0x12580000
  #define EXYNOS4_PA_OHCI                       0x12590000
  #define EXYNOS4_PA_MFC                        0x13400000
  
  #define EXYNOS4_PA_UART                       0x13800000
+ #define EXYNOS5_PA_UART                       0x12C00000
  
  #define EXYNOS4_PA_VP                 0x12C00000
  #define EXYNOS4_PA_MIXER              0x12C10000
  #define EXYNOS4_PA_IIC_HDMIPHY                0x138E0000
  
  #define EXYNOS4_PA_IIC(x)             (0x13860000 + ((x) * 0x10000))
+ #define EXYNOS5_PA_IIC(x)             (0x12C60000 + ((x) * 0x10000))
  
  #define EXYNOS4_PA_ADC                        0x13910000
  #define EXYNOS4_PA_ADC1                       0x13911000
  #define EXYNOS4_PA_SPDIF              0x139B0000
  
  #define EXYNOS4_PA_TIMER              0x139D0000
+ #define EXYNOS5_PA_TIMER              0x12DD0000
  
  #define EXYNOS4_PA_SDRAM              0x40000000
+ #define EXYNOS5_PA_SDRAM              0x40000000
  
  /* Compatibiltiy Defines */
  
  #define S3C_PA_IIC7                   EXYNOS4_PA_IIC(7)
  #define S3C_PA_RTC                    EXYNOS4_PA_RTC
  #define S3C_PA_WDT                    EXYNOS4_PA_WATCHDOG
- #define S3C_PA_UART                   EXYNOS4_PA_UART
  #define S3C_PA_SPI0                   EXYNOS4_PA_SPI0
  #define S3C_PA_SPI1                   EXYNOS4_PA_SPI1
  #define S3C_PA_SPI2                   EXYNOS4_PA_SPI2
  
  /* Compatibility UART */
  
- #define S3C_VA_UARTx(x)                       (S3C_VA_UART + ((x) * S3C_UART_OFFSET))
+ #define EXYNOS4_PA_UART0              0x13800000
+ #define EXYNOS4_PA_UART1              0x13810000
+ #define EXYNOS4_PA_UART2              0x13820000
+ #define EXYNOS4_PA_UART3              0x13830000
+ #define EXYNOS4_SZ_UART                       SZ_256
  
- #define S5P_PA_UART(x)                        (EXYNOS4_PA_UART + ((x) * S3C_UART_OFFSET))
- #define S5P_PA_UART0                  S5P_PA_UART(0)
- #define S5P_PA_UART1                  S5P_PA_UART(1)
- #define S5P_PA_UART2                  S5P_PA_UART(2)
- #define S5P_PA_UART3                  S5P_PA_UART(3)
- #define S5P_PA_UART4                  S5P_PA_UART(4)
+ #define EXYNOS5_PA_UART0              0x12C00000
+ #define EXYNOS5_PA_UART1              0x12C10000
+ #define EXYNOS5_PA_UART2              0x12C20000
+ #define EXYNOS5_PA_UART3              0x12C30000
+ #define EXYNOS5_SZ_UART                       SZ_256
  
- #define S5P_SZ_UART                   SZ_256
+ #define S3C_VA_UARTx(x)                       (S3C_VA_UART + ((x) * S3C_UART_OFFSET))
  
  #endif /* __ASM_ARCH_MAP_H */
index e8a1caaf1902957fee8fbcd696d1cd97303ca49f,cae3e2dae2e2a81405fab0fd3260de0b71ebccb1..897d9a9cf2265bf6d2d3bf1c73dff584e647d551
@@@ -21,7 -21,6 +21,7 @@@
  #include <linux/percpu.h>
  
  #include <asm/hardware/gic.h>
 +#include <asm/localtimer.h>
  
  #include <plat/cpu.h>
  
@@@ -261,7 -260,10 +261,10 @@@ static void exynos4_clockevent_init(voi
        mct_comp_device.cpumask = cpumask_of(0);
        clockevents_register_device(&mct_comp_device);
  
-       setup_irq(IRQ_MCT_G0, &mct_comp_event_irq);
+       if (soc_is_exynos5250())
+               setup_irq(EXYNOS5_IRQ_MCT_G0, &mct_comp_event_irq);
+       else
+               setup_irq(EXYNOS4_IRQ_MCT_G0, &mct_comp_event_irq);
  }
  
  #ifdef CONFIG_LOCAL_TIMERS
@@@ -381,7 -383,7 +384,7 @@@ static struct irqaction mct_tick1_event
        .handler        = exynos4_mct_tick_isr,
  };
  
 -static void exynos4_mct_tick_init(struct clock_event_device *evt)
 +static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt)
  {
        struct mct_clock_event_device *mevt;
        unsigned int cpu = smp_processor_id();
        if (mct_int_type == MCT_INT_SPI) {
                if (cpu == 0) {
                        mct_tick0_event_irq.dev_id = mevt;
-                       evt->irq = IRQ_MCT_L0;
-                       setup_irq(IRQ_MCT_L0, &mct_tick0_event_irq);
+                       evt->irq = EXYNOS4_IRQ_MCT_L0;
+                       setup_irq(EXYNOS4_IRQ_MCT_L0, &mct_tick0_event_irq);
                } else {
                        mct_tick1_event_irq.dev_id = mevt;
-                       evt->irq = IRQ_MCT_L1;
-                       setup_irq(IRQ_MCT_L1, &mct_tick1_event_irq);
-                       irq_set_affinity(IRQ_MCT_L1, cpumask_of(1));
+                       evt->irq = EXYNOS4_IRQ_MCT_L1;
+                       setup_irq(EXYNOS4_IRQ_MCT_L1, &mct_tick1_event_irq);
+                       irq_set_affinity(EXYNOS4_IRQ_MCT_L1, cpumask_of(1));
                }
        } else {
-               enable_percpu_irq(IRQ_MCT_LOCALTIMER, 0);
+               enable_percpu_irq(EXYNOS_IRQ_MCT_LOCALTIMER, 0);
        }
 -}
 -
 -/* Setup the local clock events for a CPU */
 -int __cpuinit local_timer_setup(struct clock_event_device *evt)
 -{
 -      exynos4_mct_tick_init(evt);
  
        return 0;
  }
  
 -void local_timer_stop(struct clock_event_device *evt)
 +static void exynos4_local_timer_stop(struct clock_event_device *evt)
  {
        unsigned int cpu = smp_processor_id();
        evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
                else
                        remove_irq(evt->irq, &mct_tick1_event_irq);
        else
-               disable_percpu_irq(IRQ_MCT_LOCALTIMER);
+               disable_percpu_irq(EXYNOS_IRQ_MCT_LOCALTIMER);
  }
 +
 +static struct local_timer_ops exynos4_mct_tick_ops __cpuinitdata = {
 +      .setup  = exynos4_local_timer_setup,
 +      .stop   = exynos4_local_timer_stop,
 +};
  #endif /* CONFIG_LOCAL_TIMERS */
  
  static void __init exynos4_timer_resources(void)
        if (mct_int_type == MCT_INT_PPI) {
                int err;
  
-               err = request_percpu_irq(IRQ_MCT_LOCALTIMER,
+               err = request_percpu_irq(EXYNOS_IRQ_MCT_LOCALTIMER,
                                         exynos4_mct_tick_isr, "MCT",
                                         &percpu_mct_tick);
                WARN(err, "MCT: can't request IRQ %d (%d)\n",
-                    IRQ_MCT_LOCALTIMER, err);
+                    EXYNOS_IRQ_MCT_LOCALTIMER, err);
        }
 +
 +      local_timer_register(&exynos4_mct_tick_ops);
  #endif /* CONFIG_LOCAL_TIMERS */
  }
  
index 262f8def5577425f4276b5f44ba35b2e52cbf92f,c92c0052712399c282cf68dfed39a4b3457fc8b6..b56dde2732bbd2b5215c101f6a1ce57f026a712d
@@@ -256,16 -256,10 +256,16 @@@ static struct sh_mobile_meram_info mera
  
  static struct resource meram_resources[] = {
        [0] = {
 -              .name   = "MERAM",
 -              .start  = 0xe8000000,
 -              .end    = 0xe81fffff,
 -              .flags  = IORESOURCE_MEM,
 +              .name   = "regs",
 +              .start  = 0xe8000000,
 +              .end    = 0xe807ffff,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              .name   = "meram",
 +              .start  = 0xe8080000,
 +              .end    = 0xe81fffff,
 +              .flags  = IORESOURCE_MEM,
        },
  };
  
@@@ -441,6 -435,82 +441,6 @@@ static struct platform_device usb1_host
        .resource       = usb1_host_resources,
  };
  
 -static const struct fb_videomode ap4evb_lcdc_modes[] = {
 -      {
 -#ifdef CONFIG_AP4EVB_QHD
 -              .name           = "R63302(QHD)",
 -              .xres           = 544,
 -              .yres           = 961,
 -              .left_margin    = 72,
 -              .right_margin   = 600,
 -              .hsync_len      = 16,
 -              .upper_margin   = 8,
 -              .lower_margin   = 8,
 -              .vsync_len      = 2,
 -              .sync           = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
 -#else
 -              .name           = "WVGA Panel",
 -              .xres           = 800,
 -              .yres           = 480,
 -              .left_margin    = 220,
 -              .right_margin   = 110,
 -              .hsync_len      = 70,
 -              .upper_margin   = 20,
 -              .lower_margin   = 5,
 -              .vsync_len      = 5,
 -              .sync           = 0,
 -#endif
 -      },
 -};
 -static struct sh_mobile_meram_cfg lcd_meram_cfg = {
 -      .icb[0] = {
 -              .marker_icb     = 28,
 -              .cache_icb      = 24,
 -              .meram_offset   = 0x0,
 -              .meram_size     = 0x40,
 -      },
 -      .icb[1] = {
 -              .marker_icb     = 29,
 -              .cache_icb      = 25,
 -              .meram_offset   = 0x40,
 -              .meram_size     = 0x40,
 -      },
 -};
 -
 -static struct sh_mobile_lcdc_info lcdc_info = {
 -      .meram_dev = &meram_info,
 -      .ch[0] = {
 -              .chan = LCDC_CHAN_MAINLCD,
 -              .fourcc = V4L2_PIX_FMT_RGB565,
 -              .lcd_cfg = ap4evb_lcdc_modes,
 -              .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
 -              .meram_cfg = &lcd_meram_cfg,
 -      }
 -};
 -
 -static struct resource lcdc_resources[] = {
 -      [0] = {
 -              .name   = "LCDC",
 -              .start  = 0xfe940000, /* P4-only space */
 -              .end    = 0xfe943fff,
 -              .flags  = IORESOURCE_MEM,
 -      },
 -      [1] = {
 -              .start  = intcs_evt2irq(0x580),
 -              .flags  = IORESOURCE_IRQ,
 -      },
 -};
 -
 -static struct platform_device lcdc_device = {
 -      .name           = "sh_mobile_lcdc_fb",
 -      .num_resources  = ARRAY_SIZE(lcdc_resources),
 -      .resource       = lcdc_resources,
 -      .dev    = {
 -              .platform_data  = &lcdc_info,
 -              .coherent_dma_mask = ~0,
 -      },
 -};
 -
  /*
   * QHD display
   */
@@@ -484,25 -554,20 +484,25 @@@ static struct platform_device keysc_dev
  };
  
  /* MIPI-DSI */
 -#define PHYCTRL               0x0070
  static int sh_mipi_set_dot_clock(struct platform_device *pdev,
                                 void __iomem *base,
                                 int enable)
  {
        struct clk *pck = clk_get(&pdev->dev, "dsip_clk");
 -      void __iomem *phy =  base + PHYCTRL;
  
        if (IS_ERR(pck))
                return PTR_ERR(pck);
  
        if (enable) {
 +              /*
 +               * DSIPCLK      = 24MHz
 +               * D-PHY        = DSIPCLK * ((0x6*2)+1) = 312MHz (see .phyctrl)
 +               * HsByteCLK    = D-PHY/8 = 39MHz
 +               *
 +               *  X * Y * FPS =
 +               * (544+72+600+16) * (961+8+8+2) * 30 = 36.1MHz
 +               */
                clk_set_rate(pck, clk_round_rate(pck, 24000000));
 -              iowrite32(ioread32(phy) | (0xb << 8), phy);
                clk_enable(pck);
        } else {
                clk_disable(pck);
@@@ -526,14 -591,11 +526,14 @@@ static struct resource mipidsi0_resourc
        },
  };
  
 +static struct sh_mobile_lcdc_info lcdc_info;
 +
  static struct sh_mipi_dsi_info mipidsi0_info = {
        .data_format    = MIPI_RGB888,
        .lcd_chan       = &lcdc_info.ch[0],
        .lane           = 2,
        .vsynw_offset   = 17,
 +      .phyctrl        = 0x6 << 8,
        .flags          = SH_MIPI_DSI_SYNC_PULSES_MODE |
                          SH_MIPI_DSI_HSbyteCLK,
        .set_dot_clock  = sh_mipi_set_dot_clock,
@@@ -555,81 -617,6 +555,81 @@@ static struct platform_device *qhd_devi
  };
  #endif /* CONFIG_AP4EVB_QHD */
  
 +/* LCDC0 */
 +static const struct fb_videomode ap4evb_lcdc_modes[] = {
 +      {
 +#ifdef CONFIG_AP4EVB_QHD
 +              .name           = "R63302(QHD)",
 +              .xres           = 544,
 +              .yres           = 961,
 +              .left_margin    = 72,
 +              .right_margin   = 600,
 +              .hsync_len      = 16,
 +              .upper_margin   = 8,
 +              .lower_margin   = 8,
 +              .vsync_len      = 2,
 +              .sync           = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
 +#else
 +              .name           = "WVGA Panel",
 +              .xres           = 800,
 +              .yres           = 480,
 +              .left_margin    = 220,
 +              .right_margin   = 110,
 +              .hsync_len      = 70,
 +              .upper_margin   = 20,
 +              .lower_margin   = 5,
 +              .vsync_len      = 5,
 +              .sync           = 0,
 +#endif
 +      },
 +};
 +
 +static const struct sh_mobile_meram_cfg lcd_meram_cfg = {
 +      .icb[0] = {
 +              .meram_size     = 0x40,
 +      },
 +      .icb[1] = {
 +              .meram_size     = 0x40,
 +      },
 +};
 +
 +static struct sh_mobile_lcdc_info lcdc_info = {
 +      .meram_dev = &meram_info,
 +      .ch[0] = {
 +              .chan = LCDC_CHAN_MAINLCD,
 +              .fourcc = V4L2_PIX_FMT_RGB565,
 +              .lcd_modes = ap4evb_lcdc_modes,
 +              .num_modes = ARRAY_SIZE(ap4evb_lcdc_modes),
 +              .meram_cfg = &lcd_meram_cfg,
 +#ifdef CONFIG_AP4EVB_QHD
 +              .tx_dev = &mipidsi0_device,
 +#endif
 +      }
 +};
 +
 +static struct resource lcdc_resources[] = {
 +      [0] = {
 +              .name   = "LCDC",
 +              .start  = 0xfe940000, /* P4-only space */
 +              .end    = 0xfe943fff,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              .start  = intcs_evt2irq(0x580),
 +              .flags  = IORESOURCE_IRQ,
 +      },
 +};
 +
 +static struct platform_device lcdc_device = {
 +      .name           = "sh_mobile_lcdc_fb",
 +      .num_resources  = ARRAY_SIZE(lcdc_resources),
 +      .resource       = lcdc_resources,
 +      .dev    = {
 +              .platform_data  = &lcdc_info,
 +              .coherent_dma_mask = ~0,
 +      },
 +};
 +
  /* FSI */
  #define IRQ_FSI               evt2irq(0x1840)
  static int __fsi_set_rate(struct clk *clk, long rate, int enable)
@@@ -748,18 -735,26 +748,18 @@@ fsi_set_rate_end
        return ret;
  }
  
 -static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
 -{
 -      int ret;
 -
 -      if (is_porta)
 -              ret = fsi_ak4642_set_rate(dev, rate, enable);
 -      else
 -              ret = fsi_hdmi_set_rate(dev, rate, enable);
 -
 -      return ret;
 -}
 -
  static struct sh_fsi_platform_info fsi_info = {
 -      .porta_flags = SH_FSI_BRS_INV,
 -
 -      .portb_flags = SH_FSI_BRS_INV |
 -                     SH_FSI_BRM_INV |
 -                     SH_FSI_LRS_INV |
 -                     SH_FSI_FMT_SPDIF,
 -      .set_rate = fsi_set_rate,
 +      .port_a = {
 +              .flags          = SH_FSI_BRS_INV,
 +              .set_rate       = fsi_ak4642_set_rate,
 +      },
 +      .port_b = {
 +              .flags          = SH_FSI_BRS_INV |
 +                                SH_FSI_BRM_INV |
 +                                SH_FSI_LRS_INV |
 +                                SH_FSI_FMT_SPDIF,
 +              .set_rate       = fsi_hdmi_set_rate,
 +      },
  };
  
  static struct resource fsi_resources[] = {
@@@ -801,11 -796,65 +801,11 @@@ static struct platform_device fsi_ak464
        },
  };
  
 -static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
 -      .icb[0] = {
 -              .marker_icb     = 30,
 -              .cache_icb      = 26,
 -              .meram_offset   = 0x80,
 -              .meram_size     = 0x100,
 -      },
 -      .icb[1] = {
 -              .marker_icb     = 31,
 -              .cache_icb      = 27,
 -              .meram_offset   = 0x180,
 -              .meram_size     = 0x100,
 -      },
 -};
 -
 -static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
 -      .clock_source = LCDC_CLK_EXTERNAL,
 -      .meram_dev = &meram_info,
 -      .ch[0] = {
 -              .chan = LCDC_CHAN_MAINLCD,
 -              .fourcc = V4L2_PIX_FMT_RGB565,
 -              .interface_type = RGB24,
 -              .clock_divider = 1,
 -              .flags = LCDC_FLAGS_DWPOL,
 -              .meram_cfg = &hdmi_meram_cfg,
 -      }
 -};
 -
 -static struct resource lcdc1_resources[] = {
 -      [0] = {
 -              .name   = "LCDC1",
 -              .start  = 0xfe944000,
 -              .end    = 0xfe947fff,
 -              .flags  = IORESOURCE_MEM,
 -      },
 -      [1] = {
 -              .start  = intcs_evt2irq(0x1780),
 -              .flags  = IORESOURCE_IRQ,
 -      },
 -};
 -
 -static struct platform_device lcdc1_device = {
 -      .name           = "sh_mobile_lcdc_fb",
 -      .num_resources  = ARRAY_SIZE(lcdc1_resources),
 -      .resource       = lcdc1_resources,
 -      .id             = 1,
 -      .dev    = {
 -              .platform_data  = &sh_mobile_lcdc1_info,
 -              .coherent_dma_mask = ~0,
 -      },
 -};
 -
 +/* LCDC1 */
  static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
                                unsigned long *parent_freq);
  
 -
  static struct sh_mobile_hdmi_info hdmi_info = {
 -      .lcd_chan = &sh_mobile_lcdc1_info.ch[0],
 -      .lcd_dev = &lcdc1_device.dev,
        .flags = HDMI_SND_SRC_SPDIF,
        .clk_optimize_parent = ap4evb_clk_optimize,
  };
@@@ -834,6 -883,10 +834,6 @@@ static struct platform_device hdmi_devi
        },
  };
  
 -static struct platform_device fsi_hdmi_device = {
 -      .name           = "sh_fsi2_b_hdmi",
 -};
 -
  static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
                                unsigned long *parent_freq)
  {
        return error;
  }
  
 +static const struct sh_mobile_meram_cfg hdmi_meram_cfg = {
 +      .icb[0] = {
 +              .meram_size     = 0x100,
 +      },
 +      .icb[1] = {
 +              .meram_size     = 0x100,
 +      },
 +};
 +
 +static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
 +      .clock_source = LCDC_CLK_EXTERNAL,
 +      .meram_dev = &meram_info,
 +      .ch[0] = {
 +              .chan = LCDC_CHAN_MAINLCD,
 +              .fourcc = V4L2_PIX_FMT_RGB565,
 +              .interface_type = RGB24,
 +              .clock_divider = 1,
 +              .flags = LCDC_FLAGS_DWPOL,
 +              .meram_cfg = &hdmi_meram_cfg,
 +              .tx_dev = &hdmi_device,
 +      }
 +};
 +
 +static struct resource lcdc1_resources[] = {
 +      [0] = {
 +              .name   = "LCDC1",
 +              .start  = 0xfe944000,
 +              .end    = 0xfe947fff,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              .start  = intcs_evt2irq(0x1780),
 +              .flags  = IORESOURCE_IRQ,
 +      },
 +};
 +
 +static struct platform_device lcdc1_device = {
 +      .name           = "sh_mobile_lcdc_fb",
 +      .num_resources  = ARRAY_SIZE(lcdc1_resources),
 +      .resource       = lcdc1_resources,
 +      .id             = 1,
 +      .dev    = {
 +              .platform_data  = &sh_mobile_lcdc1_info,
 +              .coherent_dma_mask = ~0,
 +      },
 +};
 +
 +static struct platform_device fsi_hdmi_device = {
 +      .name           = "sh_fsi2_b_hdmi",
 +};
 +
  static struct gpio_led ap4evb_leds[] = {
        {
                .name                   = "led4",
@@@ -1038,9 -1040,9 +1038,9 @@@ static struct platform_device *ap4evb_d
        &fsi_ak4643_device,
        &fsi_hdmi_device,
        &sh_mmcif_device,
 -      &lcdc1_device,
 -      &lcdc_device,
        &hdmi_device,
 +      &lcdc_device,
 +      &lcdc1_device,
        &ceu_device,
        &ap4evb_camera,
        &meram_device,
@@@ -1186,6 -1188,7 +1186,7 @@@ static struct i2c_board_info i2c1_devic
        },
  };
  
  #define GPIO_PORT9CR  0xE6051009
  #define GPIO_PORT10CR 0xE605100A
  #define USCCR1                0xE6058144
@@@ -1333,8 -1336,8 +1334,8 @@@ static void __init ap4evb_init(void
        lcdc_info.ch[0].interface_type          = RGB24;
        lcdc_info.ch[0].clock_divider           = 1;
        lcdc_info.ch[0].flags                   = LCDC_FLAGS_DWPOL;
 -      lcdc_info.ch[0].lcd_size_cfg.width      = 44;
 -      lcdc_info.ch[0].lcd_size_cfg.height     = 79;
 +      lcdc_info.ch[0].panel_cfg.width         = 44;
 +      lcdc_info.ch[0].panel_cfg.height        = 79;
  
        platform_add_devices(qhd_devices, ARRAY_SIZE(qhd_devices));
  
        lcdc_info.ch[0].interface_type          = RGB18;
        lcdc_info.ch[0].clock_divider           = 3;
        lcdc_info.ch[0].flags                   = 0;
 -      lcdc_info.ch[0].lcd_size_cfg.width      = 152;
 -      lcdc_info.ch[0].lcd_size_cfg.height     = 91;
 +      lcdc_info.ch[0].panel_cfg.width         = 152;
 +      lcdc_info.ch[0].panel_cfg.height        = 91;
  
        /* enable TouchScreen */
        irq_set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW);
index bd4253ba05b65f0cbd3f99c81b600df6f7f2c7ac,55da7a1159127f776c252ce8c2479795155ee7db..ca609502d6cdda92dda69a3cc421e58d25e9b4c7
@@@ -316,14 -316,8 +316,14 @@@ static struct sh_mobile_meram_info mack
  
  static struct resource meram_resources[] = {
        [0] = {
 -              .name   = "MERAM",
 +              .name   = "regs",
                .start  = 0xe8000000,
 +              .end    = 0xe807ffff,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              .name   = "meram",
 +              .start  = 0xe8080000,
                .end    = 0xe81fffff,
                .flags  = IORESOURCE_MEM,
        },
@@@ -355,23 -349,29 +355,23 @@@ static struct fb_videomode mackerel_lcd
        },
  };
  
 -static int mackerel_set_brightness(void *board_data, int brightness)
 +static int mackerel_set_brightness(int brightness)
  {
        gpio_set_value(GPIO_PORT31, brightness);
  
        return 0;
  }
  
 -static int mackerel_get_brightness(void *board_data)
 +static int mackerel_get_brightness(void)
  {
        return gpio_get_value(GPIO_PORT31);
  }
  
 -static struct sh_mobile_meram_cfg lcd_meram_cfg = {
 +static const struct sh_mobile_meram_cfg lcd_meram_cfg = {
        .icb[0] = {
 -              .marker_icb     = 28,
 -              .cache_icb      = 24,
 -              .meram_offset   = 0x0,
                .meram_size     = 0x40,
        },
        .icb[1] = {
 -              .marker_icb     = 29,
 -              .cache_icb      = 25,
 -              .meram_offset   = 0x40,
                .meram_size     = 0x40,
        },
  };
@@@ -382,20 -382,20 +382,20 @@@ static struct sh_mobile_lcdc_info lcdc_
        .ch[0] = {
                .chan = LCDC_CHAN_MAINLCD,
                .fourcc = V4L2_PIX_FMT_RGB565,
 -              .lcd_cfg = mackerel_lcdc_modes,
 -              .num_cfg = ARRAY_SIZE(mackerel_lcdc_modes),
 +              .lcd_modes = mackerel_lcdc_modes,
 +              .num_modes = ARRAY_SIZE(mackerel_lcdc_modes),
                .interface_type         = RGB24,
                .clock_divider          = 3,
                .flags                  = 0,
 -              .lcd_size_cfg.width     = 152,
 -              .lcd_size_cfg.height    = 91,
 -              .board_cfg = {
 -                      .set_brightness = mackerel_set_brightness,
 -                      .get_brightness = mackerel_get_brightness,
 +              .panel_cfg = {
 +                      .width          = 152,
 +                      .height         = 91,
                },
                .bl_info = {
                        .name = "sh_mobile_lcdc_bl",
                        .max_brightness = 1,
 +                      .set_brightness = mackerel_set_brightness,
 +                      .get_brightness = mackerel_get_brightness,
                },
                .meram_cfg = &lcd_meram_cfg,
        }
@@@ -424,44 -424,21 +424,44 @@@ static struct platform_device lcdc_devi
        },
  };
  
 -static struct sh_mobile_meram_cfg hdmi_meram_cfg = {
 +/* HDMI */
 +static struct sh_mobile_hdmi_info hdmi_info = {
 +      .flags          = HDMI_SND_SRC_SPDIF,
 +};
 +
 +static struct resource hdmi_resources[] = {
 +      [0] = {
 +              .name   = "HDMI",
 +              .start  = 0xe6be0000,
 +              .end    = 0xe6be00ff,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +      [1] = {
 +              /* There's also an HDMI interrupt on INTCS @ 0x18e0 */
 +              .start  = evt2irq(0x17e0),
 +              .flags  = IORESOURCE_IRQ,
 +      },
 +};
 +
 +static struct platform_device hdmi_device = {
 +      .name           = "sh-mobile-hdmi",
 +      .num_resources  = ARRAY_SIZE(hdmi_resources),
 +      .resource       = hdmi_resources,
 +      .id             = -1,
 +      .dev    = {
 +              .platform_data  = &hdmi_info,
 +      },
 +};
 +
 +static const struct sh_mobile_meram_cfg hdmi_meram_cfg = {
        .icb[0] = {
 -              .marker_icb     = 30,
 -              .cache_icb      = 26,
 -              .meram_offset   = 0x80,
                .meram_size     = 0x100,
        },
        .icb[1] = {
 -              .marker_icb     = 31,
 -              .cache_icb      = 27,
 -              .meram_offset   = 0x180,
                .meram_size     = 0x100,
        },
  };
 -/* HDMI */
 +
  static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
        .meram_dev = &mackerel_meram_info,
        .clock_source = LCDC_CLK_EXTERNAL,
                .clock_divider = 1,
                .flags = LCDC_FLAGS_DWPOL,
                .meram_cfg = &hdmi_meram_cfg,
 +              .tx_dev = &hdmi_device,
        }
  };
  
@@@ -500,6 -476,36 +500,6 @@@ static struct platform_device hdmi_lcdc
        },
  };
  
 -static struct sh_mobile_hdmi_info hdmi_info = {
 -      .lcd_chan       = &hdmi_lcdc_info.ch[0],
 -      .lcd_dev        = &hdmi_lcdc_device.dev,
 -      .flags          = HDMI_SND_SRC_SPDIF,
 -};
 -
 -static struct resource hdmi_resources[] = {
 -      [0] = {
 -              .name   = "HDMI",
 -              .start  = 0xe6be0000,
 -              .end    = 0xe6be00ff,
 -              .flags  = IORESOURCE_MEM,
 -      },
 -      [1] = {
 -              /* There's also an HDMI interrupt on INTCS @ 0x18e0 */
 -              .start  = evt2irq(0x17e0),
 -              .flags  = IORESOURCE_IRQ,
 -      },
 -};
 -
 -static struct platform_device hdmi_device = {
 -      .name           = "sh-mobile-hdmi",
 -      .num_resources  = ARRAY_SIZE(hdmi_resources),
 -      .resource       = hdmi_resources,
 -      .id             = -1,
 -      .dev    = {
 -              .platform_data  = &hdmi_info,
 -      },
 -};
 -
  static struct platform_device fsi_hdmi_device = {
        .name           = "sh_fsi2_b_hdmi",
  };
@@@ -852,7 -858,7 +852,7 @@@ static int __fsi_set_round_rate(struct 
        return clk_enable(clk);
  }
  
 -static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
 +static int fsi_b_set_rate(struct device *dev, int rate, int enable)
  {
        struct clk *fsib_clk;
        struct clk *fdiv_clk = &sh7372_fsidivb_clk;
        int ackmd_bpfmd;
        int ret;
  
 -      /* FSIA is slave mode. nothing to do here */
 -      if (is_porta)
 -              return 0;
 -
        /* clock start */
        switch (rate) {
        case 44100:
@@@ -904,16 -914,14 +904,16 @@@ fsi_set_rate_end
  }
  
  static struct sh_fsi_platform_info fsi_info = {
 -      .porta_flags =  SH_FSI_BRS_INV,
 -
 -      .portb_flags =  SH_FSI_BRS_INV  |
 +      .port_a = {
 +              .flags = SH_FSI_BRS_INV,
 +      },
 +      .port_b = {
 +              .flags = SH_FSI_BRS_INV |
                        SH_FSI_BRM_INV  |
                        SH_FSI_LRS_INV  |
                        SH_FSI_FMT_SPDIF,
 -
 -      .set_rate = fsi_set_rate,
 +              .set_rate = fsi_b_set_rate,
 +      }
  };
  
  static struct resource fsi_resources[] = {
@@@ -1266,8 -1274,8 +1266,8 @@@ static struct platform_device *mackerel
        &sh_mmcif_device,
        &ceu_device,
        &mackerel_camera,
 -      &hdmi_lcdc_device,
        &hdmi_device,
 +      &hdmi_lcdc_device,
        &meram_device,
  };
  
@@@ -1327,15 -1335,6 +1327,6 @@@ static struct i2c_board_info i2c1_devic
        },
  };
  
- static void __init mackerel_map_io(void)
- {
-       sh7372_map_io();
-       /* DMA memory at 0xff200000 - 0xffdfffff. The default 2MB size isn't
-        * enough to allocate the frame buffer memory.
-        */
-       init_consistent_dma_size(12 << 20);
- }
  #define GPIO_PORT9CR  0xE6051009
  #define GPIO_PORT10CR 0xE605100A
  #define GPIO_PORT167CR        0xE60520A7
@@@ -1555,7 -1554,7 +1546,7 @@@ static void __init mackerel_init(void
  }
  
  MACHINE_START(MACKEREL, "mackerel")
-       .map_io         = mackerel_map_io,
+       .map_io         = sh7372_map_io,
        .init_early     = sh7372_add_early_devices,
        .init_irq       = sh7372_init_irq,
        .handle_irq     = shmobile_handle_irq_intc,
index 5375325d7ca7d08000d9a4f8611dc77d532d59f9,0ebbee087b5e61c9cc38fbfe2729475973a948c8..4e818b7de7815fb466f0b4c5451fad7225859628
@@@ -31,6 -31,7 +31,7 @@@
  #include <linux/sh_intc.h>
  #include <linux/sh_timer.h>
  #include <linux/pm_domain.h>
+ #include <linux/dma-mapping.h>
  #include <mach/hardware.h>
  #include <mach/sh7372.h>
  #include <mach/common.h>
@@@ -54,6 -55,12 +55,12 @@@ static struct map_desc sh7372_io_desc[
  void __init sh7372_map_io(void)
  {
        iotable_init(sh7372_io_desc, ARRAY_SIZE(sh7372_io_desc));
+       /*
+        * DMA memory at 0xff200000 - 0xffdfffff. The default 2MB size isn't
+        * enough to allocate the frame buffer memory.
+        */
+       init_consistent_dma_size(12 << 20);
  }
  
  /* SCIFA0 */
@@@ -1063,8 -1070,6 +1070,8 @@@ void __init sh7372_add_standard_devices
        sh7372_add_device_to_domain(&sh7372_a4r, &veu2_device);
        sh7372_add_device_to_domain(&sh7372_a4r, &veu3_device);
        sh7372_add_device_to_domain(&sh7372_a4r, &jpu_device);
 +      sh7372_add_device_to_domain(&sh7372_a4r, &tmu00_device);
 +      sh7372_add_device_to_domain(&sh7372_a4r, &tmu01_device);
  }
  
  static void __init sh7372_earlytimer_init(void)
index 1dd2726986cfe70693ca511720f459c3ae003722,7c77a539f858a856ba30ca9cd510cbc54b23f1d5..d87d968115ec6c1adc477ebb61dc1c324ad4e6c9
@@@ -8,6 -8,7 +8,7 @@@ obj-
  obj-y                                   += pinmux.o
  obj-y                                 += fuse.o
  obj-y                                 += pmc.o
+ obj-y                                 += flowctrl.o
  obj-$(CONFIG_CPU_IDLE)                        += cpuidle.o
  obj-$(CONFIG_CPU_IDLE)                        += sleep.o
  obj-$(CONFIG_ARCH_TEGRA_2x_SOC)               += powergate.o
@@@ -17,7 -18,8 +18,8 @@@ obj-$(CONFIG_ARCH_TEGRA_2x_SOC)               += pin
  obj-$(CONFIG_ARCH_TEGRA_3x_SOC)               += pinmux-tegra30-tables.o
  obj-$(CONFIG_ARCH_TEGRA_3x_SOC)               += board-dt-tegra30.o
  obj-$(CONFIG_ARCH_TEGRA_3x_SOC)               += tegra30_clocks.o
 -obj-$(CONFIG_SMP)                       += platsmp.o localtimer.o headsmp.o
 +obj-$(CONFIG_SMP)                     += platsmp.o headsmp.o
+ obj-$(CONFIG_SMP)                       += reset.o
  obj-$(CONFIG_HOTPLUG_CPU)               += hotplug.o
  obj-$(CONFIG_TEGRA_SYSTEM_DMA)                += dma.o apbio.o
  obj-$(CONFIG_CPU_FREQ)                  += cpu-tegra.o
index 96f6c0d030bd5ce58d23a4501af0ae0e845301bc,11f7abd775b3fc2e3274b12db17e7f9d91a342a0..5f7c03e972f3dc2654f82022d81129bb5982b0d7
@@@ -56,7 -56,7 +56,7 @@@ struct of_dev_auxdata tegra30_auxdata_l
  
  static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
        /* name         parent          rate            enabled */
-       { "uartd",      "pll_p",        408000000,      true },
+       { "uarta",      "pll_p",        408000000,      true },
        { NULL,         NULL,           0,              0},
  };
  
@@@ -69,7 -69,7 +69,7 @@@ static void __init tegra30_dt_init(void
  }
  
  static const char *tegra30_dt_board_compat[] = {
 -      "nvidia,cardhu",
 +      "nvidia,tegra30",
        NULL
  };
  
index 2f86fcca64a6b1cd1006103f256447dff7e397f6,68815ce3f666cc0d7868a5b5e339f765a4b9d8c4..22df10fb9972877069f92637ff5849ba990ad9f7
@@@ -27,6 -27,7 +27,7 @@@
  #include <asm/hardware/gic.h>
  
  #include <mach/iomap.h>
+ #include <mach/powergate.h>
  
  #include "board.h"
  #include "clock.h"
@@@ -113,18 -114,23 +114,21 @@@ static void __init tegra_init_cache(u3
  #ifdef CONFIG_ARCH_TEGRA_2x_SOC
  void __init tegra20_init_early(void)
  {
 -      disable_hlt();  /* idle WFI usage needs to be confirmed */
 -
        tegra_init_fuse();
        tegra2_init_clocks();
        tegra_clk_init_from_table(tegra20_clk_init_table);
        tegra_init_cache(0x331, 0x441);
        tegra_pmc_init();
+       tegra_powergate_init();
  }
  #endif
  #ifdef CONFIG_ARCH_TEGRA_3x_SOC
  void __init tegra30_init_early(void)
  {
+       tegra_init_fuse();
        tegra30_init_clocks();
        tegra_init_cache(0x441, 0x551);
        tegra_pmc_init();
+       tegra_powergate_init();
  }
  #endif
index c1afb2738769d4be34a75e04aff95ad1a5ca8a9d,027f2b2d17883998d16143a9dd73dee289c33261..f946d129423c7b407dab381906b219f5287200ca
@@@ -19,7 -19,6 +19,7 @@@
  
  #include <linux/kernel.h>
  #include <linux/io.h>
 +#include <linux/export.h>
  
  #include <mach/iomap.h>
  
@@@ -34,6 -33,7 +34,7 @@@
  int tegra_sku_id;
  int tegra_cpu_process_id;
  int tegra_core_process_id;
+ int tegra_chip_id;
  enum tegra_revision tegra_revision;
  
  /* The BCT to use at boot is specified by board straps that can be read
@@@ -66,12 -66,9 +67,9 @@@ static inline bool get_spare_fuse(int b
        return tegra_fuse_readl(FUSE_SPARE_BIT + bit * 4);
  }
  
- static enum tegra_revision tegra_get_revision(void)
+ static enum tegra_revision tegra_get_revision(u32 id)
  {
-       void __iomem *chip_id = IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804;
-       u32 id = readl(chip_id);
        u32 minor_rev = (id >> 16) & 0xf;
-       u32 chipid = (id >> 8) & 0xff;
  
        switch (minor_rev) {
        case 1:
@@@ -79,7 -76,8 +77,8 @@@
        case 2:
                return TEGRA_REVISION_A02;
        case 3:
-               if (chipid == 0x20 && (get_spare_fuse(18) || get_spare_fuse(19)))
+               if (tegra_chip_id == TEGRA20 &&
+                       (get_spare_fuse(18) || get_spare_fuse(19)))
                        return TEGRA_REVISION_A03p;
                else
                        return TEGRA_REVISION_A03;
@@@ -92,6 -90,8 +91,8 @@@
  
  void tegra_init_fuse(void)
  {
+       u32 id;
        u32 reg = readl(IO_TO_VIRT(TEGRA_CLK_RESET_BASE + 0x48));
        reg |= 1 << 28;
        writel(reg, IO_TO_VIRT(TEGRA_CLK_RESET_BASE + 0x48));
        reg = tegra_apb_readl(TEGRA_APB_MISC_BASE + STRAP_OPT);
        tegra_bct_strapping = (reg & RAM_ID_MASK) >> RAM_CODE_SHIFT;
  
-       tegra_revision = tegra_get_revision();
+       id = readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804);
+       tegra_chip_id = (id >> 8) & 0xff;
+       tegra_revision = tegra_get_revision(id);
  
        pr_info("Tegra Revision: %s SKU: %d CPU Process: %d Core Process: %d\n",
-               tegra_revision_name[tegra_get_revision()],
+               tegra_revision_name[tegra_revision],
                tegra_sku_id, tegra_cpu_process_id,
                tegra_core_process_id);
  }
@@@ -124,4 -127,3 +128,4 @@@ unsigned long long tegra_chip_uid(void
        hi = tegra_fuse_readl(FUSE_UID_HIGH);
        return (hi << 32ull) | lo;
  }
 +EXPORT_SYMBOL(tegra_chip_uid);
index 9ec635812349d3594749cfda7fca07b742d402dd,d07a3afc38c012a940f4d7e8c8d2df51a537c7c7..8904d18de01a4dabbe196b3b464c83b5306c369d
@@@ -8,55 -8,48 +8,56 @@@ config UX500_SOC_COMMO
        select PL310_ERRATA_753970
        select ARM_ERRATA_754322
        select ARM_ERRATA_764369
 -
 -menu "Ux500 SoC"
 +      select CACHE_L2X0
  
  config UX500_SOC_DB5500
 -      bool "DB5500"
 +      bool
        select MFD_DB5500_PRCMU
  
  config UX500_SOC_DB8500
 -      bool "DB8500"
 +      bool
        select MFD_DB8500_PRCMU
        select REGULATOR_DB8500_PRCMU
 -
 -endmenu
 +      select CPU_FREQ_TABLE if CPU_FREQ
  
  menu "Ux500 target platform (boards)"
  
 -config MACH_U8500
 -      bool "U8500 Development platform"
 -      depends on UX500_SOC_DB8500
 -      select TPS6105X
 +config MACH_MOP500
 +      bool "U8500 Development platform, MOP500 versions"
 +      select UX500_SOC_DB8500
 +      select I2C
 +      select I2C_NOMADIK
+       select SOC_BUS
        help
 -        Include support for the mop500 development platform.
 +        Include support for the MOP500 development platform.
  
  config MACH_HREFV60
 -       bool "U85000 Development platform, HREFv60 version"
 -       depends on UX500_SOC_DB8500
 -       help
 -         Include support for the HREFv60 new development platform.
 +      bool "U8500 Development platform, HREFv60 version"
 +      select MACH_MOP500
 +      help
 +        Include support for the HREFv60 new development platform.
 +        Includes HREFv70, v71 etc.
  
  config MACH_SNOWBALL
        bool "U8500 Snowball platform"
 -      depends on UX500_SOC_DB8500
 -      select MACH_U8500
 +      select MACH_MOP500
        help
          Include support for the snowball development platform.
  
  config MACH_U5500
        bool "U5500 Development platform"
 -      depends on UX500_SOC_DB5500
 +      select UX500_SOC_DB5500
        help
          Include support for the U5500 development platform.
 +
 +config UX500_AUTO_PLATFORM
 +      def_bool y
 +      depends on !MACH_U5500
 +      select MACH_MOP500
 +      help
 +        At least one platform needs to be selected in order to build
 +        a working kernel. If everything else is disabled, this
 +        automatically enables MACH_MOP500.
  endmenu
  
  config UX500_DEBUG_UART
index 1daead3e583eb5de6c6d34f6571a9d78549847dd,479ebe04cf9c0bafccccd3f112d163bd14fae2e7..920251cf834cd8859900417cd106d9af7e83a210
   * SDI 0 (MicroSD slot)
   */
  
 -/* MMCIPOWER bits */
 -#define MCI_DATA2DIREN                (1 << 2)
 -#define MCI_CMDDIREN          (1 << 3)
 -#define MCI_DATA0DIREN                (1 << 4)
 -#define MCI_DATA31DIREN               (1 << 5)
 -#define MCI_FBCLKEN           (1 << 7)
 -
  /* GPIO pins used by the sdi0 level shifter */
  static int sdi0_en = -1;
  static int sdi0_vsel = -1;
  
 -static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd,
 -                                 unsigned char power_mode)
 +static int mop500_sdi0_ios_handler(struct device *dev, struct mmc_ios *ios)
  {
 -      switch (power_mode) {
 +      switch (ios->power_mode) {
        case MMC_POWER_UP:
        case MMC_POWER_ON:
                /*
@@@ -57,7 -65,8 +57,7 @@@
                break;
        }
  
 -      return MCI_FBCLKEN | MCI_CMDDIREN | MCI_DATA0DIREN |
 -             MCI_DATA2DIREN | MCI_DATA31DIREN;
 +      return 0;
  }
  
  #ifdef CONFIG_STE_DMA40
@@@ -81,17 -90,13 +81,17 @@@ static struct stedma40_chan_cfg mop500_
  #endif
  
  static struct mmci_platform_data mop500_sdi0_data = {
 -      .vdd_handler    = mop500_sdi0_vdd_handler,
 +      .ios_handler    = mop500_sdi0_ios_handler,
        .ocr_mask       = MMC_VDD_29_30,
        .f_max          = 50000000,
        .capabilities   = MMC_CAP_4_BIT_DATA |
                                MMC_CAP_SD_HIGHSPEED |
                                MMC_CAP_MMC_HIGHSPEED,
        .gpio_wp        = -1,
 +      .sigdir         = MCI_ST_FBCLKEN |
 +                              MCI_ST_CMDDIREN |
 +                              MCI_ST_DATA0DIREN |
 +                              MCI_ST_DATA2DIREN,
  #ifdef CONFIG_STE_DMA40
        .dma_filter     = stedma40_filter,
        .dma_rx_param   = &mop500_sdi0_dma_cfg_rx,
  #endif
  };
  
- static void sdi0_configure(void)
+ static void sdi0_configure(struct device *parent)
  {
        int ret;
  
        gpio_direction_output(sdi0_en, 1);
  
        /* Add the device, force v2 to subrevision 1 */
-       db8500_add_sdi0(&mop500_sdi0_data, U8500_SDI_V2_PERIPHID);
+       db8500_add_sdi0(parent, &mop500_sdi0_data, U8500_SDI_V2_PERIPHID);
  }
  
- void mop500_sdi_tc35892_init(void)
+ void mop500_sdi_tc35892_init(struct device *parent)
  {
        mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
        sdi0_en = GPIO_SDMMC_EN;
        sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL;
-       sdi0_configure();
+       sdi0_configure(parent);
  }
  
  /*
@@@ -241,12 -246,13 +241,13 @@@ static struct mmci_platform_data mop500
  #endif
  };
  
- void __init mop500_sdi_init(void)
+ void __init mop500_sdi_init(struct device *parent)
  {
        /* PoP:ed eMMC */
-       db8500_add_sdi2(&mop500_sdi2_data, U8500_SDI_V2_PERIPHID);
+       db8500_add_sdi2(parent, &mop500_sdi2_data, U8500_SDI_V2_PERIPHID);
        /* On-board eMMC */
-       db8500_add_sdi4(&mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
+       db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
        /*
         * On boards with the TC35892 GPIO expander, sdi0 will finally
         * be added when the TC35892 initializes and calls
         */
  }
  
- void __init snowball_sdi_init(void)
+ void __init snowball_sdi_init(struct device *parent)
  {
        /* On Snowball MMC_CAP_SD_HIGHSPEED isn't supported (Hardware issue?) */
        mop500_sdi0_data.capabilities &= ~MMC_CAP_SD_HIGHSPEED;
        /* On-board eMMC */
-       db8500_add_sdi4(&mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
+       db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
        /* External Micro SD slot */
        mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
        mop500_sdi0_data.cd_invert = true;
        sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
        sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
-       sdi0_configure();
+       sdi0_configure(parent);
  }
  
- void __init hrefv60_sdi_init(void)
+ void __init hrefv60_sdi_init(struct device *parent)
  {
        /* PoP:ed eMMC */
-       db8500_add_sdi2(&mop500_sdi2_data, U8500_SDI_V2_PERIPHID);
+       db8500_add_sdi2(parent, &mop500_sdi2_data, U8500_SDI_V2_PERIPHID);
        /* On-board eMMC */
-       db8500_add_sdi4(&mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
+       db8500_add_sdi4(parent, &mop500_sdi4_data, U8500_SDI_V2_PERIPHID);
        /* External Micro SD slot */
        mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
        sdi0_en = HREFV60_SDMMC_EN_GPIO;
        sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
-       sdi0_configure();
+       sdi0_configure(parent);
        /* WLAN SDIO channel */
-       db8500_add_sdi1(&mop500_sdi1_data, U8500_SDI_V2_PERIPHID);
+       db8500_add_sdi1(parent, &mop500_sdi1_data, U8500_SDI_V2_PERIPHID);
  }
index 6d672a556df896a05ebc5e60ad0f125790edd6f4,04afcdf8b0cf82e9b3f63e5c981d3cea514ce5aa..29d330374994cd1bfce832b5daa7e6cb2f32656b
@@@ -72,7 -72,7 +72,7 @@@ static struct platform_device snowball_
  };
  
  static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
 -      .gpio_base              = MOP500_AB8500_GPIO(0),
 +      .gpio_base              = MOP500_AB8500_PIN_GPIO(1),
        .irq_base               = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
        /* config_reg is the initial configuration of ab8500 pins.
         * The pins can be configured as GPIO or alt functions based
@@@ -226,7 -226,12 +226,12 @@@ static struct tps6105x_platform_data mo
  
  static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base)
  {
-       mop500_sdi_tc35892_init();
+       struct device *parent = NULL;
+ #if 0
+       /* FIXME: Is the sdi actually part of tc3589x? */
+       parent = tc3589x->dev;
+ #endif
+       mop500_sdi_tc35892_init(parent);
  }
  
  static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = {
@@@ -353,12 -358,12 +358,12 @@@ U8500_I2C_CONTROLLER(1, 0xe, 1, 8, 1000
  U8500_I2C_CONTROLLER(2,       0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
  U8500_I2C_CONTROLLER(3,       0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
  
- static void __init mop500_i2c_init(void)
+ static void __init mop500_i2c_init(struct device *parent)
  {
-       db8500_add_i2c0(&u8500_i2c0_data);
-       db8500_add_i2c1(&u8500_i2c1_data);
-       db8500_add_i2c2(&u8500_i2c2_data);
-       db8500_add_i2c3(&u8500_i2c3_data);
+       db8500_add_i2c0(parent, &u8500_i2c0_data);
+       db8500_add_i2c1(parent, &u8500_i2c1_data);
+       db8500_add_i2c2(parent, &u8500_i2c2_data);
+       db8500_add_i2c3(parent, &u8500_i2c3_data);
  }
  
  static struct gpio_keys_button mop500_gpio_keys[] = {
@@@ -451,9 -456,9 +456,9 @@@ static struct pl022_ssp_controller ssp0
        .num_chipselect = 5,
  };
  
- static void __init mop500_spi_init(void)
+ static void __init mop500_spi_init(struct device *parent)
  {
-       db8500_add_ssp0(&ssp0_platform_data);
+       db8500_add_ssp0(parent, &ssp0_platform_data);
  }
  
  #ifdef CONFIG_STE_DMA40
@@@ -587,11 -592,11 +592,11 @@@ static struct amba_pl011_data uart2_pla
  #endif
  };
  
- static void __init mop500_uart_init(void)
+ static void __init mop500_uart_init(struct device *parent)
  {
-       db8500_add_uart0(&uart0_plat);
-       db8500_add_uart1(&uart1_plat);
-       db8500_add_uart2(&uart2_plat);
+       db8500_add_uart0(parent, &uart0_plat);
+       db8500_add_uart1(parent, &uart1_plat);
+       db8500_add_uart2(parent, &uart2_plat);
  }
  
  static struct platform_device *snowball_platform_devs[] __initdata = {
  
  static void __init mop500_init_machine(void)
  {
+       struct device *parent = NULL;
        int i2c0_devs;
+       int i;
  
        mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
  
-       u8500_init_devices();
+       parent = u8500_init_devices();
  
        mop500_pins_init();
  
+       for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
+               mop500_platform_devs[i]->dev.parent = parent;
        platform_add_devices(mop500_platform_devs,
                        ARRAY_SIZE(mop500_platform_devs));
  
-       mop500_i2c_init();
-       mop500_sdi_init();
-       mop500_spi_init();
-       mop500_uart_init();
+       mop500_i2c_init(parent);
+       mop500_sdi_init(parent);
+       mop500_spi_init(parent);
+       mop500_uart_init(parent);
  
        i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
  
  
  static void __init snowball_init_machine(void)
  {
+       struct device *parent = NULL;
        int i2c0_devs;
+       int i;
  
-       u8500_init_devices();
+       parent = u8500_init_devices();
  
        snowball_pins_init();
  
+       for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++)
+               snowball_platform_devs[i]->dev.parent = parent;
        platform_add_devices(snowball_platform_devs,
                        ARRAY_SIZE(snowball_platform_devs));
  
-       mop500_i2c_init();
-       snowball_sdi_init();
-       mop500_spi_init();
-       mop500_uart_init();
+       mop500_i2c_init(parent);
+       snowball_sdi_init(parent);
+       mop500_spi_init(parent);
+       mop500_uart_init(parent);
  
        i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
        i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
  
  static void __init hrefv60_init_machine(void)
  {
+       struct device *parent = NULL;
        int i2c0_devs;
+       int i;
  
        /*
         * The HREFv60 board removed a GPIO expander and routed
         */
        mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
  
-       u8500_init_devices();
+       parent = u8500_init_devices();
  
        hrefv60_pins_init();
  
+       for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
+               mop500_platform_devs[i]->dev.parent = parent;
        platform_add_devices(mop500_platform_devs,
                        ARRAY_SIZE(mop500_platform_devs));
  
-       mop500_i2c_init();
-       hrefv60_sdi_init();
-       mop500_spi_init();
-       mop500_uart_init();
+       mop500_i2c_init(parent);
+       hrefv60_sdi_init(parent);
+       mop500_spi_init(parent);
+       mop500_uart_init(parent);
  
        i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
  
index 7ff6cbffc10446419a83f4f7d04db61eef56616d,3d594c24bfeeeaa3de82a150967d5f8547280ddf..fdcfa8721bb4358e84c2b5d361f30b3ef5503f0e
@@@ -63,7 -63,7 +63,7 @@@
   * because the AB8500 GPIO pins are enumbered starting from 1, so the value in
   * parens matches the GPIO pin number in the data sheet.
   */
 -#define MOP500_AB8500_GPIO(x)         (MOP500_EGPIO_END + (x) - 1)
 +#define MOP500_AB8500_PIN_GPIO(x)     (MOP500_EGPIO_END + (x) - 1)
  /*Snowball AB8500 GPIO */
  #define SNOWBALL_VSMPS2_1V8_GPIO      MOP500_AB8500_PIN_GPIO(1)       /* SYSCLKREQ2/GPIO1 */
  #define SNOWBALL_PM_GPIO1_GPIO                MOP500_AB8500_PIN_GPIO(2)       /* SYSCLKREQ3/GPIO2 */
  
  struct i2c_board_info;
  
- extern void mop500_sdi_init(void);
- extern void snowball_sdi_init(void);
- extern void hrefv60_sdi_init(void);
- extern void mop500_sdi_tc35892_init(void);
+ extern void mop500_sdi_init(struct device *parent);
+ extern void snowball_sdi_init(struct device *parent);
+ extern void hrefv60_sdi_init(struct device *parent);
+ extern void mop500_sdi_tc35892_init(struct device *parent);
  void __init mop500_u8500uib_init(void);
  void __init mop500_stuib_init(void);
  void __init mop500_pins_init(void);
index 851308bf6424750ef7bda0c34092a556de2e68c6,055fb6e16ee21dddddd35c98e60b8d841c841af7..6242e88e5fd301ddd3f0a7ddf28093e4bd98fc81
@@@ -2,6 -2,7 +2,7 @@@
   * Copyright (C) ST-Ericsson SA 2010
   *
   * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
+  * Author: Lee Jones <lee.jones@linaro.org> for ST-Ericsson
   * License terms: GNU General Public License (GPL) version 2
   */
  
  #include <linux/mfd/db8500-prcmu.h>
  #include <linux/mfd/db5500-prcmu.h>
  #include <linux/clksrc-dbx500-prcmu.h>
+ #include <linux/sys_soc.h>
+ #include <linux/err.h>
+ #include <linux/slab.h>
+ #include <linux/stat.h>
  
  #include <asm/hardware/gic.h>
  #include <asm/mach/map.h>
 -#include <asm/localtimer.h>
  
  #include <mach/hardware.h>
  #include <mach/setup.h>
@@@ -49,3 -55,73 +54,73 @@@ void __init ux500_init_irq(void
                db8500_prcmu_early_init();
        clk_init();
  }
+ static const char * __init ux500_get_machine(void)
+ {
+       return kasprintf(GFP_KERNEL, "DB%4x", dbx500_partnumber());
+ }
+ static const char * __init ux500_get_family(void)
+ {
+       return kasprintf(GFP_KERNEL, "ux500");
+ }
+ static const char * __init ux500_get_revision(void)
+ {
+       unsigned int rev = dbx500_revision();
+       if (rev == 0x01)
+               return kasprintf(GFP_KERNEL, "%s", "ED");
+       else if (rev >= 0xA0)
+               return kasprintf(GFP_KERNEL, "%d.%d",
+                                (rev >> 4) - 0xA + 1, rev & 0xf);
+       return kasprintf(GFP_KERNEL, "%s", "Unknown");
+ }
+ static ssize_t ux500_get_process(struct device *dev,
+                                       struct device_attribute *attr,
+                                       char *buf)
+ {
+       if (dbx500_id.process == 0x00)
+               return sprintf(buf, "Standard\n");
+       return sprintf(buf, "%02xnm\n", dbx500_id.process);
+ }
+ static void __init soc_info_populate(struct soc_device_attribute *soc_dev_attr,
+                                    const char *soc_id)
+ {
+       soc_dev_attr->soc_id   = soc_id;
+       soc_dev_attr->machine  = ux500_get_machine();
+       soc_dev_attr->family   = ux500_get_family();
+       soc_dev_attr->revision = ux500_get_revision();
+ }
+ struct device_attribute ux500_soc_attr =
+       __ATTR(process,  S_IRUGO, ux500_get_process,  NULL);
+ struct device * __init ux500_soc_device_init(const char *soc_id)
+ {
+       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 ERR_PTR(-ENOMEM);
+       soc_info_populate(soc_dev_attr, soc_id);
+       soc_dev = soc_device_register(soc_dev_attr);
+       if (IS_ERR_OR_NULL(soc_dev)) {
+               kfree(soc_dev_attr);
+               return NULL;
+       }
+       parent = soc_device_to_device(soc_dev);
+       if (!IS_ERR_OR_NULL(parent))
+               device_create_file(parent, &ux500_soc_attr);
+       return parent;
+ }
index 93d403955eaa5d452c9456cb17672d0936518658,74b43bb745420fc695cf7878d575b1af0ad0144d..3dc00ffa7bfa5d54772dc5201757b1c3ff12bc27
@@@ -18,15 -18,20 +18,17 @@@ void __init ux500_map_io(void)
  extern void __init u5500_map_io(void);
  extern void __init u8500_map_io(void);
  
- extern void __init u5500_init_devices(void);
- extern void __init u8500_init_devices(void);
+ extern struct device * __init u5500_init_devices(void);
+ extern struct device * __init u8500_init_devices(void);
  
  extern void __init ux500_init_irq(void);
  
- extern void __init u5500_sdi_init(void);
+ extern void __init u5500_sdi_init(struct device *parent);
  
- extern void __init db5500_dma_init(void);
+ extern void __init db5500_dma_init(struct device *parent);
+ extern struct device *ux500_soc_device_init(const char *soc_id);
  
 -/* We re-use nomadik_timer for this platform */
 -extern void nmdk_timer_init(void);
 -
  struct amba_device;
  extern void __init amba_add_devices(struct amba_device *devs[], int num);