blob: 2e1f6007bf624813438b77f734be21c8c6b119cc [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);
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 */
Ronald G. Minnichc8316472002-03-21 22:40:40 +000030#define SST_39SF020 0xB6 /* SST 39SF020 device */
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000031
32#define WINBOND_ID 0xDA /* Winbond Manufacture ID code */
33#define W_29C020C 0x45 /* Winbond w29c020c device code*/
34
35extern int probe_28sf040 (struct flashchip * flash);
36extern int erase_28sf040 (struct flashchip * flash);
37extern int write_28sf040 (struct flashchip * flash, char * buf);
38
Ronald G. Minnichc8316472002-03-21 22:40:40 +000039extern int probe_39sf020 (struct flashchip * flash);
40extern int erase_39sf020 (struct flashchip * flash);
41extern int write_39sf020 (struct flashchip * flash, char * buf);
42
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000043extern int probe_29f040b (struct flashchip * flash);
44extern int erase_29f040b (struct flashchip * flash);
45extern int write_29f040b (struct flashchip * flash, char * buf);
46
47extern int probe_29f002 (struct flashchip * flash);
48extern int erase_29f002 (struct flashchip * flash);
49extern int write_29f002 (struct flashchip * flash, char * buf);