RE: linux USB dwc3 not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

andy_purcell@xxxxxxxxxxxx writes:
> 00:14.1 USB controller: Intel Corporation Sunrise Point-H USB Device Controller (OTG) (rev 31)

okay, this is dwc3. Good

>> I need to ask you to try a newer kernel. Can you try v4.9.6 or v4.10-rc6?
>> 
>
> I am now running Ubuntu 4.10.0-999-generic. 
> Same results - USB device not working, test modes still not working.  

okay

>> > Using a script, I set up the USB-device to be RNDIS, using functionfs.
>> 
>> functionfs needs a userspace component, do you have that? Can you try any
>> other gadget driver like mass storage, for instance? Here's a quick script for
>> mass storage:
>> 
>> #!/bin/sh
>> 
>> dd if=/dev/zero of=/dev/shm/file bs=1M count=1024
>> 
>> mount -t configfs none /c
>> mkdir /c/usb_gadget/g1
>> echo 0x18d1 > /c/usb_gadget/g1/idVendor
>> echo 0xbeef > /c/usb_gadget/g1/idProduct mkdir
>> /c/usb_gadget/g1/strings/0x409 echo 123456789012 >
>> /c/usb_gadget/g1/strings/0x409/serialnumber
>> echo "Intel Corporation" > /c/usb_gadget/g1/strings/0x409/manufacturer
>> echo "Joule" > /c/usb_gadget/g1/strings/0x409/product
>> mkdir /c/usb_gadget/g1/functions/mass_storage.1
>> mkdir /c/usb_gadget/g1/configs/b.1
>> mkdir /c/usb_gadget/g1/configs/b.1/strings/0x409
>> echo 500 > /c/usb_gadget/g1/configs/b.1/MaxPower
>> echo /dev/shm/file > /c/usb_gadget/g1/functions/mass_storage.1/lun.0/file
>> ln -s /c/usb_gadget/g1/functions/mass_storage.1
>> /c/usb_gadget/g1/configs/b.1/f1 echo dwc3.0.auto > /c/usb_gadget/g1/UDC
>> 
>
> I run this script, slightly modified, as you suggested. 
> After running this script, I see these 2 lines added to the dmesg output: 
> [   93.096773] Mass Storage Function, version: 2009/09/11
> [   93.096777] LUN: removable file: (no medium)

alright, mass storage loaded and available.

>> > I connect a USB cable from my board to a USB-host.
>> > My USB analyzer shows nothing happens. No connection, no SETUP
>> > packets, nothing.
>> 
>> right, I'm assuming you don't have userspace component for functionfs, so -
>> >pullup() is never called.
>> 
>
> What is the userspace component for functionfs, given that I am setting up mass storage? 
> How do I get it for Ubuntu 4.10.0-999-generic? 

now that you're using mass storage, you don't need anything else ;-)

>> Can you also get the output of:
>> 
>> grep DCTL regdump
>
> root@apub1:/sys/kernel/debug/dwc3.0.auto# grep DCTL regdump 
> DCTL = 0x80f00000

okay, good. RUN/STOP bit is set. So it still doesn't work? The only
thing I can think of, is that VBUS_VALID bit in the Mux register isn't
set properly. I'm not in the office now, but I'll try to get you more
info on that.

In my SKL boards, however, that bit is always enabled. This means that
DWC3 works, but when I unplug cable, I don't see a disconnect interrupt
;-)

What you really need to make this work properly, is some way of sampling
VBUS level and, whenever it's above 4.4V, then set VBUS_VALID bit in
DRCFG0 register. This is the best way to have this always
working. Ideally it would be hidden by the BIOS, so you wouldn't have to
care about it :-s

-- 
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux