* [U-Boot] OMAP3 broken NAND hardware ECC generation
@ 2008-11-09 18:51 Dirk Behme
2008-11-10 18:33 ` Scott Wood
0 siblings, 1 reply; 2+ messages in thread
From: Dirk Behme @ 2008-11-09 18:51 UTC (permalink / raw)
To: u-boot
Dear Scott and Nishanth,
we have broken OMAP3 NAND hardware ECC generation while our clean up
of OMAP3 NAND code.
I did some debugging. Do you like to have a look to
http://git.denx.de/?p=u-boot/u-boot-arm.git;a=blob;f=drivers/mtd/nand/omap_gpmc.c;h=01b79593949fe828e4b1d3da2cf4b399c1b580ab;hb=refs/heads/omap3
?
Using some well defined data in SDRAM, I used older U-Boot with
working nand ecc hw/sw implementation and our recent version to write
this data to NAND. I then compared ecc written and found that our
latest version writes the correct location, but all zero:
Working version from older U-Boot:
OOB:
ff ff ec 13 0f 00 00 00
00 00 00 00 00 00 ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
Recent version:
OOB:
ff ff 00 00 00 00 00 00
00 00 00 00 00 00 ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
In both versions the data the ecc is calculated for is the same. In
recent version only zero is written.
Some additional debugging by adding some printf() in hw ecc functions:
OMAP3 beagleboard.org # nandecc hw
omap_hwecc_init
HW ECC selected
OMAP3 beagleboard.org # nand write 80000000 680000 1000
NAND write: device 0 offset 0x680000, size 0x1000
omap_calculate_ecc 0x00 0x00 0x00
omap_calculate_ecc 0x00 0x00 0x00
omap_calculate_ecc 0x00 0x00 0x00
omap_calculate_ecc 0x00 0x00 0x00
omap_calculate_ecc 0x00 0x00 0x00
omap_calculate_ecc 0x00 0x00 0x00
omap_calculate_ecc 0x00 0x00 0x00
omap_calculate_ecc 0x00 0x00 0x00
4096 bytes written: OK
OMAP3 beagleboard.org #
This is the result of
printf("omap_calculate_ecc 0x%02x 0x%02x 0x%02x\n", ecc_code[2],
ecc_code[1], ecc_code[0]);
I'm not sure, but it seems to me, that omap_enable_hwecc() is never
called. An printf() in this function is not shown.
Maybe call of nand_scan_tail(mtd); in omap_nand_switch_ecc() resets
anything? Or any other idea?
Thanks for your help
Dirk
^ permalink raw reply [flat|nested] 2+ messages in thread* [U-Boot] OMAP3 broken NAND hardware ECC generation
2008-11-09 18:51 [U-Boot] OMAP3 broken NAND hardware ECC generation Dirk Behme
@ 2008-11-10 18:33 ` Scott Wood
0 siblings, 0 replies; 2+ messages in thread
From: Scott Wood @ 2008-11-10 18:33 UTC (permalink / raw)
To: u-boot
Dirk Behme wrote:
> I'm not sure, but it seems to me, that omap_enable_hwecc() is never
> called. An printf() in this function is not shown.
>
> Maybe call of nand_scan_tail(mtd); in omap_nand_switch_ecc() resets
> anything? Or any other idea?
You never cleared out nand->ecc.write_page (and others), so
nand_scan_tail() saw that they were non-NULL and assumed you were
overriding them, and you got the soft-ECC versions of those, but the
hard-ECC calculate method.
-Scott
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-10 18:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-09 18:51 [U-Boot] OMAP3 broken NAND hardware ECC generation Dirk Behme
2008-11-10 18:33 ` Scott Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox