ARM: shmobile: Rework sh7372 sleep code to use virt_to_phys()
authorMagnus Damm <damm@opensource.se>
Wed, 5 Jun 2013 07:45:53 +0000 (16:45 +0900)
committerSimon Horman <horms+renesas@verge.net.au>
Mon, 17 Jun 2013 07:06:47 +0000 (16:06 +0900)
Instead of having a hard coded virt-to-phys address
conversion code in sleep-sh7372.S, rework the code
to do the conversion in C using virt_to_phys().

This removes the need for PLAT_PHYS_OFFSET which
in turn is needed for ARCH_MULTIPLATFORM.

Signed-off-by: Magnus Damm <damm@opensource.se>
[horms+renesas@verge.net.au: squashed in build fix posted as
 "ARM: shmobile: sh7372 build fix for SUSPEND=n && CPU_IDLE=n"]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
arch/arm/mach-shmobile/include/mach/sh7372.h
arch/arm/mach-shmobile/pm-sh7372.c
arch/arm/mach-shmobile/sleep-sh7372.S

index e882717ca97ff4fe05723e0120f0efe6d640441b..854a9f0ca040fa83a67629cf0034ed5e634415a5 100644 (file)
@@ -75,6 +75,8 @@ extern void sh7372_intcs_resume(void);
 extern void sh7372_intca_suspend(void);
 extern void sh7372_intca_resume(void);
 
+extern unsigned long sh7372_cpu_resume;
+
 #ifdef CONFIG_PM
 extern void __init sh7372_init_pm_domains(void);
 #else
index dec9293bb90d167d2433585d7ff4503114896428..0de75fd394b9cb654470a591dbb9ec08d0c6d361 100644 (file)
@@ -351,6 +351,9 @@ static void sh7372_enter_a4s_common(int pllc0_on)
 
 static void sh7372_pm_setup_smfram(void)
 {
+       /* pass physical address of cpu_resume() to assembly resume code */
+       sh7372_cpu_resume = virt_to_phys(cpu_resume);
+
        memcpy((void *)SMFRAM, sh7372_resume_core_standby_sysc, 0x100);
 }
 #else
index a9df53b69ab8ead409fe78352f3c707f6a2ade1f..53f4840e494914526b4ab23fa09b7a19473c4476 100644 (file)
        .global sh7372_resume_core_standby_sysc
 sh7372_resume_core_standby_sysc:
        ldr     pc, 1f
-1:     .long   cpu_resume - PAGE_OFFSET + PLAT_PHYS_OFFSET
+
+       .globl  sh7372_cpu_resume
+sh7372_cpu_resume:
+1:     .space  4
 
 #define SPDCR 0xe6180008