Part Number: AM625-Q1
Hello,
Due to a recent change in NAND chip, we will need to enable scanning of the last page for bad block markers.
For reference, to detect/mark a bad block, we will need to check the first, second, and last pages of a block (Pages 0,1,63).
While looking through the `nand_base.c` file inside the U-Boot package(SDKLA AM62x (v10.01.10.04)), we found it was possible to enable the last page scanning option by enabling the NAND_BBT_SCANLASTPAGE chip option.
However, during analysis and testing of the feature, we discovered a bug that prevents this feature from functioning correctly.
As shown in the image above, if both NAND_BBT_SCANLASTPAGE and NAND_BBT_SCAN2NDPAGE are enabled, it will cause the following incorrect behavior:
- Mark last page of selected block
- Mark first page of next block
A similar logical error also exists in the bad block check function.
To fix this issue, we have added the following modifications attached in the file below (Please convert .txt file to .patch file for easy use):
nand_base.c 0001-NAND-Bad-Block-Management-Fix.txt
Please let us know if there are any issues with this change/fix.
