Skip to contentSkip to conversation

EHCI support for the AU1200

PATCH In review Jordan Crouse 2 participants 3 messages Jan 15, 2006 – Jan 23, 2006

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 EHCI support for the AU1200

This is the re-send and fixed up version of the patch I sent out a few weeks ago, to be applied against latest linux-mips GIT. Unless somebody finds something horrible, I think these are ready to go into Greg's tree and sent on upstream.

Here is the changelog:

* All OTG references are removed and moved to their own patch (which will be forthcoming soon).
* Fixed up some coding issues with the move from PCI, including the mapping of EHCI capability and operations registers (causing the bugs that were posted here).
* Cached the cap register for speed
* Au1200 init and remove routines were in the wrong place
* reboot_notifier was registered twice

Jordan

ALCHEMY: Add EHCI support for AU1200

---

 arch/mips/au1000/common/cputable.c                 |    2 
 arch/mips/au1000/common/platform.c                 |    4 
 drivers/usb/Kconfig                                |    8 -
 drivers/usb/host/Kconfig                           |    2 
 drivers/usb/host/ehci-au1xxx.c                     |  299 ++++++++++++++++++++
 drivers/usb/host/ehci-hcd.c                        |    8 -
 drivers/usb/host/ohci-au1xxx.c                     |  105 ++++++-
 include/asm-mips/mach-mips/cpu-feature-overrides.h |    4 
 8 files changed, 405 insertions(+), 27 deletions(-)
arch/mips/au1000/common/cputable.c +1 -1
index 4dbde82..d8df5fd 100644
@@ -38,7 +38,7 @@ struct cpu_spec	cpu_specs[] = {
     { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1 },
     { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1 },
     { 0xffffffff, 0x04030200, "Au1200 AB", 0, 0 },
-    { 0xffffffff, 0x04030201, "Au1200 AC", 0, 1 },
+    { 0xffffffff, 0x04030201, "Au1200 AC", 1, 0 },
     { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0 },
 };
 
arch/mips/au1000/common/platform.c +1 -3
index 48d3f54..dbb4ee7 100644
@@ -20,7 +20,7 @@
 static struct resource au1xxx_usb_ohci_resources[] = {
 	[0] = {
 		.start		= USB_OHCI_BASE,
-		.end		= USB_OHCI_BASE + USB_OHCI_LEN,
+		.end		= USB_OHCI_BASE + USB_OHCI_LEN - 1,
 		.flags		= IORESOURCE_MEM,
 	},
 	[1] = {
@@ -278,9 +278,7 @@ static struct platform_device *au1xxx_pl
 	&au1100_lcd_device,
 #endif
 #ifdef CONFIG_SOC_AU1200
-#if 0	/* fixme */
 	&au1xxx_usb_ehci_device,
-#endif
 	&au1xxx_usb_gdt_device,
 	&au1xxx_usb_otg_device,
 	&au1200_lcd_device,
drivers/usb/Kconfig +7 -1
index 85dacc9..bff1258 100644
@@ -9,10 +9,16 @@ menu "USB support"
 # NOTE:  SL-811 option should be board-specific ...
 config USB_ARCH_HAS_HCD
 	boolean
-	default y if USB_ARCH_HAS_OHCI
+	default y if USB_ARCH_HAS_OHCI || USB_ARCH_HAS_EHCI
 	default y if ARM				# SL-811
 	default PCI
 
+# some non-PCI hcds implement EHCI
+config USB_ARCH_HAS_EHCI
+	boolean
+	default y if SOC_AU1200
+	default PCI
+
 # many non-PCI SOC chips embed OHCI
 config USB_ARCH_HAS_OHCI
 	boolean
drivers/usb/host/Kconfig +1 -1
index ed1899d..4a4db1a 100644
@@ -6,7 +6,7 @@ comment "USB Host Controller Drivers"
 
 config USB_EHCI_HCD
 	tristate "EHCI HCD (USB 2.0) support"
-	depends on USB && PCI
+	depends on USB && USB_ARCH_HAS_EHCI
 	---help---
 	  The Enhanced Host Controller Interface (EHCI) is standard for USB 2.0
 	  "high speed" (480 Mbit/sec, 60 Mbyte/sec) host controller hardware.
drivers/usb/host/ehci-au1xxx.c new file +299 -0

299 lines not on this page · raw message

drivers/usb/host/ehci-hcd.c +4 -4
index 29f52a4..30833fe 100644
@@ -894,10 +894,10 @@ MODULE_DESCRIPTION (DRIVER_INFO);
 MODULE_AUTHOR (DRIVER_AUTHOR);
 MODULE_LICENSE ("GPL");
 
-#ifdef CONFIG_PCI
+#if defined(CONFIG_SOC_AU1X00)
+#include "ehci-au1xxx.c"
+#elif defined(CONFIG_PCI)
 #include "ehci-pci.c"
-#endif
-
-#if !defined(CONFIG_PCI)
+#else
 #error "missing bus glue for ehci-hcd"
 #endif
drivers/usb/host/ohci-au1xxx.c +88 -17

206 lines not on this page · raw message

include/asm-mips/mach-mips/cpu-feature-overrides.h +4 -0
index 9f92aed..e06af6c 100644
@@ -29,7 +29,11 @@
 /* #define cpu_has_prefetch	? */
 #define cpu_has_mcheck		1
 /* #define cpu_has_ejtag	? */
+#ifdef CONFIG_CPU_HAS_LLSC
 #define cpu_has_llsc		1
+#else
+#define cpu_has_llsc		0
+#endif
 /* #define cpu_has_vtag_icache	? */
 /* #define cpu_has_dc_aliases	? */
 /* #define cpu_has_ic_fills_f_dc ? */
#1 lore raw
Quoted 1 line · Jordan Crouse

ALCHEMY:  Add EHCI support for AU1200

Unfortunately it doesn't apply to my current tree, and I see that you were reverting some of the updates in current kernel GIT ...

Please let me know if the updated version I'm posting does not behave for you.

- Dave

#2 lore raw
Quoted 5 lines · David Brownell
Quoted 1 line · Jordan Crouse

ALCHEMY: ?Add EHCI support for AU1200

Unfortunately it doesn't apply to my current tree, and I see that you were reverting some of the updates in current kernel GIT ...

Doh - reverting changes is wicked bad - I must have screwed up the merge somewhere along the line.

Quoted 2 lines

Please let me know if the updated version I'm posting does not behave for you.

Will do.

Jordan

Signature · 4 lines
Jordan Crouse
Senior Linux Engineer
AMD - Personal Connectivity Solutions Group
<www.amd.com/embeddedprocessors>