diff mbox

[6/7] ARM: EXYNOS4: Add save/restore for more ARM registers

Message ID 1308732405-16664-7-git-send-email-kgene.kim@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kim Kukjin June 22, 2011, 8:46 a.m. UTC
From: Jaecheol Lee <jc.lee@samsung.com>

This patch adds save/restore for Power Control Register and
Diagnostic Register.

Signed-off-by: Jaecheol Lee <jc.lee@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-exynos4/sleep.S |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

Comments

Russell King - ARM Linux June 22, 2011, 2:54 p.m. UTC | #1
On Wed, Jun 22, 2011 at 05:46:44PM +0900, Kukjin Kim wrote:
> From: Jaecheol Lee <jc.lee@samsung.com>
> 
> This patch adds save/restore for Power Control Register and
> Diagnostic Register.

NAK.  Please see my further suspend consolidation patches posted earlier.
I've also recently (last few days) moved these further forward and this
code no longer exists in this file (all it contains is the early
resume stuff.)

My guess is that these two registers are samsung specific, and so they
should be saved and restored by higher level code (eg, a syscore_ops
for exynos4 specific stuff.)
Kim Kukjin June 23, 2011, 6:39 a.m. UTC | #2
Russell King - ARM Linux wrote:
> 
> On Wed, Jun 22, 2011 at 05:46:44PM +0900, Kukjin Kim wrote:
> > From: Jaecheol Lee <jc.lee@samsung.com>
> >
> > This patch adds save/restore for Power Control Register and
> > Diagnostic Register.
> 
> NAK.  Please see my further suspend consolidation patches posted earlier.
> I've also recently (last few days) moved these further forward and this
> code no longer exists in this file (all it contains is the early
> resume stuff.)
> 
Oops :(
OK, will re-work based on latest rmk/for-next :)

> My guess is that these two registers are samsung specific, and so they
> should be saved and restored by higher level code (eg, a syscore_ops
> for exynos4 specific stuff.)

Let me think again.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Russell King - ARM Linux June 23, 2011, 7:51 a.m. UTC | #3
On Thu, Jun 23, 2011 at 03:39:02PM +0900, Kukjin Kim wrote:
> Russell King - ARM Linux wrote:
> > 
> > On Wed, Jun 22, 2011 at 05:46:44PM +0900, Kukjin Kim wrote:
> > > From: Jaecheol Lee <jc.lee@samsung.com>
> > >
> > > This patch adds save/restore for Power Control Register and
> > > Diagnostic Register.
> > 
> > NAK.  Please see my further suspend consolidation patches posted earlier.
> > I've also recently (last few days) moved these further forward and this
> > code no longer exists in this file (all it contains is the early
> > resume stuff.)
> > 
> Oops :(
> OK, will re-work based on latest rmk/for-next :)

The entire series is not in for-next yet, it's still being worked on.
That's why I posted the patches again yesterday.
Kim Kukjin June 23, 2011, 8 a.m. UTC | #4
Russell King - ARM Linux wrote:
> 
> On Thu, Jun 23, 2011 at 03:39:02PM +0900, Kukjin Kim wrote:
> > Russell King - ARM Linux wrote:
> > >
> > Oops :(
> > OK, will re-work based on latest rmk/for-next :)
> 
> The entire series is not in for-next yet, it's still being worked on.
> That's why I posted the patches again yesterday.

OK, first of all, will test your yesterday patches on Samsung boards then
will re-work this based on it.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
diff mbox

Patch

diff --git a/arch/arm/mach-exynos4/sleep.S b/arch/arm/mach-exynos4/sleep.S
index d55d38c..4fe13fc 100644
--- a/arch/arm/mach-exynos4/sleep.S
+++ b/arch/arm/mach-exynos4/sleep.S
@@ -42,6 +42,15 @@ 
 ENTRY(s3c_cpu_save)
 
 	stmfd	sp!, { r3 - r12, lr }
+
+	adr	r0, sleep_save_misc
+
+	mrc	p15, 0, r2, c15, c0, 0	@ read power control register
+	str	r2, [r0], #4
+
+	mrc	p15, 0, r2, c15, c0, 1	@ read diagnostic register
+	str	r2, [r0], #4
+
 	ldr	r3, =resume_with_mmu
 	bl	cpu_suspend
 
@@ -56,6 +65,14 @@  ENTRY(s3c_cpu_save)
 	b	early_wakeup
 
 resume_with_mmu:
+	adr	r0, sleep_save_misc
+
+	ldr	r1, [r0], #4
+	mcr	p15, 0, r1, c15, c0, 0	@ write power control register
+
+	ldr	r1, [r0], #4
+	mcr	p15, 0, r1, c15, c0, 1	@ write diagnostic register
+
 	mov	r0, #1
 
 early_wakeup:
@@ -71,6 +88,11 @@  early_wakeup:
 
 	.word	0x2bedf00d
 
+	 /* To save more cpu register */
+sleep_save_misc:
+	.long	0
+	.long	0
+
 	/*
 	 * s3c_cpu_resume
 	 *