linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: gpmi: add on-flash BBT support for gpmi nand
@ 2012-07-03  8:24 Huang Shijie
  2012-07-03  8:24 ` [PATCH 2/2] mtd: gpmi: update the bitflip_threshold Huang Shijie
  2012-07-16 15:35 ` [PATCH 1/2] mtd: gpmi: add on-flash BBT support for gpmi nand Artem Bityutskiy
  0 siblings, 2 replies; 5+ messages in thread
From: Huang Shijie @ 2012-07-03  8:24 UTC (permalink / raw)
  To: linux-arm-kernel

add the on flash bbt support for gpmi nand driver.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 .../devicetree/bindings/mtd/gpmi-nand.txt          |    4 ++++
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c             |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 1a5bbd3..3fb3f90 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -12,6 +12,10 @@ Required properties:
   - interrupt-names : The interrupt names "gpmi-dma", "bch";
   - fsl,gpmi-dma-channel : Should contain the dma channel it uses.
 
+Optional properties:
+  - nand-on-flash-bbt: boolean to enable on flash bbt option if not
+                       present false
+
 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 5a90df1..a1bf31f 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -27,6 +27,7 @@
 #include <linux/pinctrl/consumer.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/of_mtd.h>
 #include "gpmi-nand.h"
 
 /* add our owner bbt descriptor */
@@ -1561,6 +1562,8 @@ static int __devinit gpmi_nfc_init(struct gpmi_nand_data *this)
 	chip->ecc.size		= 1;
 	chip->ecc.strength	= 8;
 	chip->ecc.layout	= &gpmi_hw_ecclayout;
+	if (of_get_nand_on_flash_bbt(this->dev->of_node))
+		chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
 
 	/* Allocate a temporary DMA buffer for reading ID in the nand_scan() */
 	this->bch_geometry.payload_size = 1024;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] mtd: gpmi: update the bitflip_threshold
  2012-07-03  8:24 [PATCH 1/2] mtd: gpmi: add on-flash BBT support for gpmi nand Huang Shijie
@ 2012-07-03  8:24 ` Huang Shijie
  2012-07-16 20:49   ` David Woodhouse
  2012-07-16 15:35 ` [PATCH 1/2] mtd: gpmi: add on-flash BBT support for gpmi nand Artem Bityutskiy
  1 sibling, 1 reply; 5+ messages in thread
From: Huang Shijie @ 2012-07-03  8:24 UTC (permalink / raw)
  To: linux-arm-kernel

The origin code misses to update the bitflip_threshold when
we have already get the right ecc_strength.

The patch fixes it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index a1bf31f..ed9571b 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1501,6 +1501,7 @@ static int gpmi_pre_bbt_scan(struct gpmi_nand_data  *this)
 	/* Adjust the ECC strength according to the chip. */
 	this->nand.ecc.strength = this->bch_geometry.ecc_strength;
 	this->mtd.ecc_strength = this->bch_geometry.ecc_strength;
+	this->mtd.bitflip_threshold = this->bch_geometry.ecc_strength;
 
 	/* NAND boot init, depends on the gpmi_set_geometry(). */
 	return nand_boot_init(this);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 1/2] mtd: gpmi: add on-flash BBT support for gpmi nand
  2012-07-03  8:24 [PATCH 1/2] mtd: gpmi: add on-flash BBT support for gpmi nand Huang Shijie
  2012-07-03  8:24 ` [PATCH 2/2] mtd: gpmi: update the bitflip_threshold Huang Shijie
@ 2012-07-16 15:35 ` Artem Bityutskiy
  1 sibling, 0 replies; 5+ messages in thread
From: Artem Bityutskiy @ 2012-07-16 15:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2012-07-03 at 16:24 +0800, Huang Shijie wrote:
> add the on flash bbt support for gpmi nand driver.
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>

Pushed both to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120716/e7d429b3/attachment.sig>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] mtd: gpmi: update the bitflip_threshold
  2012-07-03  8:24 ` [PATCH 2/2] mtd: gpmi: update the bitflip_threshold Huang Shijie
@ 2012-07-16 20:49   ` David Woodhouse
  2012-07-17  3:28     ` Huang Shijie
  0 siblings, 1 reply; 5+ messages in thread
From: David Woodhouse @ 2012-07-16 20:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2012-07-03 at 16:24 +0800, Huang Shijie wrote:
> The origin code misses to update the bitflip_threshold when
> we have already get the right ecc_strength.
> 
> The patch fixes it.
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com> 

Should we be pushing this for 3.5?

-- 
dwmw2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6171 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120716/56147f6f/attachment.bin>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] mtd: gpmi: update the bitflip_threshold
  2012-07-16 20:49   ` David Woodhouse
@ 2012-07-17  3:28     ` Huang Shijie
  0 siblings, 0 replies; 5+ messages in thread
From: Huang Shijie @ 2012-07-17  3:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jul 17, 2012 at 4:49 AM, David Woodhouse <dwmw2@infradead.org> wrote:
> On Tue, 2012-07-03 at 16:24 +0800, Huang Shijie wrote:
>> The origin code misses to update the bitflip_threshold when
>> we have already get the right ecc_strength.
>>
>> The patch fixes it.
>>
>> Signed-off-by: Huang Shijie <b32955@freescale.com>
>
> Should we be pushing this for 3.5?
>
I think it's not needed to push this patch for 3.5.

It's okay to merge it in 3.6.


thanks
Huang Shijie

> --
> dwmw2
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-07-17  3:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-03  8:24 [PATCH 1/2] mtd: gpmi: add on-flash BBT support for gpmi nand Huang Shijie
2012-07-03  8:24 ` [PATCH 2/2] mtd: gpmi: update the bitflip_threshold Huang Shijie
2012-07-16 20:49   ` David Woodhouse
2012-07-17  3:28     ` Huang Shijie
2012-07-16 15:35 ` [PATCH 1/2] mtd: gpmi: add on-flash BBT support for gpmi nand Artem Bityutskiy

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).