mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text
@ 2021-01-29 16:11 Ahmad Fatoum
  2021-01-29 16:11 ` [PATCH 2/8] asm-generic: define fallback memcpy and memset for device I/O Ahmad Fatoum
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Ahmad Fatoum @ 2021-01-29 16:11 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Prior to 44add42d4330 ("usbgadget: autostart: add DFU support"), -s used
to do nothing. That commit made it behave like -a, but deprecated it and
changed the help text to omit it. Remove it from the short help text as
well.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 commands/usbgadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/usbgadget.c b/commands/usbgadget.c
index 9133402f52fb..3b115f147d80 100644
--- a/commands/usbgadget.c
+++ b/commands/usbgadget.c
@@ -67,7 +67,7 @@ BAREBOX_CMD_HELP_END
 BAREBOX_CMD_START(usbgadget)
 	.cmd		= do_usbgadget,
 	BAREBOX_CMD_DESC("Create USB Gadget multifunction device")
-	BAREBOX_CMD_OPTS("[-asdAD]")
+	BAREBOX_CMD_OPTS("[-adAD]")
 	BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
 	BAREBOX_CMD_HELP(cmd_usbgadget_help)
 BAREBOX_CMD_END
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 2/8] asm-generic: define fallback memcpy and memset for device I/O
  2021-01-29 16:11 [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text Ahmad Fatoum
@ 2021-01-29 16:11 ` Ahmad Fatoum
  2021-02-02 19:03   ` Sascha Hauer
  2021-01-29 16:11 ` [PATCH 3/8] ARM: <asm/io.h>: define macros for I/O memcpy/memset Ahmad Fatoum
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Ahmad Fatoum @ 2021-01-29 16:11 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The Atmel quadspi driver makes use of the memcpy_(to|from)io,
but we don't define them on all platforms. Fix this to allow
for easier porting of kernel code.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/asm-generic/io.h | 53 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 76e6d0dc1112..150a97645b6b 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -11,6 +11,7 @@
 #ifndef __ASM_GENERIC_IO_H
 #define __ASM_GENERIC_IO_H
 
+#include <linux/string.h> /* for memset() and memcpy() */
 #include <linux/types.h>
 #include <asm/byteorder.h>
 
@@ -424,4 +425,56 @@ static inline void iowrite64be(u64 value, volatile void __iomem *addr)
 #define IOMEM(addr)	((void __force __iomem *)(addr))
 #endif
 
+#ifndef memset_io
+#define memset_io memset_io
+/**
+ * memset_io	Set a range of I/O memory to a constant value
+ * @addr:	The beginning of the I/O-memory range to set
+ * @val:	The value to set the memory to
+ * @count:	The number of bytes to set
+ *
+ * Set a range of I/O memory to a given value.
+ */
+static inline void memset_io(volatile void __iomem *addr, int value,
+			     size_t size)
+{
+	memset(IOMEM(addr), value, size);
+}
+#endif
+
+#ifndef memcpy_fromio
+#define memcpy_fromio memcpy_fromio
+/**
+ * memcpy_fromio	Copy a block of data from I/O memory
+ * @dst:		The (RAM) destination for the copy
+ * @src:		The (I/O memory) source for the data
+ * @count:		The number of bytes to copy
+ *
+ * Copy a block of data from I/O memory.
+ */
+static inline void memcpy_fromio(void *buffer,
+				 const volatile void __iomem *addr,
+				 size_t size)
+{
+	memcpy(buffer, IOMEM(addr), size);
+}
+#endif
+
+#ifndef memcpy_toio
+#define memcpy_toio memcpy_toio
+/**
+ * memcpy_toio		Copy a block of data into I/O memory
+ * @dst:		The (I/O memory) destination for the copy
+ * @src:		The (RAM) source for the data
+ * @count:		The number of bytes to copy
+ *
+ * Copy a block of data to I/O memory.
+ */
+static inline void memcpy_toio(volatile void __iomem *addr, const void *buffer,
+			       size_t size)
+{
+	memcpy(IOMEM(addr), buffer, size);
+}
+#endif
+
 #endif /* __ASM_GENERIC_IO_H */
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 3/8] ARM: <asm/io.h>: define macros for I/O memcpy/memset
  2021-01-29 16:11 [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text Ahmad Fatoum
  2021-01-29 16:11 ` [PATCH 2/8] asm-generic: define fallback memcpy and memset for device I/O Ahmad Fatoum
@ 2021-01-29 16:11 ` Ahmad Fatoum
  2021-01-29 16:11 ` [PATCH 4/8] asm-generic: io.h: remove wrong use of IOMEM Ahmad Fatoum
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Ahmad Fatoum @ 2021-01-29 16:11 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

<asm-generic/io.h> expects architectures to define memcpy_toio,
memcpy_fromio and memset_io as macros as it checks for their existence
with #ifndef. Only ARM defines an own implementation, but does so
as function declaration. Add the missing macros.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/include/asm/io.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 072b47317c03..b442a37b9c1d 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -3,6 +3,10 @@
 
 #define	IO_SPACE_LIMIT	0
 
+#define memcpy_fromio memcpy_fromio
+#define memcpy_toio memcpy_toio
+#define memset_io memset_io
+
 #include <asm-generic/io.h>
 #include <asm-generic/bitio.h>
 
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 4/8] asm-generic: io.h: remove wrong use of IOMEM
  2021-01-29 16:11 [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text Ahmad Fatoum
  2021-01-29 16:11 ` [PATCH 2/8] asm-generic: define fallback memcpy and memset for device I/O Ahmad Fatoum
  2021-01-29 16:11 ` [PATCH 3/8] ARM: <asm/io.h>: define macros for I/O memcpy/memset Ahmad Fatoum
@ 2021-01-29 16:11 ` Ahmad Fatoum
  2021-02-01  8:57   ` Sascha Hauer
  2021-01-29 16:11 ` [PATCH 5/8] ppc: <asm/io.h>: remove duplicate definition Ahmad Fatoum
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Ahmad Fatoum @ 2021-01-29 16:11 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

addr is already __iomem, but we need to force strip that away to use it
as normal pointer. Define __io_virt like Linux does and use it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/asm-generic/io.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 150a97645b6b..a4b0dc4b4337 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -425,6 +425,8 @@ static inline void iowrite64be(u64 value, volatile void __iomem *addr)
 #define IOMEM(addr)	((void __force __iomem *)(addr))
 #endif
 
+#define __io_virt(x) ((void __force *)(x))
+
 #ifndef memset_io
 #define memset_io memset_io
 /**
@@ -438,7 +440,7 @@ static inline void iowrite64be(u64 value, volatile void __iomem *addr)
 static inline void memset_io(volatile void __iomem *addr, int value,
 			     size_t size)
 {
-	memset(IOMEM(addr), value, size);
+	memset(__io_virt(addr), value, size);
 }
 #endif
 
@@ -456,7 +458,7 @@ static inline void memcpy_fromio(void *buffer,
 				 const volatile void __iomem *addr,
 				 size_t size)
 {
-	memcpy(buffer, IOMEM(addr), size);
+	memcpy(buffer, __io_virt(addr), size);
 }
 #endif
 
@@ -473,7 +475,7 @@ static inline void memcpy_fromio(void *buffer,
 static inline void memcpy_toio(volatile void __iomem *addr, const void *buffer,
 			       size_t size)
 {
-	memcpy(IOMEM(addr), buffer, size);
+	memcpy(__io_virt(addr), buffer, size);
 }
 #endif
 
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 5/8] ppc: <asm/io.h>: remove duplicate definition
  2021-01-29 16:11 [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text Ahmad Fatoum
                   ` (2 preceding siblings ...)
  2021-01-29 16:11 ` [PATCH 4/8] asm-generic: io.h: remove wrong use of IOMEM Ahmad Fatoum
@ 2021-01-29 16:11 ` Ahmad Fatoum
  2021-01-29 16:11 ` [PATCH 6/8] printk: port over Linux print_hex_dump_bytes/print_hex_dump_debug Ahmad Fatoum
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Ahmad Fatoum @ 2021-01-29 16:11 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

This implementation is equivalent to the one now provided by
<asm-generic/io.h>, so it can be dropped.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/powerpc/include/asm/io.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index 025c06f3b735..8488c36f6558 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -86,10 +86,6 @@ extern void _outsl_ns(volatile u32 *port, const void *buf, int nl);
 
 #define IO_SPACE_LIMIT ~0
 
-#define memset_io(a,b,c)       memset((void *)(a),(b),(c))
-#define memcpy_fromio(a,b,c)   memcpy((a),(void *)(b),(c))
-#define memcpy_toio(a,b,c)  memcpy((void *)(a),(b),(c))
-
 /*
  * Enforce In-order Execution of I/O:
  * Acts as a barrier to ensure all previous I/O accesses have
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 6/8] printk: port over Linux print_hex_dump_bytes/print_hex_dump_debug
  2021-01-29 16:11 [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text Ahmad Fatoum
                   ` (3 preceding siblings ...)
  2021-01-29 16:11 ` [PATCH 5/8] ppc: <asm/io.h>: remove duplicate definition Ahmad Fatoum
@ 2021-01-29 16:11 ` Ahmad Fatoum
  2021-01-29 16:11 ` [PATCH 7/8] usb: add fallback ->detect method for USB host drivers Ahmad Fatoum
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Ahmad Fatoum @ 2021-01-29 16:11 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

print_hex_dump in barebox always prints a hex dump. Most users use
it for debugging though, so import Linux helpers to do so to cut
down on the #ifdef DEBUG.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/crypto/caam/caamrng.c | 16 ++++++----------
 drivers/mfd/rave-sp.c         | 10 ++++------
 drivers/mtd/ubi/debug.c       | 10 +++++-----
 drivers/video/tc358767.c      |  3 +--
 fs/ubifs/scan.c               |  2 +-
 include/printk.h              | 28 ++++++++++++++++++++++++++++
 6 files changed, 45 insertions(+), 24 deletions(-)

diff --git a/drivers/crypto/caam/caamrng.c b/drivers/crypto/caam/caamrng.c
index 39a90568dfe8..5d8cfb8bff93 100644
--- a/drivers/crypto/caam/caamrng.c
+++ b/drivers/crypto/caam/caamrng.c
@@ -91,10 +91,8 @@ static void rng_done(struct device_d *jrdev, u32 *desc, u32 err, void *context)
 	/* Buffer refilled, invalidate cache */
 	dma_sync_single_for_cpu(bd->addr, RN_BUF_SIZE, DMA_FROM_DEVICE);
 
-#ifdef DEBUG
-	print_hex_dump(KERN_ERR, "rng refreshed buf@: ",
-		       DUMP_PREFIX_OFFSET, 16, 4, bd->buf, RN_BUF_SIZE, 1);
-#endif
+	print_hex_dump_debug("rng refreshed buf@: ", DUMP_PREFIX_OFFSET,
+			     16, 4, bd->buf, RN_BUF_SIZE, 1);
 }
 
 static inline int submit_job(struct caam_rng_ctx *ctx, int to_current)
@@ -186,10 +184,9 @@ static inline int rng_create_sh_desc(struct caam_rng_ctx *ctx)
 
 	dma_sync_single_for_device((unsigned long)desc, desc_bytes(desc),
 				   DMA_TO_DEVICE);
-#ifdef DEBUG
-	print_hex_dump(KERN_ERR, "rng shdesc@: ", DUMP_PREFIX_OFFSET, 16, 4,
+
+	print_hex_dump_debug("rng shdesc@: ", DUMP_PREFIX_OFFSET, 16, 4,
 		       desc, desc_bytes(desc), 1);
-#endif
 	return 0;
 }
 
@@ -203,10 +200,9 @@ static inline int rng_create_job_desc(struct caam_rng_ctx *ctx, int buf_id)
 			     HDR_REVERSE);
 
 	append_seq_out_ptr_intlen(desc, bd->addr, RN_BUF_SIZE, 0);
-#ifdef DEBUG
-	print_hex_dump(KERN_ERR, "rng job desc@: ", DUMP_PREFIX_OFFSET, 16, 4,
+
+	print_hex_dump_debug("rng job desc@: ", DUMP_PREFIX_OFFSET, 16, 4,
 		       desc, desc_bytes(desc), 1);
-#endif
 	return 0;
 }
 
diff --git a/drivers/mfd/rave-sp.c b/drivers/mfd/rave-sp.c
index 8fc46b66bb2c..ef569dd513b5 100644
--- a/drivers/mfd/rave-sp.c
+++ b/drivers/mfd/rave-sp.c
@@ -269,9 +269,8 @@ static int rave_sp_write(struct rave_sp *sp, const u8 *data, u8 data_size)
 
 	length = dest - frame;
 
-	if (IS_ENABLED(DEBUG))
-		print_hex_dump(0, "rave-sp tx: ", DUMP_PREFIX_NONE,
-			       16, 1, frame, length, false);
+	print_hex_dump_debug("rave-sp tx: ", DUMP_PREFIX_NONE, 16, 1,
+			     frame, length, false);
 
 	return serdev_device_write(sp->serdev, frame, length, SECOND);
 }
@@ -406,9 +405,8 @@ static void rave_sp_receive_frame(struct rave_sp *sp,
 	struct device_d *dev         = sp->serdev->dev;
 	u8 crc_calculated[checksum_length];
 
-	if (IS_ENABLED(DEBUG))
-		print_hex_dump(0, "rave-sp rx: ", DUMP_PREFIX_NONE,
-			       16, 1, data, length, false);
+	print_hex_dump_debug("rave-sp rx: ", DUMP_PREFIX_NONE, 16, 1,
+			     data, length, false);
 
 	if (unlikely(length <= checksum_length)) {
 		dev_warn(dev, "Dropping short frame\n");
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c
index 6ae797c2bfd6..75d6b69f090e 100644
--- a/drivers/mtd/ubi/debug.c
+++ b/drivers/mtd/ubi/debug.c
@@ -42,7 +42,7 @@ void ubi_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len)
 
 	ubi_msg(ubi, "dumping %d bytes of data from PEB %d, offset %d",
 		len, pnum, offset);
-	print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, buf, len, 1);
+	print_hex_dump_debug("", DUMP_PREFIX_OFFSET, 32, 1, buf, len, 1);
 out:
 	vfree(buf);
 	return;
@@ -63,8 +63,8 @@ void ubi_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr)
 	pr_err("\timage_seq      %d\n", be32_to_cpu(ec_hdr->image_seq));
 	pr_err("\thdr_crc        %#08x\n", be32_to_cpu(ec_hdr->hdr_crc));
 	pr_err("erase counter header hexdump:\n");
-	print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,
-		       ec_hdr, UBI_EC_HDR_SIZE, 1);
+	print_hex_dump_debug("", DUMP_PREFIX_OFFSET, 32, 1,
+			     ec_hdr, UBI_EC_HDR_SIZE, 1);
 }
 
 /**
@@ -88,8 +88,8 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr)
 		(unsigned long long)be64_to_cpu(vid_hdr->sqnum));
 	pr_err("\thdr_crc   %08x\n", be32_to_cpu(vid_hdr->hdr_crc));
 	pr_err("Volume identifier header hexdump:\n");
-	print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,
-		       vid_hdr, UBI_VID_HDR_SIZE, 1);
+	print_hex_dump_debug("", DUMP_PREFIX_OFFSET, 32, 1,
+			     vid_hdr, UBI_VID_HDR_SIZE, 1);
 }
 
 /**
diff --git a/drivers/video/tc358767.c b/drivers/video/tc358767.c
index e64dde1ddf3f..7d14aca9115b 100644
--- a/drivers/video/tc358767.c
+++ b/drivers/video/tc358767.c
@@ -1191,8 +1191,7 @@ static int tc_read_edid(struct tc_data *tc)
 
 #ifdef DEBUG
 	printk(KERN_DEBUG "eDP display EDID:\n");
-	print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 1, tc->edid,
-		       EDID_LENGTH, true);
+	print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, tc->edid, EDID_LENGTH);
 #endif
 
 	return 0;
diff --git a/fs/ubifs/scan.c b/fs/ubifs/scan.c
index ea88926163f4..113c2cf755de 100644
--- a/fs/ubifs/scan.c
+++ b/fs/ubifs/scan.c
@@ -244,7 +244,7 @@ void ubifs_scanned_corruption(const struct ubifs_info *c, int lnum, int offs,
 	if (len > 8192)
 		len = 8192;
 	ubifs_err(c, "first %d bytes from LEB %d:%d", len, lnum, offs);
-	print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 4, buf, len, 1);
+	print_hex_dump_debug("", DUMP_PREFIX_OFFSET, 32, 4, buf, len, 1);
 }
 
 /**
diff --git a/include/printk.h b/include/printk.h
index 9941ddb12cd7..f92e477298aa 100644
--- a/include/printk.h
+++ b/include/printk.h
@@ -160,4 +160,32 @@ extern void print_hex_dump(const char *level, const char *prefix_str,
 			   int prefix_type, int rowsize, int groupsize,
 			   const void *buf, size_t len, bool ascii);
 
+#if LOGLEVEL <= MSG_DEBUG
+#define print_hex_dump_debug(prefix_str, prefix_type, rowsize,		\
+			     groupsize, buf, len, ascii)		\
+	print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize,	\
+		       groupsize, buf, len, ascii)
+#else
+static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
+                                        int rowsize, int groupsize,
+                                        const void *buf, size_t len, bool ascii)
+{
+}
+#endif
+
+/**
+ * print_hex_dump_bytes - shorthand form of print_hex_dump() with default params
+ * @prefix_str: string to prefix each line with;
+ *  caller supplies trailing spaces for alignment if desired
+ * @prefix_type: controls whether prefix of an offset, address, or none
+ *  is printed (%DUMP_PREFIX_OFFSET, %DUMP_PREFIX_ADDRESS, %DUMP_PREFIX_NONE)
+ * @buf: data blob to dump
+ * @len: number of bytes in the @buf
+ *
+ * Calls print_hex_dump(), with log level of KERN_DEBUG,
+ * rowsize of 16, groupsize of 1, and ASCII output included.
+ */
+#define print_hex_dump_bytes(prefix_str, prefix_type, buf, len)	\
+	print_hex_dump_debug(prefix_str, prefix_type, 16, 1, buf, len, true)
+
 #endif
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 7/8] usb: add fallback ->detect method for USB host drivers
  2021-01-29 16:11 [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text Ahmad Fatoum
                   ` (4 preceding siblings ...)
  2021-01-29 16:11 ` [PATCH 6/8] printk: port over Linux print_hex_dump_bytes/print_hex_dump_debug Ahmad Fatoum
@ 2021-01-29 16:11 ` Ahmad Fatoum
  2021-01-29 16:11 ` [PATCH 8/8] usb: host: ehci: remove duplicated usb_host_detect() calls Ahmad Fatoum
  2021-02-01  9:07 ` [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text Sascha Hauer
  7 siblings, 0 replies; 14+ messages in thread
From: Ahmad Fatoum @ 2021-01-29 16:11 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We already maintain a list of USB host controllers, so we can use that
to implement a generic detect callback. Currently, all drivers define
their own, which uses driver-specific means to arrive at the struct
usb_host and then call usb_host_detect().

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/usb/core/usb.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index ea244d4bcf6c..938a28e030bf 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -88,11 +88,25 @@ static inline void usb_host_release(struct usb_host *host)
 	slice_release(&host->slice);
 }
 
+static int usb_hw_detect(struct device_d *dev)
+{
+	struct usb_host *host;
+
+	list_for_each_entry(host, &host_list, list) {
+		if (dev == host->hw_dev)
+			return usb_host_detect(host);
+	}
+
+	return -ENODEV;
+}
+
 int usb_register_host(struct usb_host *host)
 {
 	list_add_tail(&host->list, &host_list);
 	host->busnum = host_busnum++;
 	slice_init(&host->slice, dev_name(host->hw_dev));
+	if (!host->hw_dev->detect)
+		host->hw_dev->detect = usb_hw_detect;
 	return 0;
 }
 
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 8/8] usb: host: ehci: remove duplicated usb_host_detect() calls
  2021-01-29 16:11 [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text Ahmad Fatoum
                   ` (5 preceding siblings ...)
  2021-01-29 16:11 ` [PATCH 7/8] usb: add fallback ->detect method for USB host drivers Ahmad Fatoum
@ 2021-01-29 16:11 ` Ahmad Fatoum
  2021-02-01  9:07 ` [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text Sascha Hauer
  7 siblings, 0 replies; 14+ messages in thread
From: Ahmad Fatoum @ 2021-01-29 16:11 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

With the last patch adding a fallback detect, we no longer need the
duplication in the host controller drivers. Drop them.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/usb/dwc2/host.c         |  9 ---------
 drivers/usb/host/ehci-atmel.c   |  8 --------
 drivers/usb/host/ehci-hcd.c     | 13 -------------
 drivers/usb/host/xhci.c         |  8 --------
 drivers/usb/imx/chipidea-imx.c  |  9 ---------
 drivers/usb/musb/musb_barebox.c |  9 ---------
 include/usb/ehci.h              |  6 ------
 7 files changed, 62 deletions(-)

diff --git a/drivers/usb/dwc2/host.c b/drivers/usb/dwc2/host.c
index 510a07dfb9a9..7a070d91f3bc 100644
--- a/drivers/usb/dwc2/host.c
+++ b/drivers/usb/dwc2/host.c
@@ -766,13 +766,6 @@ static int dwc2_host_init(struct usb_host *host)
 	return 0;
 }
 
-static int dwc2_detect(struct device_d *dev)
-{
-	struct dwc2 *dwc2 = dev->priv;
-
-	return usb_host_detect(&dwc2->host);
-}
-
 int dwc2_register_host(struct dwc2 *dwc2)
 {
 	struct usb_host *host;
@@ -784,8 +777,6 @@ int dwc2_register_host(struct dwc2 *dwc2)
 	host->submit_control_msg = dwc2_submit_control_msg;
 	host->submit_int_msg = dwc2_submit_int_msg;
 
-	dwc2->dev->detect = dwc2_detect;
-
 	return usb_register_host(host);
 }
 
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index 192c5ef9d185..c3f8ab7ad591 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -57,13 +57,6 @@ static void atmel_stop_clock(struct atmel_ehci_priv *atehci)
 	clk_disable(atehci->uclk);
 }
 
-static int atmel_ehci_detect(struct device_d *dev)
-{
-	struct atmel_ehci_priv *atehci = dev->priv;
-
-	return ehci_detect(atehci->ehci);
-}
-
 static int atmel_ehci_probe(struct device_d *dev)
 {
 	int ret;
@@ -78,7 +71,6 @@ static int atmel_ehci_probe(struct device_d *dev)
 	atehci = xzalloc(sizeof(*atehci));
 	atehci->dev = dev;
 	dev->priv = atehci;
-	dev->detect = atmel_ehci_detect;
 
 	atehci->iclk = clk_get(dev, "ehci_clk");
 	if (IS_ERR(atehci->iclk)) {
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 287849102d68..8c4da9fd12e2 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1349,11 +1349,6 @@ submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 	return result;
 }
 
-int ehci_detect(struct ehci_host *ehci)
-{
-	return usb_host_detect(&ehci->host);
-}
-
 struct ehci_host *ehci_register(struct device_d *dev, struct ehci_data *data)
 {
 	struct usb_host *host;
@@ -1411,13 +1406,6 @@ void ehci_unregister(struct ehci_host *ehci)
 	free(ehci);
 }
 
-static int ehci_dev_detect(struct device_d *dev)
-{
-	struct ehci_host *ehci = dev->priv;
-
-	return ehci_detect(ehci);
-}
-
 static int ehci_probe(struct device_d *dev)
 {
 	struct resource *iores;
@@ -1457,7 +1445,6 @@ static int ehci_probe(struct device_d *dev)
 		return PTR_ERR(ehci);
 
 	dev->priv = ehci;
-	dev->detect = ehci_dev_detect;
 
 	return 0;
 }
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 317000d65006..caab2400d8d6 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1389,13 +1389,6 @@ int xhci_deregister(struct xhci_ctrl *ctrl)
 	return 0;
 }
 
-static int xhci_detect(struct device_d *dev)
-{
-	struct xhci_ctrl *ctrl = dev->priv;
-
-	return usb_host_detect(&ctrl->host);
-}
-
 /*
  * xHCI platform driver
  */
@@ -1417,7 +1410,6 @@ static int xhci_probe(struct device_d *dev)
 		HC_LENGTH(xhci_readl(&(ctrl->hccr)->cr_capbase)));
 
 	dev->priv = ctrl;
-	dev->detect = xhci_detect;
 
 	return xhci_register(ctrl);
 }
diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index b144f41437a9..7b87f302a921 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -178,13 +178,6 @@ static int imx_chipidea_probe_dt(struct imx_chipidea *ci)
 	return 0;
 }
 
-static int ci_ehci_detect(struct device_d *dev)
-{
-	struct imx_chipidea *ci = dev->priv;
-
-	return ehci_detect(ci->ehci);
-}
-
 static int ci_set_mode(void *ctx, enum usb_dr_mode mode)
 {
 	struct imx_chipidea *ci = ctx;
@@ -205,8 +198,6 @@ static int ci_set_mode(void *ctx, enum usb_dr_mode mode)
 			}
 
 			ci->ehci = ehci;
-
-			ci->dev->detect = ci_ehci_detect;
 		} else {
 			dev_err(ci->dev, "Host support not available\n");
 			return -ENODEV;
diff --git a/drivers/usb/musb/musb_barebox.c b/drivers/usb/musb/musb_barebox.c
index b1f38c35ac0b..f54ad5e6e472 100644
--- a/drivers/usb/musb/musb_barebox.c
+++ b/drivers/usb/musb/musb_barebox.c
@@ -121,13 +121,6 @@ submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 	return submit_urb(dev, urb, 100);
 }
 
-static int musb_detect(struct device_d *dev)
-{
-	struct musb *musb = dev->priv;
-
-	return usb_host_detect(&musb->host);
-}
-
 int musb_register(struct musb *musb)
 {
 	struct usb_host *host;
@@ -139,8 +132,6 @@ int musb_register(struct musb *musb)
 	host->submit_control_msg = submit_control_msg;
 	host->submit_bulk_msg = submit_bulk_msg;
 
-	musb->controller->priv = musb;
-	musb->controller->detect = musb_detect;
 	usb_register_host(host);
 
 	return 0;
diff --git a/include/usb/ehci.h b/include/usb/ehci.h
index 9ca9252eb1d2..327500d49aed 100644
--- a/include/usb/ehci.h
+++ b/include/usb/ehci.h
@@ -24,7 +24,6 @@ struct ehci_host;
 #ifdef CONFIG_USB_EHCI
 struct ehci_host *ehci_register(struct device_d *dev, struct ehci_data *data);
 void ehci_unregister(struct ehci_host *);
-int ehci_detect(struct ehci_host *ehci);
 #else
 static inline struct ehci_host *ehci_register(struct device_d *dev,
 					      struct ehci_data *data)
@@ -35,11 +34,6 @@ static inline struct ehci_host *ehci_register(struct device_d *dev,
 static inline void ehci_unregister(struct ehci_host *ehci)
 {
 }
-
-static inline int ehci_detect(struct ehci_host *ehci)
-{
-	return 0;
-}
 #endif
 
 #endif  /* __USB_EHCI_H */
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 4/8] asm-generic: io.h: remove wrong use of IOMEM
  2021-01-29 16:11 ` [PATCH 4/8] asm-generic: io.h: remove wrong use of IOMEM Ahmad Fatoum
@ 2021-02-01  8:57   ` Sascha Hauer
  2021-02-01  8:59     ` Ahmad Fatoum
  0 siblings, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2021-02-01  8:57 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Fri, Jan 29, 2021 at 05:11:12PM +0100, Ahmad Fatoum wrote:
> addr is already __iomem, but we need to force strip that away to use it
> as normal pointer. Define __io_virt like Linux does and use it.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  include/asm-generic/io.h | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
> index 150a97645b6b..a4b0dc4b4337 100644
> --- a/include/asm-generic/io.h
> +++ b/include/asm-generic/io.h
> @@ -425,6 +425,8 @@ static inline void iowrite64be(u64 value, volatile void __iomem *addr)
>  #define IOMEM(addr)	((void __force __iomem *)(addr))
>  #endif
>  
> +#define __io_virt(x) ((void __force *)(x))
> +
>  #ifndef memset_io
>  #define memset_io memset_io
>  /**
> @@ -438,7 +440,7 @@ static inline void iowrite64be(u64 value, volatile void __iomem *addr)
>  static inline void memset_io(volatile void __iomem *addr, int value,
>  			     size_t size)
>  {
> -	memset(IOMEM(addr), value, size);
> +	memset(__io_virt(addr), value, size);
>  }

Why did you add it differently than Linux in the first place?
Should this be merged into 2/8?

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 4/8] asm-generic: io.h: remove wrong use of IOMEM
  2021-02-01  8:57   ` Sascha Hauer
@ 2021-02-01  8:59     ` Ahmad Fatoum
  0 siblings, 0 replies; 14+ messages in thread
From: Ahmad Fatoum @ 2021-02-01  8:59 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hi,

On 01.02.21 09:57, Sascha Hauer wrote:
> On Fri, Jan 29, 2021 at 05:11:12PM +0100, Ahmad Fatoum wrote:
>> addr is already __iomem, but we need to force strip that away to use it
>> as normal pointer. Define __io_virt like Linux does and use it.
>>
>> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
>> ---
>>  include/asm-generic/io.h | 8 +++++---
>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
>> index 150a97645b6b..a4b0dc4b4337 100644
>> --- a/include/asm-generic/io.h
>> +++ b/include/asm-generic/io.h
>> @@ -425,6 +425,8 @@ static inline void iowrite64be(u64 value, volatile void __iomem *addr)
>>  #define IOMEM(addr)	((void __force __iomem *)(addr))
>>  #endif
>>  
>> +#define __io_virt(x) ((void __force *)(x))
>> +
>>  #ifndef memset_io
>>  #define memset_io memset_io
>>  /**
>> @@ -438,7 +440,7 @@ static inline void iowrite64be(u64 value, volatile void __iomem *addr)
>>  static inline void memset_io(volatile void __iomem *addr, int value,
>>  			     size_t size)
>>  {
>> -	memset(IOMEM(addr), value, size);
>> +	memset(__io_virt(addr), value, size);
>>  }
> 
> Why did you add it differently than Linux in the first place?
> Should this be merged into 2/8?

Yes, please squash. I somehow thought I had added this earlier :D

Thanks,
Ahmad

> 
> Sascha
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text
  2021-01-29 16:11 [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text Ahmad Fatoum
                   ` (6 preceding siblings ...)
  2021-01-29 16:11 ` [PATCH 8/8] usb: host: ehci: remove duplicated usb_host_detect() calls Ahmad Fatoum
@ 2021-02-01  9:07 ` Sascha Hauer
  7 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2021-02-01  9:07 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Fri, Jan 29, 2021 at 05:11:09PM +0100, Ahmad Fatoum wrote:
> Prior to 44add42d4330 ("usbgadget: autostart: add DFU support"), -s used
> to do nothing. That commit made it behave like -a, but deprecated it and
> changed the help text to omit it. Remove it from the short help text as
> well.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  commands/usbgadget.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/commands/usbgadget.c b/commands/usbgadget.c
> index 9133402f52fb..3b115f147d80 100644
> --- a/commands/usbgadget.c
> +++ b/commands/usbgadget.c
> @@ -67,7 +67,7 @@ BAREBOX_CMD_HELP_END
>  BAREBOX_CMD_START(usbgadget)
>  	.cmd		= do_usbgadget,
>  	BAREBOX_CMD_DESC("Create USB Gadget multifunction device")
> -	BAREBOX_CMD_OPTS("[-asdAD]")
> +	BAREBOX_CMD_OPTS("[-adAD]")
>  	BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
>  	BAREBOX_CMD_HELP(cmd_usbgadget_help)
>  BAREBOX_CMD_END
> -- 
> 2.30.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/8] asm-generic: define fallback memcpy and memset for device I/O
  2021-01-29 16:11 ` [PATCH 2/8] asm-generic: define fallback memcpy and memset for device I/O Ahmad Fatoum
@ 2021-02-02 19:03   ` Sascha Hauer
  2021-02-02 19:41     ` Ahmad Fatoum
  0 siblings, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2021-02-02 19:03 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Fri, Jan 29, 2021 at 05:11:10PM +0100, Ahmad Fatoum wrote:
> The Atmel quadspi driver makes use of the memcpy_(to|from)io,
> but we don't define them on all platforms. Fix this to allow
> for easier porting of kernel code.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  include/asm-generic/io.h | 53 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 53 insertions(+)

This patch breaks compilation for ARM:

In file included from /ptx/work/WORK_EIHEI/sha/backup/barebox/barebox-maintainer-utils/barebox/arch/arm/include/asm/io.h:6,
                 from include/io.h:5,
                 from arch/arm/lib32/io.c:3:
include/asm-generic/io.h:448:23: error: redefinition of 'memcpy_fromio'
  448 | #define memcpy_fromio memcpy_fromio
      |                       ^~~~~~~~~~~~~
arch/arm/lib32/io.c:9:6: note: in expansion of macro 'memcpy_fromio'
    9 | void memcpy_fromio(void *to, const volatile void __iomem *from, size_t count)
      |      ^~~~~~~~~~~~~
include/asm-generic/io.h:448:23: note: previous definition of 'memcpy_fromio' was here
  448 | #define memcpy_fromio memcpy_fromio
      |                       ^~~~~~~~~~~~~
include/asm-generic/io.h:457:20: note: in expansion of macro 'memcpy_fromio'
  457 | static inline void memcpy_fromio(void *buffer,
      |                    ^~~~~~~~~~~~~
include/asm-generic/io.h:466:21: error: redefinition of 'memcpy_toio'
  466 | #define memcpy_toio memcpy_toio
      |                     ^~~~~~~~~~~
arch/arm/lib32/io.c:24:6: note: in expansion of macro 'memcpy_toio'
   24 | void memcpy_toio(volatile void __iomem *to, const void *from, size_t count)
      |      ^~~~~~~~~~~
include/asm-generic/io.h:466:21: note: previous definition of 'memcpy_toio' was here
  466 | #define memcpy_toio memcpy_toio
      |                     ^~~~~~~~~~~
include/asm-generic/io.h:475:20: note: in expansion of macro 'memcpy_toio'
  475 | static inline void memcpy_toio(volatile void __iomem *addr, const void *buffer,
      |                    ^~~~~~~~~~~
include/asm-generic/io.h:431:19: error: redefinition of 'memset_io'
  431 | #define memset_io memset_io
      |                   ^~~~~~~~~
arch/arm/lib32/io.c:39:6: note: in expansion of macro 'memset_io'
   39 | void memset_io(volatile void __iomem *dst, int c, size_t count)
      |      ^~~~~~~~~
include/asm-generic/io.h:431:19: note: previous definition of 'memset_io' was here
  431 | #define memset_io memset_io
      |                   ^~~~~~~~~
include/asm-generic/io.h:440:20: note: in expansion of macro 'memset_io'
  440 | static inline void memset_io(volatile void __iomem *addr, int value,
      |                    ^~~~~~~~~


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/8] asm-generic: define fallback memcpy and memset for device I/O
  2021-02-02 19:03   ` Sascha Hauer
@ 2021-02-02 19:41     ` Ahmad Fatoum
  2021-02-04 10:12       ` Sascha Hauer
  0 siblings, 1 reply; 14+ messages in thread
From: Ahmad Fatoum @ 2021-02-02 19:41 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox



On 02.02.21 20:03, Sascha Hauer wrote:
> On Fri, Jan 29, 2021 at 05:11:10PM +0100, Ahmad Fatoum wrote:
>> The Atmel quadspi driver makes use of the memcpy_(to|from)io,
>> but we don't define them on all platforms. Fix this to allow
>> for easier porting of kernel code.
>>
>> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
>> ---
>>  include/asm-generic/io.h | 53 ++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 53 insertions(+)
> 
> This patch breaks compilation for ARM:

Apologies, the order of the commits is wrong.
I just sent out a v2 (which I forgot the v2 tag..) and made sure this time
that all intermediate commits compile.

> 
> In file included from /ptx/work/WORK_EIHEI/sha/backup/barebox/barebox-maintainer-utils/barebox/arch/arm/include/asm/io.h:6,
>                  from include/io.h:5,
>                  from arch/arm/lib32/io.c:3:
> include/asm-generic/io.h:448:23: error: redefinition of 'memcpy_fromio'
>   448 | #define memcpy_fromio memcpy_fromio
>       |                       ^~~~~~~~~~~~~
> arch/arm/lib32/io.c:9:6: note: in expansion of macro 'memcpy_fromio'
>     9 | void memcpy_fromio(void *to, const volatile void __iomem *from, size_t count)
>       |      ^~~~~~~~~~~~~
> include/asm-generic/io.h:448:23: note: previous definition of 'memcpy_fromio' was here
>   448 | #define memcpy_fromio memcpy_fromio
>       |                       ^~~~~~~~~~~~~
> include/asm-generic/io.h:457:20: note: in expansion of macro 'memcpy_fromio'
>   457 | static inline void memcpy_fromio(void *buffer,
>       |                    ^~~~~~~~~~~~~
> include/asm-generic/io.h:466:21: error: redefinition of 'memcpy_toio'
>   466 | #define memcpy_toio memcpy_toio
>       |                     ^~~~~~~~~~~
> arch/arm/lib32/io.c:24:6: note: in expansion of macro 'memcpy_toio'
>    24 | void memcpy_toio(volatile void __iomem *to, const void *from, size_t count)
>       |      ^~~~~~~~~~~
> include/asm-generic/io.h:466:21: note: previous definition of 'memcpy_toio' was here
>   466 | #define memcpy_toio memcpy_toio
>       |                     ^~~~~~~~~~~
> include/asm-generic/io.h:475:20: note: in expansion of macro 'memcpy_toio'
>   475 | static inline void memcpy_toio(volatile void __iomem *addr, const void *buffer,
>       |                    ^~~~~~~~~~~
> include/asm-generic/io.h:431:19: error: redefinition of 'memset_io'
>   431 | #define memset_io memset_io
>       |                   ^~~~~~~~~
> arch/arm/lib32/io.c:39:6: note: in expansion of macro 'memset_io'
>    39 | void memset_io(volatile void __iomem *dst, int c, size_t count)
>       |      ^~~~~~~~~
> include/asm-generic/io.h:431:19: note: previous definition of 'memset_io' was here
>   431 | #define memset_io memset_io
>       |                   ^~~~~~~~~
> include/asm-generic/io.h:440:20: note: in expansion of macro 'memset_io'
>   440 | static inline void memset_io(volatile void __iomem *addr, int value,
>       |                    ^~~~~~~~~
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/8] asm-generic: define fallback memcpy and memset for device I/O
  2021-02-02 19:41     ` Ahmad Fatoum
@ 2021-02-04 10:12       ` Sascha Hauer
  0 siblings, 0 replies; 14+ messages in thread
From: Sascha Hauer @ 2021-02-04 10:12 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Tue, Feb 02, 2021 at 08:41:22PM +0100, Ahmad Fatoum wrote:
> 
> 
> On 02.02.21 20:03, Sascha Hauer wrote:
> > On Fri, Jan 29, 2021 at 05:11:10PM +0100, Ahmad Fatoum wrote:
> >> The Atmel quadspi driver makes use of the memcpy_(to|from)io,
> >> but we don't define them on all platforms. Fix this to allow
> >> for easier porting of kernel code.
> >>
> >> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> >> ---
> >>  include/asm-generic/io.h | 53 ++++++++++++++++++++++++++++++++++++++++
> >>  1 file changed, 53 insertions(+)
> > 
> > This patch breaks compilation for ARM:
> 
> Apologies, the order of the commits is wrong.
> I just sent out a v2 (which I forgot the v2 tag..) and made sure this time
> that all intermediate commits compile.

Ok, thanks.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-02-04 10:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29 16:11 [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text Ahmad Fatoum
2021-01-29 16:11 ` [PATCH 2/8] asm-generic: define fallback memcpy and memset for device I/O Ahmad Fatoum
2021-02-02 19:03   ` Sascha Hauer
2021-02-02 19:41     ` Ahmad Fatoum
2021-02-04 10:12       ` Sascha Hauer
2021-01-29 16:11 ` [PATCH 3/8] ARM: <asm/io.h>: define macros for I/O memcpy/memset Ahmad Fatoum
2021-01-29 16:11 ` [PATCH 4/8] asm-generic: io.h: remove wrong use of IOMEM Ahmad Fatoum
2021-02-01  8:57   ` Sascha Hauer
2021-02-01  8:59     ` Ahmad Fatoum
2021-01-29 16:11 ` [PATCH 5/8] ppc: <asm/io.h>: remove duplicate definition Ahmad Fatoum
2021-01-29 16:11 ` [PATCH 6/8] printk: port over Linux print_hex_dump_bytes/print_hex_dump_debug Ahmad Fatoum
2021-01-29 16:11 ` [PATCH 7/8] usb: add fallback ->detect method for USB host drivers Ahmad Fatoum
2021-01-29 16:11 ` [PATCH 8/8] usb: host: ehci: remove duplicated usb_host_detect() calls Ahmad Fatoum
2021-02-01  9:07 ` [PATCH 1/8] commands: usbgadget: remove deprecated s option from help text Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox