Skip to contentSkip to conversation

Import "string" I/O functions from Linux

PATCH In review Igor Prusov 3 participants 16 messages Nov 14, 2023 – Nov 29, 2023

Subsystems (16)
lore
Share & tools
lore
#0 lore raw

cover Import "string" I/O functions from Linux

This series imports generic versions of ioread_rep/iowrite_rep and reads/writes from Linux. Some cleanup is done to make sure that all platforms have proper defines for implemented functions and there are no redefinitions.

Igor Prusov (13):
sandbox: move asm-generic include to the end of file
x86: Add defines for ins/outs functions
mips: io.h: Add const to reads functions params
mips: io.h: Add defines for read/write/in/out functions
riscv: io.h: Add defines for reads/writes functions
riscv: io.h: Fix signatures of reads/writes functions
nios2: io.h: Add defines for ins/outs functions
powerpc: io.h: Add defines for __raw_{read,write} functions
xtensa: io.h: Add defines for ins/outs functions
asm-generic: Import functions from Linux
spi: meson_spifc_a1: Switch to io{read,write}32_rep()
treewide: Include linux/io.h instead of asm-generic/io.h
musb-new: Remove implementation of io.h functions

 arch/mips/include/asm/io.h                   |  35 +-
 arch/nios2/include/asm/io.h                  |   6 +
 arch/powerpc/include/asm/io.h                |  11 +
 arch/riscv/include/asm/io.h                  |  26 +-
 arch/sandbox/include/asm/io.h                |  28 +-
 arch/x86/include/asm/io.h                    |   6 +
 arch/xtensa/include/asm/io.h                 |   6 +
 drivers/mtd/nand/raw/atmel/nand-controller.c |  34 --
 drivers/mtd/nand/raw/nand_base.c             |  33 --
 drivers/spi/cadence_qspi.c                   |   2 +-
 drivers/spi/meson_spifc_a1.c                 |   4 +-
 drivers/usb/cdns3/cdns3-ti.c                 |   1 -
 drivers/usb/dwc3/dwc3-meson-g12a.c           |   2 +-
 drivers/usb/dwc3/dwc3-meson-gxl.c            |   2 +-
 drivers/usb/musb-new/musb_io.h               |  24 --
 include/asm-generic/io.h                     | 348 +++++++++++++++++++
 16 files changed, 450 insertions(+), 118 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/13 sandbox: move asm-generic include to the end of file

Generic version of io.h should be included at the end of architecture-specific ones to make sure that arch implementations are used and to avoid redefinitions.

---

 arch/sandbox/include/asm/io.h | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
arch/sandbox/include/asm/io.h +14 -14
index 31ab7289b4..77a02e5f52 100644
@@ -28,20 +28,6 @@ void *map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags);
 void unmap_physmem(const void *vaddr, unsigned long flags);
 #define unmap_physmem unmap_physmem
 
-#include <asm-generic/io.h>
-
-/* For sandbox, we want addresses to point into our RAM buffer */
-static inline void *map_sysmem(phys_addr_t paddr, unsigned long len)
-{
-	return map_physmem(paddr, len, MAP_WRBACK);
-}
-
-/* Remove a previous mapping */
-static inline void unmap_sysmem(const void *vaddr)
-{
-	unmap_physmem(vaddr, MAP_WRBACK);
-}
-
 /* Map from a pointer to our RAM buffer */
 phys_addr_t map_to_sysmem(const void *ptr);
 
@@ -229,5 +215,19 @@ static inline void memcpy_toio(volatile void *dst, const void *src, int count)
 
 #include <iotrace.h>
 #include <asm/types.h>
+#include <asm-generic/io.h>
+
+/* For sandbox, we want addresses to point into our RAM buffer */
+static inline void *map_sysmem(phys_addr_t paddr, unsigned long len)
+{
+	return map_physmem(paddr, len, MAP_WRBACK);
+}
+
+/* Remove a previous mapping */
+static inline void unmap_sysmem(const void *vaddr)
+{
+	unmap_physmem(vaddr, MAP_WRBACK);
+}
+
 
 #endif
Signature · 1 line
2.34.1
Reviewed-by on v1 1/13
#2 lore raw

Re: [PATCH 01/13] sandbox: move asm-generic include to the end of file

Quoted 10 lines · Igor Prusov

Generic version of io.h should be included at the end of architecture-specific ones to make sure that arch implementations are used and to avoid redefinitions.

---

 arch/sandbox/include/asm/io.h | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
#3 lore raw

PATCH 2/13 x86: Add defines for ins/outs functions

In reply to Igor Prusov

Add defines for {in,out}s{b,w,l}() functions to make sure that they will be used by asm-generic/io.h

---

 arch/x86/include/asm/io.h | 6 ++++++
 1 file changed, 6 insertions(+)
arch/x86/include/asm/io.h +6 -0
index 83dc09757e..5efb2e1b21 100644
@@ -202,10 +202,16 @@ __OUT(l,,int)
 __INS(b)
 __INS(w)
 __INS(l)
+#define insb insb
+#define insw insw
+#define insl insl
 
 __OUTS(b)
 __OUTS(w)
 __OUTS(l)
+#define outsb outsb
+#define outsw outsw
+#define outsl outsl
 
 /* IO space accessors */
 #define clrio(type, addr, clear) \
Signature · 1 line
2.34.1
#4 lore raw

PATCH 3/13 mips: io.h: Add const to reads functions params

In reply to Igor Prusov

Currently reads{b,w,l}() functions don't have const qualifier for their address parameter. Since asm-generic/io.h in Linux has const for all read functions, add it here as well to keep signatures in sync.

---

 arch/mips/include/asm/io.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/mips/include/asm/io.h +2 -1
index d3ad669301..12595c4334 100644
@@ -405,7 +405,8 @@ static inline void writes##bwlq(volatile void __iomem *mem,		\
 	}								\
 }									\
 									\
-static inline void reads##bwlq(volatile void __iomem *mem, void *addr,	\
+static inline void reads##bwlq(const volatile void __iomem *mem,	\
+				void *addr,				\
 			       unsigned int count)			\
 {									\
 	volatile type *__addr = addr;					\
Signature · 1 line
2.34.1
#5 lore raw

PATCH 4/13 mips: io.h: Add defines for read/write/in/out functions

In reply to Igor Prusov

Add defines for {read,write}{b,w,l,q}(), {read,write}s{b,w,l,q}() and {in,out}s{b,w,l,q}() functions to make asm-generic/io.h aware of them.

---

 arch/mips/include/asm/io.h | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
arch/mips/include/asm/io.h +32 -0
index 12595c4334..3774acaadc 100644
@@ -336,6 +336,22 @@ BUILDIO_MEM(b, u8)
 BUILDIO_MEM(w, u16)
 BUILDIO_MEM(l, u32)
 BUILDIO_MEM(q, u64)
+#define __raw_readb __raw_readb
+#define __raw_readw __raw_readw
+#define __raw_readl __raw_readl
+#define __raw_readq __raw_readq
+#define __raw_writeb __raw_writeb
+#define __raw_writew __raw_writew
+#define __raw_writel __raw_writel
+#define __raw_writeq __raw_writeq
+#define readb readb
+#define readw readw
+#define readl readl
+#define readq readq
+#define writeb writeb
+#define writew writew
+#define writel writel
+#define writeq writeq
 
 #define __BUILD_IOPORT_PFX(bus, bwlq, type)				\
 	__BUILD_IOPORT_SINGLE(bus, bwlq, type, )			\
@@ -449,8 +465,24 @@ __BUILD_IOPORT_STRING(bwlq, type)
 BUILDSTRING(b, u8)
 BUILDSTRING(w, u16)
 BUILDSTRING(l, u32)
+#define readsb readsb
+#define readsw readsw
+#define readsl readsl
+#define writesb writesb
+#define writesw writesw
+#define writesl writesl
+#define outsb outsb
+#define outsw outsw
+#define outsl outsl
+#define insb insb
+#define insw insw
+#define insl insl
 #ifdef CONFIG_64BIT
 BUILDSTRING(q, u64)
+#define readsq readsq
+#define writesq writesq
+#define insq insq
+#define outsq outsq
 #endif
 
 
Signature · 1 line
2.34.1
#6 lore raw

PATCH 5/13 riscv: io.h: Add defines for reads/writes functions

In reply to Igor Prusov

Add defines for {read,write}s{b,w,l} functions to make asm-generic/io.h aware of them.

---

 arch/riscv/include/asm/io.h | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/riscv/include/asm/io.h +8 -0
index 4170877a1a..cedd5375d6 100644
@@ -307,6 +307,14 @@ static inline void writesl(unsigned int *addr, const void *data, int longlen)
 		longlen--;
 	}
 }
+
+#define readsb readsb
+#define readsw readsw
+#define readsl readsl
+#define writesb writesb
+#define writesw writesw
+#define writesl writesl
+
 #endif
 
 #define outb_p(val, port)		outb((val), (port))
Signature · 1 line
2.34.1
#7 lore raw

PATCH 6/13 riscv: io.h: Fix signatures of reads/writes functions

In reply to Igor Prusov

Change type of address parameter from int* to volatile void* for {read,write}s{b,w,l}() functions and add const qualifier for reads. This is done to keep function signatures in sync with asm-generic/io.h and other platforms.

---

 arch/riscv/include/asm/io.h | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
arch/riscv/include/asm/io.h +12 -6
index cedd5375d6..da16585803 100644
@@ -218,7 +218,8 @@ static inline u64 readq(const volatile void __iomem *addr)
 #define insw(p, d, l)			readsw(__io(p), d, l)
 #define insl(p, d, l)			readsl(__io(p), d, l)
 
-static inline void readsb(unsigned int *addr, void *data, int bytelen)
+static inline void readsb(const volatile void __iomem *addr, void *data,
+			  unsigned int bytelen)
 {
 	unsigned char *ptr;
 	unsigned char *ptr2;
@@ -233,7 +234,8 @@ static inline void readsb(unsigned int *addr, void *data, int bytelen)
 	}
 }
 
-static inline void readsw(unsigned int *addr, void *data, int wordlen)
+static inline void readsw(const volatile void __iomem *addr, void *data,
+			  unsigned int wordlen)
 {
 	unsigned short *ptr;
 	unsigned short *ptr2;
@@ -248,7 +250,8 @@ static inline void readsw(unsigned int *addr, void *data, int wordlen)
 	}
 }
 
-static inline void readsl(unsigned int *addr, void *data, int longlen)
+static inline void readsl(const volatile void __iomem *addr, void *data,
+			  unsigned int longlen)
 {
 	unsigned int *ptr;
 	unsigned int *ptr2;
@@ -263,7 +266,8 @@ static inline void readsl(unsigned int *addr, void *data, int longlen)
 	}
 }
 
-static inline void writesb(unsigned int *addr, const void *data, int bytelen)
+static inline void writesb(volatile void __iomem *addr, const void *data,
+			   unsigned int bytelen)
 {
 	unsigned char *ptr;
 	unsigned char *ptr2;
@@ -278,7 +282,8 @@ static inline void writesb(unsigned int *addr, const void *data, int bytelen)
 	}
 }
 
-static inline void writesw(unsigned int *addr, const void *data, int wordlen)
+static inline void writesw(volatile void __iomem *addr, const void *data,
+			   unsigned int wordlen)
 {
 	unsigned short *ptr;
 	unsigned short *ptr2;
@@ -293,7 +298,8 @@ static inline void writesw(unsigned int *addr, const void *data, int wordlen)
 	}
 }
 
-static inline void writesl(unsigned int *addr, const void *data, int longlen)
+static inline void writesl(volatile void __iomem *addr, const void *data,
+			   unsigned int longlen)
 {
 	unsigned int *ptr;
 	unsigned int *ptr2;
Signature · 1 line
2.34.1
#8 lore raw

PATCH 7/13 nios2: io.h: Add defines for ins/outs functions

In reply to Igor Prusov

Add defines for {in,out}s{b,w,l} functions to make asm-generic/io.h aware of them.

---

 arch/nios2/include/asm/io.h | 6 ++++++
 1 file changed, 6 insertions(+)
arch/nios2/include/asm/io.h +6 -0
index 817cd72e00..321e4fd1ca 100644
@@ -94,6 +94,9 @@ static inline void insl (unsigned long port, void *dst, unsigned long count)
 	unsigned long *p = dst;
 	while (count--) *p++ = inl (port);
 }
+#define insb insb
+#define insw insw
+#define insl insl
 
 static inline void outsb (unsigned long port, const void *src, unsigned long count)
 {
@@ -111,6 +114,9 @@ static inline void outsl (unsigned long port, const void *src, unsigned long cou
 	const unsigned long *p = src;
 	while (count--) outl (*p++, port);
 }
+#define outsb outsb
+#define outsw outsw
+#define outsl outsl
 
 /*
  * Clear and set bits in one shot. These macros can be used to clear and
Signature · 1 line
2.34.1
#9 lore raw

PATCH 8/13 powerpc: io.h: Add defines for __raw_{read, write} functions

In reply to Igor Prusov

Add defines for __raw_{read,write}{b,w,l}() functions to make make asm-generic/io.h aware of them.

---

 arch/powerpc/include/asm/io.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/powerpc/include/asm/io.h +11 -0
index f63cae0bc8..2412bb9d7c 100644
@@ -138,26 +138,37 @@ static inline unsigned char __raw_readb(const volatile void __iomem *addr)
 {
 	return *(volatile unsigned char *)PCI_FIX_ADDR(addr);
 }
+#define __raw_readb __raw_readb
+
 static inline unsigned short __raw_readw(const volatile void __iomem *addr)
 {
 	return *(volatile unsigned short *)PCI_FIX_ADDR(addr);
 }
+#define __raw_readw __raw_readw
+
 static inline unsigned int __raw_readl(const volatile void __iomem *addr)
 {
 	return *(volatile unsigned int *)PCI_FIX_ADDR(addr);
 }
+#define __raw_readl __raw_readl
+
 static inline void __raw_writeb(unsigned char v, volatile void __iomem *addr)
 {
 	*(volatile unsigned char *)PCI_FIX_ADDR(addr) = v;
 }
+#define __raw_writeb __raw_writeb
+
 static inline void __raw_writew(unsigned short v, volatile void __iomem *addr)
 {
 	*(volatile unsigned short *)PCI_FIX_ADDR(addr) = v;
 }
+#define __raw_writew __raw_writew
+
 static inline void __raw_writel(unsigned int v, volatile void __iomem *addr)
 {
 	*(volatile unsigned int *)PCI_FIX_ADDR(addr) = v;
 }
+#define __raw_writel __raw_writel
 
 /*
  * 8, 16 and 32 bit, big and little endian I/O operations, with barrier.
Signature · 1 line
2.34.1
#10 lore raw

PATCH 9/13 xtensa: io.h: Add defines for ins/outs functions

In reply to Igor Prusov

Add defines for {in,out}s{b,w,l}() functions to make asm-generic/io.h aware of them.

---

 arch/xtensa/include/asm/io.h | 6 ++++++
 1 file changed, 6 insertions(+)
arch/xtensa/include/asm/io.h +6 -0
index 76a646e882..87ad9faa29 100644
@@ -76,6 +76,12 @@ void insl(unsigned long port, void *dst, unsigned long count);
 void outsb(unsigned long port, const void *src, unsigned long count);
 void outsw(unsigned long port, const void *src, unsigned long count);
 void outsl(unsigned long port, const void *src, unsigned long count);
+#define insb insb
+#define insw insw
+#define insl insl
+#define outsb outsb
+#define outsw outsw
+#define outsl outsl
 
 #define IO_SPACE_LIMIT ~0
 
Signature · 1 line
2.34.1
#11 lore raw

PATCH 10/13 asm-generic: Import functions from Linux

In reply to Igor Prusov

Currently {read,write}s{b,w,lq}() functions are available only on some architectures, and there are no io{read,write}{8,16,32,64}_rep() functions in u-boot. This patch adds generic versions that may be used without arch-specific implementation.

Since some of added functions were already added locally in some files, remove them to avoid redeclaration errors.

---

 drivers/mtd/nand/raw/atmel/nand-controller.c |  34 --
 drivers/mtd/nand/raw/nand_base.c             |  33 --
 include/asm-generic/io.h                     | 348 +++++++++++++++++++
 3 files changed, 348 insertions(+), 67 deletions(-)
drivers/mtd/nand/raw/atmel/nand-controller.c +0 -34
index fa962ba591..37b0c3a5cd 100644
@@ -352,40 +352,6 @@ static int atmel_nfc_wait(struct atmel_hsmc_nand_controller *nc, bool poll,
 	return ret;
 }
 
-static void iowrite8_rep(void *addr, const uint8_t *buf, int len)
-{
-	int i;
-
-	for (i = 0; i < len; i++)
-		writeb(buf[i], addr);
-}
-
-static void ioread8_rep(void *addr, uint8_t *buf, int len)
-{
-	int i;
-
-	for (i = 0; i < len; i++)
-		buf[i] = readb(addr);
-}
-
-static void ioread16_rep(void *addr, void *buf, int len)
-{
-	int i;
-	u16 *p = (u16 *)buf;
-
-	for (i = 0; i < len; i++)
-		p[i] = readw(addr);
-}
-
-static void iowrite16_rep(void *addr, const void *buf, int len)
-{
-	int i;
-	u16 *p = (u16 *)buf;
-
-	for (i = 0; i < len; i++)
-		writew(p[i], addr);
-}
-
 static u8 atmel_nand_read_byte(struct mtd_info *mtd)
 {
 	struct nand_chip *chip = mtd_to_nand(mtd);
drivers/mtd/nand/raw/nand_base.c +0 -33
index 6b4adcf6bd..815ddf5d8d 100644
@@ -245,39 +245,6 @@ static void nand_write_byte16(struct mtd_info *mtd, uint8_t byte)
 	chip->write_buf(mtd, (uint8_t *)&word, 2);
 }
 
-static void iowrite8_rep(void *addr, const uint8_t *buf, int len)
-{
-	int i;
-
-	for (i = 0; i < len; i++)
-		writeb(buf[i], addr);
-}
-static void ioread8_rep(void *addr, uint8_t *buf, int len)
-{
-	int i;
-
-	for (i = 0; i < len; i++)
-		buf[i] = readb(addr);
-}
-
-static void ioread16_rep(void *addr, void *buf, int len)
-{
-	int i;
-	u16 *p = (u16 *) buf;
-
-	for (i = 0; i < len; i++)
-		p[i] = readw(addr);
-}
-
-static void iowrite16_rep(void *addr, void *buf, int len)
-{
-	int i;
-        u16 *p = (u16 *) buf;
-
-        for (i = 0; i < len; i++)
-                writew(p[i], addr);
-}
-
 /**
  * nand_write_buf - [DEFAULT] write buffer to chip
  * @mtd: MTD device structure
include/asm-generic/io.h +348 -0

353 lines not on this page · raw message

Signature · 1 line
2.34.1
#12 lore raw

PATCH 11/13 spi: meson_spifc_a1: Switch to io{read,write}32_rep()

In reply to Igor Prusov

Use io{read,write}32_rep() functions to sync code with Linux version.

---

 drivers/spi/meson_spifc_a1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/meson_spifc_a1.c +2 -2
index 099c4c037d..a33b1a3879 100644
@@ -129,7 +129,7 @@ static void amlogic_spifc_a1_drain_buffer(struct amlogic_spifc_a1 *spifc,
 
 	writel(SPIFC_A1_DBUF_AUTO_UPDATE_ADDR,
 	       spifc->base + SPIFC_A1_DBUF_CTRL_REG);
-	readsl(spifc->base + SPIFC_A1_DBUF_DATA_REG, buf, count);
+	ioread32_rep(spifc->base + SPIFC_A1_DBUF_DATA_REG, buf, count);
 
 	if (pad) {
 		data = readl(spifc->base + SPIFC_A1_DBUF_DATA_REG);
@@ -146,7 +146,7 @@ static void amlogic_spifc_a1_fill_buffer(struct amlogic_spifc_a1 *spifc,
 
 	writel(SPIFC_A1_DBUF_DIR | SPIFC_A1_DBUF_AUTO_UPDATE_ADDR,
 	       spifc->base + SPIFC_A1_DBUF_CTRL_REG);
-	writesl(spifc->base + SPIFC_A1_DBUF_DATA_REG, buf, count);
+	iowrite32_rep(spifc->base + SPIFC_A1_DBUF_DATA_REG, buf, count);
 
 	if (pad) {
 		memcpy(&data, buf + len - pad, pad);
Signature · 1 line
2.34.1
#13 lore raw

PATCH 12/13 treewide: Include linux/io.h instead of asm-generic/io.h

In reply to Igor Prusov

Directly including asm-generic/io.h may break build because it will cause redefenition of generic io macros if linux/io.h gets included later, hence replace it with direct include of linux/io.h

---

 drivers/spi/cadence_qspi.c         | 2 +-
 drivers/usb/cdns3/cdns3-ti.c       | 1 -
 drivers/usb/dwc3/dwc3-meson-g12a.c | 2 +-
 drivers/usb/dwc3/dwc3-meson-gxl.c  | 2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)
drivers/spi/cadence_qspi.c +1 -1
index cc3a54f295..23240c1302 100644
@@ -7,7 +7,6 @@
 #include <common.h>
 #include <clk.h>
 #include <log.h>
-#include <asm-generic/io.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <malloc.h>
@@ -17,6 +16,7 @@
 #include <dm/device_compat.h>
 #include <linux/err.h>
 #include <linux/errno.h>
+#include <linux/io.h>
 #include <linux/sizes.h>
 #include <zynqmp_firmware.h>
 #include "cadence_qspi.h"
drivers/usb/cdns3/cdns3-ti.c +0 -1
index 92a7941ed1..2e44aadea4 100644
@@ -6,7 +6,6 @@
  */
 
 #include <common.h>
-#include <asm-generic/io.h>
 #include <clk.h>
 #include <dm.h>
 #include <dm/device_compat.h>
drivers/usb/dwc3/dwc3-meson-g12a.c +1 -1
index e0356e653f..196035215a 100644
@@ -8,13 +8,13 @@
 
 #include <common.h>
 #include <log.h>
-#include <asm-generic/io.h>
 #include <dm.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
 #include <dwc3-uboot.h>
 #include <generic-phy.h>
 #include <linux/delay.h>
+#include <linux/io.h>
 #include <linux/printk.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
drivers/usb/dwc3/dwc3-meson-gxl.c +1 -1
index d56f2747b6..cbe8aaa005 100644
@@ -8,12 +8,12 @@
 
 #define DEBUG
 #include <common.h>
-#include <asm-generic/io.h>
 #include <dm.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
 #include <dwc3-uboot.h>
 #include <generic-phy.h>
+#include <linux/io.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 #include <malloc.h>
Signature · 1 line
2.34.1
#14 lore raw

PATCH 13/13 musb-new: Remove implementation of io.h functions

In reply to Igor Prusov

Since {read,write}s{l, w, b}() functions are now supported in linux/io.h there is no need to add custom implementation to driver.

---

 drivers/usb/musb-new/musb_io.h | 24 ------------------------
 1 file changed, 24 deletions(-)
drivers/usb/musb-new/musb_io.h +0 -24
index 72a5365632..19b12f36a5 100644
@@ -14,31 +14,7 @@
 #ifndef __MUSB_LINUX_PLATFORM_ARCH_H__
 #define __MUSB_LINUX_PLATFORM_ARCH_H__
 
-#ifndef __UBOOT__
 #include <linux/io.h>
-#else
-#include <asm/io.h>
-#endif
-
-#if !defined(CONFIG_ARM) && !defined(CONFIG_SUPERH) \
-	&& !defined(CONFIG_PPC32) \
-	&& !defined(CONFIG_PPC64) && !defined(CONFIG_MIPS) \
-	&& !defined(CONFIG_M68K)
-static inline void readsl(const void __iomem *addr, void *buf, int len)
-	{ insl((unsigned long)addr, buf, len); }
-static inline void readsw(const void __iomem *addr, void *buf, int len)
-	{ insw((unsigned long)addr, buf, len); }
-static inline void readsb(const void __iomem *addr, void *buf, int len)
-	{ insb((unsigned long)addr, buf, len); }
-
-static inline void writesl(const void __iomem *addr, const void *buf, int len)
-	{ outsl((unsigned long)addr, buf, len); }
-static inline void writesw(const void __iomem *addr, const void *buf, int len)
-	{ outsw((unsigned long)addr, buf, len); }
-static inline void writesb(const void __iomem *addr, const void *buf, int len)
-	{ outsb((unsigned long)addr, buf, len); }
-
-#endif
 
 /* NOTE:  these offsets are all in bytes */
 
Signature · 1 line
2.34.1
#15 lore raw
In reply to Igor Prusov
Quoted 21 lines · Igor Prusov

This series imports generic versions of ioread_rep/iowrite_rep and reads/writes from Linux. Some cleanup is done to make sure that all platforms have proper defines for implemented functions and there are no redefinitions.

Igor Prusov (13):
sandbox: move asm-generic include to the end of file
x86: Add defines for ins/outs functions
mips: io.h: Add const to reads functions params
mips: io.h: Add defines for read/write/in/out functions
riscv: io.h: Add defines for reads/writes functions
riscv: io.h: Fix signatures of reads/writes functions
nios2: io.h: Add defines for ins/outs functions
powerpc: io.h: Add defines for __raw_{read,write} functions
xtensa: io.h: Add defines for ins/outs functions
asm-generic: Import functions from Linux
spi: meson_spifc_a1: Switch to io{read,write}32_rep()
treewide: Include linux/io.h instead of asm-generic/io.h
musb-new: Remove implementation of io.h functions

Quoted 1 line

[...]

Applied to u-boot/next, thanks!

Signature · 1 line
Tom