summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
diff options
context:
space:
mode:
authorHuang Shijie2013-01-25 07:04:07 +0100
committerArtem Bityutskiy2013-02-04 09:27:59 +0100
commit9ff16f0833806b6b59aaf0cc158fa6e42f24d7e4 (patch)
tree179db9e57e721cb0c779b97bbfc9d7a6db8c27dc /drivers/mtd/nand/gpmi-nand/gpmi-nand.c
parentmtd: devices: elm: Removes <xx> literals in elm DT node (diff)
downloadkernel-qcow2-linux-9ff16f0833806b6b59aaf0cc158fa6e42f24d7e4.tar.gz
kernel-qcow2-linux-9ff16f0833806b6b59aaf0cc158fa6e42f24d7e4.tar.xz
kernel-qcow2-linux-9ff16f0833806b6b59aaf0cc158fa6e42f24d7e4.zip
mtd: gpmi: set the Golois Field bit for mx6q's BCH
The GF13 can be only used in the following case: The ECC data chunk is less then 1K bytes. In mx23/mx28, the ecc data chunk is 512 bytes. So it is okay. But in mx6q, we begin to use some large nand chip whose ecc data chunk maybe 1K bytes long. So when the data chunk is 1K bytes, we have to use the GF14. This patch sets the Golois Field bit when the GF14 is needed. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/nand/gpmi-nand/gpmi-nand.c')
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 38c8b8bfc428..25216785f180 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -112,10 +112,12 @@ int common_nfc_set_geometry(struct gpmi_nand_data *this)
/* The default for the length of Galois Field. */
geo->gf_len = 13;
- /* The default for chunk size. There is no oobsize greater then 512. */
+ /* The default for chunk size. */
geo->ecc_chunk_size = 512;
- while (geo->ecc_chunk_size < mtd->oobsize)
+ while (geo->ecc_chunk_size < mtd->oobsize) {
geo->ecc_chunk_size *= 2; /* keep C >= O */
+ geo->gf_len = 14;
+ }
geo->ecc_chunk_count = mtd->writesize / geo->ecc_chunk_size;