linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] usb: ehci: add freescale imx28 special write register method
@ 2013-10-23  8:35 Peter Chen
  2013-10-23  8:35 ` [PATCH 2/3] usb: chipidea: " Peter Chen
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Peter Chen @ 2013-10-23  8:35 UTC (permalink / raw)
  To: linux-arm-kernel

According to Freescale imx28 Errata, "ENGR119653 USB: ARM to USB
register error issue", All USB register write operations must
use the ARM SWP instruction. So, we implement a special ehci_write
for imx28.

Discussion for it at below:
http://marc.info/?l=linux-usb&m=137996395529294&w=2

Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
 drivers/usb/host/ehci.h |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 2d40192..577b75d 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -203,6 +203,7 @@ struct ehci_hcd {			/* one per controller */
 	unsigned		has_synopsys_hc_bug:1; /* Synopsys HC */
 	unsigned		frame_index_bug:1; /* MosChip (AKA NetMos) */
 	unsigned		need_oc_pp_cycle:1; /* MPC834X port power */
+	unsigned		imx28_write_fix:1; /* For Freescale i.MX28 */
 
 	/* required for usb32 quirk */
 	#define OHCI_CTRL_HCFS          (3 << 6)
@@ -680,6 +681,13 @@ static inline unsigned int ehci_readl(const struct ehci_hcd *ehci,
 #endif
 }
 
+#ifdef CONFIG_SOC_IMX28
+static inline void imx28_ehci_writel(u32 val32, volatile u32 *addr)
+{
+	__asm__ ("swp %0, %0, [%1]" : : "r"(val32), "r"(addr));
+}
+#endif
+
 static inline void ehci_writel(const struct ehci_hcd *ehci,
 		const unsigned int val, __u32 __iomem *regs)
 {
@@ -687,6 +695,11 @@ static inline void ehci_writel(const struct ehci_hcd *ehci,
 	ehci_big_endian_mmio(ehci) ?
 		writel_be(val, regs) :
 		writel(val, regs);
+#elif defined(CONFIG_SOC_IMX28)
+	if (ehci->imx28_write_fix)
+		imx28_ehci_writel(val, regs);
+	else
+		writel(val, regs);
 #else
 	writel(val, regs);
 #endif
-- 
1.7.1

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

end of thread, other threads:[~2013-10-24  0:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23  8:35 [PATCH 1/3] usb: ehci: add freescale imx28 special write register method Peter Chen
2013-10-23  8:35 ` [PATCH 2/3] usb: chipidea: " Peter Chen
2013-10-23  8:35 ` [PATCH 3/3] usb: chipidea: imx: set CI_HDRC_IMX28_WRITE_FIX for imx28 Peter Chen
2013-10-23 12:09 ` [PATCH 1/3] usb: ehci: add freescale imx28 special write register method Fabio Estevam
2013-10-24  0:40   ` Peter Chen
2013-10-23 14:35 ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).