mirror of
				https://review.coreboot.org/flashrom.git
				synced 2025-11-04 07:00:39 +01:00 
			
		
		
		
	Made the ids always print in hex less verbose verify step
Corresponding to coreboot v1 svn r752.
This commit is contained in:
		
							
								
								
									
										13
									
								
								82802ab.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								flash_rom.c
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								jedec.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user