Ronald G. Minnich | eaab50b | 2003-09-12 22:41:53 +0000 | [diff] [blame] | 1 | #ifndef __FLASH_H__ |
| 2 | #define __FLASH_H__ 1 |
| 3 | |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 4 | #include <sys/io.h> |
| 5 | #include <unistd.h> |
| 6 | |
| 7 | struct flashchip { |
| 8 | char * name; |
| 9 | int manufacture_id; |
| 10 | int model_id; |
| 11 | |
Ronald G. Minnich | ef5779d | 2002-01-29 20:18:02 +0000 | [diff] [blame] | 12 | volatile char * virt_addr; |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 13 | int total_size; |
| 14 | int page_size; |
| 15 | |
| 16 | int (*probe) (struct flashchip * flash); |
| 17 | int (*erase) (struct flashchip * flash); |
Ronald G. Minnich | eaab50b | 2003-09-12 22:41:53 +0000 | [diff] [blame] | 18 | int (*write) (struct flashchip * flash, unsigned char * buf); |
| 19 | int (*read) (struct flashchip * flash, unsigned char * buf); |
| 20 | |
Ronald G. Minnich | 5643942 | 2002-09-06 16:58:14 +0000 | [diff] [blame] | 21 | int fd_mem; |
| 22 | volatile char *virt_addr_2; |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 23 | }; |
| 24 | |
| 25 | #define AMD_ID 0x01 |
| 26 | #define AM_29F040B 0xA4 |
| 27 | |
| 28 | #define ATMEL_ID 0x1F /* Winbond Manufacture ID code */ |
| 29 | #define AT_29C040A 0xA4 /* Winbond w29c020c device code*/ |
| 30 | |
| 31 | #define MX_ID 0xC2 |
| 32 | #define MX_29F002 0xB0 |
| 33 | |
| 34 | #define SST_ID 0xBF /* SST Manufacturer ID[B code */ |
| 35 | #define SST_29EE020A 0x10 /* SST 29EE020 device code */ |
| 36 | #define SST_28SF040 0x04 /* SST 29EE040 device code */ |
Ronald G. Minnich | c831647 | 2002-03-21 22:40:40 +0000 | [diff] [blame] | 37 | #define SST_39SF020 0xB6 /* SST 39SF020 device */ |
David Hendricks | 3770a11 | 2004-03-17 21:47:30 +0000 | [diff] [blame] | 38 | #define SST_39VF020 0xD6 /* SST 39VF020 device */ |
| 39 | #define SST_49LF040 0x51 /* SST 49LF040 device */ |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 40 | |
Ronald G. Minnich | e3dad01 | 2004-02-10 21:34:18 +0000 | [diff] [blame] | 41 | #define PMC_ID 0x9D /* PMC Manufacturer ID[B code */ |
| 42 | #define PMC_49FL004 0x6E /* PMC 49FL004 device code */ |
| 43 | |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 44 | #define WINBOND_ID 0xDA /* Winbond Manufacture ID code */ |
Andrew Ip | 973b26d | 2002-12-30 13:10:06 +0000 | [diff] [blame] | 45 | #define W_29C011 0xC1 /* Winbond w29c011 device code*/ |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 46 | #define W_29C020C 0x45 /* Winbond w29c020c device code*/ |
Andrew Ip | f0126ce | 2002-10-16 06:58:05 +0000 | [diff] [blame] | 47 | #define W_49F002U 0x0B /* Winbond w29c020c device code*/ |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 48 | |
Ronald G. Minnich | 3c910ed | 2002-05-28 23:29:17 +0000 | [diff] [blame] | 49 | #define ST_ID 0x20 |
| 50 | #define ST_M29F400BT 0xD5 |
| 51 | |
Ronald G. Minnich | eaab50b | 2003-09-12 22:41:53 +0000 | [diff] [blame] | 52 | #define MSYSTEMS_ID 0x156f |
| 53 | #define MSYSTEMS_MD2200 0xdb /* ? */ |
| 54 | #define MSYSTEMS_MD2800 0x30 /* hmm -- both 0x30 */ |
| 55 | #define MSYSTEMS_MD2802 0x30 /* hmm -- both 0x30 */ |
Ronald G. Minnich | 5e5f75e | 2002-01-29 18:21:41 +0000 | [diff] [blame] | 56 | |
Ronald G. Minnich | eaab50b | 2003-09-12 22:41:53 +0000 | [diff] [blame] | 57 | extern void myusec_delay(int time); |
Ollie Lho | cbbf125 | 2004-03-17 22:22:08 +0000 | [diff] [blame] | 58 | extern void myusec_calibrate_delay(); |
| 59 | extern int enable_flash_write(void); |
Ronald G. Minnich | eaab50b | 2003-09-12 22:41:53 +0000 | [diff] [blame] | 60 | #endif /* !__FLASH_H__ */ |