Message ID | CAEXMXLTm9bhX7aAub+MaZGBdw2cCsoO3nE6ep7dbm8mMryaQeg@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | sunxi: USB gadget does not work on H2+ after 92a30692b2b18f45aae6fdaae38d67ed03dd2d11 | expand |
On Mon, Aug 13, 2018 at 3:59 PM, Nuno Gonçalves <nunojpg@gmail.com> wrote: > After this commit usb gadget does not work anymore for me on the Orange Pi > Zero (H2+). Please send log or full information? Jagan.
This test is on 2018.09-rc2 with UMS enabled. With your patch, I get this dmesg on the host: [20121.718226] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad? [20122.578151] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad? [20122.578320] usb 1-4-port4: attempt power cycle [20123.750104] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad? [20124.602034] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad? [20124.602190] usb 1-4-port4: unable to enumerate USB device u-boot console is the same, including loading the gadget: Allwinner mUSB OTG (Peripheral) If you tell me how you tested USB Gadget to work, I will reproduce your test locally to confirm the issue. Thanks, Nuno On Fri, Aug 17, 2018 at 1:38 PM Jagan Teki <jagan@amarulasolutions.com> wrote: > On Mon, Aug 13, 2018 at 3:59 PM, Nuno Gonçalves <nunojpg@gmail.com> wrote: > > After this commit usb gadget does not work anymore for me on the Orange > Pi > > Zero (H2+). > > Please send log or full information? > > Jagan. >
This can be because UMS is not DM aware? On Fri, Aug 17, 2018 at 2:02 PM Nuno Gonçalves <nunojpg@gmail.com> wrote: > This test is on 2018.09-rc2 with UMS enabled. > > With your patch, I get this dmesg on the host: > > [20121.718226] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad? > [20122.578151] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad? > [20122.578320] usb 1-4-port4: attempt power cycle > [20123.750104] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad? > [20124.602034] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad? > [20124.602190] usb 1-4-port4: unable to enumerate USB device > > u-boot console is the same, including loading the gadget: > > Allwinner mUSB OTG (Peripheral) > > If you tell me how you tested USB Gadget to work, I will reproduce your > test locally to confirm the issue. > > Thanks, > Nuno > > > On Fri, Aug 17, 2018 at 1:38 PM Jagan Teki <jagan@amarulasolutions.com> > wrote: > >> On Mon, Aug 13, 2018 at 3:59 PM, Nuno Gonçalves <nunojpg@gmail.com> >> wrote: >> > After this commit usb gadget does not work anymore for me on the Orange >> Pi >> > Zero (H2+). >> >> Please send log or full information? >> >> Jagan. >> >
On Fri, Aug 17, 2018 at 5:49 PM, Nuno Gonçalves <nunojpg@gmail.com> wrote: > This can be because UMS is not DM aware? > > On Fri, Aug 17, 2018 at 2:02 PM Nuno Gonçalves <nunojpg@gmail.com> wrote: >> >> This test is on 2018.09-rc2 with UMS enabled. >> >> With your patch, I get this dmesg on the host: >> >> [20121.718226] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad? >> [20122.578151] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad? >> [20122.578320] usb 1-4-port4: attempt power cycle >> [20123.750104] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad? >> [20124.602034] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad? >> [20124.602190] usb 1-4-port4: unable to enumerate USB device >> >> u-boot console is the same, including loading the gadget: >> >> Allwinner mUSB OTG (Peripheral) >> >> If you tell me how you tested USB Gadget to work, I will reproduce your >> test locally to confirm the issue. Here is the steps with UMS on BPI-M2+ which is H3 board (USB is similar to H2+) on target: => mmc list SUNXI SD/MMC: 0 SUNXI SD/MMC: 1 (eMMC) => mmc dev 1 switch to partitions #0, OK mmc1(part 0) is current device => ums 0 mmc 1 UMS: LUN 0, dev 1, hwpart 0, sector 0x0, count 0xe90000 \musb-hdrc: peripheral reset irq lost! on host: $ sudo dmesg [25593.969620] usb 1-1: new high-speed USB device number 7 using xhci_hcd [25594.118084] usb 1-1: New USB device found, idVendor=1f3a, idProduct=1010 [25594.118092] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [25594.118097] usb 1-1: Product: USB download gadget [25594.118102] usb 1-1: Manufacturer: Allwinner Technology [25594.118107] usb 1-1: SerialNumber: 02c0008196cc4467 [25594.159273] usb-storage 1-1:1.0: USB Mass Storage device detected fastboot also look fine. Jagan.
On Sat, Aug 18, 2018 at 1:41 PM Jagan Teki <jagan@amarulasolutions.com> wrote: > Here is the steps with UMS on BPI-M2+ which is H3 board (USB is similar to > H2+) > What defconfig are you using for this test? Thanks!
On Sat, Aug 18, 2018 at 6:01 PM, Nuno Gonçalves <nunojpg@gmail.com> wrote: > > > On Sat, Aug 18, 2018 at 1:41 PM Jagan Teki <jagan@amarulasolutions.com> > wrote: >> >> Here is the steps with UMS on BPI-M2+ which is H3 board (USB is similar to >> H2+) See the board I've mentioned, it's Sinovoip_BPI_M2_Plus_defconfig
On Sat, Aug 18, 2018 at 6:29 PM Jagan Teki <jagan@amarulasolutions.com> wrote: > See the board I've mentioned, it's Sinovoip_BPI_M2_Plus_defconfig > That is the reason I asked, since that defconfig does not have CONFIG_CMD_USB_MASS_STORAGE. Your test is done with something else.
On Sat, Aug 18, 2018 at 10:05 PM, Nuno Gonçalves <nunojpg@gmail.com> wrote: > On Sat, Aug 18, 2018 at 6:29 PM Jagan Teki <jagan@amarulasolutions.com> > wrote: >> >> See the board I've mentioned, it's Sinovoip_BPI_M2_Plus_defconfig > > > That is the reason I asked, since that defconfig does not have > CONFIG_CMD_USB_MASS_STORAGE. Your test is done with something else. We, sunxi treated this CONFIG as user defined, not giving room to add it on defconfig. I enabled via menuconfig.
With the basic defconfig + CMD_USB_MASS_STORAGE, I don't get the driver to load: Controller uninitialized g_dnl_register: failed!, error: -6 g_dnl_register failed I just would like to confirm you have nothing else added... Thanks! On Sat, Aug 18, 2018 at 7:42 PM Jagan Teki <jagan@amarulasolutions.com> wrote: > > On Sat, Aug 18, 2018 at 10:05 PM, Nuno Gonçalves <nunojpg@gmail.com> wrote: > > On Sat, Aug 18, 2018 at 6:29 PM Jagan Teki <jagan@amarulasolutions.com> > > wrote: > >> > >> See the board I've mentioned, it's Sinovoip_BPI_M2_Plus_defconfig > > > > > > That is the reason I asked, since that defconfig does not have > > CONFIG_CMD_USB_MASS_STORAGE. Your test is done with something else. > > We, sunxi treated this CONFIG as user defined, not giving room to add > it on defconfig. I enabled via menuconfig.
On Sat, Aug 18, 2018 at 11:35 PM, Nuno Gonçalves <nunojpg@gmail.com> wrote: > With the basic defconfig + CMD_USB_MASS_STORAGE, I don't get the driver to load: > > Controller uninitialized > g_dnl_register: failed!, error: -6 > g_dnl_register failed Are you using mainline? is your defconfig has MUSB? try to see existing H3 defconfigs for reference.
On Sat, Aug 18, 2018 at 8:08 PM Jagan Teki <jagan@amarulasolutions.com> wrote: > > On Sat, Aug 18, 2018 at 11:35 PM, Nuno Gonçalves <nunojpg@gmail.com> wrote: > > With the basic defconfig + CMD_USB_MASS_STORAGE, I don't get the driver to load: > > > > Controller uninitialized > > g_dnl_register: failed!, error: -6 > > g_dnl_register failed This error appears when CONFIG_USB_ETHER is not set. For some reason I can't enable UMS without USB_ETHER (probably because UMS is not DM aware). Regarding the bug reported, it happens because after your commit USB_EHCI_HCD and USB_KEYBOARD are required to be set. So, with USB_ETHER, USB_KEYBOARD and USB_EHCI_HCD, it works. Except for the last not sure if this is as expected. Thanks, Nuno
diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index 2b3cf48025..01f585a283 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -300,8 +300,7 @@ static int sun4i_usb_phy_init(struct phy *phy) data->cfg->disc_thresh, PHY_DISCON_TH_LEN); } - if (usb_phy->id != 0) - sun4i_usb_phy_passby(phy, true); + sun4i_usb_phy_passby(phy, true); sun4i_usb_phy0_reroute(data, true);