linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Shengzhou Liu <Shengzhou.Liu@freescale.com>
To: <linuxppc-dev@lists.ozlabs.org>
Cc: scottwood@freescale.com, dwmw2@infradead.org,
	kumar.gala@freescale.com, linux-mtd@lists.infradead.org,
	Shengzhou Liu <Shengzhou.Liu@freescale.com>
Subject: [PATCH 2/2] mtd/nand: Add ONFI support for FSL NAND controller
Date: Mon, 5 Dec 2011 18:54:53 +0800	[thread overview]
Message-ID: <1323082493-22617-2-git-send-email-Shengzhou.Liu@freescale.com> (raw)
In-Reply-To: <1323082493-22617-1-git-send-email-Shengzhou.Liu@freescale.com>

- fix NAND_CMD_READID command for ONFI detect.
- add NAND_CMD_PARAM command to read the ONFI parameter page.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 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 742bf73..08a3aba 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);
-- 
1.6.4

  reply	other threads:[~2011-12-05 11:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-05 10:54 [PATCH 1/2] mtd/nand: fixup for fmr initialization of Freescale NAND controller Shengzhou Liu
2011-12-05 10:54 ` Shengzhou Liu [this message]
2011-12-05 19:31 ` Scott Wood
  -- strict thread matches above, loose matches on Subject: below --
2011-12-12  9:40 Shengzhou Liu
2011-12-12  9:40 ` [PATCH 2/2] mtd/nand: Add ONFI support for FSL " Shengzhou Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323082493-22617-2-git-send-email-Shengzhou.Liu@freescale.com \
    --to=shengzhou.liu@freescale.com \
    --cc=dwmw2@infradead.org \
    --cc=kumar.gala@freescale.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=scottwood@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).