From patchwork Fri Jun 13 17:46:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: grmoore@altera.com X-Patchwork-Id: 359582 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DDEF814009D for ; Sat, 14 Jun 2014 03:48:37 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WvVYu-0001zI-UJ; Fri, 13 Jun 2014 17:46:48 +0000 Received: from dns-bn1lp0143.outbound.protection.outlook.com ([207.46.163.143] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WvVYo-0001xk-W8 for linux-mtd@lists.infradead.org; Fri, 13 Jun 2014 17:46:43 +0000 Received: from BN1BFFO11FD033.protection.gbl (10.58.144.34) by BN1BFFO11HUB011.protection.gbl (10.58.144.158) with Microsoft SMTP Server (TLS) id 15.0.959.15; Fri, 13 Jun 2014 17:46:19 +0000 Received: from sj-itexedge03.altera.priv.altera.com (66.35.236.227) by BN1BFFO11FD033.mail.protection.outlook.com (10.58.144.96) with Microsoft SMTP Server (TLS) id 15.0.959.15 via Frontend Transport; Fri, 13 Jun 2014 17:46:19 +0000 Received: from sj-mail01.altera.com (137.57.1.6) by sj-itexedge03.altera.priv.altera.com (66.35.236.227) with Microsoft SMTP Server id 14.3.174.1; Fri, 13 Jun 2014 10:45:04 -0700 Received: from graham-VirtualBox-Mint.altera.com (sj-grmoore-530.altera.priv.altera.com [137.57.188.43]) by sj-mail01.altera.com (8.13.7+Sun/8.13.7) with ESMTP id s5DHkFhu025189; Fri, 13 Jun 2014 10:46:17 -0700 (PDT) From: Graham Moore To: Subject: [PATCH] In the Denali NAND controller driver, use 8 bytes for READID command. Date: Fri, 13 Jun 2014 12:46:05 -0500 Message-ID: <1402681565-7826-1-git-send-email-grmoore@altera.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.35.236.227; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199002)(68736004)(50466002)(19580405001)(50226001)(19580395003)(84676001)(83322001)(74502001)(50986999)(99396002)(102836001)(97736001)(46102001)(87286001)(44976005)(83072002)(85852003)(92726001)(87936001)(86362001)(92566001)(80022001)(74662001)(53416003)(104166001)(77156001)(77982001)(31966008)(79102001)(93916002)(76482001)(21056001)(4396001)(64706001)(62966002)(33646001)(81542001)(81342001)(6806004)(88136002)(20776003)(47776003)(36756003)(48376002)(89996001); DIR:OUT; SFP:; SCL:1; SRVR:BN1BFFO11HUB011; H:sj-itexedge03.altera.priv.altera.com; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-OriginatorOrg: altera.onmicrosoft.com X-Microsoft-Antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam; PCL:0; RULEID: X-Forefront-PRVS: 0241D5F98C Received-SPF: SoftFail (: domain of transitioning altera.com discourages use of 66.35.236.227 as permitted sender) Authentication-Results: spf=softfail (sender IP is 66.35.236.227) smtp.mailfrom=grmoore@altera.com; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140613_104643_189579_9A05BC0E X-CRM114-Status: UNSURE ( 9.07 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [207.46.163.143 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [207.46.163.143 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record Cc: Graham Moore , linux-kernel@vger.kernel.org, Yves Vandervennet , linux-mtd@lists.infradead.org, Alan Tull , Brian Norris , David Woodhouse , Dinh Nguyen X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.18-1 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 The Denali NAND driver reads only 5 bytes of ID, but some Hynix and Samsung have size parameters in the 6th byte. As a result, the page and oob size for a Hynix H27UAG8T2B were calculated incorrectly and the driver failed to load. The solution is to read 8 bytes of ID, as expected by the nand framework. Signed-off-by: Graham Moore --- drivers/mtd/nand/denali.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 9f2012a..7276125 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -488,7 +488,7 @@ static uint16_t denali_nand_timing_set(struct denali_nand_info *denali) addr = (uint32_t)MODE_11 | BANK(denali->flash_bank); index_addr(denali, (uint32_t)addr | 0, 0x90); index_addr(denali, (uint32_t)addr | 1, 0); - for (i = 0; i < 5; i++) + for (i = 0; i < 8; i++) index_addr_read_data(denali, addr | 2, &id_bytes[i]); maf_id = id_bytes[0]; device_id = id_bytes[1]; @@ -1276,7 +1276,7 @@ static void denali_cmdfunc(struct mtd_info *mtd, unsigned int cmd, int col, addr = (uint32_t)MODE_11 | BANK(denali->flash_bank); index_addr(denali, (uint32_t)addr | 0, 0x90); index_addr(denali, (uint32_t)addr | 1, 0); - for (i = 0; i < 5; i++) { + for (i = 0; i < 8; i++) { index_addr_read_data(denali, (uint32_t)addr | 2, &id);