From: Andrei Yakimov <ayakimov@iptec-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Fix fsl_elbc_nand driver
Date: Tue, 19 May 2015 16:42:49 -0700 [thread overview]
Message-ID: <1432078969.14341.178.camel@andreilinux> (raw)
In-Reply-To: <1432075134.27761.82.camel@freescale.com>
On Tue, 2015-05-19 at 17:38 -0500, Scott Wood wrote:
> On Tue, 2015-05-19 at 15:29 -0700, Andrei Yakimov wrote:
> > I did not compiling latest, I still in 2011.9 and 2.6.38.
> > I have go over latest kernel and can see they using
> > NAND_CMD_PARAM with sub command 0x40 - to get JEDEC
> > information, it is 3 mandatory copy by 512 bytes.
>
> 3x512 or 3x256?
ONFI - 3x256 sub command 0x0
JEDEC - 3x512 sub command 0x40
>
> > Going over kernel divers, figure out some read whole
> > page some 256 bytes.
> > Reading whole page (set fcbr = 0) have some sense - you do not need
> > to know anything about flash, but what to put in to read_bytes ?
>
> You don't want fbcr = 0 here because that will enable ECC which isn't
> there.
Is it correcting or just generating syndrome? It is working on
my board, I would say it only generate or ignored for this command
(8313). It should corrupt data if it correcting but it does not.
>
> > It looks like for universal patch 2K should be read.
>
> Again, if we're going to do anything beyond s/256/768/ it should be a
> higher level function where the caller says how much it wants.
It is not normal nand flow: READ_ID and PARAM assuming it know the
size.
> > I have also check other vendor controllers like tegra,
> > there continuous data read trigger additional data transfer from
> > chip.
Can we do (NOP CWO UA RWB RS RS RS RS)
wait ltesr (cc) and after that
next read_buffer ( RB or RS)
all command have to start with NOP,
this will effectively terminate previous command.
And we do not care about locks in u-boot. kernel will be different
store, but again this code executed only during start up - so who care
holding CS to long.
there is only 4 places for PARAM:
drivers/mtd/nand/mxs_nand_spl.c chip->cmdfunc(mtd, NAND_CMD_PARAM, 0,
-1);
drivers/mtd/nand/nand_base.c: chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
drivers/mtd/nand/nand_base.c: chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
drivers/mtd/nand/nand_base.c: chip->cmdfunc(mtd, NAND_CMD_PARAM, 0x40,
-1);
latest kernel read it like this:
chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
for (i = 0; i < 3; i++) {
for (j = 0; j < sizeof(*p); j++)
((uint8_t *)p)[j] = chip->read_byte(mtd);
if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) ==
le16_to_cpu(p->crc)) {
break;
}
}
>
> Yes, that's how the hardware works, but controllers like eLBC don't
> directly expose that interface. We need to get all of the command's
> output at once.
>
> > This kind of implementation better, but I did not see how it could
> > be done for this controller.
>
> I wouldn't say it's "better" so much as a closer fit to what the Linux
> NAND code is expecting.
>
> > I am not sure how is small page (512 byte) flash should operate
> > also.
>
> Is there any small-page ONFI flash?
I do not know.
ONFI parameter page will tell you page size:
80-83 M Number of data bytes per page
84-85 M Number of spare bytes per page
if we drop it, lets set to 2k and forget.
>
> Why did you take this e-mail off-list?
Sorry just forgot.
>
> -Scott
>
>
next prev parent reply other threads:[~2015-05-19 23:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-19 2:16 [U-Boot] Fix fsl_elbc_nand driver Andrei Yakimov
2015-05-19 21:40 ` Scott Wood
[not found] ` <1432074568.14341.149.camel@andreilinux>
[not found] ` <1432075134.27761.82.camel@freescale.com>
2015-05-19 23:42 ` Andrei Yakimov [this message]
2015-05-20 22:25 ` Scott Wood
2015-05-21 1:27 ` Andrei Yakimov
2015-05-21 1:37 ` Scott Wood
2015-05-21 1:55 ` Andrei Yakimov
2015-05-21 2:27 ` Scott Wood
2015-05-21 2:42 ` Andrei Yakimov
2015-05-21 2:46 ` Scott Wood
2015-05-21 3:03 ` Andrei Yakimov
2015-05-21 3:11 ` Scott Wood
2015-05-21 3:54 ` Andrei Yakimov
2015-05-21 3:57 ` 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=1432078969.14341.178.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.