
On Thursday 23 November 2006 14:42, Yotam Admon wrote:
Hi, I use U-Boot (1.1.4) and try to work with AM29LV040B (AMD None CFI Flash) in addition to known CFI flash devices (AMD, Intel, MXIC, SST).
Does anyone have a way to integrate the CFI deriver with none CFI devices?
Hi Yotam,
What I did in our local U-boot version was(*):
1. Add a cfi_ prefix to flash functions in drivers/cfi_flash.c: flash_init --> cfi_flash_init flash_erase --> cfi_flash_erase write_buff--> cfi_write_buff ...
2. Change flash base address table, in drivers/cfi_flash.c also: flash_info_t flash_info --> extern flash_info_t flash_info
3. Create in our board specific directory a flash.c file with all the flash interface functions and the declaration of flash_info: flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; flash_init() flash_erase() write_buff() ... 4. From my flash_init() I call cfi_flash_init() first. This will change the flash_id for all CFI compatible flashes in the flash_info table.
5. For all other flash types I use my own flash driver(s).
6. flash_erase(), for example, then looks like this: if (info->flash_id == FLASH_MAN_CFI) return cfi_flash_erase(info, s_first, s_last); else / * call my flash driver specific flash_erase */
Thanks, Yotam
I hope the helps you, Rui
*) I don't see a way for this to be merged into U-boot any time soon since it implies changes for all boards using the CFI driver.