summaryrefslogtreecommitdiffstats
path: root/stm50flw0x0x.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2011-12-18 15:01:24 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2011-12-18 15:01:24 +0000
commit9e15fce8945a4611343b083b94ed8d0de8d43c5f (patch)
tree3a5514d022392cf4d8fa368f9f02653da21a93ca /stm50flw0x0x.c
parent4303a77daaed729c507182667d0704a114c4b157 (diff)
downloadflashrom-9e15fce8945a4611343b083b94ed8d0de8d43c5f.zip
flashrom-9e15fce8945a4611343b083b94ed8d0de8d43c5f.tar.gz
Add struct flashctx * parameter to all functions accessing flash chips
All programmer access function prototypes except init have been made static and moved to the respective file. A few internal functions in flash chip drivers had chipaddr parameters which are no longer needed. The lines touched by flashctx changes have been adjusted to 80 columns except in header files. Corresponding to flashrom svn r1474. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Diffstat (limited to 'stm50flw0x0x.c')
-rw-r--r--stm50flw0x0x.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/stm50flw0x0x.c b/stm50flw0x0x.c
index 65d520d..9b6443e 100644
--- a/stm50flw0x0x.c
+++ b/stm50flw0x0x.c
@@ -60,8 +60,10 @@ static int unlock_block_stm50flw0x0x(struct flashctx *flash, int offset)
// unlock each 4k-sector
for (j = 0; j < 0x10000; j += 0x1000) {
msg_cdbg("unlocking at 0x%x\n", offset + j);
- chip_writeb(unlock_sector, wrprotect + offset + j);
- if (chip_readb(wrprotect + offset + j) != unlock_sector) {
+ chip_writeb(flash, unlock_sector,
+ wrprotect + offset + j);
+ if (chip_readb(flash, wrprotect + offset + j) !=
+ unlock_sector) {
msg_cerr("Cannot unlock sector @ 0x%x\n",
offset + j);
return -1;
@@ -69,8 +71,8 @@ static int unlock_block_stm50flw0x0x(struct flashctx *flash, int offset)
}
} else {
msg_cdbg("unlocking at 0x%x\n", offset);
- chip_writeb(unlock_sector, wrprotect + offset);
- if (chip_readb(wrprotect + offset) != unlock_sector) {
+ chip_writeb(flash, unlock_sector, wrprotect + offset);
+ if (chip_readb(flash, wrprotect + offset) != unlock_sector) {
msg_cerr("Cannot unlock sector @ 0x%x\n", offset);
return -1;
}
@@ -94,15 +96,16 @@ int unlock_stm50flw0x0x(struct flashctx *flash)
}
/* This function is unused. */
-int erase_sector_stm50flw0x0x(struct flashctx *flash, unsigned int sector, unsigned int sectorsize)
+int erase_sector_stm50flw0x0x(struct flashctx *flash, unsigned int sector,
+ unsigned int sectorsize)
{
chipaddr bios = flash->virtual_memory + sector;
// clear status register
- chip_writeb(0x50, bios);
+ chip_writeb(flash, 0x50, bios);
// now start it
- chip_writeb(0x32, bios);
- chip_writeb(0xd0, bios);
+ chip_writeb(flash, 0x32, bios);
+ chip_writeb(flash, 0xd0, bios);
programmer_delay(10);
wait_82802ab(flash);
OpenPOWER on IntegriCloud