]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00173947-1 mtd/gpmi : add BBT support to gpmi nand driver
authorHuang Shijie <b32955@freescale.com>
Mon, 30 Jan 2012 03:34:03 +0000 (11:34 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:10:49 +0000 (14:10 +0200)
Add a new field to gpmi_nand_platform_data{}.
Make the BBT support to board specific.

Signed-off-by: Huang Shijie <b32955@freescale.com>
drivers/mtd/nand/gpmi-nand/gpmi-nand.c
include/linux/mtd/gpmi-nand.h

index e7edca6c33e15957e2e427f574269c1e8a964e08..ea3ce22ff9d56b761465535c6667032cb5c8eefa 100644 (file)
@@ -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->options |= NAND_BBT_USE_FLASH | NAND_USE_FLASH_BBT_NO_OOB;
 
        /* Allocate a temporary DMA buffer for reading ID in the nand_scan() */
        this->bch_geometry.payload_size = 1024;
index 69b6dbf46b5edd4700aec7343b2c589702ef118e..6659446591ec596c75af6bcfd494cb4d34d532ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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;
+       unsigned int    enable_bbt:1;
 };
 #endif