summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-05-11 20:04:30 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-05-11 20:04:30 +0000
commitd13775eae1842bf04ff01b7e4b680cc16ecdbab2 (patch)
tree76ef9b2701f0b94c83774f28b32e6d2e905a458e
parent1e334e619b5bc5e29034dd4a305ddc9ec39a9033 (diff)
downloadast2050-flashrom-d13775eae1842bf04ff01b7e4b680cc16ecdbab2.zip
ast2050-flashrom-d13775eae1842bf04ff01b7e4b680cc16ecdbab2.tar.gz
Rename the STM50FLW register variable flash_addr used for block write protect handling
All other chips call it wrprotect which is less confusing. As a side benefit, flash_addr is now a name usable for other stuff. Corresponding to flashrom svn r496. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Ronald G. Minnich <rminnich@gmail.com>
-rw-r--r--stm50flw0x0x.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/stm50flw0x0x.c b/stm50flw0x0x.c
index a40da76..d2d82d6 100644
--- a/stm50flw0x0x.c
+++ b/stm50flw0x0x.c
@@ -120,7 +120,7 @@ static void wait_stm50flw0x0x(volatile uint8_t *bios)
*/
int unlock_block_stm50flw0x0x(struct flashchip *flash, int offset)
{
- volatile uint8_t *flash_addr = flash->virtual_registers + 2;
+ volatile uint8_t *wrprotect = flash->virtual_registers + 2;
const uint8_t unlock_sector = 0x00;
int j;
@@ -142,8 +142,8 @@ int unlock_block_stm50flw0x0x(struct flashchip *flash, int offset)
// unlock each 4k-sector
for (j = 0; j < 0x10000; j += 0x1000) {
printf_debug("unlocking at 0x%x\n", offset + j);
- chip_writeb(unlock_sector, flash_addr + offset + j);
- if (chip_readb(flash_addr + offset + j) != unlock_sector) {
+ chip_writeb(unlock_sector, wrprotect + offset + j);
+ if (chip_readb(wrprotect + offset + j) != unlock_sector) {
printf("Cannot unlock sector @ 0x%x\n",
offset + j);
return -1;
@@ -151,8 +151,8 @@ int unlock_block_stm50flw0x0x(struct flashchip *flash, int offset)
}
} else {
printf_debug("unlocking at 0x%x\n", offset);
- chip_writeb(unlock_sector, flash_addr + offset);
- if (chip_readb(flash_addr + offset) != unlock_sector) {
+ chip_writeb(unlock_sector, wrprotect + offset);
+ if (chip_readb(wrprotect + offset) != unlock_sector) {
printf("Cannot unlock sector @ 0x%x\n", offset);
return -1;
}
OpenPOWER on IntegriCloud