
Hi Colin,
On 17/05/2023 22:39, Colin Foster wrote:
Hi Roger,
Thanks for the tests. I attached the files and commented in line... but at the bottom of this email I have some findings...
On Wed, May 17, 2023 at 04:30:55PM +0300, Roger Quadros wrote:
Hi Colin,
I just tested this on AM335x EVM which uses BCH8_CODE_HW but 8-bit NAND part. I see that you are using 16-bit NAND.
One more difference in u-boot configuration. For me: CONFIG_NAND_OMAP_GPMC_PREFETCH=y
Not sure if that matters but let's keep it set for now.
For debug can you please apply the patch (at end) to u-boot at commit a95410696d21 (before breakage) and run the test.
All are attached.
However I have some other initial findings:
I swapped in just U-Boot (not the SPL) with your patch, and everything seems to work!
The issue of Uncorrectable ECC errors spam came from the SPL. Here's a snippet of the boot log with the "ecc" print as well as your patch:
Thanks for the tests. Glad to hear issue is narrowed down to SPL.
U-Boot SPL 2023.04-00029-g26a9ce5314-dirty (May 17 2023 - 12:06:49 -0700) OMAP4460-GP ES1.1 Trying to boot from NAND ecc: 2420106 ecc: ebd922f6 ecc: 333f844f ecc: ab812f72
This is clearly the issue. They should all have been 0.
omap-elm: uncorrectable ECC errors omap-elm: uncorrectable ECC errors omap-elm: uncorrectable ECC errors omap-elm: uncorrectable ECC errors ecc: 2420106 ecc: ebd922f6 ecc: 333f844f ecc: ab812f72 omap-elm: uncorrectable ECC errors omap-elm: uncorrectable ECC errors omap-elm: uncorrectable ECC errors omap-elm: uncorrectable ECC errors
Can you please share your spl/u-boot.cfg?
We have a stripped down driver "am335x_spl_bch.c" that deals with NAND at SPL. I haven't really looked much at that driver but it relies on omap_gpmc.c for
ecc.hwctl() read_buf() ecc.calculate()
We didn't do any functional change to these functions in commit 04fcd25873 unless something slipped through the cracks.
It seems to rely on following config options
CFG_SYS_NAND_ECCPOS CONFIG_SYS_NAND_PAGE_COUNT CONFIG_SYS_NAND_PAGE_SIZE CONFIG_SYS_NAND_5_ADDR_CYCLE CFG_SYS_NAND_ECCSIZE CFG_SYS_NAND_ECCBYTES CONFIG_SYS_NAND_OOBSIZE
Could you please share what they are set to for your SPL build?
Meanwhile, I'll try to reproduce this on AM335x-EVM.