Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184782
b: refs/heads/master
c: a89b6f0
h: refs/heads/master
v: v3
  • Loading branch information
Rajendra Nayak authored and Kevin Hilman committed Feb 23, 2010
1 parent fcf430b commit aac5141
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a1b1d3a9efad6bd53d01ff02e86626d1a51d697
refs/heads/master: a89b6f006201469a74dfc0cc4e953648b6a1c69d
33 changes: 33 additions & 0 deletions trunk/arch/arm/mach-omap2/sleep34xx.S
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "prm.h"
#include "sdrc.h"

#define SDRC_SCRATCHPAD_SEM_V 0xfa00291c

#define PM_PREPWSTST_CORE_V OMAP34XX_PRM_REGADDR(CORE_MOD, \
OMAP3430_PM_PREPWSTST)
#define PM_PREPWSTST_CORE_P 0x48306AE8
Expand All @@ -57,6 +59,37 @@
#define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS)
#define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)

.text
/* Function to aquire the semaphore in scratchpad */
ENTRY(lock_scratchpad_sem)
stmfd sp!, {lr} @ save registers on stack
wait_sem:
mov r0,#1
ldr r1, sdrc_scratchpad_sem
wait_loop:
ldr r2, [r1] @ load the lock value
cmp r2, r0 @ is the lock free ?
beq wait_loop @ not free...
swp r2, r0, [r1] @ semaphore free so lock it and proceed
cmp r2, r0 @ did we succeed ?
beq wait_sem @ no - try again
ldmfd sp!, {pc} @ restore regs and return
sdrc_scratchpad_sem:
.word SDRC_SCRATCHPAD_SEM_V
ENTRY(lock_scratchpad_sem_sz)
.word . - lock_scratchpad_sem

.text
/* Function to release the scratchpad semaphore */
ENTRY(unlock_scratchpad_sem)
stmfd sp!, {lr} @ save registers on stack
ldr r3, sdrc_scratchpad_sem
mov r2,#0
str r2,[r3]
ldmfd sp!, {pc} @ restore regs and return
ENTRY(unlock_scratchpad_sem_sz)
.word . - unlock_scratchpad_sem

.text
/* Function call to get the restore pointer for resume from OFF */
ENTRY(get_restore_pointer)
Expand Down

0 comments on commit aac5141

Please sign in to comment.