summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/platsmp-scu.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2016-01-28 16:13:32 +0100
committerSimon Horman <horms+renesas@verge.net.au>2016-02-17 21:24:29 +0900
commit8701d8083d1e4b9210b9cf4f420bcf7b4b36bd6d (patch)
treea0fb20fcf199f498b9669150a0e1b6f542b02f5d /arch/arm/mach-shmobile/platsmp-scu.c
parent901c5ffaaed117a38be9d0c29247c4888d6c8636 (diff)
downloadlinux-8701d8083d1e4b9210b9cf4f420bcf7b4b36bd6d.tar.gz
linux-8701d8083d1e4b9210b9cf4f420bcf7b4b36bd6d.tar.bz2
linux-8701d8083d1e4b9210b9cf4f420bcf7b4b36bd6d.zip
ARM: shmobile: Consolidate SCU mapping code
Currently the SCU registers are mapped in SoC-specific code, using different methods, all involving the static mapping set up from machine_desc.map_io(): - On emev2, a static (non-identity) mapping is used, with ioremap(). As the static mapping uses the MT_DEVICE type, ioremap() reuses it, and the returned virtual address is suitable for passing to shmobile_smp_hook(), - On sh73a0 and r8a7779, a static identity mapping is used, with the legacy IOMEM() macro. As the static mapping uses the MT_DEVICE_NONSHARED type, replacing IOMEM() by ioremap() would create a new mapping, whose virtual address cannot be passed to shmobile_smp_hook(). Move the mapping of the SCU registers from SoC-specific code to common code, always using ioremap(). To work in the absence of a static mapping, this requires passing the physical SCU base address to shmobile_smp_hook(). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/platsmp-scu.c')
-rw-r--r--arch/arm/mach-shmobile/platsmp-scu.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/mach-shmobile/platsmp-scu.c b/arch/arm/mach-shmobile/platsmp-scu.c
index 081a097c9219..8d478f1da265 100644
--- a/arch/arm/mach-shmobile/platsmp-scu.c
+++ b/arch/arm/mach-shmobile/platsmp-scu.c
@@ -18,7 +18,8 @@
#include "common.h"
-void __iomem *shmobile_scu_base;
+static phys_addr_t shmobile_scu_base_phys;
+static void __iomem *shmobile_scu_base;
static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb,
unsigned long action, void *hcpu)
@@ -29,7 +30,7 @@ static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb,
case CPU_UP_PREPARE:
/* For this particular CPU register SCU SMP boot vector */
shmobile_smp_hook(cpu, virt_to_phys(shmobile_boot_scu),
- (unsigned long)shmobile_scu_base);
+ shmobile_scu_base_phys);
break;
};
@@ -40,12 +41,15 @@ static struct notifier_block shmobile_smp_scu_notifier = {
.notifier_call = shmobile_smp_scu_notifier_call,
};
-void __init shmobile_smp_scu_prepare_cpus(unsigned int max_cpus)
+void __init shmobile_smp_scu_prepare_cpus(phys_addr_t scu_base_phys,
+ unsigned int max_cpus)
{
/* install boot code shared by all CPUs */
shmobile_boot_fn = virt_to_phys(shmobile_smp_boot);
/* enable SCU and cache coherency on booting CPU */
+ shmobile_scu_base_phys = scu_base_phys;
+ shmobile_scu_base = ioremap(scu_base_phys, PAGE_SIZE);
scu_enable(shmobile_scu_base);
scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL);