A10 DRAM Controller Register Guide

Note: slightly different revisions of the same DRAM controller are used in sun4i (Allwinner A10), sun5i (Allwinner A13) and sun7i (Allwinner A20). This register guide covers them all. And the differences are explained in the register descriptions where appropriate.

DRAMC Base Address: 0x01c01000

= DRAM Controller registers =

SDR_CCR
Default value: 0x80020000(A10) / 0x90020000(A20)

Offset: 0x0000

SDR_DCR
Default value: 0x000004d4(A10) / 0x00000454(A20)

Offset: 0x0004

SDR_IOCR
Default value: 0x00000000

Offset: 0x0008

SDR_CSR
Default value: 0x00000000

Offset: 0x000C

SDR_DRR
Default value: 0x086c9883

Offset: 0x0010

SDR_TPR0
Default value: 0x30926692

Offset: 0x0014

SDR_TPR1
Default value: 0x00001090

Offset: 0x0018

SDR_TPR2
Default value: 0x0001a0c8

Offset: 0x001c

SDR_ZQCR0
Default value: 0x07b00000

Offset: 0x00a8

SDR_ZQCR1
Default value: 0x00000000

Offset: 0x00ac

SDR_ZQSR
Default value: ?

Offset: 0x00b0

SDR_IDCR
Example of use in boot0

Default value: 0x00c80064

Offset: 0x00b4

SDR_HPCR
Default value: ??

Offset: 0x250+4*port

= Register dumps =

CB1 after boot0/1
01c01000: 00004000 000030e5 00cc0000 00000000   .@...0.......... 01c01010: 0882cf9d 30926692 00001090 0001a0c8   .....f.0........ 01c01020: 00000000 00000000 00000000 00000000   ................ 01c01030: 00000000 00000000 00000000 00000000   ................ 01c01040: 00000000 00000000 00000000 00000249   ............I... 01c01050: 00000000 00000000 00000000 00000056   ............V... 01c01060: 00000055 00000000 00000000 00000000   U............... 01c01070: 00000000 00000000 00000000 00000000   ................ 01c01080: 00000000 00000000 00000000 00000000   ................ 01c01090: 00000000 00000000 00210000 dd22ee11   ..........!...". 01c010a0: 7788bb44 00000000 07b00000 00000000    D..w............ 01c010b0: 8006b948 00c9ffff 00000000 00000000    H............... 01c010c0: 00000000 00000000 00000000 00000000    ................ 01c010d0: 00000000 00000000 00000000 00000000    ................ 01c010e0: 00000000 00000000 00000000 00000000    ................ 01c010f0: 00000000 00000000 00000000 00000000    ................ 01c01100: 00000000 00000000 00000000 00000000    ................ 01c01110: 00000000 00000000 00000000 00000000    ................ 01c01120: 00000000 00000000 00000000 00000000    ................ 01c01130: 00000000 00000000 00000000 00000000    ................ 01c01140: 00000000 00000000 00000000 00000000    ................ 01c01150: 00000000 00000000 00000000 00000000    ................ 01c01160: 00000000 00000000 00000000 00000000    ................ 01c01170: 00000000 00000000 00000000 00000000   ................ 01c01180: 00000000 00000000 00000000 00000000   ................ 01c01190: 00000000 00000000 00000000 00000000   ................ 01c011a0: 00000000 00000000 00000000 00000000   ................ 01c011b0: 00000000 00000000 00000000 00000000   ................ 01c011c0: 00000000 00000000 00000000 00000000   ................ 01c011d0: 00000000 00000000 00000000 00000000   ................ 01c011e0: 00000000 00000000 00000000 00000000   ................ 01c011f0: 00001a20 00000000 00000000 00000000    ............... 01c01200: 03737000 40000000 40000000 40000000   .ps....@...@...@ 01c01210: 40000000 40000000 ffffffff ffffffff   ...@...@........ 01c01220: ffffffff ffffffff 00003333 00003333   ........33..33.. 01c01230: 00006ffc 000000ff 00000000 00000000   .o.............. 01c01240: 00008000 00010400 00000000 00000000   ................ 01c01250: 00000301 00000301 00000301 00000301   ................ 01c01260: 00000301 00000301 00000000 00000000   ................ 01c01270: 00000000 00000000 00000000 00000000   ................ 01c01280: 00000000 00000000 00000000 00000000   ................ 01c01290: 00001031 00001031 00000735 00001035   1...1...5...5... 01c012a0: 00001035 00000731 00001031 00000735   5...1...1...5... 01c012b0: 00001035 00001031 00000731 00001035   5...1...1...5... 01c012c0: 00001031 00000301 00000301 00000731   1...........1... 01c012d0: 00000000 00000000 00000000 00000000   ................ 01c012e0: 00000000 00000000 00000000 00000000   ................

Reset
0000: 90020000 00000454 00000000 00000000 0010: 086c9883 3092666e 00001090 0001a0c8 0020: 00000000 00000000 00000000 00000000 0030: 00000000 00000000 00000000 00000000 0040: 00000000 00000000 00000000 00000000 0050: 00000000 00000000 00000000 00000055 0060: 00000055 00000000 00000000 00000000 0070: 00000000 00000000 00000000 00000000 0080: 00000000 00000000 00000000 00000000 0090: 00000000 00000000 00210000 dd22ee11 00a0: 7788bb44 00000000 07b00000 00000000 00b0: 0005294a 00c80064 00000000 00000000 00c0: 00000000 00000000 00000000 00000000 00d0: 00000000 00000000 00000000 00000000 00e0: 00000000 00000000 00000000 00000000 00f0: 00000000 00000000 00000000 00000000 0100: 00000000 00000000 00000000 00000000 0110: 00000000 00000000 00000000 00000000 0120: 00000000 00000000 00000000 00000000 0130: 00000000 00000000 00000000 00000000 0140: 00000000 00000000 00000000 00000000 0150: 00000000 00000000 00000000 00000000 0160: 00000000 00000000 00000000 00000000 0170: 00000000 00000000 00000000 00000000 0180: 00000000 00000000 00000000 00000000 0190: 00000000 00000000 00000000 00000000 01a0: 00000000 00000000 00000000 00000000 01b0: 00000000 00000000 00000000 00000000 01c0: 00000000 00000000 00000000 00000000 01d0: 00000000 00000000 00000000 00000000 01e0: 00000000 00000000 00000000 00000000 01f0: 00000a52 00000000 00000000 00000000 0200: 03737000 c0000000 c0000000 c0000000 0210: c0000000 c0000000 ffffffff ffffffff 0220: ffffffff ffffffff 00003333 00003333 0230: c7000000 000003ff 00000000 00000000 0240: 00008000 01010400 00000000 00000000 0250: 00000001 00000001 00000001 00000001 0260: 00000001 00000001 00000001 00000001 0270: 00000000 00000000 00000000 00000000 0280: 00000000 00000000 00000000 00000000 0290: 00000001 00000001 00000001 00000001 02a0: 00000001 00000001 00000001 00000001 02b0: 00000001 00000001 00000001 00000001 02c0: 00000001 00000001 00000000 00000001 02d0: 00000000 00000000 00000000 00000000 02e0: 00000000 00000000 00000000 00000000 02f0: 00000000 00000000 00000000 00000000

CB2 after boot0/1
01c01000: 00004020 000030e5 00000000 00000000    @...0.......... 01c01010: 0875a983 42d899b7 0000a090 00022a00   ..u....B.....*.. 01c01020: 00000000 00000000 00000000 00000000   ................ 01c01030: 00000000 00000000 00000000 00000000   ................ 01c01040: 00000000 00000000 00000000 00000249   ............I... 01c01050: 00000000 00000000 00000000 00000065   ............e... 01c01060: 00000055 00000000 00000000 00000000   U............... 01c01070: 00000000 00000000 00000000 00000000   ................ 01c01080: 00000000 00000000 00000000 00000000   ................ 01c01090: 00000000 00000000 00210000 dd22ee11   ..........!...". 01c010a0: 7788bb44 00000000 07f00000 00000002    D..w............ 01c010b0: 8002b75e 00c9ffff 00000000 00000000    ^............... 01c010c0: 00000000 00000000 00000000 00000000    ................ 01c010d0: 00000000 00000000 00000000 00000000    ................ 01c010e0: 00000000 00000000 00000000 00000000    ................ 01c010f0: 00000000 00000000 00000000 00000000    ................ 01c01100: 00000000 00000000 00000000 00000000    ................ 01c01110: 00000000 00000000 00000000 00000000    ................ 01c01120: 00000000 00000000 00000000 00000000    ................ 01c01130: 00000000 00000000 00000000 00000000    ................ 01c01140: 00000000 00000000 00000000 00000000    ................ 01c01150: 00000000 00000000 00000000 00000000    ................ 01c01160: 00000000 00000000 00000000 00000000    ................ 01c01170: 00000000 00000000 00000000 00000000   ................ 01c01180: 00000000 00000000 00000000 00000000   ................ 01c01190: 00000000 00000000 00000000 00000000   ................ 01c011a0: 00000000 00000000 00000000 00000000   ................ 01c011b0: 00000000 00000000 00000000 00000000   ................ 01c011c0: 00000000 00000000 00000000 00000000   ................ 01c011d0: 00000000 00000000 00000000 00000000   ................ 01c011e0: 00000000 00000000 00000000 00000000   ................ 01c011f0: 00001a50 00000004 00000010 00000000   P............... 01c01200: 03737000 40000000 40000000 40000000   .ps....@...@...@ 01c01210: 40000000 40000000 ffffffff ffffffff   ...@...@........ 01c01220: ffffffff ffffffff 00003333 00003333   ........33..33.. 01c01230: c7017ffc 000003ff 00000000 00000000   ................ 01c01240: 00008000 01010400 00000000 00000000   ................ 01c01250: 00000301 00000301 00000301 00000301   ................ 01c01260: 00000301 00000301 00000301 00000301   ................ 01c01270: 00000000 00000000 00000000 00000000   ................ 01c01280: 00000000 00000000 00000000 00000000   ................ 01c01290: 00001031 00001031 00000735 00001035   1...1...5...5... 01c012a0: 00001035 00000731 00001031 00000735   5...1...1...5... 01c012b0: 00001035 00001031 00000731 00001035   5...1...1...5... 01c012c0: 00000001 00001031 00000000 00001031   ....1.......1... 01c012d0: 00000000 00000000 00000000 00000000   ................ 01c012e0: 00000000 00000000 00000000 00000000   ................

CB2 after u-boot-spl (wip/a20)
01c01000: 00004020 000030e5 00000000 00000055    @...0......U... 01c01010: 0882cf83 42d899b7 0000a090 00022a00   .......B.....*.. 01c01020: 00000000 00000000 00000000 00000000   ................ 01c01030: 00000000 00000000 00000000 00000000   ................ 01c01040: 00000000 00000000 00000000 00000249   ............I... 01c01050: 00000000 00000000 00000000 00000055   ............U... 01c01060: 00000055 00000000 00000000 00000000   U............... 01c01070: 00000000 00000000 00000000 00000000   ................ 01c01080: 00000000 00000000 00000000 00000000   ................ 01c01090: 00000000 00000000 00210000 dd22ee11   ..........!...". 01c010a0: 7788bb44 00000000 07f00000 00000002    D..w............ 01c010b0: 0005294a 00c9ffff 00000000 00000000    J).............. 01c010c0: 00000000 00000000 00000000 00000000    ................ 01c010d0: 00000000 00000000 00000000 00000000    ................ 01c010e0: 00000000 00000000 00000000 00000000    ................ 01c010f0: 00000000 00000000 00000000 00000000    ................ 01c01100: 00000000 00000000 00000000 00000000    ................ 01c01110: 00000000 00000000 00000000 00000000    ................ 01c01120: 00000000 00000000 00000000 00000000    ................ 01c01130: 00000000 00000000 00000000 00000000    ................ 01c01140: 00000000 00000000 00000000 00000000    ................ 01c01150: 00000000 00000000 00000000 00000000    ................ 01c01160: 00000000 00000000 00000000 00000000    ................ 01c01170: 00000000 00000000 00000000 00000000   ................ 01c01180: 00000000 00000000 00000000 00000000   ................ 01c01190: 00000000 00000000 00000000 00000000   ................ 01c011a0: 00000000 00000000 00000000 00000000   ................ 01c011b0: 00000000 00000000 00000000 00000000   ................ 01c011c0: 00000000 00000000 00000000 00000000   ................ 01c011d0: 00000000 00000000 00000000 00000000   ................ 01c011e0: 00000000 00000000 00000000 00000000   ................ 01c011f0: 00001a50 00000004 00000010 00000000   P............... 01c01200: 03737000 40000000 40000000 40000000   .ps....@...@...@ 01c01210: 40000000 40000000 ffffffff ffffffff   ...@...@........ 01c01220: ffffffff ffffffff 00003333 00003333   ........33..33.. 01c01230: c7017ffc 000003ff 00000000 00000000   ................ 01c01240: 00008000 01010400 00000000 00000000   ................ 01c01250: 00000301 00000301 00000301 00000301   ................ 01c01260: 00000301 00000301 00000301 00000301   ................ 01c01270: 00000000 00000000 00000000 00000000   ................ 01c01280: 00000000 00000000 00000000 00000000   ................ 01c01290: 00001031 00001031 00000735 00001035   1...1...5...5... 01c012a0: 00001035 00000731 00001031 00000735   5...1...1...5... 01c012b0: 00001035 00001031 00000731 00001035   5...1...1...5... 01c012c0: 00000001 00001031 00000000 00000731   ....1.......1... 01c012d0: 00000000 00000000 00000000 00000000   ................ 01c012e0: 00000000 00000000 00000000 00000000   ................