Merge tag 'renesas-soc2-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorOlof Johansson <olof@lixom.net>
Sat, 12 Jul 2014 16:44:52 +0000 (09:44 -0700)
committerOlof Johansson <olof@lixom.net>
Sat, 12 Jul 2014 16:44:52 +0000 (09:44 -0700)
Merge "Second Round of Renesas ARM Based SoC Updates for v3.17" from Simon
Horman:

* Suspend on non-SMP update for r8a7790
* Move r8a7791.h out of mach directory.
  This is part of a multi-stage effort to move headers
  out of that directory.

* tag 'renesas-soc2-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: Allow r8a7791 to build non-SMP APMU code
  ARM: shmobile: Move r8a7791 reset code to pm-r8a7791.c
  ARM: shmobile: Allow r8a7790 to build non-SMP APMU code
  ARM: shmobile: Move r8a7790 reset code to pm-r8a7790.c
  ARM: shmobile: Use __init for APMU suspend init function
  ARM: shmobile: Adjust APMU code to build for non-SMP
  ARM: shmobile: Allow use of boot code for non-SMP case
  ARM: shmobile: Move r8a7791.h

Signed-off-by: Olof Johansson <olof@lixom.net>
1  2 
arch/arm/mach-shmobile/Makefile
arch/arm/mach-shmobile/pm-r8a7790.c
arch/arm/mach-shmobile/smp-r8a7790.c

@@@ -34,34 -34,37 +34,39 @@@ obj-$(CONFIG_ARCH_R8A7791) += clock-r8a
  obj-$(CONFIG_ARCH_R7S72100)   += clock-r7s72100.o
  endif
  
+ # CPU reset vector handling objects
+ cpu-y                         := platsmp.o headsmp.o
+ cpu-$(CONFIG_ARCH_R8A7790)    += platsmp-apmu.o
+ cpu-$(CONFIG_ARCH_R8A7791)    += platsmp-apmu.o
  # SMP objects
- smp-y                         := platsmp.o headsmp.o
+ smp-y                         := $(cpu-y)
  smp-$(CONFIG_ARCH_SH73A0)     += smp-sh73a0.o headsmp-scu.o platsmp-scu.o
  smp-$(CONFIG_ARCH_R8A7779)    += smp-r8a7779.o headsmp-scu.o platsmp-scu.o
- smp-$(CONFIG_ARCH_R8A7790)    += smp-r8a7790.o platsmp-apmu.o
- smp-$(CONFIG_ARCH_R8A7791)    += smp-r8a7791.o platsmp-apmu.o
+ smp-$(CONFIG_ARCH_R8A7790)    += smp-r8a7790.o
+ smp-$(CONFIG_ARCH_R8A7791)    += smp-r8a7791.o
  smp-$(CONFIG_ARCH_EMEV2)      += smp-emev2.o headsmp-scu.o platsmp-scu.o
  
- # IRQ objects
- obj-$(CONFIG_ARCH_SH7372)     += entry-intc.o
  # PM objects
  obj-$(CONFIG_SUSPEND)         += suspend.o
  obj-$(CONFIG_CPU_IDLE)                += cpuidle.o
 +obj-$(CONFIG_CPU_FREQ)                += cpufreq.o
  obj-$(CONFIG_ARCH_SH7372)     += pm-sh7372.o sleep-sh7372.o pm-rmobile.o
  obj-$(CONFIG_ARCH_SH73A0)     += pm-sh73a0.o
  obj-$(CONFIG_ARCH_R8A7740)    += pm-r8a7740.o pm-rmobile.o
  obj-$(CONFIG_ARCH_R8A7779)    += pm-r8a7779.o pm-rcar.o
- obj-$(CONFIG_ARCH_R8A7790)    += pm-r8a7790.o pm-rcar.o
- obj-$(CONFIG_ARCH_R8A7791)    += pm-r8a7791.o pm-rcar.o
+ obj-$(CONFIG_ARCH_R8A7790)    += pm-r8a7790.o pm-rcar.o $(cpu-y)
+ obj-$(CONFIG_ARCH_R8A7791)    += pm-r8a7791.o pm-rcar.o $(cpu-y)
+ # IRQ objects
+ obj-$(CONFIG_ARCH_SH7372)     += entry-intc.o
  
  # Board objects
  ifdef CONFIG_ARCH_SHMOBILE_MULTI
  obj-$(CONFIG_MACH_GENMAI)     += board-genmai-reference.o
  obj-$(CONFIG_MACH_KOELSCH)    += board-koelsch-reference.o
  obj-$(CONFIG_MACH_LAGER)      += board-lager-reference.o
 +obj-$(CONFIG_MACH_MARZEN)     += board-marzen-reference.o
  else
  obj-$(CONFIG_MACH_APE6EVM)    += board-ape6evm.o
  obj-$(CONFIG_MACH_APE6EVM_REFERENCE)  += board-ape6evm-reference.o
@@@ -70,6 -73,7 +75,6 @@@ obj-$(CONFIG_MACH_BOCKW)      += board-bockw
  obj-$(CONFIG_MACH_BOCKW_REFERENCE)    += board-bockw-reference.o
  obj-$(CONFIG_MACH_GENMAI)     += board-genmai.o
  obj-$(CONFIG_MACH_MARZEN)     += board-marzen.o
 -obj-$(CONFIG_MACH_MARZEN_REFERENCE)   += board-marzen-reference.o
  obj-$(CONFIG_MACH_LAGER)      += board-lager.o
  obj-$(CONFIG_MACH_ARMADILLO800EVA)    += board-armadillo800eva.o
  obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE)  += board-armadillo800eva-reference.o
   */
  
  #include <linux/kernel.h>
+ #include <linux/smp.h>
  #include <asm/io.h>
 -#include <mach/r8a7790.h>
+ #include "common.h"
  #include "pm-rcar.h"
 +#include "r8a7790.h"
  
+ /* RST */
+ #define RST           0xe6160000
+ #define CA15BAR               0x0020
+ #define CA7BAR                0x0030
+ #define CA15RESCNT    0x0040
+ #define CA7RESCNT     0x0044
+ /* On-chip RAM */
+ #define MERAM          0xe8080000
  /* SYSC */
  #define SYSCIER 0x0c
  #define SYSCIMR 0x10
@@@ -40,8 -50,33 +50,33 @@@ static inline void r8a7790_sysc_init(vo
  
  void __init r8a7790_pm_init(void)
  {
+       void __iomem *p;
+       u32 bar;
        static int once;
  
-       if (!once++)
-               r8a7790_sysc_init();
+       if (once++)
+               return;
+       /* MERAM for jump stub, because BAR requires 256KB aligned address */
+       p = ioremap_nocache(MERAM, shmobile_boot_size);
+       memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
+       iounmap(p);
+       /* setup reset vectors */
+       p = ioremap_nocache(RST, 0x63);
+       bar = (MERAM >> 8) & 0xfffffc00;
+       writel_relaxed(bar, p + CA15BAR);
+       writel_relaxed(bar, p + CA7BAR);
+       writel_relaxed(bar | 0x10, p + CA15BAR);
+       writel_relaxed(bar | 0x10, p + CA7BAR);
+       /* de-assert reset for all CPUs */
+       writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000,
+                      p + CA15RESCNT);
+       writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000,
+                      p + CA7RESCNT);
+       iounmap(p);
+       r8a7790_sysc_init();
+       shmobile_smp_apmu_suspend_init();
  }
  #include <linux/init.h>
  #include <linux/smp.h>
  #include <linux/io.h>
 +
  #include <asm/smp_plat.h>
 -#include <mach/r8a7790.h>
 +
  #include "common.h"
  #include "pm-rcar.h"
 +#include "r8a7790.h"
  
- #define RST           0xe6160000
- #define CA15BAR               0x0020
- #define CA7BAR                0x0030
- #define CA15RESCNT    0x0040
- #define CA7RESCNT     0x0044
- #define MERAM         0xe8080000
  static struct rcar_sysc_ch r8a7790_ca15_scu = {
        .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */
        .isr_bit = 12, /* CA15-SCU */
@@@ -43,35 -34,11 +36,11 @@@ static struct rcar_sysc_ch r8a7790_ca7_
  
  static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
  {
-       void __iomem *p;
-       u32 bar;
        /* let APMU code install data related to shmobile_boot_vector */
        shmobile_smp_apmu_prepare_cpus(max_cpus);
  
-       /* MERAM for jump stub, because BAR requires 256KB aligned address */
-       p = ioremap_nocache(MERAM, shmobile_boot_size);
-       memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
-       iounmap(p);
-       /* setup reset vectors */
-       p = ioremap_nocache(RST, 0x63);
-       bar = (MERAM >> 8) & 0xfffffc00;
-       writel_relaxed(bar, p + CA15BAR);
-       writel_relaxed(bar, p + CA7BAR);
-       writel_relaxed(bar | 0x10, p + CA15BAR);
-       writel_relaxed(bar | 0x10, p + CA7BAR);
-       /* enable clocks to all CPUs */
-       writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000,
-                      p + CA15RESCNT);
-       writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000,
-                      p + CA7RESCNT);
-       iounmap(p);
        /* turn on power to SCU */
        r8a7790_pm_init();
-       shmobile_smp_apmu_suspend_init();
        rcar_sysc_power_up(&r8a7790_ca15_scu);
        rcar_sysc_power_up(&r8a7790_ca7_scu);
  }