summaryrefslogtreecommitdiffstats
path: root/82802ab.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-08-25 01:17:58 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-08-25 01:17:58 +0000
commit5a7cb847f096dacb0bf96b3aa909f79d76ae8204 (patch)
treeda511e990c1fdded61ee5dcefae38314c3a5a6cc /82802ab.c
parentdd73d830f7370b5f0bbdaa0780b0ff8d6ff1776a (diff)
downloadast2050-flashrom-5a7cb847f096dacb0bf96b3aa909f79d76ae8204.zip
ast2050-flashrom-5a7cb847f096dacb0bf96b3aa909f79d76ae8204.tar.gz
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>
Diffstat (limited to '82802ab.c')
-rw-r--r--82802ab.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/82802ab.c b/82802ab.c
index 79e157a..608995d 100644
--- a/82802ab.c
+++ b/82802ab.c
@@ -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,
OpenPOWER on IntegriCloud