linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 20/25] ARM: pm: samsung: move cpu_suspend into C code
Date: Wed, 22 Jun 2011 16:15:17 +0100	[thread overview]
Message-ID: <E1QZP9B-0002X3-BZ@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20110622150816.GT23234@n2100.arm.linux.org.uk>

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>
---
 arch/arm/mach-exynos4/pm.c              |    2 +-
 arch/arm/mach-exynos4/sleep.S           |   18 ------------------
 arch/arm/mach-s3c2412/pm.c              |    2 +-
 arch/arm/mach-s3c2416/pm.c              |    2 +-
 arch/arm/mach-s3c64xx/pm.c              |    2 +-
 arch/arm/mach-s3c64xx/sleep.S           |   18 ------------------
 arch/arm/mach-s5pv210/pm.c              |    2 +-
 arch/arm/mach-s5pv210/sleep.S           |   17 -----------------
 arch/arm/plat-s3c24xx/sleep.S           |   19 -------------------
 arch/arm/plat-samsung/include/plat/pm.h |    5 ++---
 arch/arm/plat-samsung/pm.c              |    6 +++---
 11 files changed, 10 insertions(+), 83 deletions(-)

diff --git a/arch/arm/mach-exynos4/pm.c b/arch/arm/mach-exynos4/pm.c
index 8755ca8..5c01c60 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[] = {
 	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 mask = 0xFFFFFFFF;
diff --git a/arch/arm/mach-exynos4/sleep.S b/arch/arm/mach-exynos4/sleep.S
index b56a491..0984078 100644
--- a/arch/arm/mach-exynos4/sleep.S
+++ b/arch/arm/mach-exynos4/sleep.S
@@ -33,24 +33,6 @@
 	.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
 	 * image to resume to. Must be the first word before the
 	 * s3c_cpu_resume entry.
diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c2412/pm.c
index 752b13a..fecd854 100644
--- a/arch/arm/mach-s3c2412/pm.c
+++ b/arch/arm/mach-s3c2412/pm.c
@@ -37,7 +37,7 @@
 
 extern void s3c2412_sleep_enter(void);
 
-static void s3c2412_cpu_suspend(void)
+static void s3c2412_cpu_suspend(unsigned long arg)
 {
 	unsigned long tmp;
 
diff --git a/arch/arm/mach-s3c2416/pm.c b/arch/arm/mach-s3c2416/pm.c
index 41db2b2..268fda7 100644
--- a/arch/arm/mach-s3c2416/pm.c
+++ b/arch/arm/mach-s3c2416/pm.c
@@ -24,7 +24,7 @@
 
 extern void s3c2412_sleep_enter(void);
 
-static void s3c2416_cpu_suspend(void)
+static void s3c2416_cpu_suspend(unsigned long arg)
 {
 	flush_cache_all();
 
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index bc1c470..7cc1879 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)
  * this.
  */
 
-static void s3c64xx_cpu_suspend(void)
+static void s3c64xx_cpu_suspend(unsigned long arg)
 {
 	unsigned long tmp;
 
diff --git a/arch/arm/mach-s3c64xx/sleep.S b/arch/arm/mach-s3c64xx/sleep.S
index 2fd3433..34313f9 100644
--- a/arch/arm/mach-s3c64xx/sleep.S
+++ b/arch/arm/mach-s3c64xx/sleep.S
@@ -25,24 +25,6 @@
 
 	.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
 	 * bootloader can check for a resumeable image. */
 
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c
index 24febae..309e388 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[] = {
 	SAVE_ITEM(S3C2410_TCNTO(0)),
 };
 
-void s5pv210_cpu_suspend(void)
+void s5pv210_cpu_suspend(unsigned long arg)
 {
 	unsigned long tmp;
 
diff --git a/arch/arm/mach-s5pv210/sleep.S b/arch/arm/mach-s5pv210/sleep.S
index 28dfeff..e3452cc 100644
--- a/arch/arm/mach-s5pv210/sleep.S
+++ b/arch/arm/mach-s5pv210/sleep.S
@@ -32,23 +32,6 @@
 
 	.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
 	 * image to resume to. Must be the first word before the
 	 * s3c_cpu_resume entry.
diff --git a/arch/arm/plat-s3c24xx/sleep.S b/arch/arm/plat-s3c24xx/sleep.S
index 6ada459..c566125 100644
--- a/arch/arm/plat-s3c24xx/sleep.S
+++ b/arch/arm/plat-s3c24xx/sleep.S
@@ -41,25 +41,6 @@
 
 	.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
 	 * image to resume to. Must be the first word before the
 	 * 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 7fb6f6b..0a5b7fa 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;
 /* per-cpu sleep functions */
 
 extern void (*pm_cpu_prep)(void);
-extern void (*pm_cpu_sleep)(void);
+extern void (*pm_cpu_sleep)(unsigned long);
 
 /* Flags for PM Control */
 
@@ -52,10 +52,9 @@ extern unsigned char pm_uart_udivslot;  /* true to save UART UDIVSLOT */
 
 /* from sleep.S */
 
-extern int  s3c_cpu_save(unsigned long *saveblk, long);
 extern void s3c_cpu_resume(void);
 
-extern void s3c2410_cpu_suspend(void);
+extern void s3c2410_cpu_suspend(unsigned long);
 
 /* sleep save info */
 
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index 3828191..3a6d076 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,
 
 
 void (*pm_cpu_prep)(void);
-void (*pm_cpu_sleep)(void);
+void (*pm_cpu_sleep)(unsigned long);
 
 #define any_allowed(mask, allow) (((mask) & (allow)) != (allow))
 
@@ -294,11 +294,11 @@ static int s3c_pm_enter(suspend_state_t state)
 
 	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
 	 * 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 */
 
-- 
1.7.4.4

  parent reply	other threads:[~2011-06-22 15:15 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22 15:08 [PATCH 00/25 v2] Re-jig cpu_suspend for a saner calling convention Russell King - ARM Linux
2011-06-22 15:08 ` [PATCH 01/25] ARM: pm: make MULTI_CPU and !MULTI_CPU resume paths the same Russell King - ARM Linux
2011-06-22 15:09 ` [PATCH 02/25] ARM: pm: move return address (for cpu_resume) to top of stack Russell King - ARM Linux
2011-06-22 15:09 ` [PATCH 03/25] ARM: pm: extract common code from MULTI_CPU/!MULTI_CPU paths Russell King - ARM Linux
2011-06-22 15:09 ` [PATCH 04/25] ARM: pm: preserve r4 - r11 across a suspend Russell King - ARM Linux
2011-06-22 15:10 ` [PATCH 05/25] ARM: pm: reallocate registers to avoid r2, r3 Russell King - ARM Linux
2011-06-22 15:10 ` [PATCH 06/25] ARM: pm: rejig suspend follow-on function calling convention Russell King - ARM Linux
2011-06-22 15:10 ` [PATCH 07/25] ARM: pm: move sa1100 to use proper suspend func arg0 Russell King - ARM Linux
2011-06-22 15:11 ` [PATCH 08/25] ARM: pm: convert cpu_suspend() to a normal function Russell King - ARM Linux
2011-06-22 15:11 ` [PATCH 09/25] ARM: pm: plat-s3c24xx: cleanup s3c_cpu_save Russell King - ARM Linux
2011-06-22 15:11 ` [PATCH 10/25] ARM: pm: sa1100: cleanup sa1100_cpu_suspend Russell King - ARM Linux
2011-06-22 15:12 ` [PATCH 11/25] ARM: pm: mach-s5pv210: cleanup s3c_cpu_save Russell King - ARM Linux
2011-06-22 15:12 ` [PATCH 12/25] ARM: pm: mach-exynos4: " Russell King - ARM Linux
2011-06-22 15:12 ` [PATCH 13/25] ARM: pm: mach-s3c64xx: " Russell King - ARM Linux
2011-06-22 15:13 ` [PATCH 14/25] ARM: pm: pxa: cleanup PXA suspend code Russell King - ARM Linux
2011-06-22 15:13 ` [PATCH 15/25] ARM: pm: sa1100: move cpu_suspend into C code Russell King - ARM Linux
2011-06-22 15:13 ` [PATCH 16/25] ARM: pm: pxa: " Russell King - ARM Linux
2011-06-22 15:14 ` [PATCH 17/25] ARM: pm: move cpu_init() call into core code Russell King - ARM Linux
2011-06-22 15:14 ` [PATCH 18/25] ARM: pm: arrange for cpu_proc_init() to be called on resume Russell King - ARM Linux
2011-06-22 15:14 ` [PATCH 19/25] ARM: pm: sa1100: no need to re-enable clock switching Russell King - ARM Linux
2011-06-22 15:15 ` Russell King - ARM Linux [this message]
2011-06-22 15:15 ` [PATCH 21/25] ARM: pm: samsung: no need to call flush_cache_all() Russell King - ARM Linux
2011-06-22 15:15 ` [PATCH 22/25] ARM: pm: omap: no need to save all registers in sleep34xx.S Russell King - ARM Linux
2011-06-22 15:16 ` [PATCH 23/25] ARM: pm: omap34xx: remove misleading comment and use of r9 Russell King - ARM Linux
2011-06-22 15:16 ` [PATCH 24/25] ARM: pm: ensure ARMv7 CPUs save and restore the TLS register Russell King - ARM Linux
2011-06-22 15:16 ` [PATCH 25/25] ARM: pm: omap34xx: convert to generic suspend/resume support Russell King - ARM Linux
2011-06-22 16:10   ` Russell King - ARM Linux
2011-06-22 23:33     ` Santosh Shilimkar
2011-06-23 10:47       ` Russell King - ARM Linux
2011-06-23  6:33   ` Tony Lindgren
2011-06-23 10:06   ` Russell King - ARM Linux
2011-06-23 10:21     ` Russell King - ARM Linux
2011-06-23 19:05   ` Kevin Hilman
2011-06-23 20:37     ` Kevin Hilman
2011-06-23 21:57     ` Kevin Hilman
2011-06-22 21:01 ` [PATCH 00/25 v2] Re-jig cpu_suspend for a saner calling convention Russell King - ARM Linux
2011-06-22 23:26   ` Santosh Shilimkar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1QZP9B-0002X3-BZ@rmk-PC.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).