|
//read ECC ECC是如何实现的?512byte不是产生3byte吗?怎么会是4byte?
MECC = NF_RDMECC0();
NF_WRDATA((UCHAR)((MECC ) & 0xff));
NF_WRDATA((UCHAR)((MECC >> 8) & 0xff));
NF_WRDATA((UCHAR)((MECC >> 16) & 0xff));
NF_WRDATA((UCHAR)((MECC >> 24) & 0xff));
-------------------------------------------------------------
还有
if( ((DWORD) pSectorBuff) & 0x3) //这个所谓的非对齐是什么意思?
{
WrPage512Unalign (pSectorBuff);//汇编里面已经包含了循环
}
----------------在汇编nand.s中实现了WrPage512Unalign 函数
LEAF_ENTRY WrPage512Unalign
stmfd sp!,{r1 - r11}
ldr r1, =0xb0e00010 ;NFDATA
mov r2, #480
; Calculate number of unaligned bytes to read (r12 = 4 - (r0 & 3))
and r12, r0, #3
rsb r12, r12, #4
mov r3, r12
wr_unalign1
; Write unaligned bytes
ldrb r4, [r0]
strb r4, [r1]
add r0, r0, #1
subs r3, r3, #1
bne wr_unalign1
wr_main
; Write 480 bytes (32 x 15)
ldmia r0!, {r4 - r11}
str r4, [r1]
str r5, [r1]
str r6, [r1]
str r7, [r1]
str r8, [r1]
str r9, [r1]
str r10,[r1]
str r11,[r1]
subs r2, r2, #32
bne wr_main
; Write 28 bytes
ldmia r0!, {r4 - r10}
str r4, [r1]这个flash是八位的,怎么使用32位的str指令呢?应该是strb才对啊
str r5, [r1]
str r6, [r1]
str r7, [r1]
str r8, [r1]
str r9, [r1]
str r10,[r1]
; Write trailing unaligned bytes
rsbs r12, r12, #4
beq wr_exit
wr_unalign2
ldrb r4, [r0]
strb r4, [r1]
add r0, r0, #1
subs r12, r12, #1
bne wr_unalign2
wr_exit
ldmfd sp!, {r1 - r11}
IF Interworking :LOR: Thumbing
bx lr
ELSE
mov pc, lr ; return
ENDIF |
|