Even when new, NAND devices may have bad blocks. A bad block may be a block that has a bit failure or cannot erase properly. Vendors typically provide a pre-built map of known existing bad blocks for each part. The factory bad blocks are marked with by a non-0xFF value in the factory bad block marker offset on the first page of each block.
For small page devices, this factory offset is usually bytes 516 and 517 in a page. For large page devices, this factory offset is usually 2048. You can get a list of bad blocks by scanning the first page in each block on a NAND device and checking if the value in the factory bad block marker offset in the data is a non-0xFF value.
The SLC NAND controller and all NXP developed software for the SLC NAND controller (Linux, WinCE, or standalone) uses the same locations as the factory markers for bad block marking and detection. Because of this, no special processing or relocation of the bad blocks is needed for a NAND device.
The MLC NAND controller can only read and write data with ECC in 528 byte chunks. Because of this, the data and ECC values are interleaved in the NAND page. The factory bad block markers with this scheme cannot be used. If the MLC NAND controller must be used for anything besides chip boot, the factory bad block markers need to be recorded and moved prior to writing data to the device. In the case of block 0, which is use for NAND boot on the LPC32x0 using the MLC controller, no bad block detection or marking is used in any NXP software. This is because NAND device manufacturers typically guarantee the data reliability of block 0 for a limited number (ie, 1000) of write cycles.