diff options
| -rw-r--r-- | arch/arm/mach-omap2/sleep34xx.S | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 22fcc14e63be..12a8ba0e0a3c 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S | |||
| @@ -33,6 +33,8 @@ | |||
| 33 | #include "prm.h" | 33 | #include "prm.h" |
| 34 | #include "sdrc.h" | 34 | #include "sdrc.h" |
| 35 | 35 | ||
| 36 | #define SDRC_SCRATCHPAD_SEM_V 0xfa00291c | ||
| 37 | |||
| 36 | #define PM_PREPWSTST_CORE_V OMAP34XX_PRM_REGADDR(CORE_MOD, \ | 38 | #define PM_PREPWSTST_CORE_V OMAP34XX_PRM_REGADDR(CORE_MOD, \ |
| 37 | OMAP3430_PM_PREPWSTST) | 39 | OMAP3430_PM_PREPWSTST) |
| 38 | #define PM_PREPWSTST_CORE_P 0x48306AE8 | 40 | #define PM_PREPWSTST_CORE_P 0x48306AE8 |
| @@ -57,6 +59,37 @@ | |||
| 57 | #define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS) | 59 | #define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS) |
| 58 | #define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) | 60 | #define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) |
| 59 | 61 | ||
| 62 | .text | ||
| 63 | /* Function to aquire the semaphore in scratchpad */ | ||
| 64 | ENTRY(lock_scratchpad_sem) | ||
| 65 | stmfd sp!, {lr} @ save registers on stack | ||
| 66 | wait_sem: | ||
| 67 | mov r0,#1 | ||
| 68 | ldr r1, sdrc_scratchpad_sem | ||
| 69 | wait_loop: | ||
| 70 | ldr r2, [r1] @ load the lock value | ||
| 71 | cmp r2, r0 @ is the lock free ? | ||
| 72 | beq wait_loop @ not free... | ||
| 73 | swp r2, r0, [r1] @ semaphore free so lock it and proceed | ||
| 74 | cmp r2, r0 @ did we succeed ? | ||
| 75 | beq wait_sem @ no - try again | ||
| 76 | ldmfd sp!, {pc} @ restore regs and return | ||
| 77 | sdrc_scratchpad_sem: | ||
| 78 | .word SDRC_SCRATCHPAD_SEM_V | ||
| 79 | ENTRY(lock_scratchpad_sem_sz) | ||
| 80 | .word . - lock_scratchpad_sem | ||
| 81 | |||
| 82 | .text | ||
| 83 | /* Function to release the scratchpad semaphore */ | ||
| 84 | ENTRY(unlock_scratchpad_sem) | ||
| 85 | stmfd sp!, {lr} @ save registers on stack | ||
| 86 | ldr r3, sdrc_scratchpad_sem | ||
| 87 | mov r2,#0 | ||
| 88 | str r2,[r3] | ||
| 89 | ldmfd sp!, {pc} @ restore regs and return | ||
| 90 | ENTRY(unlock_scratchpad_sem_sz) | ||
| 91 | .word . - unlock_scratchpad_sem | ||
| 92 | |||
| 60 | .text | 93 | .text |
| 61 | /* Function call to get the restore pointer for resume from OFF */ | 94 | /* Function call to get the restore pointer for resume from OFF */ |
| 62 | ENTRY(get_restore_pointer) | 95 | ENTRY(get_restore_pointer) |
