From patchwork Mon Jun 6 16:11:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jamie Iles X-Patchwork-Id: 98950 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1F32CB6FB3 for ; Tue, 7 Jun 2011 02:12:04 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QTcPB-0004W0-My; Mon, 06 Jun 2011 16:11:53 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QTcPB-0000Ip-AV; Mon, 06 Jun 2011 16:11:53 +0000 Received: from mail-wy0-f177.google.com ([74.125.82.177]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QTcP7-0000IB-Hf for linux-mtd@lists.infradead.org; Mon, 06 Jun 2011 16:11:50 +0000 Received: by wyb28 with SMTP id 28so4044358wyb.36 for ; Mon, 06 Jun 2011 09:11:43 -0700 (PDT) Received: by 10.216.201.163 with SMTP id b35mr4974855weo.80.1307376703580; Mon, 06 Jun 2011 09:11:43 -0700 (PDT) Received: from localhost (gw-ba1.picochip.com [94.175.234.108]) by mx.google.com with ESMTPS id z22sm2386751weq.26.2011.06.06.09.11.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2011 09:11:42 -0700 (PDT) From: Jamie Iles To: linux-mtd@lists.infradead.org Subject: [PATCH] mtd: denali: detect the number of banks before resetting NAND Date: Mon, 6 Jun 2011 17:11:34 +0100 Message-Id: <1307376694-17905-1-git-send-email-jamie@jamieiles.com> X-Mailer: git-send-email 1.7.4.1 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110606_121149_749199_DA05630B X-CRM114-Status: GOOD ( 15.84 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.177 listed in list.dnswl.org] Cc: Jamie Iles , David Woodhouse , Artem Bityutskiy X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Commit c89eeda810f0ec4f0eee0206ebb79e476df9f83e (mtd: denali: detect the number of banks) introduced runtime detection of the number of banks. However, denali_nand_reset() uses uses denanli_nand_info::max_banks so we need to detect the maximum number of banks before doing the reset. Cc: Artem Bityutskiy Cc: David Woodhouse Signed-off-by: Jamie Iles --- Artem, I believe that this one will be needed for 3.0 to avoid breakage on Moorestown. drivers/mtd/nand/denali.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index eebdfb5..3984d48 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1346,6 +1346,7 @@ static void denali_hw_init(struct denali_nand_info *denali) * */ denali->bbtskipbytes = ioread32(denali->flash_reg + SPARE_AREA_SKIP_BYTES); + detect_max_banks(denali); denali_nand_reset(denali); iowrite32(0x0F, denali->flash_reg + RB_PIN_ENABLED); iowrite32(CHIP_EN_DONT_CARE__FLAG, @@ -1356,7 +1357,6 @@ static void denali_hw_init(struct denali_nand_info *denali) /* Should set value for these registers when init */ iowrite32(0, denali->flash_reg + TWO_ROW_ADDR_CYCLES); iowrite32(1, denali->flash_reg + ECC_ENABLE); - detect_max_banks(denali); denali_nand_timing_set(denali); denali_irq_init(denali); }