Nand Flash Support In Sibl; Loading Image Algorithm - Philips LPC3180 Application Note

Getting started linux with
Table of Contents

Advertisement

Philips Semiconductors
And in Linux:
linux-2.6.10/drivers/mtd/nand/lpc3180_nand_phytec.c
linux-2.6.10/drivers/mtd/nand/Makefile
linux-2.6.10/drivers/mtd/nand/Kconfig
linux-2.6.10/arch/arm/configs/lpc3180_defconfig
[Remark] The boldface files are the key files for NAND flash driver porting.
When users use different NAND flash devices, they still use the same LPC3180 on-chip
NAND flash controller that has the same code implementation. We can port the NAND
flash driver with modifying only the device dependent codes. Basically the listed files
without boldface don't need to be modified.

7.2 NAND flash support in SIBL

Basically NAND flash functions include read, write and erase. But in SIBL, only 'read' is
used to load images from NAND flash to SDRAM.
In file
include:
void
void
int
static int crc_check(image_header_t * iheader);
UInt32
Void
For a new NAND flash device, these functions should be modified according to its user
manual.

7.2.1 Loading image algorithm

For better understanding in reading and modifying the source code, this section gives
detailed descriptions on SIBL loading image algorithm. Just for your reference.
In file sibl/sibl_flashboot_phytec.c, functions for reading image data from
NAND flash are:
int
int
int
int
int
The most common situation for the image allocation in the NAND flash is shown as below figure:
0
0
<12NC>
Application note
sibl/sibl_flashboot_phytec.c
set_addr( UInt32 page, UInt32 column);
set_page_addr( UInt32 page);
check_bad_block(int block);
oob_check_ff_on_byte5( UInt8 *p_buf );
waitForReady(void);
read_page_data(UInt8 * buf, UInt32 page);
read_data(UInt8 * buf, int len);
read_block(UInt8 * buf, int block, int offset);
read_first_block( UInt8 *p_buf, int block_nr,
page_offset, unsigned int hdr_size);
one block
...
...
1 2
30
31
0
1 2
one page
read_first_block
...
...
1 2
29
30
31
0
1 2
the start address of the image
blue area :
the allocation of the image
Rev.03 — 21 Dec 2006
Getting started Linux with LPC3180
, the device dependent functions in reading data
...
29
30
31
0
read_block
...
29
30
31
0
1 2
AN10476
...
...
1 2
29
30
31
0
1 2
read_page_data
...
...
...
29
30
31
0
1 2
the last block
the last page
© Koninklijke Philips Electronics N.V. 2004. All rights reserved.
29
30
31
read_data
29
31
21 of 28

Advertisement

Table of Contents
loading

Table of Contents