Bekijk de volledige versie : WL-HDD USB hardware bug?

10-07-2005, 13:12
Hi all,

I've been developing all kinds of software for the WL-HDD (kernel & userland) to interface with different USB devices (webcam, headset, USB-RS232). One problem I keep encoutering is that the USB detection seems to fail when the WL-HDD is reset or powered off for a short time. Powering off (15 mins) and switching on again usually does the trick but I am looking for a real solution instead of this workaround.

I have found some other threads on this forum concerning the like problem related to different devices (like USB stick not detected or hub not detected) but I think this is a generic WL-HDD (maybe even WL 500 as well) problem and has nothing to do with individual devices.

When the problem happens, and I plug in a USB hub the ready light stays off (which I think it means it does not get enumerated)

# mount none /proc/bus/usb/
# cat /proc/bus/usb/devices
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 0.00
S: Product=USB OHCI Root Hub
S: SerialNumber=b8004000
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms

As seen, only the root hub is detected, no matter what I plug in

# cat /proc/interrupts
2: 0 MIPS usb-ohci
3: 0 MIPS eth0
4: 375 MIPS eth1
6: 769 MIPS eth2
7: 8024 MIPS timer

ERR: 0

The usb-ohci (controller) does not generate any interrupts while I think it should generate an interrupt upon plugging in a device, because when it does work the number of interrupts increases on pluggin/unplugging a device

Any clues?

10-07-2005, 13:22
Just an idea - usb core has not switched to host mode (works in device mode) and disconnected from usb pins... You've to study sources in the shared dir.

11-07-2005, 16:10
Do you know which source that might be?

[rob@localhost wlhdd]$ grep -Iir ohci broadcom/src/shared/* broadcom/src/router/shared/*
broadcom/src/shared/sbpci.c: progif = 0x10; /* OHCI */
[rob@localhost wlhdd]$
This is all I can find and it doesn't really look like it's what I should be looking for, is it?

Also do you know how I might be able to check whether the USB is operating in host or device mode?

12-07-2005, 10:36
Actually linux/arch/mips/brcm-boards/bcm947xx/pcibios.c:

* The USB core requires a special bit to be set during core
* reset to enable host (OHCI) mode. Resetting the SB core in
* pcibios_enable_device() is a hack for compatibility with
* vanilla usb-ohci so that it does not have to know about
* SB. A driver that wants to use the USB core in device mode
* should know about SB and should reset the bit back to 0
* after calling pcibios_enable_device().
if (sb_coreid(sbh) == SB_USB) {
sb_core_disable(sbh, sb_coreflags(sbh, 0, 0));
sb_core_reset(sbh, 1 << 29);
} else
sb_core_reset(sbh, 0);

14-07-2005, 11:50
I added some printk's and this code is indeed executed every time. Therefore the controller should be initialized the right way, yet the problem stays. I bought a WL500g and the problem doesn't appear on that device. I ordered a second WL-HDD, and will check it on this one to see if it is perhaps a hardware issue