* [PATCH v3] mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC
@ 2013-11-07 10:07 Huang Shijie
2013-11-12 5:26 ` Huang Shijie
0 siblings, 1 reply; 4+ messages in thread
From: Huang Shijie @ 2013-11-07 10:07 UTC (permalink / raw)
To: dwmw2-wEGCiKHe2LqWVfeAwA7xHQ
Cc: dedekind1-Re5JQEeQqe8AvxtiuMwx3w,
computersforpeace-Re5JQEeQqe8AvxtiuMwx3w,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
t.figa-Sze3O3UU22JBDgjK7y7TUQ, 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: rebase this patch on the latest l2-mtd.
v2 -- > v3: change the descriptions.
---
.../devicetree/bindings/mtd/gpmi-nand.txt | 8 ++++++++
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 3 +++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 551b2a1..458d596 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -17,6 +17,14 @@ Required properties:
Optional properties:
- nand-on-flash-bbt: boolean to enable on flash bbt option if not
present false
+ - 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 or this property is not enabled,
+ the software may chooses an implementation-defined
+ ECC scheme.
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 8f4e5b1..b849b92 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -353,6 +353,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] 4+ messages in thread
* Re: [PATCH v3] mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC
2013-11-07 10:07 [PATCH v3] mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC Huang Shijie
@ 2013-11-12 5:26 ` Huang Shijie
2013-11-12 17:47 ` Brian Norris
0 siblings, 1 reply; 4+ messages in thread
From: Huang Shijie @ 2013-11-12 5:26 UTC (permalink / raw)
To: Huang Shijie
Cc: devicetree, dedekind1, t.figa, linux-mtd, computersforpeace,
dwmw2
于 2013年11月07日 18:07, 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@freescale.com>
> ---
> v1 --> v2: rebase this patch on the latest l2-mtd.
> v2 --> v3: change the descriptions.
> ---
> .../devicetree/bindings/mtd/gpmi-nand.txt | 8 ++++++++
> drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 3 +++
> 2 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
> index 551b2a1..458d596 100644
> --- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
> +++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
> @@ -17,6 +17,14 @@ Required properties:
> Optional properties:
> - nand-on-flash-bbt: boolean to enable on flash bbt option if not
> present false
> + - 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 or this property is not enabled,
> + the software may chooses an implementation-defined
> + ECC scheme.
>
> 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 8f4e5b1..b849b92 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -353,6 +353,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);
> }
>
Hi Brian:
Is this patch ok now? I hope it can be accepted at this merge-window.
thanks
Huang Shijie
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC
2013-11-12 5:26 ` Huang Shijie
@ 2013-11-12 17:47 ` Brian Norris
[not found] ` <CAN8TOE_-O_gxM+c4k6NXvvo=7Ozp1J187=XtK9gxfLa4LGQAWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Brian Norris @ 2013-11-12 17:47 UTC (permalink / raw)
To: Huang Shijie
Cc: Mark Rutland, devicetree@vger.kernel.org, Ian Campbell,
Pawel Moll, Artem Bityutskiy, t.figa, Stephen Warren, Rob Herring,
linux-mtd@lists.infradead.org, David Woodhouse
+ DT maintainers, since they haven't responded
On Mon, Nov 11, 2013 at 9:26 PM, Huang Shijie <b32955@freescale.com> wrote:
> 于 2013年11月07日 18:07, 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@freescale.com>
>> ---
>> v1 --> v2: rebase this patch on the latest l2-mtd.
>> v2 --> v3: change the descriptions.
>> ---
>> .../devicetree/bindings/mtd/gpmi-nand.txt | 8 ++++++++
>> drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 3 +++
>> 2 files changed, 11 insertions(+), 0 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
>> b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
>> index 551b2a1..458d596 100644
>> --- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
>> +++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
>> @@ -17,6 +17,14 @@ Required properties:
>> Optional properties:
>> - nand-on-flash-bbt: boolean to enable on flash bbt option if not
>> present false
>> + - 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 or this property is not enabled,
>> + the software may chooses an implementation-defined
>> + ECC scheme.
>>
>> 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 8f4e5b1..b849b92 100644
>> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>> @@ -353,6 +353,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);
>> }
>>
> Hi Brian:
> Is this patch ok now? I hope it can be accepted at this merge-window.
The patch is OK to me, but we haven't gotten any DT review. If we
don't get any response in a few days, I'll take it anyway.
I'm not sure about taking it in 3.13 vs. 3.14, as this is
traditionally a late merge for 3.13.
Brian
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC
[not found] ` <CAN8TOE_-O_gxM+c4k6NXvvo=7Ozp1J187=XtK9gxfLa4LGQAWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-11-13 20:46 ` Brian Norris
0 siblings, 0 replies; 4+ messages in thread
From: Brian Norris @ 2013-11-13 20:46 UTC (permalink / raw)
To: Huang Shijie
Cc: David Woodhouse,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Artem Bityutskiy, t.figa-Sze3O3UU22JBDgjK7y7TUQ,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell
On Tue, Nov 12, 2013 at 9:47 AM, Brian Norris
<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> + DT maintainers, since they haven't responded
>
> On Mon, Nov 11, 2013 at 9:26 PM, Huang Shijie <b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
>> 于 2013年11月07日 18:07, 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: rebase this patch on the latest l2-mtd.
>>> v2 --> v3: change the descriptions.
>>> ---
>>> .../devicetree/bindings/mtd/gpmi-nand.txt | 8 ++++++++
>>> drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 3 +++
>>> 2 files changed, 11 insertions(+), 0 deletions(-)
>>
>> Is this patch ok now? I hope it can be accepted at this merge-window.
>
> The patch is OK to me, but we haven't gotten any DT review. If we
> don't get any response in a few days, I'll take it anyway.
I pushed this to l2-mtd.git/next and will get it into linux-next after
the merge window closes. Let me know if there are further comments.
> I'm not sure about taking it in 3.13 vs. 3.14, as this is
> traditionally a late merge for 3.13.
Queued for 3.14.
Thanks,
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] 4+ messages in thread
end of thread, other threads:[~2013-11-13 20:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-07 10:07 [PATCH v3] mtd: gpmi: add a new DT property to use the datasheet's minimum required ECC Huang Shijie
2013-11-12 5:26 ` Huang Shijie
2013-11-12 17:47 ` Brian Norris
[not found] ` <CAN8TOE_-O_gxM+c4k6NXvvo=7Ozp1J187=XtK9gxfLa4LGQAWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-13 20:46 ` Brian Norris
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).