参考bootloader文档:sprab41e:
6.4 NAND Flash Boot
To boot from NAND Flash, the AIS should be written to NAND block 1 (NAND block 0 is not used by
default) in a sequential manner, skipping (and marking) any bad blocks. The bootloader detects a bad
block by examining the spare bytes in the first and second pages of the current block. For NAND devices
that comply with the ONFI standard, the first and last pages are used instead. Figure 21 illustrates the
structure of a NAND data page. Each page includes N segments of spare bytes, where N is the number of
data bytes per page divided by 512. Each segment of spare bytes contains 6 test bytes and 10 ECC
bytes. For those pages that are checked during bad block detection, all the test bytes in each segment
must equal FFh; any other value indicates that the page (and its entire block) is bad and should not be
used.