From patchwork Mon Dec 8 03:41:03 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Jin X-Patchwork-Id: 12675 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 4A1E1DDF7A for ; Mon, 8 Dec 2008 14:45:20 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from az33egw02.freescale.net (az33egw02.freescale.net [192.88.158.103]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "az33egw02.freescale.net", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id E4B89DDDEE for ; Mon, 8 Dec 2008 14:44:57 +1100 (EST) Received: from az33smr02.freescale.net (az33smr02.freescale.net [10.64.34.200]) by az33egw02.freescale.net (8.14.3/az33egw02) with ESMTP id mB83il4v028834 for ; Sun, 7 Dec 2008 20:44:53 -0700 (MST) Received: from zch01exm21.fsl.freescale.net (zch01exm21.ap.freescale.net [10.192.129.205]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id mB83ijtg010660 for ; Sun, 7 Dec 2008 21:44:46 -0600 (CST) Received: from localhost ([10.193.20.106]) by zch01exm21.fsl.freescale.net with Microsoft SMTPSVC(6.0.3790.3959); Mon, 8 Dec 2008 11:44:45 +0800 From: Jason Jin To: galak@kernel.crashing.org Subject: [PATCH] Set the fsl elbc ECCM according the settings in bootloader. Date: Mon, 8 Dec 2008 11:41:03 +0800 Message-Id: <1228707663-26995-1-git-send-email-Jason.jin@freescale.com> X-Mailer: git-send-email 1.5.4 X-OriginalArrivalTime: 08 Dec 2008 03:44:45.0309 (UTC) FILETIME=[4F9C1AD0:01C958E7] Cc: scottwood@freescale.com, linuxppc-dev@ozlabs.org, Jason Jin X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org The ECCM maybe set in bootloader, Get ECCM settings from the bootloader, can avoid the image written by bootloader cannot read out by kernel. But the limitation of doing it this way is that, it could break large page NAND if it is written with NAND disabled in u-boot and read with NAND enabled, or vice versa. Signed-off-by: Jason Jin Acked-by: Scott Wood --- drivers/mtd/nand/fsl_elbc_nand.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index 4aa5bd6..65929db 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c @@ -777,7 +777,9 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) /* Fill in fsl_elbc_mtd structure */ priv->mtd.priv = chip; priv->mtd.owner = THIS_MODULE; - priv->fmr = 0; /* rest filled in later */ + + /* Set the ECCM according to the settings in bootloader.*/ + priv->fmr = in_be32(&lbc->fmr) & FMR_ECCM; /* fill in nand_chip structure */ /* set up function call table */