2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-25 21:54:06 +08:00
linux-next/drivers/mtd/nand
Brian Norris 9ce244b3fb mtd: support writing OOB without ECC
This fixes issues with `nandwrite -n -o' and the MEMWRITEOOB[64] ioctls
on hardware that writes ECC when writing OOB. The problem arises as
follows: `nandwrite -n' can write page data to flash without applying
ECC, but when used with the `-o' option, ECC is applied (incorrectly),
contrary to the `--noecc' option.

I found that this is the case because my hardware computes and writes
ECC data to flash upon either OOB write or page write. Thus, to support
a proper "no ECC" write, my driver must know when we're performing a raw
OOB write vs. a normal ECC OOB write. However, MTD does not pass any raw
mode information to the write_oob functions.  This patch addresses the
problems by:

1) Passing MTD_OOB_RAW down to lower layers, instead of just defaulting
   to MTD_OOB_PLACE
2) Handling MTD_OOB_RAW within the NAND layer's `nand_do_write_oob'
3) Adding a new (replaceable) function pointer in struct ecc_ctrl; this
   function should support writing OOB without ECC data. Current
   hardware often can use the same OOB write function when writing
   either with or without ECC

This was tested with nandsim as well as on actual SLC NAND.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Jim Quinlan <jim2101024@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
2011-09-11 15:02:18 +03:00
..
gpmi-nand mtd: add the common code for GPMI-NAND controller driver 2011-09-11 15:02:18 +03:00
alauda.c mtd: convert remaining users to mtd_device_register() 2011-05-25 02:25:00 +01:00
ams-delta.c mtd: convert remaining users to mtd_device_register() 2011-05-25 02:25:00 +01:00
atmel_nand_ecc.h [ARM] 5265/3: [AT91] Add copyright info 2008-09-21 23:01:18 +01:00
atmel_nand.c mtd: atmel_nand: optimize read/write buffer functions 2011-09-11 15:02:15 +03:00
au1550nd.c mtd: spelling, capitalization, uniformity 2011-09-11 15:02:13 +03:00
autcpu12.c mtd: nand: rename NAND_USE_FLASH_BBT 2011-09-11 15:01:56 +03:00
bcm_umi_bch.c mtd: add bcmring nand driver 2009-10-20 10:07:23 +09:00
bcm_umi_nand.c mtd: bcm_umi_nand: clean up error handling code 2011-09-11 15:02:17 +03:00
bf5xx_nand.c mtd: bf5xx_nand: convert to mtd_device_register() 2011-05-25 02:23:15 +01:00
cafe_nand.c mtd: spelling, capitalization, uniformity 2011-09-11 15:02:13 +03:00
cmx270_nand.c mtd: cmx270_nand.c: use mtd_device_parse_register 2011-09-11 15:02:08 +03:00
cs553x_nand.c mtd: cs553x_nand.c: use mtd_device_parse_register 2011-09-11 15:02:08 +03:00
davinci_nand.c mtd: davinci_nand.c: use mtd_device_parse_register 2011-09-11 15:02:08 +03:00
denali.c mtd: denali: detect the number of banks before resetting NAND 2011-09-11 15:02:04 +03:00
denali.h mtd: denali: detect the number of banks 2011-05-25 02:02:12 +01:00
diskonchip.c mtd: spelling, capitalization, uniformity 2011-09-11 15:02:13 +03:00
fsl_elbc_nand.c mtd: eLBC NAND: update ecc_stats.corrected when lteccr available 2011-09-11 15:02:17 +03:00
fsl_upm.c mtd: fsl_upm: fix a memory leak in fun_chip_init error path 2011-09-11 15:02:14 +03:00
fsmc_nand.c mtd: fsmc_nand.c: use mtd_device_parse_register 2011-09-11 15:02:08 +03:00
gpio.c mtd: convert remaining users to mtd_device_register() 2011-05-25 02:25:00 +01:00
h1910.c mtd: h1910.c: use mtd_device_parse_register 2011-09-11 15:02:08 +03:00
jz4740_nand.c mtd: jz4740_nand.c: use mtd_device_parse_register 2011-09-11 15:02:08 +03:00
Kconfig mtd: add GPMI-NAND driver in the config and Makefile 2011-09-11 15:02:18 +03:00
Makefile mtd: add GPMI-NAND driver in the config and Makefile 2011-09-11 15:02:18 +03:00
mpc5121_nfc.c mtd: mpc5121_nfc.c: use mtd_device_parse_register 2011-09-11 15:02:12 +03:00
mxc_nand.c mtd: mxc_nand: add mx53 NFC driver support 2011-09-11 15:02:17 +03:00
nand_base.c mtd: support writing OOB without ECC 2011-09-11 15:02:18 +03:00
nand_bbt.c mtd: replace DEBUG() with pr_debug() 2011-09-11 15:02:16 +03:00
nand_bch.c mtd: cleanup style on pr_debug messages 2011-09-11 15:02:16 +03:00
nand_bcm_umi.c mtd: add bcmring nand driver 2009-10-20 10:07:23 +09:00
nand_bcm_umi.h mtd: nand_bcm: fix hot spin and code duplication 2010-02-26 16:56:35 +00:00
nand_ecc.c mtd: spelling, capitalization, uniformity 2011-09-11 15:02:13 +03:00
nand_ids.c mtd: nand: support new Toshiba SLC 2010-10-24 23:38:30 +01:00
nandsim.c mtd: nand: rename NAND_USE_FLASH_BBT 2011-09-11 15:01:56 +03:00
ndfc.c mtd: ndfc.c: use mtd_device_parse_register 2011-09-11 15:02:12 +03:00
nomadik_nand.c mtd: nomadik_nand: add missing nand_release in nomadik_nand_remove 2011-09-11 15:01:59 +03:00
nuc900_nand.c mtd: nuc900_nand: add missing nand_release in nuc900_nand_remove 2011-09-11 15:01:58 +03:00
omap2.c mtd: cleanup style on pr_debug messages 2011-09-11 15:02:16 +03:00
orion_nand.c mtd: orion_nand.c: use mtd_device_parse_register 2011-09-11 15:02:09 +03:00
pasemi_nand.c mtd: nand: rename NAND_USE_FLASH_BBT 2011-09-11 15:01:56 +03:00
plat_nand.c mtd: plat_nand.c: use mtd_device_parse_register 2011-09-11 15:02:09 +03:00
ppchameleonevb.c mtd: ppchameleonevb.c: use mtd_device_parse_register 2011-09-11 15:02:09 +03:00
pxa3xx_nand.c mtd: pxa3xx_nand: enable multiple chip select support 2011-09-11 15:02:15 +03:00
r852.c Fix common misspellings 2011-03-31 11:26:23 -03:00
r852.h mtd: r852: remove useless pci powerup/down from suspend/resume routines 2010-10-25 01:32:21 +01:00
rtc_from4.c mtd: replace DEBUG() with pr_debug() 2011-09-11 15:02:16 +03:00
s3c2410.c mtd: s3c2410 nand: Remove uncessary null check 2011-09-11 15:02:17 +03:00
sh_flctl.c mtd: convert remaining users to mtd_device_register() 2011-05-25 02:25:00 +01:00
sharpsl.c mtd: sharpsl.c: use mtd_device_parse_register 2011-09-11 15:02:09 +03:00
sm_common.c mtd: convert remaining users to mtd_device_register() 2011-05-25 02:25:00 +01:00
sm_common.h mtd: sm_common: split smartmedia and xD table 2010-05-14 01:03:46 +01:00
socrates_nand.c mtd: socrates_nand.c: use mtd_device_parse_register 2011-09-11 15:02:13 +03:00
spia.c mtd: convert remaining users to mtd_device_register() 2011-05-25 02:25:00 +01:00
tmio_nand.c mtd: tmio_nand.c: use mtd_device_parse_register 2011-09-11 15:02:09 +03:00
txx9ndfmc.c mtd: txx9ndfmc.c: use mtd_device_parse_register 2011-09-11 15:02:09 +03:00