各位大侠好!
小弟最近在调试wince5.0的bootloader时遇到了问题,是这样的:cpu是ATMEL9261(926ej-s),在startup.s中没有启用MMU之前程序运行很好!但是当执行完mcr p15, 0, r1, c1, c0, 0 后,灯也没亮,程序就飞了,请大家赐教啊,谢谢!!
ACTIVATEMMU
; The 1st Level Section Descriptors are setup. Initialize the MMU and turn it on.
;
mov r1, #1
mcr p15, 0, r1, c3, c0, 0 ; Set up access to domain 0.
mov r0, #0 ; ********I PLUS
mcr p15, 0, r0, c8, c7, 0 ; Flush the instruction and data TLBs.
mcr p15, 0, r0, c7, c10, 4 ; Drain the write and fill buffers.********I MODIFY
mov r1, #0x78 ; Bits [6:3] must be written as 1's.
orr r1, r1, #0x1 ; Enable MMU.
orr r1, r1, #0x1000 ; Enable IC.
orr r1, r1, #0x0800 ; Enable BTB.
;orr r1, r1, #0x50000 ;16,18bit SBO
orr r1, r1, #0x4 ; Enable DC.
ldr r2, =VirtualStart ; Get virtual address of 'VirtualStart' label.
cmp r2, #0 ; Make sure no stall on "mov pc,r2" below.
beq STALL2
你说的是这个吧:
; Set the TTB.
;
ldr r9, =AT91SAM9261EK_BASE_MMU_CFG ; Physical address of the first-level table
ldr r0, =0xFFFFC000 ;
and r9, r9, r0 ; Mask off TTB[31:0] (must be 0's).
mcr p15, 0, r9, c2, c0, 0 ; Set the TTB.
我这个已经执行过了,而且我随意选了两个descriptor地址,在SRAM内存里看过descriptor值也是正确的