Wednesday, December 24, 2008

CFI-compliant NOR Flash Device Driver

CFI-compliant NOR Flash Device Driver

CPU: ARM
Example: MXIC MX29LV640D T/B (Parallel, Top Boot Flash)

Bootloader: u-boot-2008.10 (tar.bz2)

Description:
You can implement the driver in two different ways. The first one is a standalone driver and the second one is based on CFI (Common Flash Interface).
(1) You have to implement at least four functions in flash.c
flash_init()
flash_print_info()
write_buff()
flash_erase()

(2) Use the common CFI flash driver
You just need to do some patch work about flash chip.

Patch File:
(1) Standalone Device Driver (source code)
(2) CFI (patch file)

Querying the flash information on u-boot
[]# flinfo
Bank # 1: MXIC 29LV640DT FLASH (8 x 8) Size: 8 MB in 135 Sectors
   AMD Legacy command set, Manufacturer ID: 0xC2, Device ID: 0xC9
   Erase timeout: 30000 ms, write timeout: 100 ms

   Sector Start Addresses:
   10000000 ......

CFI Specifications:
1. Common Flash Memory Interface Specification, Release 2.0, AMD, 2001 (Download)
2. Common Flash Interface (CFI) JEDEC Standard, JESD 68.01, 2003 (Download) (2)
3. Common Flash Interface ID Codes, JEP 137B, 2004 (Download) (2)

Reference:
1. JEDEC

1 comment:

dinny said...

in fact, not all the vendors follow this standard. it causes headache when i try to use AMD, spansion and intel flash chips.