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.
@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.
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
).