; The default SDRAM type is 4M x 32 bits, it needs to be checked. LDR r0, =0x0 STR r0, [r0] LDR r1, =0x00800000 LDR r2, =0x12345678 STR r2, [r1] LDR r3, [r0] CMP r2, r3 LDREQ r0, =0xFFF01008 LDREQ r1, =0x000090E3 STREQ r1, [r0], #4 LDREQ r1, =0x010090E3 STREQ r1, [r0] ; check memory type (only check if 1Mx16x2 SDRAM type) LDR r0,=0x0 STR r0,[r0] LDR r0,=0x800 LDR r1,=0x12345678 STR r1,[r0] LDR r0,=0x0 LDR r2,[r0] CMP r1,r2 LDREQ r0,=0xFFF01008 ;sdconf0 LDREQ r1,=0x00009062 STREQ r1, [r0], #4 LDREQ r1,=0x00809062 STREQ r1, [r0]
; check bank 1 (check if the SDRAM existed in bank 1) LDR r0, =0xFFF0100C LDR r1, [r0] LDR r2, =0xFFF80000 AND r2, r2, r1 MOV r2, r2, lsr #1 MOV r0, #0 STR r0, [r2] LDR r0, [r2] LDR r0, =0xAABBCCDD STR r0, [r2] LDR r1, [r2, #0xc] LDR r1, [r2] CMP r0, r1 LDRNE r0, =0xFFF0100C MOVNE r1, #0 STRNE r1, [r0]
|