1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 22:43:17 +02:00

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>
This commit is contained in:
Carl-Daniel Hailfinger
2011-12-18 15:01:24 +00:00
parent 63fd9026f1
commit 8a3c60cdd0
42 changed files with 727 additions and 541 deletions

View File

@ -29,7 +29,7 @@ static int check_sst_fwhub_block_lock(struct flashctx *flash, int offset)
chipaddr registers = flash->virtual_registers;
uint8_t blockstatus;
blockstatus = chip_readb(registers + offset + 2);
blockstatus = chip_readb(flash, registers + offset + 2);
msg_cdbg("Lock status for 0x%06x (size 0x%06x) is %02x, ",
offset, flash->page_size, blockstatus);
switch (blockstatus & 0x3) {
@ -59,7 +59,7 @@ static int clear_sst_fwhub_block_lock(struct flashctx *flash, int offset)
if (blockstatus) {
msg_cdbg("Trying to clear lock for 0x%06x... ", offset);
chip_writeb(0, registers + offset + 2);
chip_writeb(flash, 0, registers + offset + 2);
blockstatus = check_sst_fwhub_block_lock(flash, offset);
msg_cdbg("%s\n", (blockstatus) ? "failed" : "OK");