nand "BCH decoding failed" when using bch8_hw_romcode ecc mode
Tibault Damman
tibault.damman at basalte.be
Wed Mar 16 06:45:31 PDT 2022
Hi all
Due to component shortages, I'm trying to move an old board from a Phytec Phycore omap4430 with 8bit nand (Micron MT29F4G08ABBDAH4) to an omap4460 variant with 16bit nand (Micron MT29F8G16ADBDAH4).
To be compatible with Linux 5.4, the rootfs nand (ubi) partition needs to be in BCH8_HW_ROMCODE ecc mode instead of the default BCH8_HW.
When I use ubiformat or ubiattach from barebox in this mode though, I get a bazillion "BCH decoding failed" prints (which I did not get on the omap4430)
> barebox at Phytec phyCORE-OMAP4460:/ ubiattach -O 2048 /dev/nand0.sys
> ...
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> nand0.root: error -74 (ECC error) while reading 512 bytes from PEB 887:0
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> nand0.root: error -74 (ECC error) while reading 512 bytes from PEB 888:0
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> BCH decoding failed
> ...
I tried these combinations:
* omap4430 (8bit nand) + BCH8_HW ecc: works (but not compatible with Linux)
* omap4430 (8bit nand) + BCH8_HW_ROMCODE ecc: works
* omap4460 (16bit nand) + BCH8_HW ecc: works (but not compatible with Linux)
* omap4460 (16bit nand) + BCH8_HW_ROMCODE ecc: does not work
I've reproduced this on the following barebox versions:
* phytec's 2013.06 fork
* 2019.07.0 (which I've been (successfully) using for omap4430)
* the latest 2020.03.0
Any clues what could be going wrong here?
Maybe the 8/16bit thing is a red herring, but it was the most obvious difference.
I've tried setting the nand device width to 16 (instead of 0 (auto)) in the board file, but that didn't change the above behaviour.
(I've also noticed the ubi tools keep assuming the subpage size is 512, when the nand has no subpages. Passing -s 2048 and -O 2048 works for the omap4430 though.)
Thanks
Tibault
More information about the barebox
mailing list