Philips Semiconductors
AN10476
Getting started Linux with LPC3180
Further explanation to the figure:
1) The first block data of the image is not guaranteed to start from the head of the
first block. So
read_first_block()
is first invoked when performing
load_image()
,
and its main job includes:
o
Start reading the image data from the page address where the image
starts.
o
Cut off the header info data of the image and reallocate the rest of the
first block into the SDRAM address space specified by the header info.
2) Then
read_block()
is invoked for reading the sequent blocks until the last one.
3) The last block data of the image is not guaranteed to fill with the whole block,
and the last page data is not guaranteed to fill with a completed page.
oad_image()
invokes
read_page_data()
in reading the full pages in the last block
and
read_data()
in reading the last incomplete page.
7.3 NAND flash support in U-Boot
U-Boot plays important roles in NAND flash operations as reading, writing, erasing, bad
block checking, etc.
Below is a list of the related source files and their functions.
Directory
Source file name
Description
lpc3180_nand_phytec.c
Deal with low-level access to the specific nand flash
on the board.
lpc3180_nand_abi_phytec.c
Interface between the Linux NAND driver MTD and the
U-boot NAND command.
nand_base.c
NAND low-level MTD interface functions.
nand_ecc.c
Contain an ECC algorithm that detect and correct 1 bit
errors in a 256 byte block data.
nand_bbt.c
Bad block table support for the NAND driver.
lib_nand/
nand_ids.c
A chip list than contains the chip info supported by the
NAND driver.
common/
cmd_nand.c
The U-boot NAND command functions.
7.3.1 Device ID list
The first step in NAND flash driver poring is to check whether your NAND flash device
type is listed in the file
nand_ids.c
. If not, you need to add the corresponding device info
to the list manually.
E.g. the info structure for ST NAND256R3A:
struct nand_flash_dev nand_flash_ids[] = {
……
{"NAND 32MiB 1,8V 8-bit",// the string identifies the device type
0x35, // the device ID code which you can find in its datasheet
512, // the page size of the device (B)
32, // the total chip size of the device (MB)
0x4000, // the erase block size of the device (B)
0},
// the bit-field to store chip relevant options
……
};
struct nand_manufacturers nand_manuf_ids[] = {
……
<12NC>
© Koninklijke Philips Electronics N.V. 2004. All rights reserved.
Application note
Rev.03 — 21 Dec 2006
22 of 28