u-boot-brain/drivers/mtd
David Brownell 7e86661cd7 NAND: fix "raw" reads with ECC syndrome layouts
The syndrome based page read/write routines store ECC, and possibly other
"OOB" data, right after each chunk of ECC'd data.  With ECC chunk size of
512 bytes and a large page (2KiB) NAND, the layout is:

  data-0 OOB-0 data-1 OOB-1 data-2 OOB-2 data-3 OOB-3 OOB-leftover

Where OOBx is (prepad, ECC, postpad).  However, the current "raw" routines
use a traditional layout -- data OOB, disregarding the prepad and postpad
values -- so when they're used with that type of ECC hardware, those calls
mix up the data and OOB.  Which means, in particular, that bad block
tables won't be found on startup, with data corruption and related chaos
ensuing.

The current syndrome-based drivers in mainline all seem to use one chunk
per page; presumably they haven't noticed such bugs.

Fix this, by adding read/write page_raw_syndrome() routines as siblings of
the existing non-raw routines; "raw" just means to bypass the ECC
computations, not change data and OOB layout.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-11-13 16:56:17 -06:00
..
nand NAND: fix "raw" reads with ECC syndrome layouts 2009-11-13 16:56:17 -06:00
onenand s5pc1xx: support onenand driver 2009-10-13 21:13:55 -05:00
spi sf: add GPL-2 license info 2009-10-24 22:44:18 +02:00
ubi UBI: Fix build problem noticed on Apollon (arm/testing repo) 2009-07-07 16:33:44 +02:00
at45.c drivers/mtd: Move conditional compilation to Makefile 2008-08-13 01:40:42 +02:00
cfi_flash.c cfi: Add weak default function for flash_cmd_reset() 2009-10-28 11:34:14 +01:00
cfi_mtd.c mtd: cfi - if defined, use MAX_FLASH_BANKS_DETECT for static declarations 2009-07-16 15:27:45 +02:00
dataflash.c mtd/dataflash.c: fix a problem with the last partition 2008-12-02 21:53:24 +01:00
jedec_flash.c Support up to 7 banks for ids as specified in JEDEC JEP106Z 2009-08-26 08:58:27 +02:00
Makefile mtd: Introduce CONFIG_MTD_DEVICE to select compilation of mtdcore.o 2009-06-12 20:45:47 +02:00
mtdconcat.c mtd: Add MTD concat support to concatenate multiple MTD NOR devices 2009-06-12 20:45:47 +02:00
mtdcore.c mtd: Remove a printf() from add_mtd_device(). 2008-11-24 11:29:53 +01:00
mtdpart.c mtd: Update MTD infrastructure to support 64bit device size 2009-06-12 20:45:47 +02:00
mw_eeprom.c Update i386 code (sc520_cdp) 2008-09-09 11:48:53 +02:00