|
在2410启动文件中有关掉电模式部分的代码如下:
EnterPWDN
mov r2,r0
tst r0,#0x8
bne ENTER_POWER_OFF
ENTER_STOP
ldr r0,=REFRESH
ldr r3,[r0] ;r3=rREFRESH
mov r1, r3
orr r1, r1, #BIT_SELFREFRESH
str r1,[r0] ;Enable SDRAM self-refresh
mov r1,#16 ;wait until self-refresh is issued. may not be needed.
0 subs r1,r1,#1
bne %B0
ldr r0,=CLKCON ;enter STOP mode.
str r2,[r0]
mov r1,#32 ;wait until the STOP mode is in effect Or wait here until the CPU & Peripherals will be turned-off; Entering POWER_OFF mode, only the reset by wake-up is available
0 subs r1,r1,#1
bne %B0
ldr r0,=REFRESH ;exit from SDRAM self refresh mode.
str r3,[r0]
MOV_PC_LR
ENTER_POWER_OFF ;NOTE:rGSTATUS3 should have the return address after wake-up from POWER_OFF mode.
ldr r0,=REFRESH
ldr r1,[r0] ;r1=rREFRESH
orr r1, r1, #BIT_SELFREFRESH
str r1, [r0] ;Enable SDRAM self-refresh
mov r1,#16 ;Wait until self-refresh is issued,which may not be needed.
0 subs r1,r1,#1
bne %B0
ldr r1,=MISCCR
ldr r0,[r1]
orr r0,r0,#(7<<17)
str r0,[r1]
ldr r0,=CLKCON ;Set the Power_OFF mode bit in the CLKCON register
str r2,[r0]
b .
这段代码中有一个部分不太理解,即:
(1)ENTER_STOP段下的代码应该是工作在什么情况下的;
(2)个人猜测这段代码可能工作在将要进入掉电模式但是在进入该模式过程中被突然中断的情况,如果是这样还有必要继续使能SDRAM自刷新吗?
(3)ENTER_POWER_OFF 段下被标红的语句似乎也是多余的,r2本来就是从CLKCON取出来的,为什么最后又要反过来存一次,难道CLKCON中间会发生变化,如果发生变化,那是什么情况下发生的呢?
请高手不吝赐教!! |
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|