rminnich | 8d3ff91 | 2003-10-25 17:01:29 +0000 | [diff] [blame] | 1 | #ifndef __FLASH_H__ |
| 2 | #define __FLASH_H__ 1 |
| 3 | |
| 4 | #include <sys/io.h> |
| 5 | #include <unistd.h> |
| 6 | |
| 7 | struct flashchip { |
ollie | 5b62157 | 2004-03-20 16:46:10 +0000 | [diff] [blame] | 8 | char *name; |
rminnich | 8d3ff91 | 2003-10-25 17:01:29 +0000 | [diff] [blame] | 9 | int manufacture_id; |
| 10 | int model_id; |
| 11 | |
ollie | 5b62157 | 2004-03-20 16:46:10 +0000 | [diff] [blame] | 12 | volatile char *virt_addr; |
rminnich | 8d3ff91 | 2003-10-25 17:01:29 +0000 | [diff] [blame] | 13 | int total_size; |
| 14 | int page_size; |
| 15 | |
| 16 | int (*probe) (struct flashchip * flash); |
| 17 | int (*erase) (struct flashchip * flash); |
ollie | 5b62157 | 2004-03-20 16:46:10 +0000 | [diff] [blame] | 18 | int (*write) (struct flashchip * flash, unsigned char *buf); |
| 19 | int (*read) (struct flashchip * flash, unsigned char *buf); |
rminnich | 8d3ff91 | 2003-10-25 17:01:29 +0000 | [diff] [blame] | 20 | |
| 21 | int fd_mem; |
| 22 | volatile char *virt_addr_2; |
| 23 | }; |
| 24 | |
| 25 | #define AMD_ID 0x01 |
| 26 | #define AM_29F040B 0xA4 |
| 27 | |
ollie | 5b62157 | 2004-03-20 16:46:10 +0000 | [diff] [blame] | 28 | #define ATMEL_ID 0x1F /* Winbond Manufacture ID code */ |
| 29 | #define AT_29C040A 0xA4 /* Winbond w29c020c device code */ |
rminnich | 8d3ff91 | 2003-10-25 17:01:29 +0000 | [diff] [blame] | 30 | |
| 31 | #define MX_ID 0xC2 |
| 32 | #define MX_29F002 0xB0 |
| 33 | |
ollie | f1845bd | 2004-03-27 00:18:15 +0000 | [diff] [blame^] | 34 | #define SST_ID 0xBF /* SST Manufacturer ID code */ |
ollie | 5b62157 | 2004-03-20 16:46:10 +0000 | [diff] [blame] | 35 | #define SST_29EE020A 0x10 /* SST 29EE020 device code */ |
| 36 | #define SST_28SF040 0x04 /* SST 29EE040 device code */ |
| 37 | #define SST_39SF020 0xB6 /* SST 39SF020 device */ |
| 38 | #define SST_39VF020 0xD6 /* SST 39VF020 device */ |
dhendricks | 81524b7 | 2004-03-17 21:47:30 +0000 | [diff] [blame] | 39 | #define SST_49LF040 0x51 /* SST 49LF040 device */ |
dhendricks | 46ebd8d | 2004-03-18 21:55:22 +0000 | [diff] [blame] | 40 | #define SST_49LF080A 0x5B /* SST 48LF080A device */ |
ollie | 5b62157 | 2004-03-20 16:46:10 +0000 | [diff] [blame] | 41 | #define SST_49LF002A 0x57 /* SST 49LF002A device */ |
| 42 | #define SST_49LF003A 0x1B /* SST 49LF003A device */ |
| 43 | #define SST_49LF004A 0x60 /* SST 49LF004A device */ |
| 44 | #define SST_49LF008A 0x5A /* SST 49LF008A device */ |
rminnich | 8d3ff91 | 2003-10-25 17:01:29 +0000 | [diff] [blame] | 45 | |
ollie | 5b62157 | 2004-03-20 16:46:10 +0000 | [diff] [blame] | 46 | #define PMC_ID 0x9D /* PMC Manufacturer ID[B code */ |
| 47 | #define PMC_49FL004 0x6E /* PMC 49FL004 device code */ |
rminnich | be1ace1 | 2004-02-10 21:34:18 +0000 | [diff] [blame] | 48 | |
ollie | 5b62157 | 2004-03-20 16:46:10 +0000 | [diff] [blame] | 49 | #define WINBOND_ID 0xDA /* Winbond Manufacture ID code */ |
| 50 | #define W_29C011 0xC1 /* Winbond w29c011 device code */ |
| 51 | #define W_29C020C 0x45 /* Winbond w29c020c device code */ |
| 52 | #define W_49F002U 0x0B /* Winbond w29c020c device code */ |
rminnich | 8d3ff91 | 2003-10-25 17:01:29 +0000 | [diff] [blame] | 53 | |
ollie | 5b62157 | 2004-03-20 16:46:10 +0000 | [diff] [blame] | 54 | #define ST_ID 0x20 |
rminnich | 8d3ff91 | 2003-10-25 17:01:29 +0000 | [diff] [blame] | 55 | #define ST_M29F400BT 0xD5 |
| 56 | |
| 57 | #define MSYSTEMS_ID 0x156f |
ollie | 5b62157 | 2004-03-20 16:46:10 +0000 | [diff] [blame] | 58 | #define MSYSTEMS_MD2200 0xdb /* ? */ |
| 59 | #define MSYSTEMS_MD2800 0x30 /* hmm -- both 0x30 */ |
| 60 | #define MSYSTEMS_MD2802 0x30 /* hmm -- both 0x30 */ |
rminnich | 8d3ff91 | 2003-10-25 17:01:29 +0000 | [diff] [blame] | 61 | |
| 62 | extern void myusec_delay(int time); |
ollie | 5672ac6 | 2004-03-17 22:22:08 +0000 | [diff] [blame] | 63 | extern void myusec_calibrate_delay(); |
| 64 | extern int enable_flash_write(void); |
ollie | 5b62157 | 2004-03-20 16:46:10 +0000 | [diff] [blame] | 65 | #endif /* !__FLASH_H__ */ |