aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-06-21 14:29:26 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-06-24 03:48:44 -0400
commite7089da9567fa8da37e35e1f81a5e3579d0d582d (patch)
treede492cf95d9b4643c52a85d2174fc22bf9a31609 /arch/arm
parent4d01446fea61a32b6755ae1e11314ffca744dcaa (diff)
ARM: pm: samsung: move cpu_suspend into C code
Move the call to cpu_suspend into C code, and noticing that all the s3c_cpu_save implementations are now identical, we can move this into the common samsung code. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-exynos4/pm.c2
-rw-r--r--arch/arm/mach-exynos4/sleep.S18
-rw-r--r--arch/arm/mach-s3c2412/pm.c2
-rw-r--r--arch/arm/mach-s3c2416/pm.c2
-rw-r--r--arch/arm/mach-s3c64xx/pm.c2
-rw-r--r--arch/arm/mach-s3c64xx/sleep.S18
-rw-r--r--arch/arm/mach-s5pv210/pm.c2
-rw-r--r--arch/arm/mach-s5pv210/sleep.S17
-rw-r--r--arch/arm/plat-s3c24xx/sleep.S19
-rw-r--r--arch/arm/plat-samsung/include/plat/pm.h5
-rw-r--r--arch/arm/plat-samsung/pm.c6
11 files changed, 10 insertions, 83 deletions
diff --git a/arch/arm/mach-exynos4/pm.c b/arch/arm/mach-exynos4/pm.c
index 8755ca8dd48d..5c01c6076645 100644
--- a/arch/arm/mach-exynos4/pm.c
+++ b/arch/arm/mach-exynos4/pm.c
@@ -280,7 +280,7 @@ static struct sleep_save exynos4_l2cc_save[] = {
280 SAVE_ITEM(S5P_VA_L2CC + L2X0_AUX_CTRL), 280 SAVE_ITEM(S5P_VA_L2CC + L2X0_AUX_CTRL),
281}; 281};
282 282
283void exynos4_cpu_suspend(void) 283void exynos4_cpu_suspend(unsigned long arg)
284{ 284{
285 unsigned long tmp; 285 unsigned long tmp;
286 unsigned long mask = 0xFFFFFFFF; 286 unsigned long mask = 0xFFFFFFFF;
diff --git a/arch/arm/mach-exynos4/sleep.S b/arch/arm/mach-exynos4/sleep.S
index b56a4914985c..0984078f1eba 100644
--- a/arch/arm/mach-exynos4/sleep.S
+++ b/arch/arm/mach-exynos4/sleep.S
@@ -33,24 +33,6 @@
33 .text 33 .text
34 34
35 /* 35 /*
36 * s3c_cpu_save
37 *
38 * entry:
39 * r1 = v:p offset
40 */
41
42ENTRY(s3c_cpu_save)
43 adr r3, BSYM(exynos4_finish_suspend)
44 b cpu_suspend
45
46exynos4_finish_suspend:
47 ldr r0, =pm_cpu_sleep
48 ldr r0, [ r0 ]
49 mov pc, r0
50
51 .ltorg
52
53 /*
54 * sleep magic, to allow the bootloader to check for an valid 36 * sleep magic, to allow the bootloader to check for an valid
55 * image to resume to. Must be the first word before the 37 * image to resume to. Must be the first word before the
56 * s3c_cpu_resume entry. 38 * s3c_cpu_resume entry.
diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c2412/pm.c
index 752b13a7b3db..fecd85489e51 100644
--- a/arch/arm/mach-s3c2412/pm.c
+++ b/arch/arm/mach-s3c2412/pm.c
@@ -37,7 +37,7 @@
37 37
38extern void s3c2412_sleep_enter(void); 38extern void s3c2412_sleep_enter(void);
39 39
40static void s3c2412_cpu_suspend(void) 40static void s3c2412_cpu_suspend(unsigned long arg)
41{ 41{
42 unsigned long tmp; 42 unsigned long tmp;
43 43
diff --git a/arch/arm/mach-s3c2416/pm.c b/arch/arm/mach-s3c2416/pm.c
index 41db2b21e213..268fda744201 100644
--- a/arch/arm/mach-s3c2416/pm.c
+++ b/arch/arm/mach-s3c2416/pm.c
@@ -24,7 +24,7 @@
24 24
25extern void s3c2412_sleep_enter(void); 25extern void s3c2412_sleep_enter(void);
26 26
27static void s3c2416_cpu_suspend(void) 27static void s3c2416_cpu_suspend(unsigned long arg)
28{ 28{
29 flush_cache_all(); 29 flush_cache_all();
30 30
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index bc1c470b7de6..7cc1879af722 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -112,7 +112,7 @@ void s3c_pm_save_core(void)
112 * this. 112 * this.
113 */ 113 */
114 114
115static void s3c64xx_cpu_suspend(void) 115static void s3c64xx_cpu_suspend(unsigned long arg)
116{ 116{
117 unsigned long tmp; 117 unsigned long tmp;
118 118
diff --git a/arch/arm/mach-s3c64xx/sleep.S b/arch/arm/mach-s3c64xx/sleep.S
index 2fd343332838..34313f9c8792 100644
--- a/arch/arm/mach-s3c64xx/sleep.S
+++ b/arch/arm/mach-s3c64xx/sleep.S
@@ -25,24 +25,6 @@
25 25
26 .text 26 .text
27 27
28 /* s3c_cpu_save
29 *
30 * Save enough processor state to allow the restart of the pm.c
31 * code after resume.
32 *
33 * entry:
34 * r1 = v:p offset
35 */
36
37ENTRY(s3c_cpu_save)
38 adr r3, BSYM(s3c64xx_finish_suspend)
39 b cpu_suspend
40
41s3c64xx_finish_suspend:
42 @@ call final suspend code
43 ldr r0, =pm_cpu_sleep
44 ldr pc, [r0]
45
46 /* Sleep magic, the word before the resume entry point so that the 28 /* Sleep magic, the word before the resume entry point so that the
47 * bootloader can check for a resumeable image. */ 29 * bootloader can check for a resumeable image. */
48 30
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c
index 24febae3d4c0..309e388a8a83 100644
--- a/arch/arm/mach-s5pv210/pm.c
+++ b/arch/arm/mach-s5pv210/pm.c
@@ -88,7 +88,7 @@ static struct sleep_save s5pv210_core_save[] = {
88 SAVE_ITEM(S3C2410_TCNTO(0)), 88 SAVE_ITEM(S3C2410_TCNTO(0)),
89}; 89};
90 90
91void s5pv210_cpu_suspend(void) 91void s5pv210_cpu_suspend(unsigned long arg)
92{ 92{
93 unsigned long tmp; 93 unsigned long tmp;
94 94
diff --git a/arch/arm/mach-s5pv210/sleep.S b/arch/arm/mach-s5pv210/sleep.S
index 28dfeff342b8..e3452ccd4b08 100644
--- a/arch/arm/mach-s5pv210/sleep.S
+++ b/arch/arm/mach-s5pv210/sleep.S
@@ -32,23 +32,6 @@
32 32
33 .text 33 .text
34 34
35 /* s3c_cpu_save
36 *
37 * entry:
38 * r1 = v:p offset
39 */
40
41ENTRY(s3c_cpu_save)
42 adr r3, BSYM(s5pv210_finish_suspend)
43 b cpu_suspend
44
45s5pv210_finish_suspend:
46 ldr r0, =pm_cpu_sleep
47 ldr r0, [ r0 ]
48 mov pc, r0
49
50 .ltorg
51
52 /* sleep magic, to allow the bootloader to check for an valid 35 /* sleep magic, to allow the bootloader to check for an valid
53 * image to resume to. Must be the first word before the 36 * image to resume to. Must be the first word before the
54 * s3c_cpu_resume entry. 37 * s3c_cpu_resume entry.
diff --git a/arch/arm/plat-s3c24xx/sleep.S b/arch/arm/plat-s3c24xx/sleep.S
index 6ada459498a8..c56612569b40 100644
--- a/arch/arm/plat-s3c24xx/sleep.S
+++ b/arch/arm/plat-s3c24xx/sleep.S
@@ -41,25 +41,6 @@
41 41
42 .text 42 .text
43 43
44 /* s3c_cpu_save
45 *
46 * entry:
47 * r1 = v:p offset
48 */
49
50ENTRY(s3c_cpu_save)
51 adr r3, BSYM(s3c24xx_finish_suspend)
52 b cpu_suspend
53
54s3c24xx_finish_suspend:
55 @@ jump to final code to send system to sleep
56 ldr r0, =pm_cpu_sleep
57 @@ldr pc, [ r0 ]
58 ldr r0, [ r0 ]
59 mov pc, r0
60
61 .ltorg
62
63 /* sleep magic, to allow the bootloader to check for an valid 44 /* sleep magic, to allow the bootloader to check for an valid
64 * image to resume to. Must be the first word before the 45 * image to resume to. Must be the first word before the
65 * s3c_cpu_resume entry. 46 * s3c_cpu_resume entry.
diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h
index 7fb6f6be8c81..0a5b7faca836 100644
--- a/arch/arm/plat-samsung/include/plat/pm.h
+++ b/arch/arm/plat-samsung/include/plat/pm.h
@@ -42,7 +42,7 @@ extern unsigned long s3c_irqwake_eintallow;
42/* per-cpu sleep functions */ 42/* per-cpu sleep functions */
43 43
44extern void (*pm_cpu_prep)(void); 44extern void (*pm_cpu_prep)(void);
45extern void (*pm_cpu_sleep)(void); 45extern void (*pm_cpu_sleep)(unsigned long);
46 46
47/* Flags for PM Control */ 47/* Flags for PM Control */
48 48
@@ -52,10 +52,9 @@ extern unsigned char pm_uart_udivslot; /* true to save UART UDIVSLOT */
52 52
53/* from sleep.S */ 53/* from sleep.S */
54 54
55extern int s3c_cpu_save(unsigned long *saveblk, long);
56extern void s3c_cpu_resume(void); 55extern void s3c_cpu_resume(void);
57 56
58extern void s3c2410_cpu_suspend(void); 57extern void s3c2410_cpu_suspend(unsigned long);
59 58
60/* sleep save info */ 59/* sleep save info */
61 60
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index 3828191416b5..3a6d0768ba0c 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -231,7 +231,7 @@ static void __maybe_unused s3c_pm_show_resume_irqs(int start,
231 231
232 232
233void (*pm_cpu_prep)(void); 233void (*pm_cpu_prep)(void);
234void (*pm_cpu_sleep)(void); 234void (*pm_cpu_sleep)(unsigned long);
235 235
236#define any_allowed(mask, allow) (((mask) & (allow)) != (allow)) 236#define any_allowed(mask, allow) (((mask) & (allow)) != (allow))
237 237
@@ -294,11 +294,11 @@ static int s3c_pm_enter(suspend_state_t state)
294 294
295 s3c_pm_arch_stop_clocks(); 295 s3c_pm_arch_stop_clocks();
296 296
297 /* s3c_cpu_save will also act as our return point from when 297 /* this will also act as our return point from when
298 * we resume as it saves its own register state and restores it 298 * we resume as it saves its own register state and restores it
299 * during the resume. */ 299 * during the resume. */
300 300
301 s3c_cpu_save(0, PLAT_PHYS_OFFSET - PAGE_OFFSET); 301 cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, 0, pm_cpu_sleep);
302 302
303 /* restore the system state */ 303 /* restore the system state */
304 304