Changeset 185 for trunk/flashrom.c


Ignore:
Timestamp:
Jan 22, 2008 4:19:01 PM (5 years ago)
Author:
hailfinger
Message:

Original v2 revision: 3070

Flashrom did not use the read function for verifying, it used direct memory
access instead. That fails if the flash chip is not mapped completely.
If the read function is set in struct flashchip, use it for verification
as well.

This fixes verification of all SPI flash chips >512 kByte behind an
IT8716F flash translation chip.

"MX25L8005 found at physical address 0xfff00000.
Flash part is MX25L8005 (1024 KB).
Flash image seems to be a legacy BIOS. Disabling checks.
Verifying flash... VERIFIED."

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@…>
Acked-by: Harald Gutmann <harald.gutmann@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/flashrom.c

    r182 r185  
    160160        int idx; 
    161161        int total_size = flash->total_size * 1024; 
    162         volatile uint8_t *bios = flash->virtual_memory; 
     162        uint8_t *buf2 = (uint8_t *) calloc(total_size, sizeof(char)); 
     163        if (flash->read == NULL) 
     164                memcpy(buf2, (const char *)flash->virtual_memory, total_size); 
     165        else 
     166                flash->read(flash, buf2); 
    163167 
    164168        printf("Verifying flash... "); 
     
    171175                        printf("0x%08x", idx); 
    172176 
    173                 if (*(bios + idx) != *(buf + idx)) { 
     177                if (*(buf2 + idx) != *(buf + idx)) { 
    174178                        if (verbose) { 
    175179                                printf("0x%08x ", idx); 
Note: See TracChangeset for help on using the changeset viewer.