summaryrefslogtreecommitdiffstats
path: root/serprog.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2014-07-19 22:03:29 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2014-07-19 22:03:29 +0000
commita5bcbceb581f27cfc0055369d3dd9cfd1ae00bfa (patch)
tree5daecd880a16b7011be28e064fb7550f3e6b7e58 /serprog.c
parent82b6ec1df30d3fca55547f230c76718d6e613b2a (diff)
downloadflashrom-a5bcbceb581f27cfc0055369d3dd9cfd1ae00bfa.tar.gz
flashrom-a5bcbceb581f27cfc0055369d3dd9cfd1ae00bfa.tar.bz2
flashrom-a5bcbceb581f27cfc0055369d3dd9cfd1ae00bfa.zip
Rename programmer registration functions
Register_programmer suggests that we register a programmer. However, that function registers a master for a given bus type, and a programmer may support multiple masters (e.g. SPI, FWH). Rename a few other functions to be more consistent. Corresponding to flashrom svn r1831. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'serprog.c')
-rw-r--r--serprog.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/serprog.c b/serprog.c
index 5f26aea84..e52c994cb 100644
--- a/serprog.c
+++ b/serprog.c
@@ -303,7 +303,7 @@ static int serprog_spi_send_command(struct flashctx *flash,
unsigned char *readarr);
static int serprog_spi_read(struct flashctx *flash, uint8_t *buf,
unsigned int start, unsigned int len);
-static struct spi_programmer spi_programmer_serprog = {
+static struct spi_master spi_master_serprog = {
.type = SPI_CONTROLLER_SERPROG,
.max_data_read = MAX_DATA_READ_UNLIMITED,
.max_data_write = MAX_DATA_WRITE_UNLIMITED,
@@ -320,7 +320,7 @@ static uint8_t serprog_chip_readb(const struct flashctx *flash,
const chipaddr addr);
static void serprog_chip_readn(const struct flashctx *flash, uint8_t *buf,
const chipaddr addr, size_t len);
-static const struct par_programmer par_programmer_serprog = {
+static const struct par_master par_master_serprog = {
.chip_readb = serprog_chip_readb,
.chip_readw = fallback_chip_readw,
.chip_readl = fallback_chip_readl,
@@ -489,7 +489,7 @@ int serprog_init(void)
v |= ((unsigned int)(rbuf[2]) << 16);
if (v == 0)
v = (1 << 24) - 1; /* SPI-op maximum. */
- spi_programmer_serprog.max_data_write = v;
+ spi_master_serprog.max_data_write = v;
msg_pdbg(MSGHEADER "Maximum write-n length is %d\n", v);
}
if (!sp_docommand(S_CMD_Q_RDNMAXLEN, 0, NULL, 3, rbuf)) {
@@ -499,7 +499,7 @@ int serprog_init(void)
v |= ((unsigned int)(rbuf[2]) << 16);
if (v == 0)
v = (1 << 24) - 1; /* SPI-op maximum. */
- spi_programmer_serprog.max_data_read = v;
+ spi_master_serprog.max_data_read = v;
msg_pdbg(MSGHEADER "Maximum read-n length is %d\n", v);
}
spispeed = extract_programmer_param("spispeed");
@@ -669,10 +669,9 @@ int serprog_init(void)
sp_streamed_transmit_bytes = 0;
sp_opbuf_usage = 0;
if (serprog_buses_supported & BUS_SPI)
- register_spi_programmer(&spi_programmer_serprog);
+ register_spi_master(&spi_master_serprog);
if (serprog_buses_supported & BUS_NONSPI)
- register_par_programmer(&par_programmer_serprog,
- serprog_buses_supported & BUS_NONSPI);
+ register_par_master(&par_master_serprog, serprog_buses_supported & BUS_NONSPI);
return 0;
}
@@ -932,7 +931,7 @@ static int serprog_spi_read(struct flashctx *flash, uint8_t *buf,
unsigned int start, unsigned int len)
{
unsigned int i, cur_len;
- const unsigned int max_read = spi_programmer_serprog.max_data_read;
+ const unsigned int max_read = spi_master_serprog.max_data_read;
for (i = 0; i < len; i += cur_len) {
int ret;
cur_len = min(max_read, (len - i));