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); |
Ronald G. Minnich | 5643942 | 2002-09-06 16:58:14 +0000 | [diff] [blame] | 16 | int fd_mem; |
| 17 | volatile char *virt_addr_2; |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 18 | }; |
| 19 | |
| 20 | #define AMD_ID 0x01 |
| 21 | #define AM_29F040B 0xA4 |
| 22 | |
| 23 | #define ATMEL_ID 0x1F /* Winbond Manufacture ID code */ |
| 24 | #define AT_29C040A 0xA4 /* Winbond w29c020c device code*/ |
| 25 | |
| 26 | #define MX_ID 0xC2 |
| 27 | #define MX_29F002 0xB0 |
| 28 | |
| 29 | #define SST_ID 0xBF /* SST Manufacturer ID[B code */ |
| 30 | #define SST_29EE020A 0x10 /* SST 29EE020 device code */ |
| 31 | #define SST_28SF040 0x04 /* SST 29EE040 device code */ |
Ronald G. Minnich | c831647 | 2002-03-21 22:40:40 +0000 | [diff] [blame] | 32 | #define SST_39SF020 0xB6 /* SST 39SF020 device */ |
Ollie Lho | 6041bcd | 2002-07-18 03:32:00 +0000 | [diff] [blame] | 33 | #define SST_39VF020 0xD6 /* SST 39SF020 device */ |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 34 | |
| 35 | #define WINBOND_ID 0xDA /* Winbond Manufacture ID code */ |
Andrew Ip | 973b26d | 2002-12-30 13:10:06 +0000 | [diff] [blame] | 36 | #define W_29C011 0xC1 /* Winbond w29c011 device code*/ |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 37 | #define W_29C020C 0x45 /* Winbond w29c020c device code*/ |
Andrew Ip | f0126ce | 2002-10-16 06:58:05 +0000 | [diff] [blame] | 38 | #define W_49F002U 0x0B /* Winbond w29c020c device code*/ |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 39 | |
Ronald G. Minnich | 3c910ed | 2002-05-28 23:29:17 +0000 | [diff] [blame] | 40 | #define ST_ID 0x20 |
| 41 | #define ST_M29F400BT 0xD5 |
| 42 | |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 43 | extern int probe_28sf040 (struct flashchip * flash); |
| 44 | extern int erase_28sf040 (struct flashchip * flash); |
| 45 | extern int write_28sf040 (struct flashchip * flash, char * buf); |
| 46 | |
Ronald G. Minnich | c831647 | 2002-03-21 22:40:40 +0000 | [diff] [blame] | 47 | extern int probe_39sf020 (struct flashchip * flash); |
| 48 | extern int erase_39sf020 (struct flashchip * flash); |
| 49 | extern int write_39sf020 (struct flashchip * flash, char * buf); |
| 50 | |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 51 | extern int probe_29f040b (struct flashchip * flash); |
| 52 | extern int erase_29f040b (struct flashchip * flash); |
| 53 | extern int write_29f040b (struct flashchip * flash, char * buf); |
| 54 | |
| 55 | extern int probe_29f002 (struct flashchip * flash); |
| 56 | extern int erase_29f002 (struct flashchip * flash); |
| 57 | extern int write_29f002 (struct flashchip * flash, char * buf); |
Andrew Ip | f0126ce | 2002-10-16 06:58:05 +0000 | [diff] [blame] | 58 | |
| 59 | extern int probe_49f002 (struct flashchip * flash); |
| 60 | extern int erase_49f002 (struct flashchip * flash); |
| 61 | extern int write_49f002 (struct flashchip * flash, char * buf); |