All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] drivers/usb/ehci: Use platform-specific accessors
@ 2017-02-10 20:23 Alexey Brodkin
  2017-02-10 20:33 ` Marek Vasut
  0 siblings, 1 reply; 14+ messages in thread
From: Alexey Brodkin @ 2017-02-10 20:23 UTC (permalink / raw)
  To: u-boot

Current implementation doesn't allow utilization of platform-specific
reads and writes.

But some arches or platforms may want to use their accessors that do
some extra work like adding barriers for data serialization etc.

Interesting enough OHCI accessors already do that so just aligning
EHCI to it now.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
---
 drivers/usb/host/ehci.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 734d7f036278..2ab830df5155 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -102,13 +102,11 @@ struct usb_linux_config_descriptor {
 } __attribute__ ((packed));
 
 #if defined CONFIG_EHCI_DESC_BIG_ENDIAN
-#define ehci_readl(x)		cpu_to_be32((*((volatile u32 *)(x))))
-#define ehci_writel(a, b)	(*((volatile u32 *)(a)) = \
-					cpu_to_be32(((volatile u32)b)))
+#define ehci_readl(x)		cpu_to_be32(readl(x))
+#define ehci_writel(a, b)	writel(cpu_to_be32(b), a)
 #else
-#define ehci_readl(x)		cpu_to_le32((*((volatile u32 *)(x))))
-#define ehci_writel(a, b)	(*((volatile u32 *)(a)) = \
-					cpu_to_le32(((volatile u32)b)))
+#define ehci_readl(x)		cpu_to_le32(readl(x))
+#define ehci_writel(a, b)	writel(cpu_to_le32(b), a)
 #endif
 
 #if defined CONFIG_EHCI_MMIO_BIG_ENDIAN
-- 
2.7.4

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

end of thread, other threads:[~2017-04-17 16:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-10 20:23 [U-Boot] [PATCH] drivers/usb/ehci: Use platform-specific accessors Alexey Brodkin
2017-02-10 20:33 ` Marek Vasut
2017-03-01 12:52   ` Alexey Brodkin
2017-03-02 23:57     ` Marek Vasut
2017-03-03 13:22       ` Alexey Brodkin
2017-03-05  1:09         ` Marek Vasut
2017-03-24 11:08           ` Alexey Brodkin
2017-03-24 12:56             ` Marek Vasut
2017-04-14 14:44               ` Marek Vasut
2017-04-14 17:16                 ` Alexey Brodkin
2017-04-14 18:50                   ` Marek Vasut
2017-04-14 20:06                   ` Tom Rini
2017-04-17 16:19                     ` Alexey Brodkin
2017-04-17 16:31                       ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.