aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2013-11-07 05:07:38 -0500
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:47:11 -0400
commit2fad0e34c5adbddf3d73e25fc42222a0ceabd5dd (patch)
tree1e8b43a890f6f99494eac64bdbdc0002d19a7719 /drivers/mtd/nand/gpmi-nand/gpmi-nand.c
parent0f67f4e72addd7a4a6a4f04238d4db6a24397cd3 (diff)
mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC
In default way, we use the ecc_strength/ecc_step size calculated by ourselves and use all the OOB area. This patch adds a new property : "fsl,use-minimum-ecc" If we enable it, we will firstly try to use the datasheet's minimum required ECC provided by the MTD layer (the ecc_strength_ds/ecc_step_ds fields in the nand_chip{}). So we may have free space in the OOB area by using the minimum ECC, and we may support JFFS2 with some SLC NANDs, such as Micron's SLC NAND. If we fail to use the minimum ECC, we will use the legacy method to calculate the ecc_strength and ecc_step size. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/nand/gpmi-nand/gpmi-nand.c')
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 5204b478a59b..739f131e572c 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -352,6 +352,9 @@ static int legacy_set_geometry(struct gpmi_nand_data *this)
352 352
353int common_nfc_set_geometry(struct gpmi_nand_data *this) 353int common_nfc_set_geometry(struct gpmi_nand_data *this)
354{ 354{
355 if (of_property_read_bool(this->dev->of_node, "fsl,use-minimum-ecc")
356 && set_geometry_by_ecc_info(this))
357 return 0;
355 return legacy_set_geometry(this); 358 return legacy_set_geometry(this);
356} 359}
357 360