diff -pNur --exclude=.svn bcm-3.12/shared/opensource/flash/cfiflash.c dev/shared/opensource/flash/cfiflash.c --- bcm-3.12/shared/opensource/flash/cfiflash.c 2007-11-20 18:02:40.000000000 +0100 +++ dev/shared/opensource/flash/cfiflash.c 2008-01-31 09:45:00.000000000 +0100 @@ -74,6 +74,10 @@ static DECLARE_MUTEX(cfi_flash_lock); #define FLASH_AMD 1 #define FLASH_INTEL 2 #define FLASH_SST 3 +#define FLASH_EON 4 + +/* list of flash manufacture ID */ +#define MANU_EON 0x7F /* Command codes for the flash_command routine */ #define FLASH_RESET 0 /* reset to read mode */ @@ -104,6 +108,8 @@ static DECLARE_MUTEX(cfi_flash_lock); #define ID_AM29LV320B 0x22F9 #define ID_MX29LV320AB 0x22A8 #define ID_MX29LV640BT 0x22C9 +#define ID_STM29W640FT 0x22ED +#define ID_STM29W640FB 0x22FD #define ID_AM29LV320M 0x227E #define ID_AM29LV320MB 0x2200 @@ -123,6 +129,9 @@ static DECLARE_MUTEX(cfi_flash_lock); #define ID_I28F320C3B 0x88C5 #define ID_I28F640J3 0x8916 +/* A list of Eon device ID's - add others as needed */ +#define ID_EN29LV640 0x227E + #define CFI_FLASH_DEVICES \ {{ID_AM29DL800T, "AM29DL800T"}, \ {ID_AM29DL800B, "AM29DL800B"}, \ @@ -140,6 +149,8 @@ static DECLARE_MUTEX(cfi_flash_lock); {ID_AM29LV320MB, "AM29LV320MB"}, \ {ID_AM29LV320MT, "AM29LV320MT"}, \ {ID_MX29LV640BT, "MX29LV640BT"}, \ + {ID_STM29W640FT, "M29W640FT"}, \ + {ID_STM29W640FB, "M29W640FB"}, \ {ID_SST39VF200A, "SST39VF200A"}, \ {ID_SST39VF400A, "SST39VF400A"}, \ {ID_SST39VF800A, "SST39VF800A"}, \ @@ -214,6 +225,7 @@ static int cfi_flash_write(unsigned shor int nbytes); static int cfi_flash_wait(unsigned short sector, int offset,unsigned short data); static unsigned short cfi_flash_get_device_id(void); +static unsigned short cfi_flash_get_manu_id(void); static int cfi_flash_get_cfi(struct cfi_query *query, unsigned short *cfi_struct, int flashFamily); @@ -330,6 +342,7 @@ int cfi_flash_init(flash_device_info_t * int i=0, j=0, count=0; int basecount=0L; unsigned short device_id; + unsigned short manu_id; int flipCFIGeometry = FALSE; *flash_info = &flash_cfi_dev; @@ -353,8 +366,48 @@ int cfi_flash_init(flash_device_info_t * cfi_flash_command(FLASH_RESET, 0, 0, 0); + manu_id = cfi_flash_get_manu_id(); flash_cfi_dev.flash_device_id = device_id = cfi_flash_get_device_id(); flash_cfi_dev.flash_device_name[0] = '\0'; + + if((manu_id) == MANU_EON) + { +#ifdef DEBUG_FLASH + printk("This is EON flash.\n"); +#endif + flashFamily = FLASH_EON; + /* get cfi */ + if (cfi_flash_get_cfi(&query, 0, flashFamily) == -1) + { + return FLASH_API_ERROR; + } + + count=0;basecount=0L; + for (i=0; i