blob: 0fde00e7a68c28dee2b824d9ff592bf3266e4280 [file] [log] [blame]
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +00001#include <sys/io.h>
2#include <unistd.h>
3
4struct flashchip {
5 char * name;
6 int manufacture_id;
7 int model_id;
8
Ronald G. Minnichef5779d2002-01-29 20:18:02 +00009 volatile char * virt_addr;
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000010 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. Minnich56439422002-09-06 16:58:14 +000016 int fd_mem;
17 volatile char *virt_addr_2;
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000018};
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. Minnichc8316472002-03-21 22:40:40 +000032#define SST_39SF020 0xB6 /* SST 39SF020 device */
Ollie Lho6041bcd2002-07-18 03:32:00 +000033#define SST_39VF020 0xD6 /* SST 39SF020 device */
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000034
35#define WINBOND_ID 0xDA /* Winbond Manufacture ID code */
Andrew Ip973b26d2002-12-30 13:10:06 +000036#define W_29C011 0xC1 /* Winbond w29c011 device code*/
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000037#define W_29C020C 0x45 /* Winbond w29c020c device code*/
Andrew Ipf0126ce2002-10-16 06:58:05 +000038#define W_49F002U 0x0B /* Winbond w29c020c device code*/
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000039
Ronald G. Minnich3c910ed2002-05-28 23:29:17 +000040#define ST_ID 0x20
41#define ST_M29F400BT 0xD5
42
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000043extern int probe_28sf040 (struct flashchip * flash);
44extern int erase_28sf040 (struct flashchip * flash);
45extern int write_28sf040 (struct flashchip * flash, char * buf);
46
Ronald G. Minnichc8316472002-03-21 22:40:40 +000047extern int probe_39sf020 (struct flashchip * flash);
48extern int erase_39sf020 (struct flashchip * flash);
49extern int write_39sf020 (struct flashchip * flash, char * buf);
50
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000051extern int probe_29f040b (struct flashchip * flash);
52extern int erase_29f040b (struct flashchip * flash);
53extern int write_29f040b (struct flashchip * flash, char * buf);
54
55extern int probe_29f002 (struct flashchip * flash);
56extern int erase_29f002 (struct flashchip * flash);
57extern int write_29f002 (struct flashchip * flash, char * buf);
Andrew Ipf0126ce2002-10-16 06:58:05 +000058
59extern int probe_49f002 (struct flashchip * flash);
60extern int erase_49f002 (struct flashchip * flash);
61extern int write_49f002 (struct flashchip * flash, char * buf);