Skip to contentSkip to conversation

support for au1xxx on-chip usb in BE mode

PATCH New Herbert Valerio Riedel 1 participant 1 message Nov 22, 2004 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support for au1xxx on-chip usb in BE mode

It's not pretty... but here it is anyway... :-)

Index: drivers/usb/host/Kconfig
===================================================================
RCS file: /home/cvs/linux/drivers/usb/host/Kconfig,v retrieving revision 1.8

usb/host/Kconfig +4 -0
diff -u -u -r1.8 Kconfig
@@ -16,6 +16,10 @@
 	default y if PXA27x
 	default PCI
 
+config USB_OHCI_BIG_ENDIAN
+	boolean
+	default y if SOC_AU1X00 && !CPU_LITTLE_ENDIAN
+
 #
 # USB Host Controller Drivers
 #

Index: drivers/usb/host/ohci-hcd.c
===================================================================
RCS file: /home/cvs/linux/drivers/usb/host/ohci-hcd.c,v retrieving revision 1.40

usb/host/ohci-hcd.c +1 -1
diff -u -u -r1.40 ohci-hcd.c
@@ -881,7 +881,7 @@
 MODULE_LICENSE ("GPL");
 
 #ifdef CONFIG_PCI
-#include "ohci-pci.c"
+//#include "ohci-pci.c"
 #endif
 
 #ifdef CONFIG_SA1111

Index: drivers/usb/host/ohci.h
===================================================================
RCS file: /home/cvs/linux/drivers/usb/host/ohci.h,v retrieving revision 1.21

usb/host/ohci.h +10 -2
diff -u -u -r1.21 ohci.h
@@ -458,6 +458,11 @@
 #define writel_be(val, addr)	out_be32((__force unsigned *)addr, val)
 #endif
 
+#if defined(CONFIG_SOC_AU1X00)
+#define readl_be(addr)          __raw_readl((__force u32 *)(addr))
+#define writel_be(val, addr)    __raw_writel(val, (__force u32 *)(addr))
+#endif
+
 static inline unsigned int ohci_readl (const struct ohci_hcd *ohci,
 							__hc32 __iomem * regs)
 {
@@ -467,8 +472,11 @@
 static inline void ohci_writel (const struct ohci_hcd *ohci,
 				const unsigned int val, __hc32 __iomem *regs)
 {
-	big_endian(ohci) ? writel_be (val, regs) :
-			   writel (val, (__force u32 *)regs);
+	if (big_endian(ohci)) {
+		writel_be (val, regs);
+	} else {
+		writel (val, (__force u32 *)regs);
+	}
 }
 
 #else	/* !CONFIG_USB_OHCI_BIG_ENDIAN */
Signature · 2 lines
Herbert Valerio Riedel <[email protected]>
Research Group for Industrial Software @ Vienna University of Technology