From: jean.pihet@newoldbits.com (jean.pihet at newoldbits.com)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/7] OMAP3: re-organize the ASM sleep code
Date: Fri, 17 Dec 2010 11:08:23 +0100 [thread overview]
Message-ID: <1292580506-4421-5-git-send-email-j-pihet@ti.com> (raw)
In-Reply-To: <1292580506-4421-1-git-send-email-j-pihet@ti.com>
From: Jean Pihet <j-pihet@ti.com>
Organize the code in the following sections:
- register access macros,
- API functions,
- internal functions.
Tested on N900 and Beagleboard with full RET and OFF modes,
using cpuidle and suspend.
Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
arch/arm/mach-omap2/sleep34xx.S | 114 +++++++++++++++++++++------------------
1 files changed, 61 insertions(+), 53 deletions(-)
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 8e9f38f..beeb682 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -79,6 +79,7 @@ ENTRY(get_restore_pointer)
ldmfd sp!, {pc} @ restore regs and return
ENTRY(get_restore_pointer_sz)
.word . - get_restore_pointer
+
.text
/* Function call to get the restore pointer for 3630 resume from OFF */
ENTRY(get_omap3630_restore_pointer)
@@ -89,9 +90,18 @@ ENTRY(get_omap3630_restore_pointer_sz)
.word . - get_omap3630_restore_pointer
.text
+/* Function call to get the restore pointer for ES3 to resume from OFF */
+ENTRY(get_es3_restore_pointer)
+ stmfd sp!, {lr} @ save registers on stack
+ adr r0, restore_es3
+ ldmfd sp!, {pc} @ restore regs and return
+ENTRY(get_es3_restore_pointer_sz)
+ .word . - get_es3_restore_pointer
+
+ .text
/*
* L2 cache needs to be toggled for stable OFF mode functionality on 3630.
- * This function sets up a fflag that will allow for this toggling to take
+ * This function sets up a flag that will allow for this toggling to take
* place on 3630. Hopefully some version in the future maynot need this
*/
ENTRY(enable_omap3630_toggle_l2_on_restore)
@@ -101,58 +111,6 @@ ENTRY(enable_omap3630_toggle_l2_on_restore)
str r1, l2dis_3630
ldmfd sp!, {pc} @ restore regs and return
- .text
-/* Function call to get the restore pointer for for ES3 to resume from OFF */
-ENTRY(get_es3_restore_pointer)
- stmfd sp!, {lr} @ save registers on stack
- adr r0, restore_es3
- ldmfd sp!, {pc} @ restore regs and return
-ENTRY(get_es3_restore_pointer_sz)
- .word . - get_es3_restore_pointer
-
-ENTRY(es3_sdrc_fix)
- ldr r4, sdrc_syscfg @ get config addr
- ldr r5, [r4] @ get value
- tst r5, #0x100 @ is part access blocked
- it eq
- biceq r5, r5, #0x100 @ clear bit if set
- str r5, [r4] @ write back change
- ldr r4, sdrc_mr_0 @ get config addr
- ldr r5, [r4] @ get value
- str r5, [r4] @ write back change
- ldr r4, sdrc_emr2_0 @ get config addr
- ldr r5, [r4] @ get value
- str r5, [r4] @ write back change
- ldr r4, sdrc_manual_0 @ get config addr
- mov r5, #0x2 @ autorefresh command
- str r5, [r4] @ kick off refreshes
- ldr r4, sdrc_mr_1 @ get config addr
- ldr r5, [r4] @ get value
- str r5, [r4] @ write back change
- ldr r4, sdrc_emr2_1 @ get config addr
- ldr r5, [r4] @ get value
- str r5, [r4] @ write back change
- ldr r4, sdrc_manual_1 @ get config addr
- mov r5, #0x2 @ autorefresh command
- str r5, [r4] @ kick off refreshes
- bx lr
-sdrc_syscfg:
- .word SDRC_SYSCONFIG_P
-sdrc_mr_0:
- .word SDRC_MR_0_P
-sdrc_emr2_0:
- .word SDRC_EMR2_0_P
-sdrc_manual_0:
- .word SDRC_MANUAL_0_P
-sdrc_mr_1:
- .word SDRC_MR_1_P
-sdrc_emr2_1:
- .word SDRC_EMR2_1_P
-sdrc_manual_1:
- .word SDRC_MANUAL_1_P
-ENTRY(es3_sdrc_fix_sz)
- .word . - es3_sdrc_fix
-
/* Function to call rom code to save secure ram context */
ENTRY(save_secure_ram_context)
stmfd sp!, {r1-r12, lr} @ save registers on stack
@@ -577,6 +535,56 @@ skip_l2_inval:
/* restore regs and return */
ldmfd sp!, {r0-r12, pc}
+
+/*
+ * Internal functions
+ */
+
+ .text
+ENTRY(es3_sdrc_fix)
+ ldr r4, sdrc_syscfg @ get config addr
+ ldr r5, [r4] @ get value
+ tst r5, #0x100 @ is part access blocked
+ it eq
+ biceq r5, r5, #0x100 @ clear bit if set
+ str r5, [r4] @ write back change
+ ldr r4, sdrc_mr_0 @ get config addr
+ ldr r5, [r4] @ get value
+ str r5, [r4] @ write back change
+ ldr r4, sdrc_emr2_0 @ get config addr
+ ldr r5, [r4] @ get value
+ str r5, [r4] @ write back change
+ ldr r4, sdrc_manual_0 @ get config addr
+ mov r5, #0x2 @ autorefresh command
+ str r5, [r4] @ kick off refreshes
+ ldr r4, sdrc_mr_1 @ get config addr
+ ldr r5, [r4] @ get value
+ str r5, [r4] @ write back change
+ ldr r4, sdrc_emr2_1 @ get config addr
+ ldr r5, [r4] @ get value
+ str r5, [r4] @ write back change
+ ldr r4, sdrc_manual_1 @ get config addr
+ mov r5, #0x2 @ autorefresh command
+ str r5, [r4] @ kick off refreshes
+ bx lr
+
+sdrc_syscfg:
+ .word SDRC_SYSCONFIG_P
+sdrc_mr_0:
+ .word SDRC_MR_0_P
+sdrc_emr2_0:
+ .word SDRC_EMR2_0_P
+sdrc_manual_0:
+ .word SDRC_MANUAL_0_P
+sdrc_mr_1:
+ .word SDRC_MR_1_P
+sdrc_emr2_1:
+ .word SDRC_EMR2_1_P
+sdrc_manual_1:
+ .word SDRC_MANUAL_1_P
+ENTRY(es3_sdrc_fix_sz)
+ .word . - es3_sdrc_fix
+
/* Make sure SDRC accesses are ok */
wait_sdrc_ok:
--
1.7.1
next prev parent reply other threads:[~2010-12-17 10:08 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-17 10:08 [PATCH 0/7 v5] OMAP3: clean up ASM sleep code jean.pihet at newoldbits.com
2010-12-17 10:08 ` [PATCH 1/7] OMAP3: remove unused code from the " jean.pihet at newoldbits.com
2010-12-17 10:36 ` Santosh Shilimkar
2010-12-17 13:18 ` Nishanth Menon
2010-12-17 10:08 ` [PATCH 2/7] OMAP2+: use global values for the SRAM PA addresses jean.pihet at newoldbits.com
2010-12-17 10:36 ` Santosh Shilimkar
2010-12-17 13:34 ` Nishanth Menon
2010-12-17 14:59 ` Jean Pihet
2010-12-17 15:00 ` Nishanth Menon
2010-12-17 10:08 ` [PATCH 3/7] OMAP3: remove hardcoded values from the ASM sleep code jean.pihet at newoldbits.com
2010-12-17 10:36 ` Santosh Shilimkar
2010-12-17 13:51 ` Nishanth Menon
2010-12-17 10:08 ` jean.pihet at newoldbits.com [this message]
2010-12-17 10:37 ` [PATCH 4/7] OMAP3: re-organize " Santosh Shilimkar
2010-12-17 14:05 ` Nishanth Menon
2010-12-17 10:08 ` [PATCH 5/7] OMAP3: rework of the ASM sleep code execution paths jean.pihet at newoldbits.com
2010-12-17 10:37 ` Santosh Shilimkar
2010-12-17 15:35 ` Nishanth Menon
2010-12-18 15:54 ` Jean Pihet
2010-12-17 10:08 ` [PATCH 6/7] OMAP3: add comments for low power code errata jean.pihet at newoldbits.com
2010-12-17 10:37 ` Santosh Shilimkar
2010-12-17 15:43 ` Nishanth Menon
2010-12-17 10:08 ` [PATCH 7/7] OMAP3: ASM sleep code format rework jean.pihet at newoldbits.com
2010-12-17 10:37 ` Santosh Shilimkar
2010-12-17 15:58 ` Nishanth Menon
2010-12-18 15:56 ` Jean Pihet
2010-12-17 23:02 ` [PATCH 0/7 v5] OMAP3: clean up ASM sleep code Kevin Hilman
2010-12-17 23:07 ` Jean Pihet
2010-12-17 23:22 ` Nishanth Menon
2010-12-18 15:51 ` Jean Pihet
-- strict thread matches above, loose matches on Subject: below --
2010-12-18 15:44 [PATCH 0/7 v6] " jean.pihet at newoldbits.com
2010-12-18 15:44 ` [PATCH 4/7] OMAP3: re-organize the " jean.pihet at newoldbits.com
2010-12-16 17:50 [PATCH 0/7 v4] OMAP3: clean up " jean.pihet at newoldbits.com
2010-12-16 17:50 ` [PATCH 4/7] OMAP3: re-organize the " jean.pihet at newoldbits.com
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=1292580506-4421-5-git-send-email-j-pihet@ti.com \
--to=jean.pihet@newoldbits.com \
--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).