NFC Register Guide

= NAND Flash Controller = Warning, default values where obtained using mtest in u-boot. They all kept reading 0, no matter what was written to them. So it could be write only or otherwise.

NFC Registers
Timer Base address: 0x01c03000

NFC_CTL
Default value: 0x0000

Offset: 0x0000

NFC_ST
Default value: 0x00000f00

Offset: 0x0004

NFC_INT
Default value: 0x0000

Offset: 0x0008

NFC_CMD
Default value: 0x0000

Offset: 0x0024

NFC_READ_CMD_SET
Default value: 0x00e00f30

Offset: 0x0028

NFC_WRITE_CMD_SET
Default value: 0x70008510

Offset: 0x002c

NFC_ECC_CTL
Default value: 0x4a800008

Offset: 0x0034

NFC_USER_DB
Default value: 0xff * 64

Offset: 0x0034

= Initial values =

default map
md 0x01c03000 0x29 01c03000: 00000000 00000f00 00000000 00000000   ................ 01c03010: 00000095 00000000 00000000 00000000   ................ 01c03020: 00000000 00000000 00e00530 70008510   ........0......p 01c03030: 00000000 4a800008 00000000 00000000    .......J........ 01c03040: 00000000 00000000 00000000 00000000   ................ 01c03050: ffffffff ffffffff ffffffff ffffffff   ................ 01c03060: ffffffff ffffffff ffffffff ffffffff   ................ 01c03070: ffffffff ffffffff ffffffff ffffffff   ................ 01c03080: ffffffff ffffffff ffffffff ffffffff   ................ 01c03090: 00000000 00000000 00000000 00000000   ................ 01c030a0: 00000400   ....

all set to 1
mw 0x01c03000 0xffffffff 0x29 md 0x01c03000 0x29 01c03000: 0f3fcf5f 00000f00 00000007 00000f3f   _.?.........?... 01c03010: 000007ff ffffffff ffffffff 0000001f   ................ 01c03020: 000003ff ffff00ff 00ffffff ffffffff   ................ 01c03030: 00000000 7ffffe39 00000000 0000017f   ....9........... 01c03040: 00000000 00000000 00000000 00000000   ................ 01c03050: ffffffff ffffffff ffffffff ffffffff   ................ 01c03060: ffffffff ffffffff ffffffff ffffffff   ................ 01c03070: ffffffff ffffffff ffffffff ffffffff   ................ 01c03080: ffffffff ffffffff ffffffff ffffffff   ................ 01c03090: 00000000 00000000 00000000 00000000   ................ 01c030a0: 0000ffff   ....

all set to 0
mw 0x01c03000 0x00 0x29 md 0x01c03000 0x29 01c03000: 00000000 00000f00 00000000 00000000   ................ 01c03010: 00000095 00000000 00000000 00000000   ................ 01c03020: 00000000 00000000 00e00530 70008510   ........0......p 01c03030: 00000000 4a800008 00000000 00000000    .......J........ 01c03040: 00000000 00000000 00000000 00000000   ................ 01c03050: ffffffff ffffffff ffffffff ffffffff   ................ 01c03060: ffffffff ffffffff ffffffff ffffffff   ................ 01c03070: ffffffff ffffffff ffffffff ffffffff   ................ 01c03080: ffffffff ffffffff ffffffff ffffffff   ................ 01c03090: 00000000 00000000 00000000 00000000   ................ 01c030a0: 00000400   ....

Spare area
Each page data write will cause a spare area data write if hardware ECC is enabled. Sometimes the page is more than 1K, so it needs multiple times to write a page. The spare area will also be written with ECC data muliple times sequencely. One time a data write op will write 4 Byte user data stored at NFC_USER_DATA(i) following ECC data whose length depending on the ECC mode.

Random Seed
The controller includes a randomizer that scrambles the data to avoid large islands of the same charge. During boot the randomizer is initialized by the BROM to 0x4a80 and thus the SPL is expected to be randomized as such. Currently, boot[01] and stock kernels use the following randomized values, it is formed by page number % 128 index into static const unsigned short random_seed[128] = { 0x2b75, 0x0bd0, 0x5ca3, 0x62d1, 0x1c93, 0x07e9, 0x2162, 0x3a72, 0x0d67, 0x67f9, 0x1be7, 0x077d, 0x032f, 0x0dac, 0x2716, 0x2436, 0x7922, 0x1510, 0x3860, 0x5287, 0x480f, 0x4252, 0x1789, 0x5a2d, 0x2a49, 0x5e10, 0x437f, 0x4b4e, 0x2f45, 0x216e, 0x5cb7, 0x7130, 0x2a3f, 0x60e4, 0x4dc9, 0x0ef0, 0x0f52, 0x1bb9, 0x6211, 0x7a56, 0x226d, 0x4ea7, 0x6f36, 0x3692, 0x38bf, 0x0c62, 0x05eb, 0x4c55, 0x60f4, 0x728c, 0x3b6f, 0x2037, 0x7f69, 0x0936, 0x651a, 0x4ceb, 0x6218, 0x79f3, 0x383f, 0x18d9, 0x4f05, 0x5c82, 0x2912, 0x6f17, 0x6856, 0x5938, 0x1007, 0x61ab, 0x3e7f, 0x57c2, 0x542f, 0x4f62, 0x7454, 0x2eac, 0x7739, 0x42d4, 0x2f90, 0x435a, 0x2e52, 0x2064, 0x637c, 0x66ad, 0x2c90, 0x0bad, 0x759c, 0x0029, 0x0986, 0x7126, 0x1ca7, 0x1605, 0x386a, 0x27f5, 0x1380, 0x6d75, 0x24c3, 0x0f8e, 0x2b7a, 0x1418, 0x1fd1, 0x7dc1, 0x2d8e, 0x43af, 0x2267, 0x7da3, 0x4e3d, 0x1338, 0x50db, 0x454d, 0x764d, 0x40a3, 0x42e6, 0x262b, 0x2d2e, 0x1aea, 0x2e17, 0x173d, 0x3a6e, 0x71bf, 0x25f9, 0x0a5d, 0x7c57, 0x0fbe, 0x46ce, 0x4939, 0x6b17, 0x37bb, 0x3e91, 0x76db };