linux-mips
[Top] [All Lists]

[PATCH] support for au1xxx on-chip usb in BE mode

To: Pete Popov <ppopov@embeddedalley.com>
Subject: [PATCH] support for au1xxx on-chip usb in BE mode
From: Herbert Valerio Riedel <hvr@inso.tuwien.ac.at>
Date: Mon, 22 Nov 2004 21:55:16 +0100
Cc: linux-mips@linux-mips.org
Organization: Research Group for Industrial Software @ Vienna University of Technology
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
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
diff -u -u -r1.8 Kconfig
--- drivers/usb/host/Kconfig    15 Nov 2004 11:49:33 -0000      1.8
+++ drivers/usb/host/Kconfig    22 Nov 2004 20:49:20 -0000
@@ -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
diff -u -u -r1.40 ohci-hcd.c
--- drivers/usb/host/ohci-hcd.c 15 Nov 2004 11:49:33 -0000      1.40
+++ drivers/usb/host/ohci-hcd.c 22 Nov 2004 20:49:21 -0000
@@ -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
diff -u -u -r1.21 ohci.h
--- drivers/usb/host/ohci.h     15 Nov 2004 11:49:33 -0000      1.21
+++ drivers/usb/host/ohci.h     22 Nov 2004 20:49:21 -0000
@@ -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 */


-- 
Herbert Valerio Riedel <hvr@inso.tuwien.ac.at>
Research Group for Industrial Software @ Vienna University of Technology


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] support for au1xxx on-chip usb in BE mode, Herbert Valerio Riedel <=