mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC
Subsystems (3)
PATCH v2 1/1 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.
---
v1 --> v2:
based on David's patch to fix the regression.
--- .../devicetree/bindings/mtd/gpmi-nand.txt | 6 ++++++ drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 3 +++ 2 files changed, 9 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/mtd/gpmi-nand.txt +6 -0
@@ -17,6 +17,12 @@ Required properties: Optional properties: - nand-on-flash-bbt: boolean to enable on flash bbt option if not present false + - fsl,use-minimum-ecc: By enabling this boolean property, the gpmi will 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. The device tree may optionally contain sub-nodes describing partitions of the address space. See partition.txt for more detail.
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +3 -0
@@ -352,6 +352,9 @@ static int legacy_set_geometry(struct gpmi_nand_data *this)int common_nfc_set_geometry (struct gpmi_nand_data *this) { +if (of_property_read_bool (this->dev->of_node,"fsl,use-minimum-ecc" ) + &&set_geometry_by_ecc_info (this)) +return 0 ;return legacy_set_geometry (this); }
Signature · 7 lines
1.7.2.rc3 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 45 lines · Huang Shijie
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_strengthandecc_stepsize.Signed-off-by Huang Shijie <[email protected]>---
v1 --> v2:
based on David's patch to fix the regression.--- .../devicetree/bindings/mtd/gpmi-nand.txt | 6 ++++++ drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 3 +++ 2 files changed, 9 insertions(+), 0 deletions(-)Documentation/devicetree/bindings/mtd/gpmi-nand.txt +6
-0@@ -17,6 +17,12 @@ Required properties: Optional properties: - nand-on-flash-bbt: boolean to enable on flash bbt option if not present false + - fsl,use-minimum-ecc: By enabling this boolean property, the gpmi will 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. The device tree may optionally contain sub-nodes describing partitions of the address space. See partition.txt for more detail.drivers/mtd/nand/gpmi-nand/gpmi-nand.c +0
-0
drivers/mtd/nand/gpmi-nand/gpmi-nand.c static int legacy_set_geometry(struct gpmi_nand_data *this) · line 360
Quoted 9 lines
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +3
-0@@ -352,6 +352,9 @@ static int legacy_set_geometry(struct gpmi_nand_data *this)int common_nfc_set_geometry (struct gpmi_nand_data *this) { +if (of_property_read_bool (this->dev->of_node,"fsl,use-minimum-ecc" ) + &&set_geometry_by_ecc_info (this)) +return 0 ;return legacy_set_geometry (this); }
any comment about this patch?
thanks
Huang Shijie
Quoted 28 lines · Huang Shijie
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_strengthandecc_stepsize.Signed-off-by Huang Shijie <[email protected]>---
v1 --> v2:
based on David's patch to fix the regression.--- .../devicetree/bindings/mtd/gpmi-nand.txt | 6 ++++++ drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 3 +++ 2 files changed, 9 insertions(+), 0 deletions(-)Documentation/devicetree/bindings/mtd/gpmi-nand.txt +0
-0
Documentation/devicetree/bindings/mtd/gpmi-nand.txt Required properties: · line 25
Quoted 9 lines
Documentation/devicetree/bindings/mtd/gpmi-nand.txt +6
-0@@ -17,6 +17,12 @@ Required properties: Optional properties: - nand-on-flash-bbt: boolean to enable on flash bbt option if not present false + - fsl,use-minimum-ecc: By enabling this boolean property, the gpmi will 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.
This description still uses Linux-isms/MTD-isms (ecc_strength_ds, ecc_step_ds, nand_chip{}, JFFS2). I would personally write this as something like the following:
- fsl,use-minimum-ecc: Protect this NAND flash with the minimum ECC strength required. The required ECC strength is automatically discoverable for some flash (e.g., according to the ONFI standard). However, note that if this strength is not discoverable, the software may choose an implementation-defined ECC scheme.
Is that enough weaseling? Any comments from the DT folks, or shall we simply take this binding without review?
Documentation/devicetree/bindings/mtd/gpmi-nand.txt Required properties: · line 28
Quoted 3 lines
Documentation/devicetree/bindings/mtd/gpmi-nand.txt +0
-0The device tree may optionally contain sub-nodes describing partitions of the address space. See partition.txt for more detail.
...
Brian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 11 lines · Brian Norris
This description still uses Linux-isms/MTD-isms (
ecc_strength_ds,ecc_step_ds, nand_chip{}, JFFS2). I would personally write this as something like the following:- fsl,use-minimum-ecc: Protect this NAND flash with the minimum ECC strength required. The required ECC strength is automatically discoverable for some flash (e.g., according to the ONFI standard). However, note that if this strength is not discoverable, the software may choose an implementation-defined ECC scheme.
this description is better then mine.
thanks
Huang Shijie
Hi,
Quoted 43 lines · On Tuesday 05 of November 2013 12:07:29 Brian Norris wrote:
Quoted 28 lines · Huang Shijie
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_strengthandecc_stepsize.Signed-off-by Huang Shijie <[email protected]>---
v1 --> v2:
based on David's patch to fix the regression.--- .../devicetree/bindings/mtd/gpmi-nand.txt | 6 ++++++ drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 3 +++ 2 files changed, 9 insertions(+), 0 deletions(-)Documentation/devicetree/bindings/mtd/gpmi-nand.txt +0
-0Documentation/devicetree/bindings/mtd/gpmi-nand.txt Required properties: · line 25
Quoted 9 lines
Documentation/devicetree/bindings/mtd/gpmi-nand.txt +6
-0@@ -17,6 +17,12 @@ Required properties: Optional properties: - nand-on-flash-bbt: boolean to enable on flash bbt option if not present false + - fsl,use-minimum-ecc: By enabling this boolean property, the gpmi will 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.This description still uses Linux-isms/MTD-isms (
ecc_strength_ds,ecc_step_ds, nand_chip{}, JFFS2). I would personally write this as something like the following:
Quoted 7 lines
- fsl,use-minimum-ecc: Protect this NAND flash with the minimum ECC strength required. The required ECC strength is automatically discoverable for some flash (e.g., according to the ONFI standard). However, note that if this strength is not discoverable, the software may choose an implementation-defined ECC scheme.
After reading this description, it is not clear to me what is the default behavior if this property is not present.
Best regards,
Tomasz
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html