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.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-big/flashrom.c =================================================================== --- flashrom-big/flashrom.c (Revision 3069) +++ flashrom-big/flashrom.c (Arbeitskopie) @@ -159,7 +159,11 @@ { int idx; int total_size = flash->total_size * 1024; - volatile uint8_t *bios = flash->virtual_memory; + uint8_t *buf2 = (uint8_t *) calloc(total_size, sizeof(char)); + if (flash->read == NULL) + memcpy(buf2, (const char *)flash->virtual_memory, total_size); + else + flash->read(flash, buf2);
printf("Verifying flash... ");
@@ -170,7 +174,7 @@ if (verbose && ((idx & 0xfff) == 0xfff)) printf("0x%08x", idx);
- if (*(bios + idx) != *(buf + idx)) { + if (*(buf2 + idx) != *(buf + idx)) { if (verbose) { printf("0x%08x ", idx); }
Am Dienstag, 22. Januar 2008 15:59:28 schrieb Carl-Daniel Hailfinger:
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.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Harald Gutmann harald.gutmann@gmx.net
"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."
regards, harald
Index: flashrom-big/flashrom.c
--- flashrom-big/flashrom.c (Revision 3069) +++ flashrom-big/flashrom.c (Arbeitskopie) @@ -159,7 +159,11 @@ { int idx; int total_size = flash->total_size * 1024;
- volatile uint8_t *bios = flash->virtual_memory;
uint8_t *buf2 = (uint8_t *) calloc(total_size, sizeof(char));
if (flash->read == NULL)
memcpy(buf2, (const char *)flash->virtual_memory, total_size);
else
flash->read(flash, buf2);
printf("Verifying flash... ");
@@ -170,7 +174,7 @@ if (verbose && ((idx & 0xfff) == 0xfff)) printf("0x%08x", idx);
if (*(bios + idx) != *(buf + idx)) {
if (*(buf2 + idx) != *(buf + idx)) { if (verbose) { printf("0x%08x ", idx); }
On 22.01.2008 16:10, Harald Gutmann wrote:
Am Dienstag, 22. Januar 2008 15:59:28 schrieb Carl-Daniel Hailfinger:
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.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Harald Gutmann harald.gutmann@gmx.net
"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."
Thanks, r3070.
Regards, Carl-Daniel
On Tue, Jan 22, 2008 at 03:59:28PM +0100, Carl-Daniel Hailfinger wrote:
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.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-big/flashrom.c
--- flashrom-big/flashrom.c (Revision 3069) +++ flashrom-big/flashrom.c (Arbeitskopie) @@ -159,7 +159,11 @@ { int idx; int total_size = flash->total_size * 1024;
- volatile uint8_t *bios = flash->virtual_memory;
- uint8_t *buf2 = (uint8_t *) calloc(total_size, sizeof(char));
sizeof(char) is 1 per definition in ANSI C, no need for sizeof here.
Uwe.
On 22.01.2008 16:59, Uwe Hermann wrote:
On Tue, Jan 22, 2008 at 03:59:28PM +0100, Carl-Daniel Hailfinger wrote:
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.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-big/flashrom.c
--- flashrom-big/flashrom.c (Revision 3069) +++ flashrom-big/flashrom.c (Arbeitskopie) @@ -159,7 +159,11 @@ { int idx; int total_size = flash->total_size * 1024;
- volatile uint8_t *bios = flash->virtual_memory;
- uint8_t *buf2 = (uint8_t *) calloc(total_size, sizeof(char));
sizeof(char) is 1 per definition in ANSI C, no need for sizeof here.
This was a cut-and-paste from the read function in flashrom. You can post a cleaunp patch if you want.
Regards, Carl-Daniel
* Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net [080122 15:59]:
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.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
looks reasonable, but i could not test it.
Acked-by: Stefan Reinauer stepan@coresystems.de
On 27.01.2008 05:28, Stefan Reinauer wrote:
- Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net [080122 15:59]:
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.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
looks reasonable, but i could not test it.
Acked-by: Stefan Reinauer stepan@coresystems.de
Thanks, was already committed in r3070.
Regards, Carl-Daniel