From: Michal Simek <michal.simek@amd.com>
To: Angus Ainslie <angus@akkea.ca>, <ye.li@nxp.com>
Cc: Marek Vasut <marex@denx.de>, U Boot <u-boot@lists.denx.de>,
Michal Simek <michal.simek@xilinx.com>, <kernel@puri.sm>
Subject: Re: DWC3 host support
Date: Tue, 19 Jul 2022 08:47:03 +0200 [thread overview]
Message-ID: <fc01ed9c-cb0a-3305-74af-dca6257c1db3@amd.com> (raw)
In-Reply-To: <33999919934dd27e026ff6b765227dbb@akkea.ca>
Hi,
On 7/18/22 18:23, Angus Ainslie wrote:
> Hi,
>
> On 2022-07-18 01:13, Michal Simek wrote:
>> On 7/17/22 17:23, Marek Vasut wrote:
>>> On 7/17/22 05:00, Angus Ainslie wrote:
>>>> On 2022-07-16 11:37, Marek Vasut wrote:
>>>>> On 7/16/22 15:02, Angus Ainslie wrote:
>>>>>> Hi Michal,
>>>>>>
>>>>>> I recently rebased my librem5 tree onto the latest u-boot-imx branch
>>>>>> and the dwc3 host mode stopped working.
>>>>>>
>>>>>> I bisected it down to this commit:
>>>>>>
>>>>>> 142d50fbce7c364a74f5e8204dba491b9f066e6c usb: dwc3: Add support for
>>>>>> usb3-phy PHY configuration
>>>>>>
>>>>>> Reverting that commit allows usb host mode to work on the librem5 again.
>>>>>>
>>>>>> Should this initialization go into an SOC specific glue_configure
>>>>>> function ?
>>>>>>
>>>>>> Is the imx8mq.dtsi missing something that will keep usb host working
>>>>>> with this patch ?
>>>>>>
>>>>>> Does this break usb host on other imx8mq devices ?
>>>>>
>>>>> Wasn't this fixed by:
>>>>> 868d58f69c ("usb: dwc3: Fix non-usb3 configurations")
>>>>> ?
>>>>
>>>> I've got that in my tree and it still fails to probe the USB2 hub and
>>>> USB 2 storage.
>>>
>>> I assume you do have CONFIG_PHY_IMX8MQ_USB enabled ?
>>>
>>> What does generic_phy_get_by_name() return for you in
>>> drivers/usb/dwc3/dwc3-generic.c ?
>>
>> As Marek said there was one patch which fixes origin patch which
>> didn't handle all the error cases properly. We need to know return
>> value from generic_phy_get_by_name(), also if you still have usb3-phy
>> in DT (as is in imx8mq.dtsi) with phy DT status enabled and enabled
>> phy driver (CONFIG_PHY_IMX8MQ_USB).
>>
>
> Removing the usb3 phy definition also "fixes" it
>
> --- a/arch/arm/dts/imx8mq-librem5-r4.dts
> +++ b/arch/arm/dts/imx8mq-librem5-r4.dts
> @@ -33,3 +33,8 @@
> &proximity {
> proximity-near-level = <10>;
> };
> +
> +&usb_dwc3_1 {
> + phys = <&usb3_phy1>;
> + phy-names = "usb2-phy";
> +};
Log shows that phy initialization is called properly but it looks like that
initialization itself has issue which should be the issue with phy driver.
DWC3 driver is calling just phy_init and phy_power_on which are quite small 2
functions in phy-imx8mq-usb.c.
Did usb3 work before 142d50fbce7c364a74f5e8204dba491b9f066e6c?
I have no idea how imx is working but I have added to CC author of this phy driver.
I see small differences between Linux and U-Boot drivers.
99 value &= ~PHY_CTRL0_SSC_RANGE_MASK;
100 value |= PHY_CTRL0_SSC_RANGE_4003PPM;
And in power_on I see this in u-boot
129 /* Disable rx term override */
130 value = readl(imx_phy->base + PHY_CTRL6);
131 value &= ~PHY_CTRL6_RXTERM_OVERRIDE_SEL;
132 writel(value, imx_phy->base + PHY_CTRL6);
And Linux driver is handling regulators. Do you use any regulator?
If usb3.0 works in Linux I think it should be easier for you to track this down
but there are some small differences in the U-Boot driver which can be the
reason why it is failing on your board.
Thanks,
Michal
next prev parent reply other threads:[~2022-07-19 6:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-16 13:02 DWC3 host support Angus Ainslie
2022-07-16 13:26 ` Angus Ainslie
2022-07-16 18:37 ` Marek Vasut
2022-07-17 3:00 ` Angus Ainslie
2022-07-17 15:23 ` Marek Vasut
2022-07-18 8:13 ` Michal Simek
2022-07-18 14:50 ` Angus Ainslie
2022-07-18 16:23 ` Angus Ainslie
2022-07-19 6:47 ` Michal Simek [this message]
2022-07-19 13:22 ` Angus Ainslie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fc01ed9c-cb0a-3305-74af-dca6257c1db3@amd.com \
--to=michal.simek@amd.com \
--cc=angus@akkea.ca \
--cc=kernel@puri.sm \
--cc=marex@denx.de \
--cc=michal.simek@xilinx.com \
--cc=u-boot@lists.denx.de \
--cc=ye.li@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox