blob: 1828176b361fbd490a5c3be20fc5f4637931da0a [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 */
30
31#define WINBOND_ID 0xDA /* Winbond Manufacture ID code */
32#define W_29C020C 0x45 /* Winbond w29c020c device code*/
33
34extern int probe_28sf040 (struct flashchip * flash);
35extern int erase_28sf040 (struct flashchip * flash);
36extern int write_28sf040 (struct flashchip * flash, char * buf);
37
38extern int probe_29f040b (struct flashchip * flash);
39extern int erase_29f040b (struct flashchip * flash);
40extern int write_29f040b (struct flashchip * flash, char * buf);
41
42extern int probe_29f002 (struct flashchip * flash);
43extern int erase_29f002 (struct flashchip * flash);
44extern int write_29f002 (struct flashchip * flash, char * buf);