summaryrefslogtreecommitdiff
path: root/include/linux/platform_data/elm.h
diff options
context:
space:
mode:
authorPhilip Avinash <avinashphilip@ti.com>2013-01-04 13:26:51 +0530
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-02-04 09:26:29 +0200
commit62116e5171e00f85a8d53f76e45b84423c89ff34 (patch)
treed7b4b6c16ce14c991bcb4473a209f6a8e44da874 /include/linux/platform_data/elm.h
parentbf22433575ef30a4807f0620498017df0f27df67 (diff)
mtd: nand: omap2: Support for hardware BCH error correction.
ELM module can be used for hardware error correction of BCH 4 & 8 bit. ELM module functionality is verified by checking the availability of handle for ELM module in device tree. Hence supporting 1. ELM module available, BCH error correction done by ELM module. Also support read & write page in one shot by adding custom read_page and write_page methods. This helps in optimizing code for NAND flashes with page size less than 4 KB. 2. If ELM module not available fall back to software BCH error correction support. New structure member is added to omap_nand_info 1. "is_elm_used" to know the status of whether the ELM module is used for error correction or not. 2. "elm_dev" device pointer to elm device on detection of ELM module. Also being here update the device tree documentation of gpmc-nand for adding optional property elm_id. Note: ECC layout uses 1 extra bytes for 512 byte of data to handle erased pages. Extra byte programmed to zero for programmed pages. Also BCH8 requires 14 byte ecc to maintain compatibility with RBL ECC layout. This results a common ecc layout across RBL, U-boot & Linux with BCH8. Signed-off-by: Philip Avinash <avinashphilip@ti.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'include/linux/platform_data/elm.h')
-rw-r--r--include/linux/platform_data/elm.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/platform_data/elm.h b/include/linux/platform_data/elm.h
index 11ab6aaf2431..1bd5244d1dcd 100644
--- a/include/linux/platform_data/elm.h
+++ b/include/linux/platform_data/elm.h
@@ -30,7 +30,8 @@ enum bch_ecc {
#define BCH4_ECC_OOB_BYTES 7
/* RBL requires 14 byte even though BCH8 uses only 13 byte */
#define BCH8_SIZE (BCH8_ECC_OOB_BYTES + 1)
-#define BCH4_SIZE (BCH4_ECC_OOB_BYTES)
+/* Uses 1 extra byte to handle erased pages */
+#define BCH4_SIZE (BCH4_ECC_OOB_BYTES + 1)
/**
* struct elm_errorvec - error vector for elm