summaryrefslogtreecommitdiff
path: root/util/flash_and_burn/m29f400bt.h
diff options
context:
space:
mode:
authorLi-Ta Lo <ollie@lanl.gov>2004-03-20 16:46:10 +0000
committerLi-Ta Lo <ollie@lanl.gov>2004-03-20 16:46:10 +0000
commitfbf43ac5a6d90468b4f32c0ea0fc29bd41fabf87 (patch)
tree3cdf0a8d629f9e92cb432a41626255f3ae3dd806 /util/flash_and_burn/m29f400bt.h
parent6a1a1102ea2cd8aed7014c90241f8db7b71847f1 (diff)
consolidate more jedec standard code
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1457 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flash_and_burn/m29f400bt.h')
-rw-r--r--util/flash_and_burn/m29f400bt.h31
1 files changed, 18 insertions, 13 deletions
diff --git a/util/flash_and_burn/m29f400bt.h b/util/flash_and_burn/m29f400bt.h
index 3d1799f4e2..efe0953701 100644
--- a/util/flash_and_burn/m29f400bt.h
+++ b/util/flash_and_burn/m29f400bt.h
@@ -3,13 +3,14 @@
#include <stdio.h>
-extern int probe_m29f400bt (struct flashchip * flash);
-extern int erase_m29f400bt (struct flashchip * flash);
-extern int block_erase_m29f400bt (volatile char * bios, volatile char * dst);
-extern int write_m29f400bt (struct flashchip * flash, unsigned char * buf);
-extern int write_linuxbios_m29f400bt (struct flashchip * flash, unsigned char * buf);
+extern int probe_m29f400bt(struct flashchip *flash);
+extern int erase_m29f400bt(struct flashchip *flash);
+extern int block_erase_m29f400bt(volatile char *bios, volatile char *dst);
+extern int write_m29f400bt(struct flashchip *flash, unsigned char *buf);
+extern int write_linuxbios_m29f400bt(struct flashchip *flash,
+ unsigned char *buf);
-extern __inline__ void toggle_ready_m29f400bt (volatile char * dst)
+extern __inline__ void toggle_ready_m29f400bt(volatile char *dst)
{
unsigned int i = 0;
char tmp1, tmp2;
@@ -25,7 +26,8 @@ extern __inline__ void toggle_ready_m29f400bt (volatile char * dst)
}
}
-extern __inline__ void data_polling_m29f400bt (volatile char * dst, unsigned char data)
+extern __inline__ void data_polling_m29f400bt(volatile char *dst,
+ unsigned char data)
{
unsigned int i = 0;
char tmp;
@@ -40,7 +42,7 @@ extern __inline__ void data_polling_m29f400bt (volatile char * dst, unsigned cha
}
}
-extern __inline__ void protect_m29f400bt (volatile char * bios)
+extern __inline__ void protect_m29f400bt(volatile char *bios)
{
*(volatile char *) (bios + 0xAAA) = 0xAA;
*(volatile char *) (bios + 0x555) = 0x55;
@@ -49,11 +51,12 @@ extern __inline__ void protect_m29f400bt (volatile char * bios)
usleep(200);
}
-extern __inline__ void write_page_m29f400bt (volatile char * bios, char * src, volatile char * dst,
- int page_size)
+extern __inline__ void write_page_m29f400bt(volatile char *bios, char *src,
+ volatile char *dst,
+ int page_size)
{
int i;
-
+
for (i = 0; i < page_size; i++) {
*(volatile char *) (bios + 0xAAA) = 0xAA;
*(volatile char *) (bios + 0x555) = 0x55;
@@ -64,11 +67,13 @@ extern __inline__ void write_page_m29f400bt (volatile char * bios, char * src, v
//*(volatile char *) (bios) = 0xF0;
//usleep(5);
toggle_ready_m29f400bt(dst);
- printf("Value in the flash at address %p = %#x, want %#x\n",(char *)(dst-bios), *dst, *src);
+ printf
+ ("Value in the flash at address %p = %#x, want %#x\n",
+ (char *) (dst - bios), *dst, *src);
dst++;
src++;
}
}
-#endif /* !__M29F400BT_H__ */
+#endif /* !__M29F400BT_H__ */