Bug 194562 - Cubieboard2: only one USB device is seen by the system
Summary: Cubieboard2: only one USB device is seen by the system
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm Any
: --- Affects Only Me
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-23 19:26 UTC by Maxim Filimonov
Modified: 2015-10-09 02:39 UTC (History)
3 users (show)

See Also:


Attachments
dmesg.log (4.58 KB, text/x-log)
2014-10-23 19:26 UTC, Maxim Filimonov
no flags Details
kernel config (4.49 KB, text/plain)
2014-10-23 19:26 UTC, Maxim Filimonov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Filimonov 2014-10-23 19:26:08 UTC
Created attachment 148588 [details]
dmesg.log

I'm trying to plug in a USB device (a wireless dongle based on urtwn). See the kernel config in the attachment.
The problem is that when I plug any USB device into the board's USB Host socket, I see no reaction. It doesn't even give any power to the devcice. `usbconfig list` only shows the USB Flash drive with the root partition.
root@cubie:~ # usbconfig list
ugen1.1: <EHCI root HUB Allwinner> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.1: <EHCI root HUB Allwinner> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <Mass Storage Device JetFlash> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)


root@cubie:~ # uname -a
FreeBSD cubie 11.0-CURRENT FreeBSD 11.0-CURRENT #3 r273464M: Thu Oct 23 23:02:27 MSK 2014     root@quad:/usr/obj/arm.armv6/usr/src/head/sys/CUBIEBOARD2  arm

I have also attached the dmesg log.
Comment 1 Maxim Filimonov 2014-10-23 19:26:51 UTC
Created attachment 148589 [details]
kernel config
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2014-10-23 19:35:15 UTC
Hi,

Can you verify that the port has +5V and that USB jumpers, if any, are correctly assigned. Does not look like a USB core software issue yet.

Might be some GPIO's that needs tweaking through the FDT tables.

--HPS
Comment 3 Maxim Filimonov 2014-10-23 19:49:27 UTC
Does booting from both of the ports count? I can attach a usb flash drive to both of the ports, and it still boots up correctly.
Comment 4 Hans Petter Selasky freebsd_committer freebsd_triage 2014-10-23 19:58:40 UTC
Hi,

The bootloader might do some special programming switching on USB ports, which the kernel lacks. Is U-boot the bootloader you are using?

--HPS
Comment 5 Maxim Filimonov 2014-10-23 20:08:11 UTC
It is. 
And here's its version:
sunxi#version

U-Boot 2011.09-rc1-00003-ge89ab14-dirty (Jan 03 2014 - 12:57:33) Allwinner Technology 
arm-linux-gnueabi-gcc (crosstool-NG linaro-1.13.1-2012.02-20120222 - Linaro GCC 2012.02) 4.6.3 20120201 (prerelease)
GNU ld (crosstool-NG linaro-1.13.1-2012.02-20120222 - Linaro GCC 2012.02) 2.22
Comment 6 Maxim Filimonov 2014-10-23 20:44:15 UTC
After I plugged in both of the USB devices and booted up the system, everything went way beter: the urtwn device is detected, but it doesn't want to load the firmware.
Comment 7 Hans Petter Selasky freebsd_committer freebsd_triage 2014-10-24 05:38:52 UTC
Does the urtwn work on a regular PC w/FreeBSD installed?

--HPS
Comment 8 ganbold 2014-10-24 06:08:15 UTC
In my case it detect when plugs in buffalo wifi stick which is run(4).

My u-boot version is:

U-Boot 2013.04-07297-gc8f265c (Jun 17 2013 - 02:01:35) Allwinner Technology
arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.7-2013.04-20130415 - Linaro GCC 2013.04) 4.7.3 20130328 (prerelease)
GNU ld (crosstool-NG linaro-1.13.1-4.7-2013.04-20130415 - Linaro GCC 2013.04) 2.23.1
Comment 9 Maxim Filimonov 2014-10-24 06:41:42 UTC
Hans, yep: urtwn works perfectly at my laptop which runs FreeBSD 10.1-RC2.
Comment 10 Hans Petter Selasky freebsd_committer freebsd_triage 2014-10-24 06:43:25 UTC
Hi,

It's detecting in dmesg or not?

Which architecture is your board, ARM?

Might be the firmware tool for urtwn is not built or installed.

--HPS
Comment 11 Kevin Lo freebsd_committer freebsd_triage 2014-10-24 07:40:28 UTC
(In reply to Maxim Filimonov from comment #6)
> After I plugged in both of the USB devices and booted up the system,
> everything went way beter: the urtwn device is detected, but it doesn't want
> to load the firmware.

Seems like you forgot to compile urtwnfw(4) into the kernel...
Comment 12 Maxim Filimonov 2014-10-24 08:15:05 UTC
Kevin, should it reside in the kernel config? If so, yes I have. Must recompile the kernel then. Thank you.
Comment 13 Kevin Lo freebsd_committer freebsd_triage 2014-10-24 08:32:38 UTC
Yes.  Add "device urtwnfw" to your kernel config and don't forget to add
"legal.realtek.license_ack=1" to /boot/loader.conf :-)
Comment 14 Maxim Filimonov 2014-10-24 08:51:06 UTC
(In reply to Kevin Lo from comment #13)
> Yes.  Add "device urtwnfw" to your kernel config and don't forget to add
> "legal.realtek.license_ack=1" to /boot/loader.conf :-)

Yep, I remember about license_ack :-). Thank you.
Comment 15 Maxim Filimonov 2015-10-09 02:39:25 UTC
Seems to be fixed; at least, the second USB device I tried to connect was detected by the kernel.