From patchwork Tue Jan 31 11:11:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 138763 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (unknown [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8D32FB6FA0 for ; Tue, 31 Jan 2012 23:05:31 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RsBbP-00036G-Mf; Tue, 31 Jan 2012 11:10:19 +0000 Received: from tx2ehsobe003.messaging.microsoft.com ([65.55.88.13] helo=TX2EHSOBE002.bigfish.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RsBbM-00033z-F1; Tue, 31 Jan 2012 11:10:16 +0000 Received: from mail82-tx2-R.bigfish.com (10.9.14.241) by TX2EHSOBE002.bigfish.com (10.9.40.22) with Microsoft SMTP Server id 14.1.225.23; Tue, 31 Jan 2012 11:10:14 +0000 Received: from mail82-tx2 (localhost [127.0.0.1]) by mail82-tx2-R.bigfish.com (Postfix) with ESMTP id B99CA14026C; Tue, 31 Jan 2012 11:10:14 +0000 (UTC) X-SpamScore: 3 X-BigFish: VS3(zzzz1202h1082kzz8275bhz2dhc1bhc31hc1ah2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail82-tx2 (localhost.localdomain [127.0.0.1]) by mail82-tx2 (MessageSwitch) id 1328008213407086_26421; Tue, 31 Jan 2012 11:10:13 +0000 (UTC) Received: from TX2EHSMHS034.bigfish.com (unknown [10.9.14.241]) by mail82-tx2.bigfish.com (Postfix) with ESMTP id 5D64D240045; Tue, 31 Jan 2012 11:10:13 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS034.bigfish.com (10.9.99.134) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 31 Jan 2012 11:10:11 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.355.3; Tue, 31 Jan 2012 05:10:11 -0600 Received: from localhost.ap.freescale.net (udp161149uds.ap.freescale.net [10.192.242.25]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id q0VBA8wb003199; Tue, 31 Jan 2012 05:10:08 -0600 (CST) From: Huang Shijie To: Subject: [PATCH v3] mtd/gpmi : add BBT support to gpmi nand driver Date: Tue, 31 Jan 2012 19:11:56 +0800 Message-ID: <1328008316-27258-1-git-send-email-b32955@freescale.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [65.55.88.13 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: marek.vasut@gmail.com, linux-mtd@lists.infradead.org, w.sang@pengutronix.de, linux-arm-kernel@lists.infradead.org, Huang Shijie X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add a new field to gpmi_nand_platform_data{}. Make the BBT support to board specific. Signed-off-by: Huang Shijie Reviewed-by: Wolfram Sang --- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 2 ++ include/linux/mtd/gpmi-nand.h | 2 ++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 493ec2f..4d369df 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c @@ -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; diff --git a/include/linux/mtd/gpmi-nand.h b/include/linux/mtd/gpmi-nand.h index 69b6dbf..04ab366 100644 --- a/include/linux/mtd/gpmi-nand.h +++ b/include/linux/mtd/gpmi-nand.h @@ -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