Made the ids always print in hex less verbose verify step
Corresponding to coreboot v1 svn r752.
diff --git a/82802ab.c b/82802ab.c
index 71f2af7..b41efcc 100644
--- a/82802ab.c
+++ b/82802ab.c
@@ -73,7 +73,8 @@
#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 @@
// 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
*(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 @@
*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 @@
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 @@
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;