summaryrefslogtreecommitdiff
path: root/arch/alpha/include/asm/core_lca.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2022-10-03 13:12:54 +0200
committerArnd Bergmann <arnd@arndb.de>2022-10-04 11:23:29 +0200
commite19d4ebc536dadb607fe305fdaf48218d3e32d7c (patch)
tree5d645d629d6675015352a1a00d560f55efc6272d /arch/alpha/include/asm/core_lca.h
parent28a679ea60d0d16c3556f687bb2040559e92e932 (diff)
alpha: add full ioread64/iowrite64 implementation
The previous patch introduced ioread64/iowrite64 declarations, but this means we no longer get the io-64-nonatomic variant, and run into a long error when someone actually wants to use these: ERROR: modpost: "ioread64" [drivers/net/ethernet/freescale/enetc/fsl-enetc.ko] undefined! Add the (hopefully) correct implementation for each machine type, based on the 32-bit accessor. Since the 32-bit return type does not work for ioread64(), change the internal implementation to use the correct width consistently, but leave the external interface to match the asm-generic/iomap.h header that uses 32-bit or 64-bit return values. Reported-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Fixes: 7e772dad9913 ("alpha: Use generic <asm-generic/io.h>") Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/alpha/include/asm/core_lca.h')
-rw-r--r--arch/alpha/include/asm/core_lca.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/arch/alpha/include/asm/core_lca.h b/arch/alpha/include/asm/core_lca.h
index ec86314418cb..d8c3e72ef8f6 100644
--- a/arch/alpha/include/asm/core_lca.h
+++ b/arch/alpha/include/asm/core_lca.h
@@ -230,7 +230,7 @@ union el_lca {
} while (0)
-__EXTERN_INLINE unsigned int lca_ioread8(const void __iomem *xaddr)
+__EXTERN_INLINE u8 lca_ioread8(const void __iomem *xaddr)
{
unsigned long addr = (unsigned long) xaddr;
unsigned long result, base_and_type;
@@ -266,7 +266,7 @@ __EXTERN_INLINE void lca_iowrite8(u8 b, void __iomem *xaddr)
*(vuip) ((addr << 5) + base_and_type) = w;
}
-__EXTERN_INLINE unsigned int lca_ioread16(const void __iomem *xaddr)
+__EXTERN_INLINE u16 lca_ioread16(const void __iomem *xaddr)
{
unsigned long addr = (unsigned long) xaddr;
unsigned long result, base_and_type;
@@ -302,7 +302,7 @@ __EXTERN_INLINE void lca_iowrite16(u16 b, void __iomem *xaddr)
*(vuip) ((addr << 5) + base_and_type) = w;
}
-__EXTERN_INLINE unsigned int lca_ioread32(const void __iomem *xaddr)
+__EXTERN_INLINE u32 lca_ioread32(const void __iomem *xaddr)
{
unsigned long addr = (unsigned long) xaddr;
if (addr < LCA_DENSE_MEM)
@@ -318,6 +318,22 @@ __EXTERN_INLINE void lca_iowrite32(u32 b, void __iomem *xaddr)
*(vuip)addr = b;
}
+__EXTERN_INLINE u64 lca_ioread64(const void __iomem *xaddr)
+{
+ unsigned long addr = (unsigned long) xaddr;
+ if (addr < LCA_DENSE_MEM)
+ addr = ((addr - LCA_IO) << 5) + LCA_IO + 0x18;
+ return *(vulp)addr;
+}
+
+__EXTERN_INLINE void lca_iowrite64(u64 b, void __iomem *xaddr)
+{
+ unsigned long addr = (unsigned long) xaddr;
+ if (addr < LCA_DENSE_MEM)
+ addr = ((addr - LCA_IO) << 5) + LCA_IO + 0x18;
+ *(vulp)addr = b;
+}
+
__EXTERN_INLINE void __iomem *lca_ioportmap(unsigned long addr)
{
return (void __iomem *)(addr + LCA_IO);