HowToUSB


There's quite a bit of info floating around the OpenWRT wiki and forums on USB support, e.g. http://wiki.openwrt.org/OpenWrtDocs/Customizing/Hardware/USB

http://www.linux-usb.org/usb2.html .

 

This page contains notes (from Chuck) regarding initial experiences with USB on the WGT634U. I'm a USB weenie so apply a grain of salt.

 

WGT634U uses the NEC uPD720101 chip which has hardware pins for five (count 'em 5) physical USB ports. However only ONE port is installed on the WGT634U. With a BGA package like this there is not much hope of wiring up any of the missing ports.

 

The uPD720101 contains two OHCI host controllers (for USB1.1 communications) and one EHCI host controller (for USB2.0 communications). There is also a "companion" OHCI controller which handles transactions when a USB2.0 port is communicating with a slower USB1.1 device.

 

If you load the ohci_hcd kernel module, you can talk to USB1.0 and 1.1 devices over the USB port on the router. In theory, you can skip ohci and load only the usb2 module (ehci_hcd) if you have only USB2.0 devices attached. In practice, you probably want to load both modules, so you can talk to both types.

 

As far as I know there is no reason to build or load uhci_hcd on a WGT634U. There are no uhci (Intel-style) USB host controllers.

 

At boot time, linux probes the PCI bus and finds four USB host controllers: three ohci and one ehci. It produces a number of errors

 

<6>usb 1-2: new low speed USB device using ohci_hcd and address 6
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0in 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0in 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0in 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: GetStatus roothub.portstatus [1] = 0x00100303 PRSC LSD A PPS PES CCS
<3>usb 1-2: device descriptor read/64, error -145
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0in 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0in 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0in 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: GetStatus roothub.portstatus [1] = 0x00100303 PRSC LSDA PPS PES CCS
<6>Initializing USB Mass Storage driver...
<3>usb 1-2: device descriptor read/64, error -145
<7>ohci_hcd 0000:00:03.0: GetStatus roothub.portstatus [1] = 0x00100303 PRSC LSDA PPS PES CCS
<6>usb 1-2: new low speed USB device using ohci_hcd and address 7
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0in 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0in 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0in 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: GetStatus roothub.portstatus [1] = 0x00100303 PRSC LSDA PPS PES CCS
<3>usb 1-2: device descriptor read/64, error -145
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0in 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0in 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0in 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: GetStatus roothub.portstatus [1] = 0x00100303 PRSC LSD
A PPS PES CCS
<3>usb 1-2: device descriptor read/64, error -145
<7>ohci_hcd 0000:00:03.0: GetStatus roothub.portstatus [1] = 0x00100303 PRSC LSDA PPS PES CCS
<6>usb 1-2: new low speed USB device using ohci_hcd and address 8
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0out 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0out 5ec20000 cc 5 --> status -145
<3>usb 1-2: device not accepting address 8, error -145
<7>ohci_hcd 0000:00:03.0: GetStatus roothub.portstatus [1] = 0x00100303 PRSC LSDA PPS PES CCS
<6>usb 1-2: new low speed USB device using ohci_hcd and address 9
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0out 5ec20000 cc 5 --> status -145
<7>ohci_hcd 0000:00:03.0: urb 8128de00 path 2 ep0out 5ec20000 cc 5 --> status -145
<3>usb 1-2: device not accepting address 9, error -145

 

during this process, perhaps because the unwired controllers are complaining. Not sure about that, but it does seem to work.

 

If you're working on a USB project you probably want the lsusb utility. For this you need to symlink packages/libs/libusb and packages/utils/usbutils into trunk/package, then make menuconfig. You may also want to enable kernel debugging for USB in the kernel config (see http://wiki.openwrt.org/BuildRoot#Customizingthekerneloptions )

 

/proc/bus/usb is the mount point for the usbfs, which lsusb accesses. So you need to set up a mount sometime after the usb-core kernel module has loaded: mount -t usbfs none /proc/bus/usb

 

Good luck!