summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--82802ab.c13
-rw-r--r--am29f040b.c2
-rw-r--r--flash_rom.c18
-rw-r--r--jedec.c2
-rw-r--r--m29f400bt.c6
-rw-r--r--sst28sf040.c2
-rw-r--r--sst39sf020.c3
-rw-r--r--w49f002u.c3
8 files changed, 30 insertions, 19 deletions
diff --git a/82802ab.c b/82802ab.c
index 71f2af7..b41efcc 100644
--- a/82802ab.c
+++ b/82802ab.c
@@ -73,7 +73,8 @@ int probe_82802ab (struct flashchip * flash)
#endif
myusec_delay(10);
- printf(__FUNCTION__ "id1 %d, id2 %d\n", id1, id2);
+ printf("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
+
if (id1 == flash->manufacture_id && id2 == flash->model_id) {
size_t size = flash->total_size * 1024;
// we need to mmap the write-protect space.
@@ -129,12 +130,12 @@ int erase_82802ab_block(struct flashchip *flash, int offset)
// clear status register
*bios = 0x50;
- printf("Erase at %p\n", bios);
+ //printf("Erase at %p\n", bios);
// clear write protect
- printf("write protect is at %p\n", (wrprotect));
- printf("write protect is 0x%x\n", *(wrprotect));
+ //printf("write protect is at %p\n", (wrprotect));
+ //printf("write protect is 0x%x\n", *(wrprotect));
*(wrprotect) = 0;
- printf("write protect is 0x%x\n", *(wrprotect));
+ //printf("write protect is 0x%x\n", *(wrprotect));
// now start it
*(volatile unsigned char *) (bios) = 0x20;
@@ -142,7 +143,7 @@ int erase_82802ab_block(struct flashchip *flash, int offset)
myusec_delay(10);
// now let's see what the register is
status = wait_82802ab(flash->virt_addr);
- print_82802ab_status(status);
+ //print_82802ab_status(status);
printf("DONE BLOCK 0x%x\n", offset);
}
int erase_82802ab (struct flashchip * flash)
diff --git a/am29f040b.c b/am29f040b.c
index ceba046..3603bb9 100644
--- a/am29f040b.c
+++ b/am29f040b.c
@@ -78,7 +78,7 @@ int probe_29f040b (struct flashchip * flash)
myusec_delay(10);
- printf(__FUNCTION__ "id1 %d, id2 %d\n", id1, id2);
+ printf("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
diff --git a/flash_rom.c b/flash_rom.c
index 94d4972..0ec1e04 100644
--- a/flash_rom.c
+++ b/flash_rom.c
@@ -180,7 +180,7 @@ struct flashchip * probe_flash(struct flashchip * flash)
return NULL;
}
-int verify_flash (struct flashchip * flash, char * buf)
+int verify_flash (struct flashchip * flash, char * buf, int verbose)
{
int i = 0;
int total_size = flash->total_size *1024;
@@ -188,13 +188,19 @@ int verify_flash (struct flashchip * flash, char * buf)
printf("Verifying address: ");
while (i++ < total_size) {
- printf("0x%08x", i);
+ if (verbose)
+ printf("0x%08x", i);
if (*(bios+i) != *(buf+i)) {
+ printf("FAILED\n");
return 0;
}
- printf("\b\b\b\b\b\b\b\b\b\b");
+ if (verbose)
+ printf("\b\b\b\b\b\b\b\b\b\b");
}
- printf("\n");
+ if (verbose)
+ printf("\n");
+ else
+ printf("VERIFIED\n");
return 1;
}
@@ -211,7 +217,7 @@ myusec_calibrate_delay()
struct timeval start, end;
int ok = 0;
- fprintf(stderr, "Setting up microsecond timing loop\n");
+ printf("Setting up microsecond timing loop\n");
while (! ok) {
//fprintf(stderr, "Try %d\n", count);
gettimeofday(&start, 0);
@@ -333,6 +339,6 @@ main (int argc, char * argv[])
printf("OK, calibrated, now do the deed\n");
flash->write (flash, buf);
- verify_flash (flash, buf);
+ verify_flash (flash, buf, /* verbose = */ 0);
return 0;
}
diff --git a/jedec.c b/jedec.c
index f26659f..e811959 100644
--- a/jedec.c
+++ b/jedec.c
@@ -47,7 +47,7 @@ int probe_jedec (struct flashchip * flash)
myusec_delay(10);
- printf(__FUNCTION__ "id1 %d, id2 %d\n", id1, id2);
+ printf("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
diff --git a/m29f400bt.c b/m29f400bt.c
index 2011ceb..73f9213 100644
--- a/m29f400bt.c
+++ b/m29f400bt.c
@@ -46,8 +46,10 @@ int probe_m29f400bt (struct flashchip * flash)
*(volatile char *) (bios + 0xAAA) = 0xF0;
myusec_delay(10);
-
- printf(__FUNCTION__ " id1 %x, id2 %x\n", id1, id2);
+
+ printf("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
+
+
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
diff --git a/sst28sf040.c b/sst28sf040.c
index 4042e8b..d811988 100644
--- a/sst28sf040.c
+++ b/sst28sf040.c
@@ -113,7 +113,7 @@ int probe_28sf040 (struct flashchip * flash)
*bios = RESET;
myusec_delay(10);
- printf(__FUNCTION__ "id1 %d, id2 %d\n", id1, id2);
+ printf("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__ , id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
diff --git a/sst39sf020.c b/sst39sf020.c
index 48a1d59..7e0853a 100644
--- a/sst39sf020.c
+++ b/sst39sf020.c
@@ -128,7 +128,8 @@ int probe_39sf020 (struct flashchip * flash)
myusec_delay(10);
- printf(__FUNCTION__ "id1 %d, id2 %d\n", id1, id2);
+ printf("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
+
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
diff --git a/w49f002u.c b/w49f002u.c
index 887a15b..65b540c 100644
--- a/w49f002u.c
+++ b/w49f002u.c
@@ -44,7 +44,8 @@ int probe_49f002 (struct flashchip * flash)
myusec_delay(10);
- printf(__FUNCTION__ "id1 %d, id2 %d\n", id1, id2);
+ printf("%s: id1 0x%x, id2 0x%x\n", __FUNCTION__, id1, id2);
+
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
OpenPOWER on IntegriCloud