阅读:1174回复:1
求助,关于2440进入sleep后的唤醒问题
在CE5.0下做2440的sleep模式,发现在CPU进入sleep后在利用外部中断唤醒过程中“死”掉了。唤醒代码如下:
WAKEUP_POWER_OFF ; Release SCLKn after wake-up from the POWER_OFF mode. ldr r1, =MISCCR ldr r0, [r1] bic r0, r0, #(7<<17) ; SCLK0:0->SCLK, SCLK1:0->SCLK, SCKE:L->H. str r0, [r1] ; Set up the memory control registers. ; add r0, pc, #SMRDATA - (. + 8) ldr r1, =BWSCON ; BWSCON Address. add r2, r0, #52 ; End address of SMRDATA. 3 ldr r3, [r0], #4 str r3, [r1], #4 cmp r2, r0 bne %B3 mov r0, #0x2000 4 subs r0, r0, #1 bne %B4 ;------------------------------------------------------------------------------ ; Recover Process : Starting Point ; ; 1. Checksum Calculation saved Data ldr r5, =SLEEPDATA_BASE_PHYSICAL ; pointer to physical address mov r3, r5 ; pointer for checksum calculation ldr r2, =0x0 ldr r0, =(SLEEPDATA_SIZE-1) ; get size of data structure to do 50 ldr r1, [r3], #4 ; pointer to SLEEPDATA and r1, r1, #0x1 mov r1, r1, ROR #31 add r2, r2, r1 subs r0, r0, #1 ; dec the count bne %b50 ; loop till done ldr r0,=GSTATUS3 ldr r3, [r0] ; get the Sleep data checksum from the Power cmp r2, r3 ; compare to what we saved before going to bne BringUpWinCE ; bad news - do a cold boot ; 2. MMU Enable ldr r10, [r5, #SleepState_MMUDOMAIN] ; load the MMU domain access ldr r9, [r5, #SleepState_MMUTTB] ; load the MMU TTB info ldr r8, [r5, #SleepState_MMUCTL] ; load the MMU control info ldr r7, [r5, #SleepState_WakeAddr ] ; load the LR address nop nop nop nop nop ; if software reset mov r1, #0 teq r1, r7 bne %f60 b BringUpWinCE ; wakeup routine 60 mcr p15, 0, r10, c3, c0, 0 ; setup access to domain 0 mcr p15, 0, r9, c2, c0, 0 ; PT address mcr p15, 0, r0, c8, c7, 0 ; flush I+D TLBs mcr p15, 0, r8, c1, c0, 0 ; restore MMU control ; 3. Jump to Kernel Image's fw.s (Awake_address) mov pc, r7 ; jump to new VA nop 跟踪运行过程发现在跑到 mcr p15, 0, r8, c1, c0, 0 ; restore MMU control 时停住了。这里应该是恢复内存操作的。多次调试后未果,不知道问题出在哪,请各位大哥指点一二。 |
|
沙发#
发布于:2007-05-08 15:44
yzymcs,你搞定没有啊,请指导一下
我的问题是注释掉mcr p15, 0, r0, c8, c7, 0 ; flush I+D TLBs 就可以走下去,但是mov pc, r7 ; jump to new VA 这句不能正常跳转,还有就是 ldr r0,=GSTATUS3 ldr r3, [r0] ; get the Sleep data checksum from the Power cmp r2, r3 ; compare to what we saved before going to bne BringUpWinCE ; bad news - do a cold boot 我的板上读出来的GSTATUS3值跟算出来的不等,我只好注释掉这几句,不知道什么原因,请大家说明一下,谢谢! |
|