diff options
| author | Ronald G. Minnich <rminnich@gmail.com> | 2003-02-28 17:21:38 +0000 | 
|---|---|---|
| committer | Ronald G. Minnich <rminnich@gmail.com> | 2003-02-28 17:21:38 +0000 | 
| commit | d4228fdc4793c900e3f5eb0d2db0576a6f36235d (patch) | |
| tree | 8b97e52b0701f641a3566e0448b699ce912e46a7 | |
| parent | 4d32e789a867bbf1419fc1f4f82b1145891d4d16 (diff) | |
| download | flashrom-d4228fdc4793c900e3f5eb0d2db0576a6f36235d.tar.gz flashrom-d4228fdc4793c900e3f5eb0d2db0576a6f36235d.tar.bz2 flashrom-d4228fdc4793c900e3f5eb0d2db0576a6f36235d.zip | |
Made the ids always print in hex less verbose verify step
Corresponding to coreboot v1 svn r752.
| -rw-r--r-- | 82802ab.c | 13 | ||||
| -rw-r--r-- | am29f040b.c | 2 | ||||
| -rw-r--r-- | flash_rom.c | 18 | ||||
| -rw-r--r-- | jedec.c | 2 | ||||
| -rw-r--r-- | m29f400bt.c | 6 | ||||
| -rw-r--r-- | sst28sf040.c | 2 | ||||
| -rw-r--r-- | sst39sf020.c | 3 | ||||
| -rw-r--r-- | w49f002u.c | 3 | 
8 files changed, 30 insertions, 19 deletions
| @@ -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 ceba046f..3603bb99 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 94d4972a..0ec1e042 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;  } @@ -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 2011ceb1..73f92136 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 4042e8bf..d811988c 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 48a1d596..7e0853a0 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; @@ -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; | 
