Device Dependent Functions Porting; Nand Flash Support In Linux Mtd Driver - Philips LPC3180 Application Note

Getting started linux with
Table of Contents

Advertisement

Philips Semiconductors
{NAND_MFR_STMICRO,
......
};
The definitions of both data structures can be found in
[Remark] The type
Linux MTD driver

7.3.2 Device dependent functions porting

We should be clear that users may connect different kinds of NAND flash devices, but
they use the same NAND flash controller – LPC3180 on-chip NAND flash controller. It's
the NAND flash controller that gives the sequential logic control on the NAND flash
device. This feature greatly simplifies the porting process.
NAND flash related functions in
The top 1-7 functions are based on the NAND Flash Controller, we don't need to modify
the codes unless the hardware configuration is changed.
While the last one
the NAND flash device, we need to add specific device operations in the function. It is
declared as:
int LPC3180_nand_command_lp(
)

7.4 NAND flash support in Linux MTD driver

The NAND flash driver in Linux is mainly for the file system JFFS2. Actually we can get
the Linux MTD driver file based on u-boot
<12NC>
Application note
//the manufacture ID code of the device
"ST Micro"},
//the string identifies the manufacture name
nand_flash_dev
./linux-2.6/include/linux/mtd/nand.h
No.
Function
1
LPC3180_nand_write_byte
2
LPC3180_nand_read_byte
3
LPC3180_nand_write_buf_8
4
LPC3180_nand_read_buf_8
5
LPC3180_nand_verify_buf_8
6
LPC3180_nand_select_chip
7
LPC3180_device_ready
8
LPC3180_nand_command_lp
LPC3180_nand_command_lp
struct mtd_info* mtd, //pointer to structure mtd_info
unsigned command,
int column,
int page_addr
Rev.03 — 21 Dec 2006
is only a little different with the one defined in the
./lib_nand/lpc3180_nand_phytec.c
Description
Write one byte to Data Register, then the data is independently
transferred to the Nand Flash Device by the controller.
Read one byte from Data Register, the read of Data Register is
translated to read cycles to the Nand Flash device by the
controller.
Write len bytes data to Data Register, then the data are written
to the Nand Flash Device sequentially.
Read len bytes from Data Register.
Verify len bytes data.
A NULL function.
Function for checking on device ready signal.
Resolve the command passed through the up-level interface,
and perform the specific operations on the Nand Flash Device.
is based on the NAND flash controller and
//operation command
//column address
//page address
./lib_nand/lpc3180_nand_phytec.c
AN10476
Getting started Linux with LPC3180
.
./uboot/_nand.h
.
:
© Koninklijke Philips Electronics N.V. 2004. All rights reserved.
. The
23 of 28

Advertisement

Table of Contents
loading

Table of Contents