summaryrefslogtreecommitdiffstats
path: root/spi25.c
diff options
context:
space:
mode:
Diffstat (limited to 'spi25.c')
-rw-r--r--spi25.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/spi25.c b/spi25.c
index f660ad1..9763c80 100644
--- a/spi25.c
+++ b/spi25.c
@@ -876,8 +876,7 @@ int spi_byte_program(struct flashctx *flash, unsigned int addr,
return result;
}
-int spi_nbyte_program(struct flashctx *flash, unsigned int addr, uint8_t *bytes,
- unsigned int len)
+int spi_nbyte_program(struct flashctx *flash, unsigned int addr, const uint8_t *bytes, unsigned int len)
{
int result;
/* FIXME: Switch to malloc based on len unless that kills speed. */
@@ -983,7 +982,7 @@ int spi_read_chunked(struct flashctx *flash, uint8_t *buf, unsigned int start,
* FIXME: Use the chunk code from Michael Karcher instead.
* Each page is written separately in chunks with a maximum size of chunksize.
*/
-int spi_write_chunked(struct flashctx *flash, uint8_t *buf, unsigned int start,
+int spi_write_chunked(struct flashctx *flash, const uint8_t *buf, unsigned int start,
unsigned int len, unsigned int chunksize)
{
int rc = 0;
@@ -1032,8 +1031,7 @@ int spi_write_chunked(struct flashctx *flash, uint8_t *buf, unsigned int start,
* (e.g. due to size constraints in IT87* for over 512 kB)
*/
/* real chunksize is 1, logical chunksize is 1 */
-int spi_chip_write_1(struct flashctx *flash, uint8_t *buf, unsigned int start,
- unsigned int len)
+int spi_chip_write_1(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len)
{
unsigned int i;
int result = 0;
@@ -1049,7 +1047,7 @@ int spi_chip_write_1(struct flashctx *flash, uint8_t *buf, unsigned int start,
return 0;
}
-int default_spi_write_aai(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len)
+int default_spi_write_aai(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len)
{
uint32_t pos = start;
int result;
OpenPOWER on IntegriCloud