summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-08-12 14:19:42 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-08-23 16:09:26 +0200
commit79f8074d9217fb3316b8f9426b361a70537e4094 (patch)
tree1af10fd2ecb43d4656c618d4890fd9d8aaec13db /arch/powerpc
parent1ebfb6e6c6312138ce128d7b51fbe2092b37d907 (diff)
downloadbarebox-79f8074d9217fb3316b8f9426b361a70537e4094.tar.gz
barebox-79f8074d9217fb3316b8f9426b361a70537e4094.tar.xz
asm-generic: include bitio.h from io.h
This is currently used on ARM and sandbox, but it's relevant for other platforms like x86 as well if driver code wants to make use of the functions defined within. MIPS and PowerPC already defines the symbols, but that's ok because <bitio.h> doesn't override existing macros. This works for MIPS, but not PowerPC, where those aren't macros. Fix that up. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210812121944.4419-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/include/asm/io.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index 8488c36f65..30d0987023 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -132,6 +132,7 @@ static inline void __raw_writel(unsigned int v, volatile void __iomem *addr)
/*
* 8, 16 and 32 bit, big and little endian I/O operations, with barrier.
*/
+#define in_8 in_8
static inline u8 in_8(const volatile u8 __iomem *addr)
{
u8 ret;
@@ -141,11 +142,13 @@ static inline u8 in_8(const volatile u8 __iomem *addr)
return ret;
}
+#define out_8 out_8
static inline void out_8(volatile u8 __iomem *addr, u8 val)
{
__asm__ __volatile__("sync;stb%U0%X0 %1,%0" : "=m" (*addr) : "r" (val));
}
+#define in_le16 in_le16
static inline u16 in_le16(const volatile u16 __iomem *addr)
{
u16 ret;
@@ -155,6 +158,7 @@ static inline u16 in_le16(const volatile u16 __iomem *addr)
return ret;
}
+#define in_be16 in_be16
static inline u16 in_be16(const volatile u16 __iomem *addr)
{
u16 ret;
@@ -164,17 +168,20 @@ static inline u16 in_be16(const volatile u16 __iomem *addr)
return ret;
}
+#define out_le16 out_le16
static inline void out_le16(volatile u16 __iomem *addr, u16 val)
{
__asm__ __volatile__("sync; sthbrx %1,0,%2"
: "=m" (*addr) : "r" (val), "r" (addr));
}
+#define out_be16 out_be16
static inline void out_be16(volatile u16 __iomem *addr, u16 val)
{
__asm__ __volatile__("sync;sth%U0%X0 %1,%0" : "=m" (*addr) : "r" (val));
}
+#define in_le32 in_le32
static inline u32 in_le32(const volatile u32 __iomem *addr)
{
u32 ret;
@@ -184,6 +191,7 @@ static inline u32 in_le32(const volatile u32 __iomem *addr)
return ret;
}
+#define in_be32 in_be32
static inline u32 in_be32(const volatile u32 __iomem *addr)
{
u32 ret;
@@ -193,12 +201,14 @@ static inline u32 in_be32(const volatile u32 __iomem *addr)
return ret;
}
+#define out_le32 out_le32
static inline void out_le32(volatile u32 __iomem *addr, u32 val)
{
__asm__ __volatile__("sync; stwbrx %1,0,%2"
: "=m" (*addr) : "r" (val), "r" (addr));
}
+#define out_be32 out_be32
static inline void out_be32(volatile u32 __iomem *addr, u32 val)
{
__asm__ __volatile__("sync;stw%U0%X0 %1,%0" : "=m" (*addr) : "r" (val));