From owner-freebsd-arm@FreeBSD.ORG Mon Dec 24 01:04:36 2012 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E07459A7 for ; Mon, 24 Dec 2012 01:04:36 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248]) by mx1.freebsd.org (Postfix) with ESMTP id 693348FC0C for ; Mon, 24 Dec 2012 01:04:36 +0000 (UTC) Received: from [88.198.91.248] (helo=[IPv6:::1]) by id.bluezbox.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Tmw81-0005HK-0q; Sun, 23 Dec 2012 16:42:52 -0800 Message-ID: <50D7A504.10203@bluezbox.com> Date: Sun, 23 Dec 2012 16:42:44 -0800 From: Oleksandr Tymoshenko User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: wynkoop@wynn.com Subject: Re: beaglebone usb problems References: <201212230507.qBN572su095100@mail.wynn.com> In-Reply-To: <201212230507.qBN572su095100@mail.wynn.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 12/22/2012 9:07 PM, wynkoop@wynn.com wrote: > Greeting- > > Today I grabbed the lattest kernel and usreland sources with csup onto my > beaglebone with the idea of building a kernel that would support usb. > > I used the default BEAGLEBOARD config file that I found in the ARM branch of > /usr/src/sys. After a crash on building because of lack of memory I got the > new kernel built and installed by adding some swap space. Not the best > thing to do to an SD card, but a needed evil. > > I completed the build of the kernel and installed it. Upon reboot the system > is still not seeing the USB BUS. > > I have verified that it sees the USB bus under the provided gnu/linux > distribution. > > [ 0.553985] usbcore: registered new interface driver cdc_acm > [ 0.554077] usbcore: registered new interface driver usblp > [ 0.554138] usbcore: registered new interface driver cdc_wdm > [ 0.554199] usbcore: registered new interface driver uas > [ 0.554321] usbcore: registered new interface driver usb-storage > [ 0.554412] usbcore: registered new interface driver libusual > [ 0.561981] usbcore: registered new interface driver usbhid > [ 0.561981] usbhid: USB HID core driver > [ 0.562927] usbcore: registered new interface driver snd-usb-audio > [ 0.673187] usb 1-1: new high-speed USB device number 2 using musb-hdrc > [ 0.813659] usb 1-1: New USB device found, idVendor=0781, idProduct=5573 > [ 0.813690] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 > [ 0.813690] usb 1-1: Product: Staples > [ 0.813690] usb 1-1: Manufacturer: > [ 0.813720] usb 1-1: SerialNumber: 4C532000070802101254 > [ 0.815277] scsi0 : usb-storage 1-1:1.0 > [ 2.234497] musb-hdrc musb-hdrc.0: MUSB HDRC host driver > [ 2.234527] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 2 > [ 2.234649] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002 > [ 2.234649] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 > [ 2.234680] usb usb2: Product: MUSB HDRC host driver > [ 2.234680] usb usb2: Manufacturer: [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2012 01:04:36 -0000 On 12/22/2012 9:07 PM, wynkoop@wynn.com wrote: > Greeting- > > Today I grabbed the lattest kernel and usreland sources with csup onto my > beaglebone with the idea of building a kernel that would support usb. > > I used the default BEAGLEBOARD config file that I found in the ARM branch of > /usr/src/sys. After a crash on building because of lack of memory I got the > new kernel built and installed by adding some swap space. Not the best > thing to do to an SD card, but a needed evil. > > I completed the build of the kernel and installed it. Upon reboot the system > is still not seeing the USB BUS. > > I have verified that it sees the USB bus under the provided gnu/linux > distribution. > > [ 0.553985] usbcore: registered new interface driver cdc_acm > [ 0.554077] usbcore: registered new interface driver usblp > [ 0.554138] usbcore: registered new interface driver cdc_wdm > [ 0.554199] usbcore: registered new interface driver uas > [ 0.554321] usbcore: registered new interface driver usb-storage > [ 0.554412] usbcore: registered new interface driver libusual > [ 0.561981] usbcore: registered new interface driver usbhid > [ 0.561981] usbhid: USB HID core driver > [ 0.562927] usbcore: registered new interface driver snd-usb-audio > [ 0.673187] usb 1-1: new high-speed USB device number 2 using musb-hdrc > [ 0.813659] usb 1-1: New USB device found, idVendor=0781, idProduct=5573 > [ 0.813690] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 > [ 0.813690] usb 1-1: Product: Staples > [ 0.813690] usb 1-1: Manufacturer: > [ 0.813720] usb 1-1: SerialNumber: 4C532000070802101254 > [ 0.815277] scsi0 : usb-storage 1-1:1.0 > [ 2.234497] musb-hdrc musb-hdrc.0: MUSB HDRC host driver > [ 2.234527] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 2 > [ 2.234649] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002 > [ 2.234649] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 > [ 2.234680] usb usb2: Product: MUSB HDRC host driver > [ 2.234680] usb usb2: Manufacturer: Linux 3.2.28 musb-hcd > [ 2.234680] usb usb2: SerialNumber: musb-hdrc.0 > root@beaglebone:~# > > Plugging in a supported USB wifi device under Linux produced the following: > > [ 246.557800] usb 1-1: USB disconnect, device number 2 > [ 253.454040] usb 1-1: new high-speed USB device number 3 using musb-hdrc > [ 253.747406] usb 1-1: New USB device found, idVendor=2001, idProduct=3c00 > [ 253.747436] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 > [ 253.747467] usb 1-1: Product: 802.11g WLAN Adapter > [ 253.747467] usb 1-1: Manufacturer: ANI > [ 253.828186] cfg80211: Calling CRDA to update world regulatory domain > [ 254.014068] usb 1-1: reset high-speed USB device number 3 using musb-hdrc > [ 254.325317] ieee80211 phy0: Selected rate control algorithm 'pid' > [ 254.326263] Registered led device: rt2500usb-phy0::radio > [ 254.326385] Registered led device: rt2500usb-phy0::quality > [ 254.342895] usbcore: registered new interface driver rt2500usb > [ 254.505523] ADDRCONF(NETDEV_UP): wlan0: link is not ready > root@beaglebone:~# ifconfig wlan0 > > > wlan0 Link encap:Ethernet HWaddr 00:13:46:97:95:ED > UP BROADCAST MULTICAST MTU:1500 Metric:1 > RX packets:0 errors:0 dropped:0 overruns:0 frame:0 > TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) > > > So I think I can say the hardware is working. > > Under FreeBSD 10 we see the following: > > root@beaglebone:~ # dmesg | grep -i usb > am335x_pmic0: TPS65217B ver 1.1 powered by USB and AC > root@beaglebone:~ # > > > In other words we do not even see the bus let alone any wifi or storage device > inserted into the bus. > > My kernel config has the needed stuff I believe. Here is the snippit. > > # USB support > device usb > options USB_DEBUG > #options USB_REQ_DEBUG > #options USB_VERBOSE > device musb > device umass > device scbus # SCSI bus (required for SCSI) > device da # Direct Access (disks) > > # Ethernet > device loop > device ether > device mii > device smscphy > device cpsw > device bpf > > # USB ethernet support, requires miibus > device miibus > device axe # ASIX Electronics USB Ethernet > > > > > This test was done under FreeBSD 10 built from sources updated today I can > not even see any usb bus let alone any devices. > > Does anyone have ideas? > I looked into it and it seems we do not have proper support for USB on BeagleBone. Although the general logic for MUSB is in the tree (dev/usb/controller/musb_otg.c) there is no actual driver part for AM335x, like musb_otg_atmelarm.c for Atmel devices. From what I saw in spec it shouldn't be really hard to get hardware-specific glue done for BeagleBone. Since there are two musb ports on AM335x device and some additional hardware involved the actual driver is slightly more complicated then just adding FDT entry and fdt glue, but not exceedingly hard either I will not have spare cycles for a week or two so if somebody with real hardware could get it done - that would be great. AM335x TRM: http://www.ti.com/lit/ug/spruh73g/spruh73g.pdf See chapter 16.