From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Fri, 30 Oct 2009 11:42:19 -0500 Subject: [U-Boot] about nand_read_byte() interface In-Reply-To: References: Message-ID: <20091030164218.GA631@loki.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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