From patchwork Fri Sep 18 21:10:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mark A. Greer" X-Patchwork-Id: 48661 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8ILCHHD014241 for ; Fri, 18 Sep 2009 21:12:18 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8ILAE1K029667; Fri, 18 Sep 2009 16:10:14 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id n8ILAD10010597; Fri, 18 Sep 2009 16:10:14 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 4F62D80627; Fri, 18 Sep 2009 16:10:13 -0500 (CDT) X-Original-To: Davinci-linux-open-source@linux.davincidsp.com Delivered-To: Davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 1B01980626 for ; Fri, 18 Sep 2009 16:10:10 -0500 (CDT) Received: from neches.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id n8ILA9H4012716 for ; Fri, 18 Sep 2009 16:10:09 -0500 (CDT) Received: from mail144-tx2-R.bigfish.com (mail-tx2.bigfish.com [65.55.88.113]) by neches.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8ILA9wN011788 for ; Fri, 18 Sep 2009 16:10:09 -0500 Received: from mail144-tx2 (localhost.localdomain [127.0.0.1]) by mail144-tx2-R.bigfish.com (Postfix) with ESMTP id 68C491304CB for ; Fri, 18 Sep 2009 21:10:09 +0000 (UTC) X-SpamScore: 7 X-BigFish: vps7(zza4b1ozz1202hzzz2dh6bh61h) X-Spam-TCS-SCL: 0:0 X-FB-SS: 5, X-MS-Exchange-Organization-Antispam-Report: OrigIP: 63.81.120.158; Service: EHS Received: by mail144-tx2 (MessageSwitch) id 1253308206296287_21606; Fri, 18 Sep 2009 21:10:06 +0000 (UCT) Received: from TX2EHSMHS012.bigfish.com (unknown [10.9.14.246]) by mail144-tx2.bigfish.com (Postfix) with ESMTP id 3F312E98052 for ; Fri, 18 Sep 2009 21:10:06 +0000 (UTC) Received: from gateway-1237.mvista.com (63.81.120.158) by TX2EHSMHS012.bigfish.com (10.9.99.112) with Microsoft SMTP Server id 14.0.482.32; Fri, 18 Sep 2009 21:10:05 +0000 Received: from mag.az.mvista.com (mag.az.mvista.com [10.50.1.99]) by hermes.mvista.com (Postfix) with ESMTP id 66F351B7E9 for ; Fri, 18 Sep 2009 14:10:04 -0700 (PDT) Received: from mgreer by mag.az.mvista.com with local (Exim 4.69) (envelope-from ) id 1MokiS-0003Mz-9m for Davinci-linux-open-source@linux.davincidsp.com; Fri, 18 Sep 2009 14:10:04 -0700 Date: Fri, 18 Sep 2009 14:10:04 -0700 From: "Mark A. Greer" To: Davinci List Message-ID: <20090918211004.GA12907@mag.az.mvista.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Reverse-DNS: unknown Cc: Subject: [PATCH 1/2] nand: Add bad block table overrides to Davinci NAND driver X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Mark A. Greer The existing NAND infrastructure allows the default main and mirror bad block tables to be overridden in nand_default_bbt(). However, the davinci_nand driver does not support this. So, add fields to the davinci driver's platform data so platform code can pass in their own bbt's and make the driver honor those overrides. Signed-off-by: Mark A. Greer --- This is required by the da830 evm (see following patch) which requires different 'offs' and 'veroffs' values than the default. This seemed like the solution that fit best with the existing infratructure. If anyone has a better solution, please speak up. arch/arm/mach-davinci/include/mach/nand.h | 4 ++++ drivers/mtd/nand/davinci_nand.c | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/include/mach/nand.h b/arch/arm/mach-davinci/include/mach/nand.h index b520c4b..b2ad809 100644 --- a/arch/arm/mach-davinci/include/mach/nand.h +++ b/arch/arm/mach-davinci/include/mach/nand.h @@ -79,6 +79,10 @@ struct davinci_nand_pdata { /* platform_data */ /* e.g. NAND_BUSWIDTH_16 or NAND_USE_FLASH_BBT */ unsigned options; + + /* Main and mirror bbt descriptor overrides */ + struct nand_bbt_descr *bbt_td; + struct nand_bbt_descr *bbt_md; }; #endif /* __ARCH_ARM_DAVINCI_NAND_H */ diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 0bcfd49..31461d7 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -591,6 +591,8 @@ static int __init nand_davinci_probe(struct platform_device *pdev) /* options such as NAND_USE_FLASH_BBT or 16-bit widths */ info->chip.options = pdata->options; + info->chip.bbt_td = pdata->bbt_td; + info->chip.bbt_md = pdata->bbt_md; info->ioaddr = (uint32_t __force) vaddr;