Skip to contentSkip to conversation

mtd/gpmi : add BBT support to gpmi nand driver

PATCH Superseded Huang Shijie 2 participants 2 messages Jan 31, 2012

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mtd/gpmi : add BBT support to gpmi nand driver

Add a new field to gpmi_nand_platform_data{}.
Make the BBT support to board specific.

---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 ++
 include/linux/mtd/gpmi-nand.h          |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/mtd/nand/gpmi-nand/gpmi-nand.c +2 -0
index 493ec2f..4d369df 100644
@@ -1493,6 +1493,8 @@ static int __devinit gpmi_nfc_init(struct gpmi_nand_data *this)
 	chip->ecc.mode		= NAND_ECC_HW;
 	chip->ecc.size		= 1;
 	chip->ecc.layout	= &gpmi_hw_ecclayout;
+	if (pdata->enable_bbt)
+		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;
include/linux/mtd/gpmi-nand.h +2 -0
index 69b6dbf..12078c9 100644
@@ -51,6 +51,7 @@
  * @partitions:              An optional pointer to an array of partition
  *                           descriptions.
  * @partition_count:         The number of elements in the partitions array.
+ * @enable_bbt:              Enable the BBT or not.
  */
 struct gpmi_nand_platform_data {
 	/* SoC hardware information. */
@@ -64,5 +65,6 @@ struct gpmi_nand_platform_data {
 	/* Medium information. */
 	struct		mtd_partition *partitions;
 	unsigned	partition_count;
+	int		enable_bbt;
 };
 #endif
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH v2 1/1 mtd/gpmi : add BBT support to gpmi nand driver

Quoted 4 lines · Huang Shijie

Add a new field to gpmi_nand_platform_data{}.
Make the BBT support to board specific.

Much better :)

include/linux/mtd/gpmi-nand.h struct gpmi_nand_platform_data { · line 68

Quoted 5 lines
include/linux/mtd/gpmi-nand.h +1 -0
@@ -64,5 +65,6 @@ struct gpmi_nand_platform_data {
 	/* Medium information. */
 	struct		mtd_partition *partitions;
 	unsigned	partition_count;
+	int		enable_bbt;

Bitfield? (check imx for example)

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120131/372991b5/attachment.sig>