mtk-openwrt / arm-trusted-firmware

Read-only mirror of Trusted Firmware-A
https://developer.trustedfirmware.org/dashboard/view/6/
Other
22 stars 20 forks source link

mediatek: skip bad blocks on SPI-NAND (SNFI/SPIM-NAND) #2

Closed dangowrt closed 2 years ago

dangowrt commented 2 years ago

In case we don't use NMBM in favor of using UBI on highler layers we still need to handle bad blocks while reading BL3 image from SPI-NAND flash. Ideally we would be using UBI here as well, e.g. by porting drivers/mtd/ubispl/ from U-Boot sources (under BSD-3-Clause).

For now, apply a generic minimal solution sufficient skipping up to 3 bad blocks while reading which is sufficient for loading BL3 even from a very broken NAND.

Signed-off-by: Daniel Golle daniel@makrotopia.org

dangowrt commented 2 years ago

See also OpenWrt Forum thread

hackpascal commented 2 years ago

the spim-nand nand_read() already supports skip bad block. I'll upload a new version for snfi-nand

dangowrt commented 2 years ago

Excellent. Thank you!

dangowrt commented 2 years ago

Superseded, now implemented directly in snfi driver.