[U-Boot] Fix fsl_elbc_nand driver
Scott Wood
scottwood at freescale.com
Tue May 19 23:40:14 CEST 2015
On Mon, 2015-05-18 at 19:16 -0700, Andrei Yakimov wrote:
> This is my best try. I have test it with my old u-boot,
> but not with master. Do not have a bench for it.
A bench?
> This is not very important patch. I do not find
> any other ONFI user in u-boot.
> Andrei
>
> From d76b4ae8e866affa15dd9da860574d0600969d57 Mon Sep 17 00:00:00 2001
> From: Andrei Yakimov <ayakimov at iptec-inc.com>
> Date: Mon, 18 May 2015 18:50:12 -0700
> Subject: [PATCH] ONFI detect reading only first parameter page.
>
> NAND_CMD_PARAM read only first parameter page. Need to read all 3
> (as per ONFI spec) due to no error correction for this area
>
> Signed-off-by: Andrei Yakimov <ayakimov at iptec-inc.com>
> ---
>
> drivers/mtd/nand/fsl_elbc_nand.c | 9 +++++----
> drivers/mtd/nand/fsl_ifc_nand.c | 10 ++++++----
> 2 files changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mtd/nand/fsl_elbc_nand.c
> b/drivers/mtd/nand/fsl_elbc_nand.c
> index e85832d..8ac470f 100644
> --- a/drivers/mtd/nand/fsl_elbc_nand.c
> +++ b/drivers/mtd/nand/fsl_elbc_nand.c
> @@ -336,11 +336,12 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd,
> unsigned int command,
> (FIR_OP_RBW << FIR_OP2_SHIFT));
> 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)
> + * although currently it's 8 bytes for READID
> + * param page containg at least 3 copy for
> + * robustnes, we need to read them all.
> */
> - out_be32(&lbc->fbcr, 256);
> - ctrl->read_bytes = 256;
> + out_be32(&lbc->fbcr, (command == NAND_CMD_PARAM) ? 786 : 8);
> + ctrl->read_bytes = (command == NAND_CMD_PARAM) ? 786 : 8;
786? Not 768?
-Scott
More information about the U-Boot
mailing list