summaryrefslogtreecommitdiff
path: root/util/flash_and_burn/sst49lf040.c
diff options
context:
space:
mode:
authorLi-Ta Lo <ollie@lanl.gov>2005-01-11 02:48:22 +0000
committerLi-Ta Lo <ollie@lanl.gov>2005-01-11 02:48:22 +0000
commit3678ad8e38abee296221cd33e2cbc1e5181f715f (patch)
tree6e45728f1d15d500edc806eccffc37e5589f0291 /util/flash_and_burn/sst49lf040.c
parent883b8793c9777544101261ebcbed6088e0df1593 (diff)
*** empty log message ***
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1852 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flash_and_burn/sst49lf040.c')
-rw-r--r--util/flash_and_burn/sst49lf040.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/util/flash_and_burn/sst49lf040.c b/util/flash_and_burn/sst49lf040.c
index 624a8655ef..f19b91e1c2 100644
--- a/util/flash_and_burn/sst49lf040.c
+++ b/util/flash_and_burn/sst49lf040.c
@@ -30,6 +30,21 @@
#include "jedec.h"
#include "sst49lf040.h"
+int erase_49lf040(struct flashchip *flash)
+{
+ int i;
+ int total_size = flash->total_size * 1024;
+ int page_size = flash->page_size;
+ volatile char *bios = flash->virt_addr;
+
+ for (i = 0; i < total_size / page_size; i++) {
+ /* Chip erase only works in parallel programming mode
+ * for the 49lf040. Use sector-erase instead */
+ erase_sector_jedec(bios, i * page_size);
+ }
+ return 0;
+}
+
int write_49lf040(struct flashchip *flash, unsigned char *buf)
{
int i;
@@ -40,8 +55,8 @@ int write_49lf040(struct flashchip *flash, unsigned char *buf)
printf("Programming Page: ");
for (i = 0; i < total_size / page_size; i++) {
/* erase the page before programming
- * Chip erase only works in parallel programming mode for the 49lf040.
- * Use sector-erase instead */
+ * Chip erase only works in parallel programming mode
+ * for the 49lf040. Use sector-erase instead */
erase_sector_jedec(bios, i * page_size);
/* write to the sector */