diff options
author | Ollie Lho <ollie@sis.com.tw> | 2004-03-18 19:40:07 +0000 |
---|---|---|
committer | Ollie Lho <ollie@sis.com.tw> | 2004-03-18 19:40:07 +0000 |
commit | 55bd16c263222494321766810039aa9e7bc0ddb8 (patch) | |
tree | 17ed4f4c1e385338b6470fa3d2974668d6b8b5fc /sst39sf020.c | |
parent | 29dbba09011d9487e2d0573c3f2bd32010fedc48 (diff) | |
download | flashrom-55bd16c263222494321766810039aa9e7bc0ddb8.zip flashrom-55bd16c263222494321766810039aa9e7bc0ddb8.tar.gz |
Fixed 32bit vs 64bit long int arithematics
Corresponding to flashrom svn r8 and coreboot v2 svn r1434.
Diffstat (limited to 'sst39sf020.c')
-rw-r--r-- | sst39sf020.c | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/sst39sf020.c b/sst39sf020.c index fa35276..3d23adf 100644 --- a/sst39sf020.c +++ b/sst39sf020.c @@ -22,6 +22,8 @@ * Reference: * 4 MEgabit (512K x 8) SuperFlash EEPROM, SST28SF040 data sheet * + * ToDo: Consilidated to standard JEDEC code. + * * $Id$ */ @@ -37,34 +39,6 @@ #define RESET 0xFF #define READ_ID 0x90 -static __inline__ void protect_39sf020 (volatile char * bios) -{ - /* ask compiler not to optimize this */ - volatile unsigned char tmp; - - tmp = *(volatile unsigned char *) (bios + 0x1823); - tmp = *(volatile unsigned char *) (bios + 0x1820); - tmp = *(volatile unsigned char *) (bios + 0x1822); - tmp = *(volatile unsigned char *) (bios + 0x0418); - tmp = *(volatile unsigned char *) (bios + 0x041B); - tmp = *(volatile unsigned char *) (bios + 0x0419); - tmp = *(volatile unsigned char *) (bios + 0x040A); -} - -static __inline__ void unprotect_39sf020 (volatile char * bios) -{ - /* ask compiler not to optimize this */ - volatile unsigned char tmp; - - tmp = *(volatile unsigned char *) (bios + 0x1823); - tmp = *(volatile unsigned char *) (bios + 0x1820); - tmp = *(volatile unsigned char *) (bios + 0x1822); - tmp = *(volatile unsigned char *) (bios + 0x0418); - tmp = *(volatile unsigned char *) (bios + 0x041B); - tmp = *(volatile unsigned char *) (bios + 0x0419); - tmp = *(volatile unsigned char *) (bios + 0x041A); -} - static __inline__ int erase_sector_39sf020 (volatile char * bios, unsigned long address) { *bios = AUTO_PG_ERASE1; @@ -77,9 +51,9 @@ static __inline__ int erase_sector_39sf020 (volatile char * bios, unsigned long } static __inline__ int write_sector_39sf020(volatile char * bios, - unsigned char * src, - volatile unsigned char * dst, - unsigned int page_size) + unsigned char * src, + volatile unsigned char * dst, + unsigned int page_size) { int i; volatile char *Temp; @@ -177,8 +151,8 @@ int write_39sf020 (struct flashchip * flash, unsigned char * buf) int total_size = flash->total_size * 1024, page_size = flash->page_size; volatile char * bios = flash->virt_addr; -// unprotect_39sf020 (bios); erase_39sf020(flash); + printf ("Programming Page: "); for (i = 0; i < total_size/page_size; i++) { /* erase the page before programming */ @@ -193,7 +167,5 @@ int write_39sf020 (struct flashchip * flash, unsigned char * buf) } printf("\n"); -// protect_39sf020 (bios); - return(0); } |