[U-Boot] [PATCH V2] usb: ehci-mx6: Fix bus enumeration for DM case

Marek Vasut marex at denx.de
Wed Oct 9 06:29:58 UTC 2019


On 10/8/19 7:25 PM, Igor Opaniuk wrote:
> Hi Marek,

Hi,

[...]

>>  drivers/usb/host/ehci-mx6.c | 37 +++++++++++++++++++++++++++++++++++++
>>  1 file changed, 37 insertions(+)
>>
>> diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
>> index 33abfeada0..e9e6ed596d 100644
>> --- a/drivers/usb/host/ehci-mx6.c
>> +++ b/drivers/usb/host/ehci-mx6.c
>> @@ -503,6 +503,42 @@ static int ehci_usb_ofdata_to_platdata(struct udevice *dev)
>>         return 0;
>>  }
>>
>> +static int ehci_usb_bind(struct udevice *dev)
>> +{
>> +       /*
>> +        * TODO:
>> +        * This driver is only partly converted to DT probing and still uses
>> +        * a tremendous amount of hard-coded addresses. To make things worse,
>> +        * the driver depends on specific sequential indexing of controllers,
>> +        * from which it derives offsets in the PHY and ANATOP register sets.
>> +        *
>> +        * Here we attempt to calculate these indexes from DT information as
>> +        * well as we can. The USB controllers on all existing iMX6/iMX7 SoCs
>> +        * are placed next to each other, at addresses incremented by 0x200.
>> +        * Thus, the index is derived from the multiple of 0x200 offset from
>> +        * the first controller address.
> I'm afraid I'm a bit late, as the patch is already applied but
> this statement is not true for iMX7S/iMX7D SoCs.
> 
> If you look into arch/arm/dts/imx7s.dtsi and
> arch/arm/dts/imx7d.dtsi, you'll find that
> addresses are not incremented by 0x200:
> 
> usbotg1: usb at 30b10000 {
>     compatible = "fsl,imx7d-usb", "fsl,imx27-usb";
>     reg = <0x30b10000 0x200>;
>               ^^^^^^^^^^^^
> ....
> usbotg2: usb at 30b20000 {
>     compatible = "fsl,imx7d-usb", "fsl,imx27-usb";
>     reg = <0x30b20000 0x200>;
>               ^^^^^^^^^^^
> ....
> 
> usbh: usb at 30b30000 {
>     compatible = "fsl,imx7d-usb", "fsl,imx27-usb";
>     reg = <0x30b30000 0x200>;
>                  ^^^^^^^^^^^
> ....
> 
> Which causes probing issues:

I don't have an iMX7 board, but I can still test on the iMX6 ones. Can
you prepare a patch ?

[...]


More information about the U-Boot mailing list