Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 1 | #include <sys/io.h> |
| 2 | #include <unistd.h> |
| 3 | |
| 4 | struct flashchip { |
| 5 | char * name; |
| 6 | int manufacture_id; |
| 7 | int model_id; |
| 8 | |
Ronald G. Minnich | ef5779d | 2002-01-29 20:18:02 +0000 | [diff] [blame^] | 9 | volatile char * virt_addr; |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 10 | int total_size; |
| 11 | int page_size; |
| 12 | |
| 13 | int (*probe) (struct flashchip * flash); |
| 14 | int (*erase) (struct flashchip * flash); |
| 15 | int (*write) (struct flashchip * flash, char * buf); |
| 16 | }; |
| 17 | |
| 18 | #define AMD_ID 0x01 |
| 19 | #define AM_29F040B 0xA4 |
| 20 | |
| 21 | #define ATMEL_ID 0x1F /* Winbond Manufacture ID code */ |
| 22 | #define AT_29C040A 0xA4 /* Winbond w29c020c device code*/ |
| 23 | |
| 24 | #define MX_ID 0xC2 |
| 25 | #define MX_29F002 0xB0 |
| 26 | |
| 27 | #define SST_ID 0xBF /* SST Manufacturer ID[B code */ |
| 28 | #define SST_29EE020A 0x10 /* SST 29EE020 device code */ |
| 29 | #define SST_28SF040 0x04 /* SST 29EE040 device code */ |
| 30 | |
| 31 | #define WINBOND_ID 0xDA /* Winbond Manufacture ID code */ |
| 32 | #define W_29C020C 0x45 /* Winbond w29c020c device code*/ |
| 33 | |
| 34 | extern int probe_28sf040 (struct flashchip * flash); |
| 35 | extern int erase_28sf040 (struct flashchip * flash); |
| 36 | extern int write_28sf040 (struct flashchip * flash, char * buf); |
| 37 | |
| 38 | extern int probe_29f040b (struct flashchip * flash); |
| 39 | extern int erase_29f040b (struct flashchip * flash); |
| 40 | extern int write_29f040b (struct flashchip * flash, char * buf); |
| 41 | |
| 42 | extern int probe_29f002 (struct flashchip * flash); |
| 43 | extern int erase_29f002 (struct flashchip * flash); |
| 44 | extern int write_29f002 (struct flashchip * flash, char * buf); |