[patch 2.6.23-rc3 4/4] EHCI initializes properly on PPC SOCs

David Brownell <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
From: Mike Nuss <[email protected]>

Correctly initialize the on-chip EHCI controller on the AMCC PPC440EPx.
Fix "USB 0.0" initialization message, and properly put the controller
into a known state before starting it.

Add "FIXME" comment to the au1xxx bus glue which is doing the same wrong
thing here.  (Who maintains that, now that AMD sold off Alchemy?)  Remove
some false copyright attributions which were somehow placed in the au1xxx
bus glue then copied into ppc-soc.

Signed-off-by: Mike Nuss <[email protected]>
Signed-off-by: David Brownell <[email protected]>
Cc: Stefan Roese <[email protected]>
Cc: K.Boge <[email protected]>
Cc: Jordan Crouse <[email protected]>
---
Bugfix; for 2.6.23 please.

 drivers/usb/host/ehci-au1xxx.c  |    5 +++--
 drivers/usb/host/ehci-ppc-soc.c |   22 ++++++++++++++++++++--
 2 files changed, 23 insertions(+), 4 deletions(-)

--- g26.orig/drivers/usb/host/ehci-ppc-soc.c	2007-08-17 23:34:25.000000000 -0700
+++ g26/drivers/usb/host/ehci-ppc-soc.c	2007-08-18 00:22:07.000000000 -0700
@@ -6,7 +6,7 @@
  * Bus Glue for PPC On-Chip EHCI driver
  * Tested on AMCC 440EPx
  *
- * Based on "ehci-au12xx.c" by David Brownell <[email protected]>
+ * Based on "ehci-au1xxx.c" by K.Boge <[email protected]>
  *
  * This file is licenced under the GPL.
  */
@@ -15,6 +15,24 @@
 
 extern int usb_disabled(void);
 
+/* called during probe() after chip reset completes */
+static int ehci_ppc_soc_setup(struct usb_hcd *hcd)
+{
+	struct ehci_hcd	*ehci = hcd_to_ehci(hcd);
+	int		retval;
+
+	retval = ehci_halt(ehci);
+	if (retval)
+		return retval;
+
+	retval = ehci_init(hcd);
+	if (retval)
+		return retval;
+
+	ehci->sbrn = 0x20;
+	return ehci_reset(ehci);
+}
+
 /**
  * usb_ehci_ppc_soc_probe - initialize PPC-SoC-based HCDs
  * Context: !in_interrupt()
@@ -120,7 +138,7 @@ static const struct hc_driver ehci_ppc_s
 	/*
 	 * basic lifecycle operations
 	 */
-	.reset = ehci_init,
+	.reset = ehci_ppc_soc_setup,
 	.start = ehci_run,
 	.stop = ehci_stop,
 	.shutdown = ehci_shutdown,
--- g26.orig/drivers/usb/host/ehci-au1xxx.c	2007-08-17 23:34:25.000000000 -0700
+++ g26/drivers/usb/host/ehci-au1xxx.c	2007-08-17 23:38:47.000000000 -0700
@@ -1,8 +1,6 @@
 /*
  * EHCI HCD (Host Controller Driver) for USB.
  *
- * (C) Copyright 2000-2004 David Brownell <[email protected]>
- *
  * Bus Glue for AMD Alchemy Au1xxx
  *
  * Based on "ohci-au1xxx.c" by Matt Porter <[email protected]>
@@ -196,6 +194,9 @@ static const struct hc_driver ehci_au1xx
 
 	/*
 	 * basic lifecycle operations
+	 *
+	 * FIXME -- ehci_init() doesn't do enough here.
+	 * See ehci-ppc-soc for a complete implementation.
 	 */
 	.reset = ehci_init,
 	.start = ehci_run,

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.