summaryrefslogtreecommitdiffstats
path: root/sst49lfxxxc.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 /sst49lfxxxc.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 'sst49lfxxxc.c')
-rw-r--r--sst49lfxxxc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sst49lfxxxc.c b/sst49lfxxxc.c
index bcfb043..37f0628 100644
--- a/sst49lfxxxc.c
+++ b/sst49lfxxxc.c
@@ -23,11 +23,14 @@
#include "flash.h"
#include "chipdrivers.h"
-static int write_lockbits_block_49lfxxxc(struct flashctx *flash, unsigned long address, unsigned char bits)
+static int write_lockbits_block_49lfxxxc(struct flashctx *flash,
+ unsigned long address,
+ unsigned char bits)
{
unsigned long lock = flash->virtual_registers + address + 2;
- msg_cdbg("lockbits at address=0x%08lx is 0x%01x\n", lock, chip_readb(lock));
- chip_writeb(bits, lock);
+ msg_cdbg("lockbits at address=0x%08lx is 0x%01x\n", lock,
+ chip_readb(flash, lock));
+ chip_writeb(flash, bits, lock);
return 0;
}
@@ -59,13 +62,14 @@ int unlock_49lfxxxc(struct flashctx *flash)
return write_lockbits_49lfxxxc(flash, 0);
}
-int erase_sector_49lfxxxc(struct flashctx *flash, unsigned int address, unsigned int sector_size)
+int erase_sector_49lfxxxc(struct flashctx *flash, unsigned int address,
+ unsigned int sector_size)
{
uint8_t status;
chipaddr bios = flash->virtual_memory;
- chip_writeb(0x30, bios);
- chip_writeb(0xD0, bios + address);
+ chip_writeb(flash, 0x30, bios);
+ chip_writeb(flash, 0xD0, bios + address);
status = wait_82802ab(flash);
print_status_82802ab(status);
OpenPOWER on IntegriCloud