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

bit-flips on SPI-NAND flash connected via SNFI result in abort and fatal error #10

Open dangowrt opened 1 month ago

dangowrt commented 1 month ago

Tests of users suggest that correctable bit-flips in SPI-NAND connected via SNFI on MT7622 do not get corrected when reading FIP in BL2. This hints that the BCH/ECC engine is not setup correctly by the driver in ARM TrustedFirmware-A while the exact same drivers works fine in U-Boot.

Maybe mtk_ecc_setup() is broken or not acting correctly, also because https://github.com/mtk-openwrt/arm-trusted-firmware/blob/mtksoc/plat/mediatek/apsoc_common/drivers/snfi/mtk-snand-ecc.c#L166 is dead code (i is unsigned and hence can never be < 0).

dangowrt commented 1 month ago

@hackpascal @onlyfly34 It has been confirmed that this is a regression introduced somewhere between TF-A v2.4 and v2.9. The dirver in TF-A v2.4 does correct all bitflips, while in TF-A v2.9 is doesn't.