aboutsummaryrefslogtreecommitdiffstats
path: root/serprog.c
diff options
context:
space:
mode:
Diffstat (limited to 'serprog.c')
-rw-r--r--serprog.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/serprog.c b/serprog.c
index 98aac831..25c9944e 100644
--- a/serprog.c
+++ b/serprog.c
@@ -303,15 +303,13 @@ static int serprog_spi_send_command(struct flashctx *flash,
unsigned int writecnt, unsigned int readcnt,
const unsigned char *writearr,
unsigned char *readarr);
-static int serprog_spi_read(struct flashctx *flash, uint8_t *buf,
- unsigned int start, unsigned int len);
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,
.command = serprog_spi_send_command,
.multicommand = default_spi_send_multicommand,
- .read = serprog_spi_read,
+ .read = default_spi_read,
.write_256 = default_spi_write_256,
.write_aai = default_spi_write_aai,
};
@@ -933,25 +931,6 @@ static int serprog_spi_send_command(struct flashctx *flash,
return ret;
}
-/* FIXME: This function is optimized so that it does not split each transaction
- * into chip page_size long blocks unnecessarily like spi_read_chunked. This has
- * the advantage that it is much faster for most chips, but breaks those with
- * non-continuous reads. When spi_read_chunked is fixed this method can be removed. */
-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_master_serprog.max_data_read;
- for (i = 0; i < len; i += cur_len) {
- int ret;
- cur_len = min(max_read, (len - i));
- ret = spi_nbyte_read(flash, start + i, buf + i, cur_len);
- if (ret)
- return ret;
- }
- return 0;
-}
-
void *serprog_map(const char *descr, uintptr_t phys_addr, size_t len)
{
/* Serprog transmits 24 bits only and assumes the underlying implementation handles any remaining bits