summaryrefslogtreecommitdiffstats
path: root/sst28sf040.c
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2003-09-12 22:41:53 +0000
committerRonald G. Minnich <rminnich@gmail.com>2003-09-12 22:41:53 +0000
commiteaab50bb32edfe419eb472eacfdc82cbc3ecae8c (patch)
tree4ddad443cb40d4f090ba476bb48ddd47b98790a6 /sst28sf040.c
parentceec420c3db6c20c4b882e8bf3ad113db7fcd2de (diff)
downloadast2050-flashrom-eaab50bb32edfe419eb472eacfdc82cbc3ecae8c.zip
ast2050-flashrom-eaab50bb32edfe419eb472eacfdc82cbc3ecae8c.tar.gz
Changes from NIKI
Corresponding to coreboot v1 svn r873.
Diffstat (limited to 'sst28sf040.c')
-rw-r--r--sst28sf040.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sst28sf040.c b/sst28sf040.c
index d811988..ee49f79 100644
--- a/sst28sf040.c
+++ b/sst28sf040.c
@@ -25,6 +25,7 @@
* $Id$
*/
+#include <stdio.h>
#include "flash.h"
#include "jedec.h"
@@ -63,16 +64,18 @@ static __inline__ void unprotect_28sf040 (volatile char * bios)
tmp = *(volatile unsigned char *) (bios + 0x041A);
}
-static __inline__ erase_sector_28sf040 (volatile char * bios, unsigned long address)
+static __inline__ int erase_sector_28sf040 (volatile char * bios, unsigned long address)
{
*bios = AUTO_PG_ERASE1;
*(bios + address) = AUTO_PG_ERASE2;
/* wait for Toggle bit ready */
toggle_ready_jedec(bios);
+
+ return(0);
}
-static __inline__ write_sector_28sf040(volatile char * bios, unsigned char * src,
+static __inline__ int write_sector_28sf040(volatile char * bios, unsigned char * src,
volatile unsigned char * dst, unsigned int page_size)
{
int i;
@@ -91,6 +94,8 @@ static __inline__ write_sector_28sf040(volatile char * bios, unsigned char * src
/* wait for Toggle bit ready */
toggle_ready_jedec(bios);
}
+
+ return(0);
}
int probe_28sf040 (struct flashchip * flash)
@@ -133,9 +138,11 @@ int erase_28sf040 (struct flashchip * flash)
myusec_delay(10);
toggle_ready_jedec(bios);
+
+ return(0);
}
-int write_28sf040 (struct flashchip * flash, char * buf)
+int write_28sf040 (struct flashchip * flash, unsigned char * buf)
{
int i;
int total_size = flash->total_size * 1024, page_size = flash->page_size;
@@ -157,4 +164,6 @@ int write_28sf040 (struct flashchip * flash, char * buf)
printf("\n");
protect_28sf040 (bios);
+
+ return(0);
}
OpenPOWER on IntegriCloud