Commit 2f665945b39a9972260cbcf60d5e7f2a60587f5e
Committed by
Scott Wood
1 parent
e3a4facdfc
Exists in
v2017.01-smarct4x
and in
39 other branches
mtd: nand: am335x: Fix 'bit-flip' errors in SPL
OMAP GPMC driver used with some NAND Flash devices (e.g. Spansion S34ML08G1) causes that U-boot shows hundreds of 'nand: bit-flip corrected' error messages. Possible cause was discussed in the mailinglist thread: http://lists.denx.de/pipermail/u-boot/2014-April/177508.html The issue was partially fixed with the cc81a5291910d7a.git however this has to be done to fix the SPL. The original author of the code is Belisko Marek <marek.belisko@gmail.com> Signed-off-by: Rostislav Lisovy <lisovy@merica.cz>
Showing 1 changed file with 8 additions and 4 deletions Side-by-side Diff
drivers/mtd/nand/am335x_spl_bch.c
... | ... | @@ -64,14 +64,18 @@ |
64 | 64 | NAND_CTRL_ALE | NAND_CTRL_CHANGE); /* A[7:0] */ |
65 | 65 | hwctrl(&nand_info[0], (offs >> 8) & 0xff, NAND_CTRL_ALE); /* A[11:9] */ |
66 | 66 | /* Row address */ |
67 | - hwctrl(&nand_info[0], (page_addr & 0xff), NAND_CTRL_ALE); /* A[19:12] */ | |
68 | - hwctrl(&nand_info[0], ((page_addr >> 8) & 0xff), | |
67 | + if (cmd != NAND_CMD_RNDOUT) { | |
68 | + hwctrl(&nand_info[0], (page_addr & 0xff), | |
69 | + NAND_CTRL_ALE); /* A[19:12] */ | |
70 | + hwctrl(&nand_info[0], ((page_addr >> 8) & 0xff), | |
69 | 71 | NAND_CTRL_ALE); /* A[27:20] */ |
70 | 72 | #ifdef CONFIG_SYS_NAND_5_ADDR_CYCLE |
71 | - /* One more address cycle for devices > 128MiB */ | |
72 | - hwctrl(&nand_info[0], (page_addr >> 16) & 0x0f, | |
73 | + /* One more address cycle for devices > 128MiB */ | |
74 | + hwctrl(&nand_info[0], (page_addr >> 16) & 0x0f, | |
73 | 75 | NAND_CTRL_ALE); /* A[31:28] */ |
74 | 76 | #endif |
77 | + } | |
78 | + | |
75 | 79 | hwctrl(&nand_info[0], NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE); |
76 | 80 | |
77 | 81 | if (cmd == NAND_CMD_READ0) { |