From patchwork Thu Dec 29 04:59:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Kushwaha X-Patchwork-Id: 133501 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 856F6B6FA6 for ; Thu, 29 Dec 2011 16:01:28 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Rg863-0004Kd-W2; Thu, 29 Dec 2011 05:00:08 +0000 Received: from am1ehsobe001.messaging.microsoft.com ([213.199.154.204] helo=AM1EHSOBE001.bigfish.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Rg85z-0004K2-F8 for linux-mtd@lists.infradead.org; Thu, 29 Dec 2011 05:00:04 +0000 Received: from mail67-am1-R.bigfish.com (10.3.201.240) by AM1EHSOBE001.bigfish.com (10.3.204.21) with Microsoft SMTP Server id 14.1.225.23; Thu, 29 Dec 2011 04:59:40 +0000 Received: from mail67-am1 (localhost [127.0.0.1]) by mail67-am1-R.bigfish.com (Postfix) with ESMTP id E06AA2A0247; Thu, 29 Dec 2011 04:59:47 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bh8275dhz2dh2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail67-am1 (localhost.localdomain [127.0.0.1]) by mail67-am1 (MessageSwitch) id 1325134787815998_10105; Thu, 29 Dec 2011 04:59:47 +0000 (UTC) Received: from AM1EHSMHS011.bigfish.com (unknown [10.3.201.245]) by mail67-am1.bigfish.com (Postfix) with ESMTP id C3ED258003F; Thu, 29 Dec 2011 04:59:47 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS011.bigfish.com (10.3.207.111) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 29 Dec 2011 04:59:40 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.355.3; Wed, 28 Dec 2011 22:59:55 -0600 Received: from b32579-VirtualBox.ap.freescale.net (b32579-VirtualBox.ap.freescale.net [10.232.132.40]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id pBT4xjZQ000125; Wed, 28 Dec 2011 22:59:52 -0600 (CST) From: Prabhakar Kushwaha To: , Subject: [PATCH 2/2] mtd/nand: Fix IFC driver to support 2K NAND page Date: Thu, 29 Dec 2011 10:29:39 +0530 Message-ID: <1325134779-3571-3-git-send-email-prabhakar@freescale.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1325134779-3571-1-git-send-email-prabhakar@freescale.com> References: <1325134779-3571-1-git-send-email-prabhakar@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 [213.199.154.204 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: scottwood@freescale.com, Poonam Aggrwal , Prabhakar Kushwaha 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 1) OOB area should be updated irrespective of NAND page size. Earlier it was updated only for 512byte NAND page. 2) During OOB update fbcr should be equal to OOB size. Signed-off-by: Poonam Aggrwal Signed-off-by: Prabhakar Kushwaha --- git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git (branch next) Tested on P1010RDB drivers/mtd/nand/fsl_ifc_nand.c | 20 ++++++++------------ 1 files changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index 2df7206..2c02168 100644 --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c @@ -439,20 +439,16 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command, out_be32(&ifc->ifc_nand.nand_fir1, (IFC_FIR_OP_CW1 << IFC_NAND_FIR1_OP5_SHIFT)); - if (column >= mtd->writesize) { - /* OOB area --> READOOB */ - column -= mtd->writesize; - nand_fcr0 |= NAND_CMD_READOOB << - IFC_NAND_FCR0_CMD0_SHIFT; - ifc_nand_ctrl->oob = 1; - } else if (column < 256) + if (column < 256) /* First 256 bytes --> READ0 */ nand_fcr0 |= NAND_CMD_READ0 << IFC_NAND_FCR0_CMD0_SHIFT; - else - /* Second 256 bytes --> READ1 */ - nand_fcr0 |= - NAND_CMD_READ1 << IFC_NAND_FCR0_CMD0_SHIFT; + } + + if (column >= mtd->writesize) { + /* OOB area --> READOOB */ + column -= mtd->writesize; + ifc_nand_ctrl->oob = 1; } out_be32(&ifc->ifc_nand.nand_fcr0, nand_fcr0); @@ -465,7 +461,7 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command, int full_page; if (ifc_nand_ctrl->oob) { out_be32(&ifc->ifc_nand.nand_fbcr, - ifc_nand_ctrl->index); + ifc_nand_ctrl->index - ifc_nand_ctrl->column); full_page = 0; } else { out_be32(&ifc->ifc_nand.nand_fbcr, 0);