U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Yakimov <ayakimov@iptec-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] fsl_elbc_nand bug
Date: Fri, 15 May 2015 14:48:38 -0700	[thread overview]
Message-ID: <1431726518.14341.96.camel@andreilinux> (raw)

Hi, 
 I just found, if NAND ONFI parameter page first copy is 
bad, u-boot will never read extra copes: 

fsl_elbc_nand.c: 
 342                 out_be32(&lbc->fbcr, 256);  
 343                 ctrl->read_bytes = 256;

this code cause "read beyond buffer" error message:
 
nand_base.c:
   chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
3243         for (i = 0; i < 3; i++) {
3244                 for (j = 0; j < sizeof(*p); j++)
3245                         ((uint8_t *)p)[j] = chip->read_byte(mtd);
3246                 if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) ==
3247                                 le16_to_cpu(p->crc)) {
3248                         break;
3249                 }
3250         }

Unfortunately I do not working with latest u-boot now,
so can not provide a patch,  read size should be increased to
at least 768 ( 3 copy mandatory for ONFI spec). Linux kernel should be
updated too.

I am also not expert for other NAND controllers drivers.

But first copy of ONFI parameter page CAN GO BAD. I seen it my self.

Andrei

             reply	other threads:[~2015-05-15 21:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15 21:48 Andrei Yakimov [this message]
2015-05-18 21:17 ` [U-Boot] fsl_elbc_nand bug Scott Wood
2015-05-18 22:10   ` Andrei Yakimov
2015-05-18 22:41     ` Scott Wood

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=1431726518.14341.96.camel@andreilinux \
    --to=ayakimov@iptec-inc.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