From patchwork Mon Jun 7 10:15:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raffaele Recalcati X-Patchwork-Id: 104680 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 o57AIbn7009210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 7 Jun 2010 10:19:13 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o57AFhjF017234 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Jun 2010 05:15:43 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o57AFg9B029833; Mon, 7 Jun 2010 05:15:42 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id C74F480627; Mon, 7 Jun 2010 05:15:42 -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 993E980626 for ; Mon, 7 Jun 2010 05:15:41 -0500 (CDT) Received: from neches.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id o57AFfJv026662 for ; Mon, 7 Jun 2010 05:15:41 -0500 (CDT) Received: from psmtp.com (na3sys009amx228.postini.com [74.125.149.112]) by neches.ext.ti.com (8.13.7/8.13.7) with SMTP id o57AFeAD006411 for ; Mon, 7 Jun 2010 05:15:40 -0500 Received: from source ([209.85.214.173]) by na3sys009amx228.postini.com ([74.125.148.10]) with SMTP; Mon, 07 Jun 2010 10:15:40 GMT Received: by mail-iw0-f173.google.com with SMTP id 41so3308425iwn.4 for ; Mon, 07 Jun 2010 03:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=8ZZ2yEpFCRsIKoLYNr2V/hdiQgC4qw6QboNtFGiZAAU=; b=ZskFzNTNxTCTT7jUluSa/fG4U3oSTfWopVR/TBzuv6sbFOJgjFiz4C0kD4Z9IhIT++ en2brHPijK8xZVy2ygdJy5yRsR1/m6crVZThr0zhexUGWyd5sD963Po3j2yju7JsC3cu 6sG9Rkgi5snXg3vayx2Xbs9C0HSw5rthcWlgM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=S2auXRvMX/PniQKe+EjTSQ+JpABJEEfBNAaKjy0IBjlTR4iS4xp8Awk+rNJOaqZcnh 8Zp4GSm4QvvOSHSSoPa8dReYZx/H8sd5BBTv0FJ0LulLQ/BcpJE7+zfPqcLAdv71tw/n +IhF99F+noP/Q2fXySFXNBnx8KYgVFEkaeDnw= MIME-Version: 1.0 Received: by 10.231.32.129 with SMTP id c1mr4176658ibd.112.1275905740392; Mon, 07 Jun 2010 03:15:40 -0700 (PDT) Received: by 10.231.172.16 with HTTP; Mon, 7 Jun 2010 03:15:40 -0700 (PDT) Date: Mon, 7 Jun 2010 12:15:40 +0200 Message-ID: Subject: [PATCH 05/12] mtd-nand: davinci: Added 16 bit wide bus for DaVinci bmx board From: Raffaele Recalcati To: davinci-linux-open-source X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:76.23750/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] 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: , 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]); Mon, 07 Jun 2010 10:19:13 +0000 (UTC) diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index 103235e..d29685d 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); + } + +} + + /*----------------------------------------------------------------------*/