Skip to contentSkip to conversation

mtd: gpmi: add on-flash BBT support for gpmi nand

PATCH New Huang Shijie 4 participants 5 messages Jul 3, 2012 – Jul 17, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mtd: gpmi: add on-flash BBT support for gpmi nand

add the on flash bbt support for gpmi nand driver.

---
 .../devicetree/bindings/mtd/gpmi-nand.txt          |    4 ++++
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c             |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/mtd/gpmi-nand.txt +4 -0
index 1a5bbd3..3fb3f90 100644
@@ -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.
 
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +3 -0
index 5a90df1..a1bf31f 100644
@@ -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;
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 2/2 mtd: gpmi: update the bitflip_threshold

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

The patch fixes it.

---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +1 -0
index a1bf31f..ed9571b 100644
@@ -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);
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 2/2 mtd: gpmi: update the bitflip_threshold

Quoted 6 lines · Huang Shijie

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

The patch fixes it.

Should we be pushing this for 3.5?

Signature · 8 lines
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>
#3 lore raw

PATCH 2/2 mtd: gpmi: update the bitflip_threshold

Quoted 10 lines · David Woodhouse
Quoted 6 lines · Huang Shijie

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

The patch fixes it.

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

Quoted 8 lines

--
dwmw2

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

#4 lore raw

PATCH 1/2 mtd: gpmi: add on-flash BBT support for gpmi nand

In reply to Huang Shijie
Quoted 3 lines · Huang Shijie

add the on flash bbt support for gpmi nand driver.

Pushed both to l2-mtd.git, thanks!

Signature · 9 lines
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>