From patchwork Thu Aug 29 15:14:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hoyler, Gernot" X-Patchwork-Id: 270823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A07FB2C0079 for ; Thu, 29 Aug 2013 23:11:10 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VF209-0001Ay-92; Thu, 29 Aug 2013 13:11:05 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VF207-0002hQ-IQ; Thu, 29 Aug 2013 13:11:03 +0000 Received: from usausmgw02.spansion.com ([12.110.209.162]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VF205-0002gD-5X for linux-mtd@lists.infradead.org; Thu, 29 Aug 2013 13:11:01 +0000 Received: from biz-exht101.spansion.com ([10.248.30.7]) by usausmgw02.Spansion.com with ESMTP; 29 Aug 2013 06:10:40 -0700 Received: from muc-cse-01.spansion.com (10.244.1.191) by BIZ-EXHT101.spansion.com (10.248.30.13) with Microsoft SMTP Server id 14.2.342.3; Thu, 29 Aug 2013 08:10:40 -0500 From: Gernot Hoyler Organization: Spansion To: Subject: [PATCH 2/2] mtd: cfi_cmdset_0002: 65 nm changes Date: Thu, 29 Aug 2013 17:14:49 +0200 User-Agent: KMail/1.11.2 (Linux/2.6.31-65nm; KDE/4.2.2; i686; ; ) MIME-Version: 1.0 Content-Disposition: inline Message-ID: <201308291714.49766.Gernot.Hoyler@spansion.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130829_091101_262228_156F9764 X-CRM114-Status: GOOD ( 12.08 ) X-Spam-Score: -4.4 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org To increase both program throughput and data reliability, Spansion recommends to operate today's flash devices that are built in 65 nm or smaller process technology in block write mode. For example, the Spansion S29GL-S family internally programs data in chunks of 32 bytes. Therefore a writesize of a multiple of 32 bytes would be fine in general. A value of 512 has been found a good compromise between maximum throughput (the larger the better) and risk of data loss during a power failure event (the smaller the better). Signed-off-by: Gernot Hoyler --- drivers/mtd/chips/cfi_cmdset_0002.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index b8f7b87..9952fde 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -196,9 +196,17 @@ static void fixup_use_write_buffers(struct mtd_info *mtd) { struct map_info *map = mtd->priv; struct cfi_private *cfi = map->fldrv_priv; + struct cfi_pri_amdstd *extp = cfi->cmdset_priv; + if (cfi->cfiq->BufWriteTimeoutTyp) { pr_debug("Using buffer write method\n" ); mtd->_write = cfi_amdstd_write_buffers; + + if (extp->SiliconRevision >= 0x1C) { + mtd->writesize = 512; + mtd->flags &= ~MTD_BIT_WRITEABLE; + printk(KERN_INFO "Setting mtd writesize = 512 bytes\n"); + } } }