summaryrefslogtreecommitdiff
path: root/payloads
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2021-09-16 15:53:32 -0700
committerFelix Held <felix-coreboot@felixheld.de>2021-09-20 12:07:51 +0000
commitea03d0047bbde9b2b4d3278470df6a8060640f4f (patch)
tree72849e599eb8f136b3c94ef6be0a5a32e6cdbc4c /payloads
parent1c8e8b259d18b3692811243ca7e4b95ade2a8095 (diff)
device/mmio: Make buffer_to_fifo32() take a const buffer
The input buffer to the buffer_to_fifo family of functions is only read, so it can be a const pointer. (Also, remove the MIPS check in libpayload for these functions... the MIPS architecture has been removed a while ago.) Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I021069680cf691590fdacc3d51f747f12ae3df31 Reviewed-on: https://review.coreboot.org/c/coreboot/+/57731 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'payloads')
-rw-r--r--payloads/libpayload/include/libpayload.h6
-rw-r--r--payloads/libpayload/libc/lib.c6
2 files changed, 4 insertions, 8 deletions
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 7701a052c2..e08d211983 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -472,18 +472,16 @@ static inline int __ffs64(u64 x) { return log2_64(x & (u64)(-(s64)x)); }
* @defgroup mmio MMIO helper functions
* @{
*/
-#if !CONFIG(LP_ARCH_MIPS)
void buffer_from_fifo32(void *buffer, size_t size, void *fifo,
int fifo_stride, int fifo_width);
-void buffer_to_fifo32_prefix(void *buffer, u32 prefix, int prefsz, size_t size,
+void buffer_to_fifo32_prefix(const void *buffer, u32 prefix, int prefsz, size_t size,
void *fifo, int fifo_stride, int fifo_width);
-static inline void buffer_to_fifo32(void *buffer, size_t size, void *fifo,
+static inline void buffer_to_fifo32(const void *buffer, size_t size, void *fifo,
int fifo_stride, int fifo_width)
{
buffer_to_fifo32_prefix(buffer, 0, 0, size, fifo,
fifo_stride, fifo_width);
}
-#endif
/** @} */
/**
diff --git a/payloads/libpayload/libc/lib.c b/payloads/libpayload/libc/lib.c
index 8387e02a47..77e213c7e0 100644
--- a/payloads/libpayload/libc/lib.c
+++ b/payloads/libpayload/libc/lib.c
@@ -126,7 +126,6 @@ char *getenv(const char *name)
return NULL;
}
-#if !CONFIG(LP_ARCH_MIPS)
/*
* Reads a transfer buffer from 32-bit FIFO registers. fifo_stride is the
* distance in bytes between registers (e.g. pass 4 for a normal array of 32-bit
@@ -156,10 +155,10 @@ void buffer_from_fifo32(void *buffer, size_t size, void *fifo,
* bytes of the 'prefix' u32 parameter and any high-order bytes exceeding prefsz
* must be 0. Note that 'size' counts total bytes written, including 'prefsz'.
*/
-void buffer_to_fifo32_prefix(void *buffer, u32 prefix, int prefsz, size_t size,
+void buffer_to_fifo32_prefix(const void *buffer, u32 prefix, int prefsz, size_t size,
void *fifo, int fifo_stride, int fifo_width)
{
- u8 *p = buffer;
+ const u8 *p = buffer;
int i, j = prefsz;
assert(fifo_width > 0 && fifo_width <= sizeof(u32) &&
@@ -175,4 +174,3 @@ void buffer_to_fifo32_prefix(void *buffer, u32 prefix, int prefsz, size_t size,
}
}
-#endif