* [U-Boot] about nand_read_byte() interface
@ 2009-10-30 5:20 HeLei
2009-10-30 16:42 ` Scott Wood
0 siblings, 1 reply; 3+ messages in thread
From: HeLei @ 2009-10-30 5:20 UTC (permalink / raw)
To: u-boot
Hi, all
I'm a little confused on NAND read operation.
According to NAND character, NAND flash is read page by page, which mean's once you read, at least you should read data with page size (such as 512Bytes)
But the nand_read_byte() is implemented as following: static u_char nand_read_byte(struct mtd_info *mtd) { struct nand_chip *this = mtd->priv; return readb(this->IO_ADDR_R); }it seems only one byte is read out.
Anybody can tell what's wrong with my understanding?
ThanksLeon
_________________________________________________________________
?????????????????msn?????
http://ditu.live.com/?form=TL&swm=1
^ permalink raw reply [flat|nested] 3+ messages in thread* [U-Boot] about nand_read_byte() interface
2009-10-30 5:20 [U-Boot] about nand_read_byte() interface HeLei
@ 2009-10-30 16:42 ` Scott Wood
2009-11-02 3:07 ` HeLei
0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2009-10-30 16:42 UTC (permalink / raw)
To: u-boot
On Fri, Oct 30, 2009 at 01:20:58PM +0800, HeLei wrote:
>
> Hi, all
Hi, please wrap your lines at 75 or so characters -- and definitely don't
paste code as all one line.
> I'm a little confused on NAND read operation.
> According to NAND character, NAND flash is read page by page, which mean's
> once you read, at least you should read data with page size (such as
> 512Bytes)
Yes, unless you're reading from the out-of-band area.
> But the nand_read_byte() is implemented as following: static u_char
> nand_read_byte(struct mtd_info *mtd) { struct nand_chip *this = mtd->priv; return readb(this->IO_ADDR_R); }
> it seems only one byte is read out.
It's reading one byte out of a buffer that was previously filled with some
operation. It is used for reading status bytes and OOB bad block markers.
-Scott
^ permalink raw reply [flat|nested] 3+ messages in thread* [U-Boot] about nand_read_byte() interface
2009-10-30 16:42 ` Scott Wood
@ 2009-11-02 3:07 ` HeLei
0 siblings, 0 replies; 3+ messages in thread
From: HeLei @ 2009-11-02 3:07 UTC (permalink / raw)
To: u-boot
Thank you, Scott :)
> Date: Fri, 30 Oct 2009 11:42:19 -0500
> From: scottwood at freescale.com
> To: leon.he at msn.com
> CC: u-boot at lists.denx.de
> Subject: Re: [U-Boot] about nand_read_byte() interface
>
> On Fri, Oct 30, 2009 at 01:20:58PM +0800, HeLei wrote:
> >
> > Hi, all
>
> Hi, please wrap your lines at 75 or so characters -- and definitely don't
> paste code as all one line.
Sorry, I change to another email client, I hope it will be okay this time.
> > I'm a little confused on NAND read operation.
> > According to NAND character, NAND flash is read page by page, which mean's
> > once you read, at least you should read data with page size (such as
> > 512Bytes)
>
> Yes, unless you're reading from the out-of-band area.
So, this means we have to call nand_read() to get the whole page, even if we just need a single byte in the page. And the call chain is as following:
mtd->nand => nand_read => nand_do_read_ops =>nand_read_page_raw => ...
Do I get it ?
> > But the nand_read_byte() is implemented as following: static u_char
> > nand_read_byte(struct mtd_info *mtd) { struct nand_chip *this = mtd->priv; return readb(this->IO_ADDR_R); }
> > it seems only one byte is read out.
>
> It's reading one byte out of a buffer that was previously filled with some
> operation. It is used for reading status bytes and OOB bad block markers.
Yes, interface nand_read_byte() is often used to read out status byte or OOB byte, after I review the code.
> -Scott
_________________________________________________________________
?? Windows 7???????? PC??????
http://www.microsoft.com/china/windows/buy/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-02 3:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-30 5:20 [U-Boot] about nand_read_byte() interface HeLei
2009-10-30 16:42 ` Scott Wood
2009-11-02 3:07 ` HeLei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox