Re: USB difficulties with an iMX6ULL

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

 



On Sat, 2020-06-20 at 10:18 +0000, Peter Chen wrote:
>  
> > On Fri, 2020-06-19 at 02:05 +0000, Peter Chen wrote:
> > > > 1st problem - RNDIS
> > > > We try to use RNDIS on one of the USB ports the Colibri iMX6ULL
> > > > has.
> > > > For this
> > > > purpose I'm using the usb_f_rndis.ko kernel module and setting
> > > > dr_mode of
> > > > &usbotg1 to "peripheral"
> > > > This works fine on iMX7 but does not on iMX6ULL. On the ULL
> > > > board I
> > > > can see a "ci_hdrc.0" in /sys/class/udc after boot. If I add now
> > > > an
> > > > USB GPIO extcon to usbotg this changes to "ci_hdrc.1" and
> > > > everything
> > > > works fine after boot, but not after unplugging USB and
> > > > replugging.
> > > > To setup RNDIS I use the commands [1] I put at the end of this
> > > > email
> > > > for reference.
> > > > 
> > > 
> > > If the board designs for USB part are the same between iMX7
> > > version
> > > and iMX6ULL version, keep dts content are the same except for the
> > > USB
> > > PHY port (including the phandle for it), these two SoCs uses the
> > > different USB PHY.
> > 
> > Thanks for this hint! Then here may something be different or not
> > quite right yet (for
> > our usecase).
> > 
> > I saw that in phy-mxs-usb.c there is no "mode" in struct mxs_phy
> > like it is on
> > downstream code. I couldn't find how the code switches the PHY to
> > peripheral
> > mode.
> > 
> > Should it even be possible with this phy to use dr_mode =
> > "peripheral"?
> > 
> 
> No, this mode is set at udc.c, it may be not related to your failure
> use case.
> Try to debug at probe function, and see what's the difference.

Thanks for helping me debugging this! In the meantime I found the issue.
We have a different hardware design. On the iMX6ULL VBUS is not hooked
up. I'm using now extcon with a GPIO which works fine.

> 
> > > If the RNDIS could work at the first time, it seems your configfs
> > > script should be OK.
> > > 
> > > > 2nd problem - constant resetting
> > > > When I compile a plain mainline kernel with
> > > > "imx_v6_v7_defconfig"
> > > > and boot the
> > > > iMX6ULL with it I see that the USB is constantly resetting the
> > > > hub
> > > > that is present on the Colibri Evaluation carrier board.
> > > > 
> > > > [   49.654621] usb 1-1: reset high-speed USB device number 2
> > > > using
> > > > ci_hdrc
> > > > [   52.180781] usb 1-1: reset high-speed USB device number 2
> > > > using
> > > > ci_hdrc
> > > > [   54.699678] usb 1-1: reset high-speed USB device number 2
> > > > using
> > > > ci_hdrc
> > > > 
> > > 
> > > Try to add external power to the USB HUB avoid the board can't
> > > supply
> > > enough power.
> > > If not, try to disable runtime pm, and see if it works.
> > > 
> > >  59 static const struct ci_hdrc_imx_platform_flag imx6ul_usb_data
> > > = {
> > >  60         .flags = CI_HDRC_SUPPORTS_RUNTIME_PM |
> > >  61                 CI_HDRC_TURN_VBUS_EARLY_ON,
> > >  62 };
> > >  63
> > 
> > The power is no problem. The usb-hub is soldered to the carrier-
> > board, I measured
> > it and voltage is rock solid. We use an USB2514 chip.
> > 
> > Thanks for the hint, disabling CI_HDRC_SUPPORTS_RUNTIME_PM solves
> > the
> > issue.
> > 
> 
> Try to port this patch from downstream BSP.
> 
> commit 5840b174e85e66b502b4887026ce44c5665c29b1
> Author: Li Jun <jun.li@xxxxxxx>
> Date:   Mon Oct 16 23:13:19 2017 +0800
> 
>     MLK-16576 usb: phy: mxs: set hold_ring_off for USB2 PLL power up
>     
>     USB2 PLL use ring VCO, when the PLL power up, the ring VCO’s
> supply also
>     ramp up. There is a possibility that the ring VCO start
> oscillation at
>     multi nodes in this phase, especially for VCO which has many
> stages, then
>     the multiwave will kept until PLL power down. Hold_ring_off(bit11)
> can
>     force the VCO in one determined state when VCO supply start ramp
> up, to
>     avoid this multiwave issue. Per IC design's suggestion it's better
> this
>     bit can be off from 25us after pll power up to 25us before USB
> TX/RX.
>     
>     Acked-by: Peter Chen <peter.chen@xxxxxxx>
>     Signed-off-by: Li Jun <jun.li@xxxxxxx>$

I forward ported this patch to 5.8-rc2 unfortunately it did not help. I
guess I will just remove CI_HDRC_SUPPORTS_RUNTIME_PM for now.

Thanks again!

Best Regards,
Philippe
> 
> Peter




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

  Powered by Linux