>
> > Hello ChenYu, 
> > Thank you for your response. 
> > I tried compiling the MUSB driver in host-only mode. 
> > I have set dr_mode="host" in my .dts. and the following Kconfig options 
> (as 
> > per http://linux-sunxi.org/USB_Gadget/Ethernet#Kernel_support): 
> > 
> > CONFIG_USB_MUSB_HDRC=m 
> > CONFIG_USB_MUSB_DUAL_ROLE=y 
>
> This is clearly not host-only mode. 
> It would say MUSB_HOST_ONLY or something similar. 
>

Aaaahhh... Sorry, I just copy-pasted that from 
http://linux-sunxi.org/USB_Gadget/Ethernet 
I can assure you that I have indeed set CONFIG_USB_MUSB_HOST=y. 

> I also tried many other combinations including setting MUSB mode to
> > dual-role with dr_mode as OTG.
> > Now, the MUSB driver gets inserted, but the USB port doesn't detect
> > connected devices.
>
> Do you even see the USB host under lsusb?


Here's what I see when I load sunxi.ko:
[   39.474864] usb_phy_generic.0.auto supply vcc not found, using dummy 
regulator
[   39.482851] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, 
bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
[   39.482875] musb-hdrc: MHDRC RTL version 0.0
[   39.482894] musb-hdrc: 11/11 max ep, 5184/8192 memory
[   39.483064] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[   39.488819] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned 
bus number 5
[   39.496980] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002
[   39.503939] usb usb5: New USB device strings: Mfr=3, Product=2, 
SerialNumber=1
[   39.511194] usb usb5: Product: MUSB HDRC host driver
[   39.516159] usb usb5: Manufacturer: Linux 4.4.79 musb-hcd
[   39.521571] usb usb5: SerialNumber: musb-hdrc.1.auto
[   39.527331] hub 5-0:1.0: USB hub found
[   39.531211] hub 5-0:1.0: 1 port detected

So I believe that's working alright.
# lsusb
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


> Did I miss some setting or Kconfig parameter?

 

Did you enable any gadget drivers and actually have them loaded?
> I believe I already mentioned this last time. 


I did enable g_ether and g_mass_storage in the Kconfig. But I just 
realized that I have been overlooking the fact that loading g_ether fails ->
# modprobe g_ether
1 module could not be probed
- g_ether

The error is ->
[   31.760984] g_ether musb-hdrc.1.auto: failed to start g_ether: -2

FWIW, here is the thread I was referring to when I mentioned the 'Invalid 
or missing 'dr_mode' property' error I got with MUSB host-only role 
-> https://www.mail-archive.com/[email protected]/msg12420.html
Thank you for your help. 

Best regards,
~~ Shoaib.

On Tuesday, August 15, 2017 at 6:11:10 PM UTC+4, Chen-Yu Tsai wrote:
>
> On Tue, Aug 15, 2017 at 10:01 PM, sufi al hussaini hassani kamili 
> raheemi <[email protected] <javascript:>> wrote: 
> > Hello ChenYu, 
> > Thank you for your response. 
> > I tried compiling the MUSB driver in host-only mode. 
> > I have set dr_mode="host" in my .dts. and the following Kconfig options 
> (as 
> > per http://linux-sunxi.org/USB_Gadget/Ethernet#Kernel_support): 
> > 
> > CONFIG_USB_MUSB_HDRC=m 
> > CONFIG_USB_MUSB_DUAL_ROLE=y 
>
> This is clearly not host-only mode. 
> It would say MUSB_HOST_ONLY or something similar. 
>
> > CONFIG_USB_MUSB_SUNXI=m 
> > CONFIG_MUSB_PIO_ONLY=y 
> > CONFIG_USB_PHY=y 
> > CONFIG_NOP_USB_XCEIV=m 
> > 
> > 
> > But loading the sunxi module fails with following error -> 
> > 
> > [ 128.670411] musb-sunxi 1c13000.usb: Invalid or missing 'dr_mode' 
> property 
> > [ 128.677233] musb-sunxi: probe of 1c13000.usb failed with error -22 
> > 
> > I read of a similar problem in another thread, but I'm not sure it's the 
> > same. 
>
> Note sure about this. 
>
> > 
> > I also tried many other combinations including setting MUSB mode to 
> > dual-role with dr_mode as OTG. 
> > Now, the MUSB driver gets inserted, but the USB port doesn't detect 
> > connected devices. 
>
> Do you even see the USB host under lsusb? 
>
> > Did I miss some setting or Kconfig parameter? 
>
> Did you enable any gadget drivers and actually have them loaded? 
> I believe I already mentioned this last time. 
>
> ChenYu 
>
> > 
> > Best regards, 
> > ~~ Shoaib. 
> > 
> > On Friday, August 4, 2017 at 6:40:43 AM UTC+4, Chen-Yu Tsai wrote: 
> >> 
> >> On Sun, Jul 30, 2017 at 2:35 PM, sufi al hussaini hassani kamili 
> >> raheemi <[email protected]> wrote: 
> >> > Hi All, 
> >> > 
> >> > I am not able to get USB0 to work in host mode. 
> >> > This is an Olimex A20 Olinuxino micro and I have set `dr_mode = 
> "host";` 
> >> > in 
> >> > the dts. I have compiled the kernel with USB support and the other 
> USBs 
> >> > are 
> >> > working fine. 
> >> > 
> >> > I found this post 
> >> > 
> >> > (
> https://groups.google.com/forum/#!msg/linux-sunxi/uulK5lf7XrU/QUMtNbVpAQAJ) 
>
> >> > which addresses a similar problem for the lime2 board. I tried making 
> >> > these 
> >> > changes but it isn't working for me. 
> >> > My kernel version is 4.4.71 and it should have USB support as per the 
> >> > sunxi 
> >> > mainlining effort page. 
> >> > 
> >> > FWIW, I see the following in my boot logs: 
> >> > [    1.591201] vcc5v0: disabling 
> >> > [    1.591218] ahci-5v: disabling 
> >> > [    1.591225] usb0-vbus: disabling 
> >> > 
> >> > 
> >> > I'd appreciate if someone can help me here. 
> >> 
> >> What mode are you compiling the MUSB driver as? If you selected OTG 
> then 
> >> you also need a gadget driver. I'm not sure if the bug that needs the 
> >> gadget driver to probe before the MUSB driver was fixed in 4.4 or not. 
> >> 
> >> Safe bet is to just compile the MUSB driver in host-only mode. Note 
> this 
> >> is separate from what you specified in the device tree. 
> >> 
> >> ChenYu 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "linux-sunxi" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to [email protected] <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to