summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-03-20 20:30:02 +0200
committerPatrick Georgi <pgeorgi@google.com>2019-03-22 12:18:41 +0000
commita9506dbaf410d9b2d297661f51f0e0b9842170e1 (patch)
treeb442dc8f162549abb0e11377c80bc624a69e896a /src/arch
parent9c8044bdcd2aa77d8a8092b270ca36fd3aa23b87 (diff)
arch/mips: Fix <arch/mmio.h> prototypes
These signatures need to be consistent across different architectures. Change-Id: Ide8502ee8cda8995828c77fe1674d8ba6f3aa15f Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31995 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/mips/include/arch/mmio.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/arch/mips/include/arch/mmio.h b/src/arch/mips/include/arch/mmio.h
index 27a4944961..c491b51bcb 100644
--- a/src/arch/mips/include/arch/mmio.h
+++ b/src/arch/mips/include/arch/mmio.h
@@ -24,43 +24,47 @@
#include <arch/cache.h>
#include <endian.h>
-static inline uint8_t read8(unsigned long addr)
+static inline uint8_t read8(const volatile void *addr)
{
asm("sync");
return *(volatile uint8_t *)addr;
}
-static inline uint16_t read16(unsigned long addr)
+static inline uint16_t read16(const volatile void *addr)
{
asm("sync");
return *(volatile uint16_t *)addr;
}
-static inline uint32_t read32(unsigned long addr)
+static inline uint32_t read32(const volatile void *addr)
{
asm("sync");
return *(volatile uint32_t *)addr;
}
-static inline void write8(unsigned long addr, uint8_t val)
+static inline void write8(volatile void *addr, uint8_t val)
{
asm("sync");
*(volatile uint8_t *)addr = val;
asm("sync");
}
-static inline void write16(unsigned long addr, uint16_t val)
+static inline void write16(volatile void *addr, uint16_t val)
{
asm("sync");
*(volatile uint16_t *)addr = val;
asm("sync");
}
-static inline void write32(unsigned long addr, uint32_t val)
+static inline void write32(volatile void *addr, uint32_t val)
{
asm("sync");
*(volatile uint32_t *)addr = val;
asm("sync");
}
+/* Fixing soc/imgtech/pistachio seemed painful at the time. */
+#define read32_x(addr) read32((void *)(addr))
+#define write32_x(addr, val) write32((void *)(addr), (val))
+
#endif /* __MIPS_ARCH_IO_H */