[PATCH 7/7] OMAP3: ASM sleep code format rework
From: Jean Pihet j-pi...@ti.com Cosmetic fixes to the code: - white spaces and tabs, - alignement, - comments rephrase and typos, - multi-line comments Tested on N900 and Beagleboard with full RET and OFF modes, using cpuidle and suspend. Signed-off-by: Jean Pihet j-pi...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com Tested-by: Nishanth Menon n...@ti.com --- arch/arm/mach-omap2/sleep34xx.S | 224 --- 1 files changed, 117 insertions(+), 107 deletions(-) diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 7a63da2..29f4bf7 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S @@ -1,6 +1,4 @@ /* - * linux/arch/arm/mach-omap2/sleep.S - * * (C) Copyright 2007 * Texas Instruments * Karthik Dasu karthik...@ti.com @@ -81,20 +79,20 @@ .text /* Function call to get the restore pointer for resume from OFF */ ENTRY(get_restore_pointer) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack adr r0, restore -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return ENTRY(get_restore_pointer_sz) -.word . - get_restore_pointer + .word . - get_restore_pointer .text /* Function call to get the restore pointer for 3630 resume from OFF */ ENTRY(get_omap3630_restore_pointer) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack adr r0, restore_3630 -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return ENTRY(get_omap3630_restore_pointer_sz) -.word . - get_omap3630_restore_pointer + .word . - get_omap3630_restore_pointer .text /* Function call to get the restore pointer for ES3 to resume from OFF */ @@ -112,16 +110,16 @@ ENTRY(get_es3_restore_pointer_sz) * place on 3630. Hopefully some version in the future may not need this. */ ENTRY(enable_omap3630_toggle_l2_on_restore) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack /* Setup so that we will disable and enable l2 */ mov r1, #0x1 str r1, l2dis_3630 -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return + .text /* Function to call rom code to save secure ram context */ ENTRY(save_secure_ram_context) stmfd sp!, {r1-r12, lr} @ save registers on stack - adr r3, api_params @ r3 points to parameters str r0, [r3,#0x4] @ r0 has sdram address ldr r12, high_mask @@ -165,14 +163,14 @@ ENTRY(save_secure_ram_context_sz) * * * Notes: - * - this code gets copied to internal SRAM at boot. The execution pointer - * in SRAM is _omap_sram_idle. + * - this code gets copied to internal SRAM at boot and after wake-up + * from OFF mode. The execution pointer in SRAM is _omap_sram_idle. * - when the OMAP wakes up it continues at different execution points * depending on the low power mode (non-OFF vs OFF modes), * cf. 'Resume path for xxx mode' comments. */ ENTRY(omap34xx_cpu_suspend) - stmfd sp!, {r0-r12, lr} @ save registers on stack + stmfd sp!, {r0-r12, lr} @ save registers on stack /* * r0 contains restore pointer in sdram @@ -280,9 +278,9 @@ clean_l2: * - should be faster and will change with kernel * - 'might' have to copy address, load and jump to it */ - ldr r1, kernel_flush - mov lr, pc - bx r1 + ldr r1, kernel_flush + mov lr, pc + bx r1 omap3_do_wfi: ldr r4, sdrc_power @ read the SDRC_POWER register @@ -375,18 +373,18 @@ restore_3630: /* Fall through to common code for the remaining logic */ restore: -/* + /* * Check what was the reason for mpu reset and store the reason in r9: * 0 - No context lost - * 1 - Only L1 and logic lost - * 2 - Only L2 lost - In this case, we wont be here - * 3 - Both L1 and L2 lost +* 1 - Only L1 and logic lost +* 2 - Only L2 lost - In this case, we wont be here +* 3 - Both L1 and L2 lost */ - ldr r1, pm_pwstctrl_mpu + ldr r1, pm_pwstctrl_mpu ldr r2, [r1] - and r2, r2, #0x3 - cmp r2, #0x0@ Check if target power state was OFF or RET -moveq r9, #0x3@ MPU OFF = L1 and L2 lost + and r2, r2, #0x3 + cmp r2, #0x0@ Check if target power state was OFF or RET + moveq r9, #0x3@ MPU OFF = L1 and L2 lost movne r9, #0x1@ Only L1 and L2 lost = avoid L2 invalidation
[PATCH 7/7] OMAP3: ASM sleep code format rework
From: Jean Pihet j-pi...@ti.com Cosmetic fixes to the code: - white spaces and tabs, - alignement, - comments rephrase and typos, - multi-line comments Tested on N900 and Beagleboard with full RET and OFF modes, using cpuidle and suspend. Signed-off-by: Jean Pihet j-pi...@ti.com --- arch/arm/mach-omap2/sleep34xx.S | 226 +-- 1 files changed, 122 insertions(+), 104 deletions(-) diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 8e5004a..6376427 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S @@ -1,6 +1,10 @@ /* * linux/arch/arm/mach-omap2/sleep.S * + * (C) Copyright 2010 + * Texas Instruments + * Jean Pihet j-pi...@ti.com + * * (C) Copyright 2007 * Texas Instruments * Karthik Dasu karthik...@ti.com @@ -81,20 +85,20 @@ .text /* Function call to get the restore pointer for resume from OFF */ ENTRY(get_restore_pointer) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack adr r0, restore -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return ENTRY(get_restore_pointer_sz) -.word . - get_restore_pointer + .word . - get_restore_pointer .text /* Function call to get the restore pointer for 3630 resume from OFF */ ENTRY(get_omap3630_restore_pointer) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack adr r0, restore_3630 -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return ENTRY(get_omap3630_restore_pointer_sz) -.word . - get_omap3630_restore_pointer + .word . - get_omap3630_restore_pointer .text /* Function call to get the restore pointer for ES3 to resume from OFF */ @@ -112,16 +116,16 @@ ENTRY(get_es3_restore_pointer_sz) * place on 3630. Hopefully some version in the future may not need this. */ ENTRY(enable_omap3630_toggle_l2_on_restore) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack /* Setup so that we will disable and enable l2 */ mov r1, #0x1 str r1, l2dis_3630 -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return + .text /* Function to call rom code to save secure ram context */ ENTRY(save_secure_ram_context) stmfd sp!, {r1-r12, lr} @ save registers on stack - adr r3, api_params @ r3 points to parameters str r0, [r3,#0x4] @ r0 has sdram address ldr r12, high_mask @@ -150,6 +154,7 @@ api_params: ENTRY(save_secure_ram_context_sz) .word . - save_secure_ram_context + /* * == * == Idle entry point == @@ -163,13 +168,14 @@ ENTRY(save_secure_ram_context_sz) * and executes the WFI instruction * * Notes: - * - this code gets copied to internal SRAM at boot. + * - this code gets copied to internal SRAM at boot and after wake-up + * from OFF mode * - when the OMAP wakes up it continues at different execution points * depending on the low power mode (non-OFF vs OFF modes), * cf. 'Resume path for xxx mode' comments. */ ENTRY(omap34xx_cpu_suspend) - stmfd sp!, {r0-r12, lr} @ save registers on stack + stmfd sp!, {r0-r12, lr} @ save registers on stack /* * r0 contains restore pointer in sdram @@ -276,9 +282,9 @@ clean_l2: * - should be faster and will change with kernel * - 'might' have to copy address, load and jump to it */ - ldr r1, kernel_flush - mov lr, pc - bx r1 + ldr r1, kernel_flush + mov lr, pc + bx r1 omap3_do_wfi: ldr r4, sdrc_power @ read the SDRC_POWER register @@ -371,18 +377,18 @@ restore_3630: /* Fall thru to common code for the remaining logic */ restore: -/* + /* * Check what was the reason for mpu reset and store the reason in r9: * 0 - No context lost - * 1 - Only L1 and logic lost - * 2 - Only L2 lost - In this case, we wont be here - * 3 - Both L1 and L2 lost +* 1 - Only L1 and logic lost +* 2 - Only L2 lost - In this case, we wont be here +* 3 - Both L1 and L2 lost */ - ldr r1, pm_pwstctrl_mpu + ldr r1, pm_pwstctrl_mpu ldr r2, [r1] - and r2, r2, #0x3 - cmp r2, #0x0@ Check if target power state was OFF or RET -moveq r9, #0x3@ MPU OFF = L1 and L2 lost + and r2, r2, #0x3 + cmp r2, #0x0@ Check if target power state was OFF or RET + moveq r9, #0x3@ MPU OFF = L1 and L2
Re: [PATCH 7/7] OMAP3: ASM sleep code format rework
On Fri, Dec 17, 2010 at 6:09 AM, Santosh Shilimkar santosh.shilim...@ti.com wrote: -Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap- ow...@vger.kernel.org] On Behalf Of jean.pi...@newoldbits.com Sent: Thursday, December 16, 2010 11:21 PM To: linux-omap@vger.kernel.org Cc: khil...@deeprootsystems.com; linux-arm-ker...@lists.infradead.org; Jean Pihet Subject: [PATCH 7/7] OMAP3: ASM sleep code format rework From: Jean Pihet j-pi...@ti.com Cosmetic fixes to the code: - white spaces and tabs, - alignement, - comments rephrase and typos, - multi-line comments Tested on N900 and Beagleboard with full RET and OFF modes, using cpuidle and suspend. Signed-off-by: Jean Pihet j-pi...@ti.com --- arch/arm/mach-omap2/sleep34xx.S | 221 +- - 1 files changed, 118 insertions(+), 103 deletions(-) diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach- omap2/sleep34xx.S index 207f6e9..9c1c57e 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S @@ -1,6 +1,10 @@ /* * linux/arch/arm/mach-omap2/sleep.S * + * (C) Copyright 2010 + * Texas Instruments + * Jean Pihet j-pi...@ti.com + * * (C) Copyright 2007 * Texas Instruments * Karthik Dasu karthik...@ti.com @@ -78,20 +82,20 @@ .text /* Function call to get the restore pointer for resume from OFF */ ENTRY(get_restore_pointer) - stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack adr r0, restore - ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return ENTRY(get_restore_pointer_sz) - .word . - get_restore_pointer + .word . - get_restore_pointer .text /* Function call to get the restore pointer for 3630 resume from OFF */ ENTRY(get_omap3630_restore_pointer) - stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack adr r0, restore_3630 - ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return ENTRY(get_omap3630_restore_pointer_sz) - .word . - get_omap3630_restore_pointer + .word . - get_omap3630_restore_pointer .text /* Function call to get the restore pointer for ES3 to resume from OFF */ @@ -109,16 +113,16 @@ ENTRY(get_es3_restore_pointer_sz) * place on 3630. Hopefully some version in the future maynot need this. */ ENTRY(enable_omap3630_toggle_l2_on_restore) - stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack /* Setup so that we will disable and enable l2 */ mov r1, #0x1 str r1, l2dis_3630 - ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return + .text /* Function to call rom code to save secure ram context */ ENTRY(save_secure_ram_context) stmfd sp!, {r1-r12, lr} @ save registers on stack - adr r3, api_params @ r3 points to parameters str r0, [r3,#0x4] @ r0 has sdram address ldr r12, high_mask @@ -147,6 +151,7 @@ api_params: ENTRY(save_secure_ram_context_sz) .word . - save_secure_ram_context + /* * == * == Idle entry point == @@ -160,13 +165,14 @@ ENTRY(save_secure_ram_context_sz) * and executes the WFI instruction * * Notes: - * - this code gets copied to internal SRAM at boot. + * - this code gets copied to internal SRAM at boot and after wake-up + * from OFF mode * - when the OMAP wakes up it continues at different execution points * depending on the low power mode (non-OFF vs OFF modes), * cf. 'Resume path for xxx mode' comments. */ ENTRY(omap34xx_cpu_suspend) - stmfd sp!, {r0-r12, lr} @ save registers on stack + stmfd sp!, {r0-r12, lr} @ save registers on stack /* * r0 contains restore pointer in sdram @@ -271,9 +277,9 @@ clean_l2: * - should be faster and will change with kernel * - 'might' have to copy address, load and jump to it */ - ldr r1, kernel_flush - mov lr, pc - bx r1 + ldr r1, kernel_flush + mov lr, pc + bx r1 omap3_do_wfi: ldr r4, sdrc_power @ read the SDRC_POWER register @@ -366,18 +372,18 @@ restore_3630: /* Fall thru to common code for the remaining logic */ restore: - /* + /* * Check what was the reason for mpu reset and store the reason in r9: * 0 - No context lost - * 1 - Only L1 and logic lost - * 2 - Only L2 lost - In this case, we wont be here - * 3 - Both L1 and L2 lost + * 1 - Only L1 and logic lost + * 2 - Only L2 lost - In this case
RE: [PATCH 7/7] OMAP3: ASM sleep code format rework
-Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap- ow...@vger.kernel.org] On Behalf Of jean.pi...@newoldbits.com Sent: Friday, December 17, 2010 3:38 PM To: linux-omap@vger.kernel.org Cc: khil...@deeprootsystems.com; linux-arm-ker...@lists.infradead.org; Jean Pihet Subject: [PATCH 7/7] OMAP3: ASM sleep code format rework From: Jean Pihet j-pi...@ti.com Cosmetic fixes to the code: - white spaces and tabs, - alignement, - comments rephrase and typos, - multi-line comments Tested on N900 and Beagleboard with full RET and OFF modes, using cpuidle and suspend. Signed-off-by: Jean Pihet j-pi...@ti.com Acked-by: Santosh Shilimkar santosh.shilim...@ti.com --- arch/arm/mach-omap2/sleep34xx.S | 226 +- - 1 files changed, 122 insertions(+), 104 deletions(-) diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach- omap2/sleep34xx.S index 8e5004a..6376427 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S @@ -1,6 +1,10 @@ /* * linux/arch/arm/mach-omap2/sleep.S * + * (C) Copyright 2010 + * Texas Instruments + * Jean Pihet j-pi...@ti.com + * * (C) Copyright 2007 * Texas Instruments * Karthik Dasu karthik...@ti.com @@ -81,20 +85,20 @@ .text /* Function call to get the restore pointer for resume from OFF */ ENTRY(get_restore_pointer) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack adr r0, restore -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return ENTRY(get_restore_pointer_sz) -.word . - get_restore_pointer + .word . - get_restore_pointer .text /* Function call to get the restore pointer for 3630 resume from OFF */ ENTRY(get_omap3630_restore_pointer) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack adr r0, restore_3630 -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return ENTRY(get_omap3630_restore_pointer_sz) -.word . - get_omap3630_restore_pointer + .word . - get_omap3630_restore_pointer .text /* Function call to get the restore pointer for ES3 to resume from OFF */ @@ -112,16 +116,16 @@ ENTRY(get_es3_restore_pointer_sz) * place on 3630. Hopefully some version in the future may not need this. */ ENTRY(enable_omap3630_toggle_l2_on_restore) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack /* Setup so that we will disable and enable l2 */ mov r1, #0x1 str r1, l2dis_3630 -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return + .text /* Function to call rom code to save secure ram context */ ENTRY(save_secure_ram_context) stmfd sp!, {r1-r12, lr} @ save registers on stack - adr r3, api_params @ r3 points to parameters str r0, [r3,#0x4] @ r0 has sdram address ldr r12, high_mask @@ -150,6 +154,7 @@ api_params: ENTRY(save_secure_ram_context_sz) .word . - save_secure_ram_context + /* * == * == Idle entry point == @@ -163,13 +168,14 @@ ENTRY(save_secure_ram_context_sz) * and executes the WFI instruction * * Notes: - * - this code gets copied to internal SRAM at boot. + * - this code gets copied to internal SRAM at boot and after wake-up + * from OFF mode * - when the OMAP wakes up it continues at different execution points * depending on the low power mode (non-OFF vs OFF modes), * cf. 'Resume path for xxx mode' comments. */ ENTRY(omap34xx_cpu_suspend) - stmfd sp!, {r0-r12, lr} @ save registers on stack + stmfd sp!, {r0-r12, lr} @ save registers on stack /* * r0 contains restore pointer in sdram @@ -276,9 +282,9 @@ clean_l2: * - should be faster and will change with kernel * - 'might' have to copy address, load and jump to it */ - ldr r1, kernel_flush - mov lr, pc - bx r1 + ldr r1, kernel_flush + mov lr, pc + bx r1 omap3_do_wfi: ldr r4, sdrc_power @ read the SDRC_POWER register @@ -371,18 +377,18 @@ restore_3630: /* Fall thru to common code for the remaining logic */ restore: -/* + /* * Check what was the reason for mpu reset and store the reason in r9: * 0 - No context lost - * 1 - Only L1 and logic lost - * 2 - Only L2 lost - In this case, we wont be here - * 3 - Both L1 and L2 lost + * 1 - Only L1 and logic lost + * 2 - Only L2 lost - In this case, we wont be here + * 3 - Both
Re: [PATCH 7/7] OMAP3: ASM sleep code format rework
jean.pi...@newoldbits.com had written, on 12/17/2010 04:08 AM, the following: From: Jean Pihet j-pi...@ti.com Thanks for doing this, could you pull in the other cosmetic changes from patches 1-6 here as well? Also, please run checkpatch.pl --strict: ERROR: trailing whitespace #426: FILE: arch/arm/mach-omap2/sleep34xx.S:590: +^I * The caches and prediction are not enabled here, they $ total: 1 errors, 0 warnings, 0 checks, 447 lines checked NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or scripts/cleanfile Also reported by git am: linux-2.6/.git/rebase-apply/patch:355: trailing whitespace. * The caches and prediction are not enabled here, they warning: 1 line adds whitespace errors. Cosmetic fixes to the code: - white spaces and tabs, - alignement, - comments rephrase and typos, - multi-line comments Tested on N900 and Beagleboard with full RET and OFF modes, using cpuidle and suspend. Signed-off-by: Jean Pihet j-pi...@ti.com --- arch/arm/mach-omap2/sleep34xx.S | 226 +-- 1 files changed, 122 insertions(+), 104 deletions(-) diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 8e5004a..6376427 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S @@ -1,6 +1,10 @@ /* * linux/arch/arm/mach-omap2/sleep.S if you are cleaning things up, you might as well throw this out. * + * (C) Copyright 2010 + * Texas Instruments if you do use this, please follow the requirements that have been standardized in side TI now: Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ + * Jean Pihet j-pi...@ti.com + * umm.. will leave it for Kevin to comment. the series was a cleanup I agree, functionally there is much contribution from lot of other folks as well.. personally, since all contributions are maintained in git history anyways.. I dont usually bother about touching the original copyrights - but that is just me * (C) Copyright 2007 * Texas Instruments * Karthik Dasu karthik...@ti.com @@ -81,20 +85,20 @@ .text /* Function call to get the restore pointer for resume from OFF */ ENTRY(get_restore_pointer) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack adr r0, restore -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return ENTRY(get_restore_pointer_sz) -.word . - get_restore_pointer + .word . - get_restore_pointer .text /* Function call to get the restore pointer for 3630 resume from OFF */ ENTRY(get_omap3630_restore_pointer) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack adr r0, restore_3630 -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return ENTRY(get_omap3630_restore_pointer_sz) -.word . - get_omap3630_restore_pointer + .word . - get_omap3630_restore_pointer .text /* Function call to get the restore pointer for ES3 to resume from OFF */ @@ -112,16 +116,16 @@ ENTRY(get_es3_restore_pointer_sz) * place on 3630. Hopefully some version in the future may not need this. */ ENTRY(enable_omap3630_toggle_l2_on_restore) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack /* Setup so that we will disable and enable l2 */ mov r1, #0x1 str r1, l2dis_3630 -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return + .text /* Function to call rom code to save secure ram context */ ENTRY(save_secure_ram_context) stmfd sp!, {r1-r12, lr} @ save registers on stack - adr r3, api_params @ r3 points to parameters str r0, [r3,#0x4] @ r0 has sdram address ldr r12, high_mask @@ -150,6 +154,7 @@ api_params: ENTRY(save_secure_ram_context_sz) .word . - save_secure_ram_context + IMHO, spurious - just need one EOL, not 2. /* * == * == Idle entry point == @@ -163,13 +168,14 @@ ENTRY(save_secure_ram_context_sz) * and executes the WFI instruction * * Notes: - * - this code gets copied to internal SRAM at boot. + * - this code gets copied to internal SRAM at boot and after wake-up + * from OFF mode * - when the OMAP wakes up it continues at different execution points * depending on the low power mode (non-OFF vs OFF modes), * cf. 'Resume path for xxx mode' comments. */ ENTRY(omap34xx_cpu_suspend) - stmfd sp!, {r0-r12, lr} @ save registers on stack + stmfd sp!, {r0-r12, lr} @ save registers on stack /* * r0 contains restore pointer in sdram @@ -276,9 +282,9 @@ clean_l2: * - should be
[PATCH 7/7] OMAP3: ASM sleep code format rework
From: Jean Pihet j-pi...@ti.com Cosmetic fixes to the code: - white spaces and tabs, - alignement, - comments rephrase and typos, - multi-line comments Tested on N900 and Beagleboard with full RET and OFF modes, using cpuidle and suspend. Signed-off-by: Jean Pihet j-pi...@ti.com --- arch/arm/mach-omap2/sleep34xx.S | 221 +-- 1 files changed, 118 insertions(+), 103 deletions(-) diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 207f6e9..9c1c57e 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S @@ -1,6 +1,10 @@ /* * linux/arch/arm/mach-omap2/sleep.S * + * (C) Copyright 2010 + * Texas Instruments + * Jean Pihet j-pi...@ti.com + * * (C) Copyright 2007 * Texas Instruments * Karthik Dasu karthik...@ti.com @@ -78,20 +82,20 @@ .text /* Function call to get the restore pointer for resume from OFF */ ENTRY(get_restore_pointer) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack adr r0, restore -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return ENTRY(get_restore_pointer_sz) -.word . - get_restore_pointer + .word . - get_restore_pointer .text /* Function call to get the restore pointer for 3630 resume from OFF */ ENTRY(get_omap3630_restore_pointer) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack adr r0, restore_3630 -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return ENTRY(get_omap3630_restore_pointer_sz) -.word . - get_omap3630_restore_pointer + .word . - get_omap3630_restore_pointer .text /* Function call to get the restore pointer for ES3 to resume from OFF */ @@ -109,16 +113,16 @@ ENTRY(get_es3_restore_pointer_sz) * place on 3630. Hopefully some version in the future maynot need this. */ ENTRY(enable_omap3630_toggle_l2_on_restore) -stmfd sp!, {lr} @ save registers on stack + stmfd sp!, {lr} @ save registers on stack /* Setup so that we will disable and enable l2 */ mov r1, #0x1 str r1, l2dis_3630 -ldmfd sp!, {pc} @ restore regs and return + ldmfd sp!, {pc} @ restore regs and return + .text /* Function to call rom code to save secure ram context */ ENTRY(save_secure_ram_context) stmfd sp!, {r1-r12, lr} @ save registers on stack - adr r3, api_params @ r3 points to parameters str r0, [r3,#0x4] @ r0 has sdram address ldr r12, high_mask @@ -147,6 +151,7 @@ api_params: ENTRY(save_secure_ram_context_sz) .word . - save_secure_ram_context + /* * == * == Idle entry point == @@ -160,13 +165,14 @@ ENTRY(save_secure_ram_context_sz) * and executes the WFI instruction * * Notes: - * - this code gets copied to internal SRAM at boot. + * - this code gets copied to internal SRAM at boot and after wake-up + * from OFF mode * - when the OMAP wakes up it continues at different execution points * depending on the low power mode (non-OFF vs OFF modes), * cf. 'Resume path for xxx mode' comments. */ ENTRY(omap34xx_cpu_suspend) - stmfd sp!, {r0-r12, lr} @ save registers on stack + stmfd sp!, {r0-r12, lr} @ save registers on stack /* * r0 contains restore pointer in sdram @@ -271,9 +277,9 @@ clean_l2: * - should be faster and will change with kernel * - 'might' have to copy address, load and jump to it */ - ldr r1, kernel_flush - mov lr, pc - bx r1 + ldr r1, kernel_flush + mov lr, pc + bx r1 omap3_do_wfi: ldr r4, sdrc_power @ read the SDRC_POWER register @@ -366,18 +372,18 @@ restore_3630: /* Fall thru to common code for the remaining logic */ restore: -/* + /* * Check what was the reason for mpu reset and store the reason in r9: * 0 - No context lost - * 1 - Only L1 and logic lost - * 2 - Only L2 lost - In this case, we wont be here - * 3 - Both L1 and L2 lost +* 1 - Only L1 and logic lost +* 2 - Only L2 lost - In this case, we wont be here +* 3 - Both L1 and L2 lost */ - ldr r1, pm_pwstctrl_mpu + ldr r1, pm_pwstctrl_mpu ldr r2, [r1] - and r2, r2, #0x3 - cmp r2, #0x0@ Check if target power state was OFF or RET -moveq r9, #0x3@ MPU OFF = L1 and L2 lost + and r2, r2, #0x3 + cmp r2, #0x0@ Check if target power state was OFF or RET + moveq r9, #0x3@ MPU OFF = L1 and L2