From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/5] mtd/nand: Add ONFI support for FSL NAND controller
Date: Thu, 8 Dec 2011 12:09:49 -0600 [thread overview]
Message-ID: <4EE0FD6D.10204@freescale.com> (raw)
In-Reply-To: <1323341352-14996-4-git-send-email-Shengzhou.Liu@freescale.com>
On 12/08/2011 04:49 AM, Shengzhou Liu wrote:
> - 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 4d1e527..52362b1 100644
> --- a/drivers/mtd/nand/fsl_elbc_nand.c
> +++ b/drivers/mtd/nand/fsl_elbc_nand.c
> @@ -340,20 +340,25 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command,
>
> /* READID must read all 5 possible bytes while CEB is active */
> case NAND_CMD_READID:
> - vdbg("fsl_elbc_cmdfunc: NAND_CMD_READID.\n");
> + case NAND_CMD_PARAM:
> + vdbg("fsl_elbc_cmdfunc: NAND_CMD 0x%x.\n", command);
>
> out_be32(&lbc->fir, (FIR_OP_CW0 << 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);
> - /* 5 bytes for manuf, device and exts */
> - out_be32(&lbc->fbcr, 5);
> - ctrl->read_bytes = 5;
> + out_be32(&lbc->fcr, command << FCR_CMD0_SHIFT);
> + /*
> + * although currently it's 8 bytes for READID, we always read
> + * the maximum 256 bytes(for PARAM)
> + */
> + out_be32(&lbc->fbcr, 256);
> + ctrl->read_bytes = 256;
> ctrl->use_mdr = 1;
> - ctrl->mdr = 0;
> -
> + ctrl->mdr = column;
> set_addr(mtd, 0, 0, 0);
> fsl_elbc_run_command(mtd);
> + if (mtd->writesize > 2048)
> + memcpy_fromio(ctrl->buffer, ctrl->addr, 256);
This memcpy_fromio looks like leakage from patch 5/5.
-Scott
next prev parent reply other threads:[~2011-12-08 18:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-08 10:49 [U-Boot] [PATCH 1/5] mtd/nand: Add function board_nand_init_tail() for some special NAND controllers Shengzhou Liu
2011-12-08 10:49 ` [U-Boot] [PATCH 2/5] mtd/nand: Fixup for support ONFI detect Shengzhou Liu
2011-12-08 10:49 ` [U-Boot] [PATCH 3/5] mtd/nand: remove CONFIG_SYS_NAND_ONFI_DETECTION to enable ONFI detection Shengzhou Liu
2011-12-08 10:49 ` [U-Boot] [PATCH 4/5] mtd/nand: Add ONFI support for FSL NAND controller Shengzhou Liu
2011-12-08 10:49 ` [U-Boot] [PATCH 5/5] mtd/nand: workaround for Freescale FCM to support 4k pagesize Nand chip Shengzhou Liu
2011-12-08 16:37 ` Marek Vasut
2011-12-09 2:33 ` LiuShuo
2011-12-09 8:27 ` Marek Vasut
2011-12-09 8:58 ` LiuShuo
2011-12-09 9:11 ` Marek Vasut
2011-12-09 9:32 ` LiuShuo
2011-12-09 9:46 ` Marek Vasut
2011-12-08 18:09 ` Scott Wood [this message]
2011-12-08 16:35 ` [U-Boot] [PATCH 1/5] mtd/nand: Add function board_nand_init_tail() for some special NAND controllers Marek Vasut
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=4EE0FD6D.10204@freescale.com \
--to=scottwood@freescale.com \
--cc=u-boot@lists.denx.de \
/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