Attention is currently required from: Nikolai Artemiev.
Edward O'Callaghan has uploaded this change for review.
register/: Pass flashprog though register_X_master() helpers
Change-Id: I2ee5c8801d17512e6949e6ed7050c9162c107af3
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M atahpt.c
M atapromise.c
M atavia.c
M drkaiser.c
M dummyflasher.c
M gfxnvidia.c
M ichspi.c
M include/programmer.h
M internal.c
M it8212.c
M linux_mtd.c
M nic3com.c
M nicintel.c
M nicintel_eeprom.c
M nicnatsemi.c
M nicrealtek.c
M opaque.c
M parallel.c
M satamv.c
M satasii.c
M serprog.c
21 files changed, 36 insertions(+), 23 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/17/72817/1
diff --git a/atahpt.c b/atahpt.c
index 43a10ad..f059b19 100644
--- a/atahpt.c
+++ b/atahpt.c
@@ -106,7 +106,7 @@
data->flash_access = pci_read_long(dev, REG_FLASH_ACCESS);
pci_write_long(dev, REG_FLASH_ACCESS, data->flash_access | BIT_FLASH_ACCESS);
- return register_par_master(&par_master_atahpt, BUS_PARALLEL, data);
+ return register_par_master(flashprog, &par_master_atahpt, BUS_PARALLEL, data);
}
const struct programmer_entry programmer_atahpt = {
diff --git a/atapromise.c b/atapromise.c
index 9deed47..208597b 100644
--- a/atapromise.c
+++ b/atapromise.c
@@ -170,7 +170,7 @@
data->rom_size = rom_size;
max_rom_decode.parallel = rom_size;
- return register_par_master(&par_master_atapromise, BUS_PARALLEL, data);
+ return register_par_master(flashprog, &par_master_atapromise, BUS_PARALLEL, data);
}
const struct programmer_entry programmer_atapromise = {
diff --git a/atavia.c b/atavia.c
index 92ac261..ba3c2ec 100644
--- a/atavia.c
+++ b/atavia.c
@@ -176,7 +176,7 @@
return 1;
}
- return register_par_master(&lpc_master_atavia, BUS_LPC, NULL);
+ return register_par_master(flashprog, &lpc_master_atavia, BUS_LPC, NULL);
}
const struct programmer_entry programmer_atavia = {
diff --git a/drkaiser.c b/drkaiser.c
index 2e5dd1a..8be5dba 100644
--- a/drkaiser.c
+++ b/drkaiser.c
@@ -108,7 +108,7 @@
max_rom_decode.parallel = 128 * 1024;
- return register_par_master(&par_master_drkaiser, BUS_PARALLEL, data);
+ return register_par_master(flashprog, &par_master_drkaiser, BUS_PARALLEL, data);
}
const struct programmer_entry programmer_drkaiser = {
diff --git a/dummyflasher.c b/dummyflasher.c
index 149811c..bd4b94a 100644
--- a/dummyflasher.c
+++ b/dummyflasher.c
@@ -1418,9 +1418,9 @@
}
if (dummy_buses_supported & BUS_PROG)
- ret |= register_opaque_master(&opaque_master_dummyflasher, data);
+ ret |= register_opaque_master(flashprog, &opaque_master_dummyflasher, data);
if (dummy_buses_supported & BUS_NONSPI)
- ret |= register_par_master(&par_master_dummyflasher,
+ ret |= register_par_master(flashprog, &par_master_dummyflasher,
dummy_buses_supported & BUS_NONSPI,
data);
if (dummy_buses_supported & BUS_SPI)
diff --git a/gfxnvidia.c b/gfxnvidia.c
index 7d8eb59..d445ab7 100644
--- a/gfxnvidia.c
+++ b/gfxnvidia.c
@@ -136,7 +136,7 @@
/* Write/erase doesn't work. */
programmer_may_write = false;
- return register_par_master(&par_master_gfxnvidia, BUS_PARALLEL, data);
+ return register_par_master(flashprog, &par_master_gfxnvidia, BUS_PARALLEL, data);
}
const struct programmer_entry programmer_gfxnvidia = {
diff --git a/ichspi.c b/ichspi.c
index 1aae99b..877064a 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -2348,7 +2348,7 @@
if (!opaque_hwseq_data)
return ERROR_FLASHROM_FATAL;
memcpy(opaque_hwseq_data, &hwseq_data, sizeof(*opaque_hwseq_data));
- register_opaque_master(&opaque_master_ich_hwseq, opaque_hwseq_data);
+ register_opaque_master(flashprog, &opaque_master_ich_hwseq, opaque_hwseq_data);
} else {
register_spi_master(&spi_master_ich9, NULL);
}
diff --git a/include/programmer.h b/include/programmer.h
index 9f807c5..56c6524 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -421,7 +421,8 @@
void (*delay) (const struct flashctx *flash, unsigned int usecs);
void *data;
};
-int register_opaque_master(const struct opaque_master *mst, void *data);
+int register_opaque_master(struct flashrom_programmer *flashprog,
+ const struct opaque_master *mst, void *data);
/* parallel.c */
struct par_master {
@@ -439,7 +440,7 @@
void (*delay) (const struct flashctx *flash, unsigned int usecs);
void *data;
};
-int register_par_master(const struct par_master *mst, const enum chipbustype buses, void *data);
+int register_par_master(struct flashrom_programmer *flashprog, const struct par_master *mst, const enum chipbustype buses, void *data);
/* programmer.c */
struct registered_master {
diff --git a/internal.c b/internal.c
index c2e428f..0928f6e 100644
--- a/internal.c
+++ b/internal.c
@@ -280,7 +280,7 @@
#endif
if (internal_buses_supported & BUS_NONSPI)
- register_par_master(&par_master_internal, internal_buses_supported, NULL);
+ register_par_master(flashprog, &par_master_internal, internal_buses_supported, NULL);
/* Report if a non-whitelisted laptop is detected that likely uses a legacy bus. */
if (is_laptop && !laptop_ok) {
diff --git a/it8212.c b/it8212.c
index 2450454..9528b4d 100644
--- a/it8212.c
+++ b/it8212.c
@@ -98,7 +98,7 @@
pci_write_long(dev, PCI_ROM_ADDRESS, io_base_addr | 0x01);
max_rom_decode.parallel = IT8212_MEMMAP_SIZE;
- return register_par_master(&par_master_it8212, BUS_PARALLEL, data);
+ return register_par_master(flashprog, &par_master_it8212, BUS_PARALLEL, data);
}
const struct programmer_entry programmer_it8212 = {
.name = "it8212",
diff --git a/linux_mtd.c b/linux_mtd.c
index 0e68cc7..4d79114 100644
--- a/linux_mtd.c
+++ b/linux_mtd.c
@@ -545,7 +545,7 @@
return 1;
}
- return register_opaque_master(&linux_mtd_opaque_master, data);
+ return register_opaque_master(flashprog, &linux_mtd_opaque_master, data);
linux_mtd_init_exit:
free(param_str);
diff --git a/nic3com.c b/nic3com.c
index 8ca79ae..de9762e 100644
--- a/nic3com.c
+++ b/nic3com.c
@@ -144,7 +144,7 @@
max_rom_decode.parallel = 128 * 1024;
- return register_par_master(&par_master_nic3com, BUS_PARALLEL, data);
+ return register_par_master(flashprog, &par_master_nic3com, BUS_PARALLEL, data);
init_err_cleanup_exit:
/* 3COM 3C90xB cards need a special fixup. */
diff --git a/nicintel.c b/nicintel.c
index 0e19856..444b894 100644
--- a/nicintel.c
+++ b/nicintel.c
@@ -119,7 +119,7 @@
data->nicintel_control_bar = control_bar;
max_rom_decode.parallel = NICINTEL_MEMMAP_SIZE;
- return register_par_master(&par_master_nicintel, BUS_PARALLEL, data);
+ return register_par_master(flashprog, &par_master_nicintel, BUS_PARALLEL, data);
}
const struct programmer_entry programmer_nicintel = {
diff --git a/nicintel_eeprom.c b/nicintel_eeprom.c
index 2a7861c..58a14fd 100644
--- a/nicintel_eeprom.c
+++ b/nicintel_eeprom.c
@@ -530,7 +530,7 @@
data->eec = eec;
data->done_i210_write = false;
- return register_opaque_master(mst, data);
+ return register_opaque_master(flashprog, mst, data);
}
const struct programmer_entry programmer_nicintel_eeprom = {
diff --git a/nicnatsemi.c b/nicnatsemi.c
index 817855e..5ec356a 100644
--- a/nicnatsemi.c
+++ b/nicnatsemi.c
@@ -112,7 +112,7 @@
* functions below wants to be 0x0000FFFF.
*/
max_rom_decode.parallel = 131072;
- return register_par_master(&par_master_nicnatsemi, BUS_PARALLEL, data);
+ return register_par_master(flashprog, &par_master_nicnatsemi, BUS_PARALLEL, data);
}
diff --git a/nicrealtek.c b/nicrealtek.c
index d2c7850..68868e5 100644
--- a/nicrealtek.c
+++ b/nicrealtek.c
@@ -132,7 +132,7 @@
data->bios_rom_addr = bios_rom_addr;
data->bios_rom_data = bios_rom_data;
- return register_par_master(&par_master_nicrealtek, BUS_PARALLEL, data);
+ return register_par_master(flashprog, &par_master_nicrealtek, BUS_PARALLEL, data);
}
const struct programmer_entry programmer_nicrealtek = {
diff --git a/opaque.c b/opaque.c
index 7704ec7..d7c3322 100644
--- a/opaque.c
+++ b/opaque.c
@@ -21,6 +21,7 @@
*/
#include <stdint.h>
+
#include "flash.h"
#include "flashchips.h"
#include "chipdrivers.h"
@@ -46,7 +47,8 @@
return flash->mst->opaque.erase(flash, blockaddr, blocklen);
}
-int register_opaque_master(const struct opaque_master *mst, void *data)
+int register_opaque_master(struct flashrom_programmer *flashprog,
+ const struct opaque_master *mst, void *data)
{
struct registered_master rmst = {0};
diff --git a/parallel.c b/parallel.c
index b193723..ce0749d 100644
--- a/parallel.c
+++ b/parallel.c
@@ -126,7 +126,7 @@
fallback_chip_readn(flash, buf, addr, len);
}
-int register_par_master(const struct par_master *mst,
+int register_par_master(struct flashrom_programmer *flashprog, const struct par_master *mst,
const enum chipbustype buses,
void *data)
{
diff --git a/satamv.c b/satamv.c
index 0aee07f..c2592d4 100644
--- a/satamv.c
+++ b/satamv.c
@@ -197,7 +197,7 @@
/* 512 kByte with two 8-bit latches, and
* 4 MByte with additional 3-bit latch. */
max_rom_decode.parallel = 4 * 1024 * 1024;
- return register_par_master(&par_master_satamv, BUS_PARALLEL, data);
+ return register_par_master(flashprog, &par_master_satamv, BUS_PARALLEL, data);
}
const struct programmer_entry programmer_satamv = {
diff --git a/satasii.c b/satasii.c
index 4e6b7de..8b9c794 100644
--- a/satasii.c
+++ b/satasii.c
@@ -140,7 +140,7 @@
}
data->bar = bar;
- return register_par_master(&par_master_satasii, BUS_PARALLEL, data);
+ return register_par_master(flashprog, &par_master_satasii, BUS_PARALLEL, data);
}
const struct programmer_entry programmer_satasii = {
.name = "satasii",
diff --git a/serprog.c b/serprog.c
index 2b1b7f1..8f9e09d 100644
--- a/serprog.c
+++ b/serprog.c
@@ -952,7 +952,7 @@
if (serprog_buses_supported & BUS_SPI)
register_spi_master(&spi_master_serprog, NULL);
if (serprog_buses_supported & BUS_NONSPI)
- register_par_master(&par_master_serprog, serprog_buses_supported & BUS_NONSPI, NULL);
+ register_par_master(flashprog, &par_master_serprog, serprog_buses_supported & BUS_NONSPI, NULL);
return 0;
init_err_cleanup_exit:
To view, visit change 72817. To unsubscribe, or for help writing mail filters, visit settings.