* [PATCH v2] mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC @ 2013-10-28 3:05 Huang Shijie [not found] ` <1382929517-22606-1-git-send-email-b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Huang Shijie @ 2013-10-28 3:05 UTC (permalink / raw) To: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ Cc: dedekind1-Re5JQEeQqe8AvxtiuMwx3w, computersforpeace-Re5JQEeQqe8AvxtiuMwx3w, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree-u79uwXL29TY76Z2rM5mHXA, 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_strength and ecc_step size. Signed-off-by: Huang Shijie <b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org> --- 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(-) diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt index 551b2a1..4297795 100644 --- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt +++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt @@ -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. diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 7ac2280..3ec55d0 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) 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); } -- 1.7.2.rc3 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 5+ messages in thread
[parent not found: <1382929517-22606-1-git-send-email-b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org>]
* Re: [PATCH v2] mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC [not found] ` <1382929517-22606-1-git-send-email-b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org> @ 2013-11-05 6:19 ` Huang Shijie 2013-11-05 20:07 ` Brian Norris 1 sibling, 0 replies; 5+ messages in thread From: Huang Shijie @ 2013-11-05 6:19 UTC (permalink / raw) To: Huang Shijie Cc: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ, dedekind1-Re5JQEeQqe8AvxtiuMwx3w, computersforpeace-Re5JQEeQqe8AvxtiuMwx3w, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree-u79uwXL29TY76Z2rM5mHXA 于 2013年10月28日 11:05, 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_strength and ecc_step size. > > Signed-off-by: Huang Shijie <b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org> > --- > 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(-) > > diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt > index 551b2a1..4297795 100644 > --- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt > +++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt > @@ -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. > diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c > index 7ac2280..3ec55d0 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) > > 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 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC [not found] ` <1382929517-22606-1-git-send-email-b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org> 2013-11-05 6:19 ` Huang Shijie @ 2013-11-05 20:07 ` Brian Norris [not found] ` <20131105200729.GT20061-bU/DPfM3abD4WzifrMjOTkcViWtcw2C0@public.gmane.org> 1 sibling, 1 reply; 5+ messages in thread From: Brian Norris @ 2013-11-05 20:07 UTC (permalink / raw) To: Huang Shijie Cc: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ, dedekind1-Re5JQEeQqe8AvxtiuMwx3w, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree-u79uwXL29TY76Z2rM5mHXA On Mon, Oct 28, 2013 at 11:05:17AM +0800, Huang Shijie wrote: > 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-KZfg59tc24xl57MIdRCFDg@public.gmane.org> > --- > 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(-) > > diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt > index 551b2a1..4297795 100644 > --- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt > +++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt > @@ -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? > > The 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20131105200729.GT20061-bU/DPfM3abD4WzifrMjOTkcViWtcw2C0@public.gmane.org>]
* Re: [PATCH v2] mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC [not found] ` <20131105200729.GT20061-bU/DPfM3abD4WzifrMjOTkcViWtcw2C0@public.gmane.org> @ 2013-11-06 2:39 ` Huang Shijie 2013-11-06 14:39 ` Tomasz Figa 1 sibling, 0 replies; 5+ messages in thread From: Huang Shijie @ 2013-11-06 2:39 UTC (permalink / raw) To: Brian Norris Cc: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ, dedekind1-Re5JQEeQqe8AvxtiuMwx3w, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree-u79uwXL29TY76Z2rM5mHXA 于 2013年11月06日 04:07, 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 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC [not found] ` <20131105200729.GT20061-bU/DPfM3abD4WzifrMjOTkcViWtcw2C0@public.gmane.org> 2013-11-06 2:39 ` Huang Shijie @ 2013-11-06 14:39 ` Tomasz Figa 1 sibling, 0 replies; 5+ messages in thread From: Tomasz Figa @ 2013-11-06 14:39 UTC (permalink / raw) To: Brian Norris Cc: Huang Shijie, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ, dedekind1-Re5JQEeQqe8AvxtiuMwx3w, linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, devicetree-u79uwXL29TY76Z2rM5mHXA Hi, On Tuesday 05 of November 2013 12:07:29 Brian Norris wrote: > On Mon, Oct 28, 2013 at 11:05:17AM +0800, Huang Shijie wrote: > > 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-KZfg59tc24xl57MIdRCFDg@public.gmane.org> > > --- > > 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(-) > > > > diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt > > index 551b2a1..4297795 100644 > > --- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt > > +++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt > > @@ -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. 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-11-06 14:39 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-10-28 3:05 [PATCH v2] mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC Huang Shijie [not found] ` <1382929517-22606-1-git-send-email-b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org> 2013-11-05 6:19 ` Huang Shijie 2013-11-05 20:07 ` Brian Norris [not found] ` <20131105200729.GT20061-bU/DPfM3abD4WzifrMjOTkcViWtcw2C0@public.gmane.org> 2013-11-06 2:39 ` Huang Shijie 2013-11-06 14:39 ` Tomasz Figa
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).