|
;//将程序从nandflash拷贝到sdram
;===========================================================
nand_boot_beg
bl ClearSdram
mov r5, #NFCONF
;set timing value
ldr r0, =(7<<12)|(7<<8)|(7<<4)
str r0, [r5]
;enable control
ldr r0, =(0<<13)|(0<<12)|(0<<10)|(0<<9)|(0<<8)|(1<<6)|(1<<5)|(1<<4)|(1<<1)|(1<<0)
str r0, [r5, #4]
bl ReadNandID
mov r6, #0
ldr r0, =0xecF1
cmp r5, r0
beq %F1
ldr r0, =0xec76
cmp r5, r0
beq %F1
mov r6, #1
1
bl ReadNandStatus
mov r8, #0
ldr r9, =ResetEntry
mov r10,#32 ;+081010 feiling
2
ands r0, r8, #0x3f ;如果是第一页,则检测坏块
bne %F3
mov r0, r8
bl CheckBadBlk
cmp r0, #0
addne r8, r8, #64 ;每块的页数 此处有BUG r8同时也做计数用。。
红色部分有什么用,好像是多余的代码,想问下拷贝具体过程是怎样的?
|
|