Commit e7089da9 authored by Russell King's avatar Russell King

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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 4d01446f
...@@ -280,7 +280,7 @@ static struct sleep_save exynos4_l2cc_save[] = { ...@@ -280,7 +280,7 @@ static struct sleep_save exynos4_l2cc_save[] = {
SAVE_ITEM(S5P_VA_L2CC + L2X0_AUX_CTRL), SAVE_ITEM(S5P_VA_L2CC + L2X0_AUX_CTRL),
}; };
void exynos4_cpu_suspend(void) void exynos4_cpu_suspend(unsigned long arg)
{ {
unsigned long tmp; unsigned long tmp;
unsigned long mask = 0xFFFFFFFF; unsigned long mask = 0xFFFFFFFF;
......
...@@ -32,24 +32,6 @@ ...@@ -32,24 +32,6 @@
.text .text
/*
* s3c_cpu_save
*
* entry:
* r1 = v:p offset
*/
ENTRY(s3c_cpu_save)
adr r3, BSYM(exynos4_finish_suspend)
b cpu_suspend
exynos4_finish_suspend:
ldr r0, =pm_cpu_sleep
ldr r0, [ r0 ]
mov pc, r0
.ltorg
/* /*
* sleep magic, to allow the bootloader to check for an valid * sleep magic, to allow the bootloader to check for an valid
* image to resume to. Must be the first word before the * image to resume to. Must be the first word before the
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
extern void s3c2412_sleep_enter(void); extern void s3c2412_sleep_enter(void);
static void s3c2412_cpu_suspend(void) static void s3c2412_cpu_suspend(unsigned long arg)
{ {
unsigned long tmp; unsigned long tmp;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
extern void s3c2412_sleep_enter(void); extern void s3c2412_sleep_enter(void);
static void s3c2416_cpu_suspend(void) static void s3c2416_cpu_suspend(unsigned long arg)
{ {
flush_cache_all(); flush_cache_all();
......
...@@ -112,7 +112,7 @@ void s3c_pm_save_core(void) ...@@ -112,7 +112,7 @@ void s3c_pm_save_core(void)
* this. * this.
*/ */
static void s3c64xx_cpu_suspend(void) static void s3c64xx_cpu_suspend(unsigned long arg)
{ {
unsigned long tmp; unsigned long tmp;
......
...@@ -25,24 +25,6 @@ ...@@ -25,24 +25,6 @@
.text .text
/* s3c_cpu_save
*
* Save enough processor state to allow the restart of the pm.c
* code after resume.
*
* entry:
* r1 = v:p offset
*/
ENTRY(s3c_cpu_save)
adr r3, BSYM(s3c64xx_finish_suspend)
b cpu_suspend
s3c64xx_finish_suspend:
@@ call final suspend code
ldr r0, =pm_cpu_sleep
ldr pc, [r0]
/* Sleep magic, the word before the resume entry point so that the /* Sleep magic, the word before the resume entry point so that the
* bootloader can check for a resumeable image. */ * bootloader can check for a resumeable image. */
......
...@@ -88,7 +88,7 @@ static struct sleep_save s5pv210_core_save[] = { ...@@ -88,7 +88,7 @@ static struct sleep_save s5pv210_core_save[] = {
SAVE_ITEM(S3C2410_TCNTO(0)), SAVE_ITEM(S3C2410_TCNTO(0)),
}; };
void s5pv210_cpu_suspend(void) void s5pv210_cpu_suspend(unsigned long arg)
{ {
unsigned long tmp; unsigned long tmp;
......
...@@ -32,23 +32,6 @@ ...@@ -32,23 +32,6 @@
.text .text
/* s3c_cpu_save
*
* entry:
* r1 = v:p offset
*/
ENTRY(s3c_cpu_save)
adr r3, BSYM(s5pv210_finish_suspend)
b cpu_suspend
s5pv210_finish_suspend:
ldr r0, =pm_cpu_sleep
ldr r0, [ r0 ]
mov pc, r0
.ltorg
/* sleep magic, to allow the bootloader to check for an valid /* sleep magic, to allow the bootloader to check for an valid
* image to resume to. Must be the first word before the * image to resume to. Must be the first word before the
* s3c_cpu_resume entry. * s3c_cpu_resume entry.
......
...@@ -41,25 +41,6 @@ ...@@ -41,25 +41,6 @@
.text .text
/* s3c_cpu_save
*
* entry:
* r1 = v:p offset
*/
ENTRY(s3c_cpu_save)
adr r3, BSYM(s3c24xx_finish_suspend)
b cpu_suspend
s3c24xx_finish_suspend:
@@ jump to final code to send system to sleep
ldr r0, =pm_cpu_sleep
@@ldr pc, [ r0 ]
ldr r0, [ r0 ]
mov pc, r0
.ltorg
/* sleep magic, to allow the bootloader to check for an valid /* sleep magic, to allow the bootloader to check for an valid
* image to resume to. Must be the first word before the * image to resume to. Must be the first word before the
* s3c_cpu_resume entry. * s3c_cpu_resume entry.
......
...@@ -42,7 +42,7 @@ extern unsigned long s3c_irqwake_eintallow; ...@@ -42,7 +42,7 @@ extern unsigned long s3c_irqwake_eintallow;
/* per-cpu sleep functions */ /* per-cpu sleep functions */
extern void (*pm_cpu_prep)(void); extern void (*pm_cpu_prep)(void);
extern void (*pm_cpu_sleep)(void); extern void (*pm_cpu_sleep)(unsigned long);
/* Flags for PM Control */ /* Flags for PM Control */
...@@ -52,10 +52,9 @@ extern unsigned char pm_uart_udivslot; /* true to save UART UDIVSLOT */ ...@@ -52,10 +52,9 @@ extern unsigned char pm_uart_udivslot; /* true to save UART UDIVSLOT */
/* from sleep.S */ /* from sleep.S */
extern int s3c_cpu_save(unsigned long *saveblk, long);
extern void s3c_cpu_resume(void); extern void s3c_cpu_resume(void);
extern void s3c2410_cpu_suspend(void); extern void s3c2410_cpu_suspend(unsigned long);
/* sleep save info */ /* sleep save info */
......
...@@ -231,7 +231,7 @@ static void __maybe_unused s3c_pm_show_resume_irqs(int start, ...@@ -231,7 +231,7 @@ static void __maybe_unused s3c_pm_show_resume_irqs(int start,
void (*pm_cpu_prep)(void); void (*pm_cpu_prep)(void);
void (*pm_cpu_sleep)(void); void (*pm_cpu_sleep)(unsigned long);
#define any_allowed(mask, allow) (((mask) & (allow)) != (allow)) #define any_allowed(mask, allow) (((mask) & (allow)) != (allow))
...@@ -294,11 +294,11 @@ static int s3c_pm_enter(suspend_state_t state) ...@@ -294,11 +294,11 @@ static int s3c_pm_enter(suspend_state_t state)
s3c_pm_arch_stop_clocks(); s3c_pm_arch_stop_clocks();
/* s3c_cpu_save will also act as our return point from when /* this will also act as our return point from when
* we resume as it saves its own register state and restores it * we resume as it saves its own register state and restores it
* during the resume. */ * during the resume. */
s3c_cpu_save(0, PLAT_PHYS_OFFSET - PAGE_OFFSET); cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, 0, pm_cpu_sleep);
/* restore the system state */ /* restore the system state */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment