aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Heijligen <thomas.heijligen@secunet.com>2022-08-15 13:15:43 +0200
committerThomas Heijligen <src@posteo.de>2022-08-17 18:49:40 +0000
commit4ad591bcdc80951bec31177bd45cd265afde721a (patch)
tree9c9d90989222126989c54126935e961d2769290f
parent6a3988b6cd75f6eb1e987add17c680d15f2cfdfc (diff)
downloadflashrom-4ad591bcdc80951bec31177bd45cd265afde721a.tar.gz
flashrom-4ad591bcdc80951bec31177bd45cd265afde721a.tar.bz2
flashrom-4ad591bcdc80951bec31177bd45cd265afde721a.zip
parade_lspcon: Rename PAGE_SIZE to avoid redefinition
PAGE_SIZE is defined in musl libc include/limits.h as _GNU_SOURCE _BSD_DOURCE or _XOPEN_SOURCE Change-Id: Ib6162f87f021f0085073253b73528bbe0737a48e Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66745 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
-rw-r--r--parade_lspcon.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/parade_lspcon.c b/parade_lspcon.c
index e8938c9a..e2d28621 100644
--- a/parade_lspcon.c
+++ b/parade_lspcon.c
@@ -27,7 +27,7 @@
#define REGISTER_ADDRESS (0x94 >> 1)
#define PAGE_ADDRESS (0x9e >> 1)
-#define PAGE_SIZE 256
+#define TUNNEL_PAGE_SIZE 256
#define MAX_SPI_WAIT_RETRIES 1000
#define CLT2_SPI 0x82
@@ -332,7 +332,7 @@ static int parade_lspcon_set_mpu_active(int fd, int running)
static int parade_lspcon_map_page(int fd, unsigned int offset)
{
int ret = 0;
- /* Page number byte, need to / PAGE_SIZE. */
+ /* Page number byte, need to / TUNNEL_PAGE_SIZE. */
ret |= parade_lspcon_write_register(fd, ROMADDR_BYTE1, (offset >> 8) & 0xff);
ret |= parade_lspcon_write_register(fd, ROMADDR_BYTE2, (offset >> 16));
@@ -351,10 +351,10 @@ static int parade_lspcon_read(struct flashctx *flash, uint8_t *buf,
if (fd < 0)
return SPI_GENERIC_ERROR;
- for (i = 0; i < len; i += PAGE_SIZE) {
+ for (i = 0; i < len; i += TUNNEL_PAGE_SIZE) {
ret |= parade_lspcon_map_page(fd, start + i);
- ret |= parade_lspcon_read_data(fd, PAGE_ADDRESS, buf + i, min(len - i, PAGE_SIZE));
- update_progress(flash, FLASHROM_PROGRESS_READ, i + PAGE_SIZE, len);
+ ret |= parade_lspcon_read_data(fd, PAGE_ADDRESS, buf + i, min(len - i, TUNNEL_PAGE_SIZE));
+ update_progress(flash, FLASHROM_PROGRESS_READ, i + TUNNEL_PAGE_SIZE, len);
}
return ret;
@@ -366,8 +366,8 @@ static int parade_lspcon_write_page(int fd, const uint8_t *buf, unsigned int len
* Using static buffer with maximum possible size,
* extra byte is needed for prefixing zero at index 0.
*/
- uint8_t write_buffer[PAGE_SIZE + 1] = { 0 };
- if (len > PAGE_SIZE)
+ uint8_t write_buffer[TUNNEL_PAGE_SIZE + 1] = { 0 };
+ if (len > TUNNEL_PAGE_SIZE)
return SPI_GENERIC_ERROR;
/* First byte represents the writing offset and should always be zero. */
@@ -392,10 +392,10 @@ static int parade_lspcon_write_256(struct flashctx *flash, const uint8_t *buf,
ret |= parade_lspcon_enable_hw_write(fd);
ret |= parade_lspcon_i2c_clt2_spi_reset(fd);
- for (unsigned int i = 0; i < len; i += PAGE_SIZE) {
+ for (unsigned int i = 0; i < len; i += TUNNEL_PAGE_SIZE) {
ret |= parade_lspcon_map_page(fd, start + i);
- ret |= parade_lspcon_write_page(fd, buf + i, min(len - i, PAGE_SIZE));
- update_progress(flash, FLASHROM_PROGRESS_WRITE, i + PAGE_SIZE, len);
+ ret |= parade_lspcon_write_page(fd, buf + i, min(len - i, TUNNEL_PAGE_SIZE));
+ update_progress(flash, FLASHROM_PROGRESS_WRITE, i + TUNNEL_PAGE_SIZE, len);
}
ret |= parade_lspcon_enable_write_protection(fd);