From patchwork Tue Jan 31 10:38:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 138762 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 94BF01007D2 for ; Tue, 31 Jan 2012 23:05:07 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RsB50-0006wW-ME; Tue, 31 Jan 2012 10:36:50 +0000 Received: from tx2ehsobe001.messaging.microsoft.com ([65.55.88.11] helo=TX2EHSOBE006.bigfish.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RsB4t-0006vx-NF; Tue, 31 Jan 2012 10:36:44 +0000 Received: from mail53-tx2-R.bigfish.com (10.9.14.239) by TX2EHSOBE006.bigfish.com (10.9.40.26) with Microsoft SMTP Server id 14.1.225.23; Tue, 31 Jan 2012 10:36:40 +0000 Received: from mail53-tx2 (localhost [127.0.0.1]) by mail53-tx2-R.bigfish.com (Postfix) with ESMTP id AB6CFE03AA; Tue, 31 Jan 2012 10:36:40 +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 mail53-tx2 (localhost.localdomain [127.0.0.1]) by mail53-tx2 (MessageSwitch) id 1328006199598987_8394; Tue, 31 Jan 2012 10:36:39 +0000 (UTC) Received: from TX2EHSMHS038.bigfish.com (unknown [10.9.14.250]) by mail53-tx2.bigfish.com (Postfix) with ESMTP id 8B2532E0047; Tue, 31 Jan 2012 10:36:39 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS038.bigfish.com (10.9.99.138) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 31 Jan 2012 10:36:38 +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 04:36:38 -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 q0VAaZrG020021; Tue, 31 Jan 2012 04:36:36 -0600 (CST) From: Huang Shijie To: Subject: [PATCH v2] mtd/gpmi : add BBT support to gpmi nand driver Date: Tue, 31 Jan 2012 18:38:23 +0800 Message-ID: <1328006303-26844-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.11 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 --- 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..12078c9 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; + int enable_bbt; }; #endif