blob: 3649704c36684e54a8e12d716a7e42d6e0ae2dd5 [file] [log] [blame]
Ronald G. Minnich56439422002-09-06 16:58:14 +00001extern int probe_82802ab (struct flashchip * flash);
2extern int erase_82802ab (struct flashchip * flash);
3extern int write_82802ab (struct flashchip * flash, char * buf);
4
5extern __inline__ void toggle_ready_82802ab (volatile char * dst)
6{
7 unsigned int i = 0;
8 char tmp1, tmp2;
9
10 tmp1 = *dst & 0x40;
11
12 while (i++ < 0xFFFFFF) {
13 tmp2 = *dst & 0x40;
14 if (tmp1 == tmp2) {
15 break;
16 }
17 tmp1 = tmp2;
18 }
19}
20
21extern __inline__ void data_polling_82802ab (volatile char * dst, char data)
22{
23 unsigned int i = 0;
24 char tmp;
25
26 data &= 0x80;
27
28 while (i++ < 0xFFFFFF) {
29 tmp = *dst & 0x80;
30 if (tmp == data) {
31 break;
32 }
33 }
34}
35
36extern __inline__ void protect_82802ab (volatile char * bios)
37{
38 *(volatile char *) (bios + 0x5555) = 0xAA;
39 *(volatile char *) (bios + 0x2AAA) = 0x55;
40 *(volatile char *) (bios + 0x5555) = 0xA0;
41
42 usleep(200);
43}
44