From patchwork Fri Jun 11 10:19:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raffaele Recalcati X-Patchwork-Id: 105551 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5BANXO8018112 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 11 Jun 2010 10:24:14 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o5BALN2U012248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Jun 2010 05:21:23 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id o5BALMrY010704; Fri, 11 Jun 2010 05:21:22 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id C0CE380663; Fri, 11 Jun 2010 05:21:09 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id AB9018063D for ; Fri, 11 Jun 2010 05:20:13 -0500 (CDT) Received: from white.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id o5BAKDXO009335 for ; Fri, 11 Jun 2010 05:20:13 -0500 (CDT) Received: from psmtp.com (na3sys009amx176.postini.com [74.125.149.157]) by white.ext.ti.com (8.13.7/8.13.7) with SMTP id o5BAKCGe017459 for ; Fri, 11 Jun 2010 05:20:12 -0500 Received: from source ([74.125.82.173]) by na3sys009amx176.postini.com ([74.125.148.10]) with SMTP; Fri, 11 Jun 2010 10:20:12 GMT Received: by wyb36 with SMTP id 36so682567wyb.4 for ; Fri, 11 Jun 2010 03:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=5kAAfIghecCSZgILAetdpMPL4xf4xD4Ho3uCTN1U4V8=; b=RFIklZNns/ZhnGcHg1qWwAIpxCA7if/39PMvMAc7Fn/kpWTJRYS0UerERvHjvs2sEl G3hUoJOrwQKXOxXtdIoyw7kHqwwCKO8dDVrtU+jvJtH2ZLOZFOxnbudO4JtIZycHLCFG GFumoeeptcFunZ2gEUsdbSrRMQQuR9BfrMoDU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=G0+TP7jcfB0DSMu1yLm/8uFppqmmaxA9rrxCRIuZwXKgyJdv7K1A1Ounlz5EmO7eDC PaQkWFR86siFtmJ757OldbN00pcO2ZLAvyS5AHbtItzSvFeqmYV+qWXxL7jaRPJVGOK3 1bC9kvlEyPAojw2dAkLiY/wKoCZwIZ29ZXo9g= Received: by 10.227.143.200 with SMTP id w8mr1659829wbu.9.1276251608059; Fri, 11 Jun 2010 03:20:08 -0700 (PDT) Received: from localhost.localdomain (host81-90-static.72-81-b.business.telecomitalia.it [81.72.90.81]) by mx.google.com with ESMTPS id p17sm530613wbe.14.2010.06.11.03.20.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 03:20:07 -0700 (PDT) From: Raffaele Recalcati To: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 05/14] mtd-nand: davinci: Added 16 bit wide bus for DaVinci bmx board Date: Fri, 11 Jun 2010 12:19:45 +0200 Message-Id: <1276251594-5936-5-git-send-email-lamiaposta71@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1276251594-5936-1-git-send-email-lamiaposta71@gmail.com> References: <1276251594-5936-1-git-send-email-lamiaposta71@gmail.com> X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:55.30342/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.5000) s cv gt3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] Cc: Raffaele Recalcati X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 11 Jun 2010 10:24:14 +0000 (UTC) diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 103235e..7818dc3 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -508,6 +508,38 @@ static void __init nand_dm6446evm_flash_init(struct davinci_nand_info *info) } } +static void __init nand_bmx_flash_init(struct davinci_nand_info *info) +{ + uint32_t regval, a1cr; + + /* + * NAND FLASH timings @ PLL1 == 459 MHz + * - AEMIF.CLK freq = PLL1/6 = 459/6 = 76.5 MHz + * - AEMIF.CLK period = 1/76.5 MHz = 13.1 ns + */ + regval = 0 + | (0 << 31) /* selectStrobe */ + | (1 << 30) /* extWait (never with NAND) */ + | (0 << 26) /* writeSetup 10 ns */ + | (4 << 20) /* writeStrobe 40 ns */ + | (0 << 17) /* writeHold 10 ns */ + | (0 << 13) /* readSetup 10 ns */ + | (4 << 7) /* readStrobe 60 ns */ + | (0 << 4) /* readHold 10 ns */ + | (1 << 2) /* turnAround ?? ns */ + | (1 << 0) /* asyncSize 16-bit bus */ + ; + a1cr = davinci_nand_readl(info, A1CR_OFFSET); + if (a1cr != regval) { + dev_err(info->dev, "Warning: NAND config: Set A1CR " \ + "reg to 0x%08x, was 0x%08x, should be done by " \ + "bootloader.\n", regval, a1cr); + davinci_nand_writel(info, A1CR_OFFSET, regval); + } + +} + + /*----------------------------------------------------------------------*/ /* An ECC layout for using 4-bit ECC with small-page flash, storing @@ -697,6 +729,16 @@ static int __init nand_davinci_probe(struct platform_device *pdev) */ if (machine_is_davinci_evm()) nand_dm6446evm_flash_init(info); + else if (machine_is_bmx()) + nand_bmx_flash_init(info); + /* + * No reason to do this, + * because the boot loader + * is booting the kernel + * that is in the nand flash + * and so EMIF must already + * configured + */ spin_lock_irq(&davinci_nand_lock);