From patchwork Tue Dec 6 08:54:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengzhou Liu X-Patchwork-Id: 129589 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B1D541007D9 for ; Tue, 6 Dec 2011 20:32:51 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RXrMq-0004m7-5N; Tue, 06 Dec 2011 09:31:16 +0000 Received: from ch1ehsobe006.messaging.microsoft.com ([216.32.181.186] helo=ch1outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RXrKB-0004hY-KZ for linux-mtd@lists.infradead.org; Tue, 06 Dec 2011 09:28:32 +0000 Received: from mail12-ch1-R.bigfish.com (10.43.68.241) by CH1EHSOBE006.bigfish.com (10.43.70.56) with Microsoft SMTP Server id 14.1.225.23; Tue, 6 Dec 2011 09:28:30 +0000 Received: from mail12-ch1 (localhost [127.0.0.1]) by mail12-ch1-R.bigfish.com (Postfix) with ESMTP id 5D3DBE00CC; Tue, 6 Dec 2011 09:28:30 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-SS: 13, Received: from mail12-ch1 (localhost.localdomain [127.0.0.1]) by mail12-ch1 (MessageSwitch) id 1323163710285416_3267; Tue, 6 Dec 2011 09:28:30 +0000 (UTC) Received: from CH1EHSMHS004.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.249]) by mail12-ch1.bigfish.com (Postfix) with ESMTP id 3FAE240045; Tue, 6 Dec 2011 09:28:30 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS004.bigfish.com (10.43.70.4) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 6 Dec 2011 09:28:30 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.339.2; Tue, 6 Dec 2011 03:28:29 -0600 Received: from localhost (tank.ap.freescale.net [10.193.20.104]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id pB69SR6H016229; Tue, 6 Dec 2011 03:28:28 -0600 (CST) From: Shengzhou Liu To: Subject: [PATCH 2/2 v2] mtd/nand: Add ONFI support for FSL NAND controller Date: Tue, 6 Dec 2011 16:54:15 +0800 Message-ID: <1323161655-19050-2-git-send-email-Shengzhou.Liu@freescale.com> X-Mailer: git-send-email 1.6.4 In-Reply-To: <1323161655-19050-1-git-send-email-Shengzhou.Liu@freescale.com> References: <1323161655-19050-1-git-send-email-Shengzhou.Liu@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [216.32.181.186 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: scottwood@freescale.com, dwmw2@infradead.org, kumar.gala@freescale.com, linux-mtd@lists.infradead.org, Shengzhou Liu X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org - fix NAND_CMD_READID command for ONFI detect. - add NAND_CMD_PARAM command to read the ONFI parameter page. Signed-off-by: Shengzhou Liu --- v2: no changes drivers/mtd/nand/fsl_elbc_nand.c | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index 4f405a0..b4db407 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c @@ -349,19 +349,24 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command, fsl_elbc_run_command(mtd); return; - /* READID must read all 5 possible bytes while CEB is active */ case NAND_CMD_READID: - dev_vdbg(priv->dev, "fsl_elbc_cmdfunc: NAND_CMD_READID.\n"); + case NAND_CMD_PARAM: + dev_vdbg(priv->dev, "fsl_elbc_cmdfunc: NAND_CMD %x\n", command); out_be32(&lbc->fir, (FIR_OP_CM0 << FIR_OP0_SHIFT) | (FIR_OP_UA << FIR_OP1_SHIFT) | (FIR_OP_RBW << FIR_OP2_SHIFT)); - out_be32(&lbc->fcr, NAND_CMD_READID << FCR_CMD0_SHIFT); - /* nand_get_flash_type() reads 8 bytes of entire ID string */ - out_be32(&lbc->fbcr, 8); - elbc_fcm_ctrl->read_bytes = 8; + out_be32(&lbc->fcr, command << FCR_CMD0_SHIFT); + /* reads 8 bytes of entire ID string */ + if (NAND_CMD_READID == command) { + out_be32(&lbc->fbcr, 8); + elbc_fcm_ctrl->read_bytes = 8; + } else { + out_be32(&lbc->fbcr, 256); + elbc_fcm_ctrl->read_bytes = 256; + } elbc_fcm_ctrl->use_mdr = 1; - elbc_fcm_ctrl->mdr = 0; + elbc_fcm_ctrl->mdr = column; set_addr(mtd, 0, 0, 0); fsl_elbc_run_command(mtd);