diff options
author | ollie <ollie@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2004-12-07 03:15:51 +0000 |
---|---|---|
committer | ollie <ollie@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2004-12-07 03:15:51 +0000 |
commit | 44cb2a1663b967052acfe63a16ce62492ba7d077 (patch) | |
tree | 9d6bd66ce4d93b8adabc83aeae4e1c94c94ff862 /sst_fwhub.c | |
parent | ab2facd46e3bddb32a0fecf2d897c6505d4da6a9 (diff) | |
download | flashrom-44cb2a1663b967052acfe63a16ce62492ba7d077.tar.gz |
Original v2 revision: 1812
SST49LF00[2,3,4] should use
the same driver as 49LF008
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@27 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'sst_fwhub.c')
-rw-r--r-- | sst_fwhub.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/sst_fwhub.c b/sst_fwhub.c index 7ab6bdb..909e394 100644 --- a/sst_fwhub.c +++ b/sst_fwhub.c @@ -75,19 +75,17 @@ int probe_sst_fwhub(struct flashchip *flash) printf("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2); if (id1 != flash->manufacture_id || id2 != flash->model_id) - return 0; + return 0; myusec_delay(10); - - // we need to mmap the write-protect space. bios = mmap(0, size, PROT_WRITE | PROT_READ, MAP_SHARED, flash->fd_mem, (off_t) (0 - 0x400000 - size)); if (bios == MAP_FAILED) { - // it's this part but we can't map it ... - perror("Error MMAP /dev/mem"); - exit(1); + // it's this part but we can't map it ... + perror("Error MMAP /dev/mem"); + exit(1); } flash->virt_addr_2 = bios; @@ -96,9 +94,6 @@ int probe_sst_fwhub(struct flashchip *flash) unsigned char wait_sst_fwhub(volatile unsigned char *bios) { - - - toggle_ready_jedec(bios); return 0; } @@ -138,16 +133,16 @@ int erase_sst_fwhub(struct flashchip *flash) return (0); } -void write_page_sst_fwhub(volatile char *bios, char *src, volatile char *dst, - int page_size) +void write_page_sst_fwhub(volatile char *bios, char *src, + volatile char *dst, int page_size) { int i; for (i = 0; i < page_size; i++) { /* transfer data from source to destination */ - write_byte_program_jedec(bios, src, dst); - src++; - dst++; + write_byte_program_jedec(bios, src, dst); + src++; + dst++; } } @@ -168,7 +163,7 @@ int write_sst_fwhub(struct flashchip *flash, unsigned char *buf) for (i = 0; i < total_size / page_size; i++) { printf("%04d at address: 0x%08x", i, i * page_size); write_page_sst_fwhub(bios, buf + i * page_size, - bios + i * page_size, page_size); + bios + i * page_size, page_size); printf ("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); } |