Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Dec 2001 05:49:45 -0800 (PST)
From:      Thorsten Greiner <thorsten.greiner@consol.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/33004: Patch for USB (uhci)
Message-ID:  <200112191349.fBJDnjb62094@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         33004
>Category:       kern
>Synopsis:       Patch for USB (uhci)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 19 05:50:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Thorsten Greiner
>Release:        4.4-STABLE
>Organization:
>Environment:
FreeBSD tybalt 4.4-STABLE FreeBSD 4.4-STABLE #51: Wed Dec 19 10:57:03 CET 2001     thorsten@tybalt:/usr/src/sys/compile/TYBALT  i386
>Description:
Out of the box 4.4-STABLE will not activate the uhci usb controller on my ASUS L7300 laptop. This usb host controller is recognized as follows:

uhci0: <Intel 82443MX USB controller> port 0x1c00-0x1c1f at device 7.2 on pci0
pci_cfgintr_linked: linked (63) to hard-routed irq 11
pci_cfgintr: 0:7 INTD routed to irq 11
usb0: <Intel 82443MX USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered

The symptoms of the problem are timeouts during bus exploration:

Dec 18 10:34:38 tybalt /kernel: uhub0: device problem, disabling port 1 

>How-To-Repeat:
Probably difficult unless you have the same hardware...
>Fix:
Apply the following patch to /usr/src/sys/pci/uhci_pci.c:

--- uhci_pci.c_orig	Wed Dec 20 10:56:47 2001
+++ uhci_pci.c	Wed Dec 19 10:56:50 2001
@@ -182,6 +182,7 @@
 	uhci_softc_t *sc = device_get_softc(self);
 	int rid;
 	int err;
+	u_int32_t csr;
 
 	rid = PCI_UHCI_BASE_REG;
 	sc->io_res = bus_alloc_resource(self, SYS_RES_IOPORT, &rid,
@@ -275,6 +276,11 @@
 		uhci_pci_detach(self);
 		return ENXIO;
 	}
+
+	/* Enable the device. */
+	csr = pci_read_config(self, PCI_COMMAND_STATUS_REG, 4);
+	pci_write_config(self, PCI_COMMAND_STATUS_REG, 
+		csr | PCIM_CMD_BUSMASTEREN, 4);
 
 	/* Set the PIRQD enable bit and switch off all the others. We don't
 	 * want legacy support to interfere with us
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112191349.fBJDnjb62094>