1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 06:01:16 +02:00

Make struct flashchip a field in struct flashctx instead of a complete copy

All the driver conversion work and cleanup has been done by Stefan.
flashrom.c and cli_classic.c are a joint work of Stefan and Carl-Daniel.

Corresponding to flashrom svn r1579.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
Carl-Daniel Hailfinger
2012-08-25 01:17:58 +00:00
parent dd73d830f7
commit 5a7cb847f0
23 changed files with 263 additions and 277 deletions

View File

@ -44,7 +44,7 @@ int probe_82802ab(struct flashctx *flash)
{
chipaddr bios = flash->virtual_memory;
uint8_t id1, id2, flashcontent1, flashcontent2;
int shifted = (flash->feature_bits & FEATURE_ADDR_SHIFTED) != 0;
int shifted = (flash->chip->feature_bits & FEATURE_ADDR_SHIFTED) != 0;
/* Reset to get a clean state */
chip_writeb(flash, 0xFF, bios);
@ -80,10 +80,10 @@ int probe_82802ab(struct flashctx *flash)
msg_cdbg(", id2 is normal flash content");
msg_cdbg("\n");
if (id1 != flash->manufacture_id || id2 != flash->model_id)
if (id1 != flash->chip->manufacture_id || id2 != flash->chip->model_id)
return 0;
if (flash->feature_bits & FEATURE_REGISTERMAP)
if (flash->chip->feature_bits & FEATURE_REGISTERMAP)
map_flash_registers(flash);
return 1;
@ -112,7 +112,7 @@ int unlock_82802ab(struct flashctx *flash)
int i;
//chipaddr wrprotect = flash->virtual_registers + page + 2;
for (i = 0; i < flash->total_size * 1024; i+= flash->page_size)
for (i = 0; i < flash->chip->total_size * 1024; i+= flash->chip->page_size)
chip_writeb(flash, 0, flash->virtual_registers + i + 2);
return 0;
@ -181,7 +181,7 @@ int unlock_28f004s5(struct flashctx *flash)
}
/* Read block lock-bits */
for (i = 0; i < flash->total_size * 1024; i+= (64 * 1024)) {
for (i = 0; i < flash->chip->total_size * 1024; i+= (64 * 1024)) {
bcfg = chip_readb(flash, bios + i + 2); // read block lock config
msg_cdbg("block lock at %06x is %slocked!\n", i, bcfg ? "" : "un");
if (bcfg) {
@ -234,7 +234,7 @@ int unlock_lh28f008bjt(struct flashctx *flash)
}
/* Read block lock-bits, 8 * 8 KB + 15 * 64 KB */
for (i = 0; i < flash->total_size * 1024;
for (i = 0; i < flash->chip->total_size * 1024;
i += (i >= (64 * 1024) ? 64 * 1024 : 8 * 1024)) {
bcfg = chip_readb(flash, bios + i + 2); /* read block lock config */
msg_cdbg("block lock at %06x is %slocked!\n", i,