mbox series

[0/3] Add USB role switch support to DWC2

Message ID 20200616140717.28465-1-amelie.delaunay@st.com (mailing list archive)
Headers show
Series Add USB role switch support to DWC2 | expand

Message

Amelie Delaunay June 16, 2020, 2:07 p.m. UTC
When using usb-c connector (but it can also be the case with a micro-b
connector), iddig, avalid, bvalid, vbusvalid input signals may not be
connected to the DWC2 OTG controller.
DWC2 OTG controller features an overriding control of the PHY voltage valid
and ID input signals.
So, missing signals can be forced using usb role from usb role switch and
this override feature.

This series adds support for usb role switch to dwc2, by using overriding
control of the PHY voltage valid and ID input signals.

It has been tested on stm32mp157c-dk2 [1], which has a Type-C connector
managed by a Type-C port controller, and connected to USB OTG controller.

[1] https://www.st.com/en/evaluation-tools/stm32mp157c-dk2.html

Amelie Delaunay (3):
  usb: dwc2: override PHY input signals with usb role switch support
  usb: dwc2: don't use ID/Vbus detection if usb-role-switch on STM32MP15
    SoCs
  ARM: dts: stm32: enable usb-role-switch on USB OTG on stm32mp15xx-dkx

 arch/arm/boot/dts/stm32mp15xx-dkx.dtsi |   2 +-
 drivers/usb/dwc2/Kconfig               |   1 +
 drivers/usb/dwc2/Makefile              |   2 +-
 drivers/usb/dwc2/core.h                |   8 ++
 drivers/usb/dwc2/drd.c                 | 190 +++++++++++++++++++++++++
 drivers/usb/dwc2/gadget.c              |   2 +-
 drivers/usb/dwc2/params.c              |   4 +-
 drivers/usb/dwc2/platform.c            |  13 ++
 8 files changed, 218 insertions(+), 4 deletions(-)
 create mode 100644 drivers/usb/dwc2/drd.c

Comments

Minas Harutyunyan June 25, 2020, 11:34 a.m. UTC | #1
Hi,

On 6/16/2020 6:07 PM, Amelie Delaunay wrote:
> When using usb-c connector (but it can also be the case with a micro-b
> connector), iddig, avalid, bvalid, vbusvalid input signals may not be
> connected to the DWC2 OTG controller.
> DWC2 OTG controller features an overriding control of the PHY voltage valid
> and ID input signals.
> So, missing signals can be forced using usb role from usb role switch and
> this override feature.
> 
> This series adds support for usb role switch to dwc2, by using overriding
> control of the PHY voltage valid and ID input signals.
> 
> It has been tested on stm32mp157c-dk2 [1], which has a Type-C connector
> managed by a Type-C port controller, and connected to USB OTG controller.
> 
> [1] https://urldefense.com/v3/__https://www.st.com/en/evaluation-tools/stm32mp157c-dk2.html__;!!A4F2R9G_pg!KPU6pLcAMaVrFxzSp3peLkjZzWJzjsc__Kl878UYSLY2Cnv5NMmwACsY4kTCow0$
> 
> Amelie Delaunay (3):
>    usb: dwc2: override PHY input signals with usb role switch support
>    usb: dwc2: don't use ID/Vbus detection if usb-role-switch on STM32MP15
>      SoCs
>    ARM: dts: stm32: enable usb-role-switch on USB OTG on stm32mp15xx-dkx
> 
>   arch/arm/boot/dts/stm32mp15xx-dkx.dtsi |   2 +-
>   drivers/usb/dwc2/Kconfig               |   1 +
>   drivers/usb/dwc2/Makefile              |   2 +-
>   drivers/usb/dwc2/core.h                |   8 ++
>   drivers/usb/dwc2/drd.c                 | 190 +++++++++++++++++++++++++
>   drivers/usb/dwc2/gadget.c              |   2 +-
>   drivers/usb/dwc2/params.c              |   4 +-
>   drivers/usb/dwc2/platform.c            |  13 ++
>   8 files changed, 218 insertions(+), 4 deletions(-)
>   create mode 100644 drivers/usb/dwc2/drd.c
> 
For dwc2:

Acked-by Minas Harutyunyan <hminas@synopsys.com>

Thanks,
Minas
Alexandre TORGUE July 21, 2020, 8:54 a.m. UTC | #2
Hi Amélie

On 6/16/20 4:07 PM, Amelie Delaunay wrote:
> When using usb-c connector (but it can also be the case with a micro-b
> connector), iddig, avalid, bvalid, vbusvalid input signals may not be
> connected to the DWC2 OTG controller.
> DWC2 OTG controller features an overriding control of the PHY voltage valid
> and ID input signals.
> So, missing signals can be forced using usb role from usb role switch and
> this override feature.
> 
> This series adds support for usb role switch to dwc2, by using overriding
> control of the PHY voltage valid and ID input signals.
> 
> It has been tested on stm32mp157c-dk2 [1], which has a Type-C connector
> managed by a Type-C port controller, and connected to USB OTG controller.
> 
> [1] https://www.st.com/en/evaluation-tools/stm32mp157c-dk2.html
> 
> Amelie Delaunay (3):
>    usb: dwc2: override PHY input signals with usb role switch support
>    usb: dwc2: don't use ID/Vbus detection if usb-role-switch on STM32MP15
>      SoCs
>    ARM: dts: stm32: enable usb-role-switch on USB OTG on stm32mp15xx-dkx
> 
>   arch/arm/boot/dts/stm32mp15xx-dkx.dtsi |   2 +-
>   drivers/usb/dwc2/Kconfig               |   1 +
>   drivers/usb/dwc2/Makefile              |   2 +-
>   drivers/usb/dwc2/core.h                |   8 ++
>   drivers/usb/dwc2/drd.c                 | 190 +++++++++++++++++++++++++
>   drivers/usb/dwc2/gadget.c              |   2 +-
>   drivers/usb/dwc2/params.c              |   4 +-
>   drivers/usb/dwc2/platform.c            |  13 ++
>   8 files changed, 218 insertions(+), 4 deletions(-)
>   create mode 100644 drivers/usb/dwc2/drd.c
> 

DT patch applied on stm32-next.

Thanks
Alex
Amelie Delaunay July 24, 2020, 12:57 p.m. UTC | #3
Hi Felipe,

I saw that you took DT patch (ARM: dts: stm32: enable usb-role-switch on 
USB OTG on stm32mp15xx-dkx) in your next branch. As it was already in
Alex' stm32-next branch, a potential merge conflict could occurred.

Regards,
Amelie

On 7/21/20 10:54 AM, Alexandre Torgue wrote:
> Hi Amélie
> 
> On 6/16/20 4:07 PM, Amelie Delaunay wrote:
>> When using usb-c connector (but it can also be the case with a micro-b
>> connector), iddig, avalid, bvalid, vbusvalid input signals may not be
>> connected to the DWC2 OTG controller.
>> DWC2 OTG controller features an overriding control of the PHY voltage 
>> valid
>> and ID input signals.
>> So, missing signals can be forced using usb role from usb role switch and
>> this override feature.
>>
>> This series adds support for usb role switch to dwc2, by using overriding
>> control of the PHY voltage valid and ID input signals.
>>
>> It has been tested on stm32mp157c-dk2 [1], which has a Type-C connector
>> managed by a Type-C port controller, and connected to USB OTG controller.
>>
>> [1] https://www.st.com/en/evaluation-tools/stm32mp157c-dk2.html
>>
>> Amelie Delaunay (3):
>>    usb: dwc2: override PHY input signals with usb role switch support
>>    usb: dwc2: don't use ID/Vbus detection if usb-role-switch on STM32MP15
>>      SoCs
>>    ARM: dts: stm32: enable usb-role-switch on USB OTG on stm32mp15xx-dkx
>>
>>   arch/arm/boot/dts/stm32mp15xx-dkx.dtsi |   2 +-
>>   drivers/usb/dwc2/Kconfig               |   1 +
>>   drivers/usb/dwc2/Makefile              |   2 +-
>>   drivers/usb/dwc2/core.h                |   8 ++
>>   drivers/usb/dwc2/drd.c                 | 190 +++++++++++++++++++++++++
>>   drivers/usb/dwc2/gadget.c              |   2 +-
>>   drivers/usb/dwc2/params.c              |   4 +-
>>   drivers/usb/dwc2/platform.c            |  13 ++
>>   8 files changed, 218 insertions(+), 4 deletions(-)
>>   create mode 100644 drivers/usb/dwc2/drd.c
>>
> 
> DT patch applied on stm32-next.
> 
> Thanks
> Alex
Felipe Balbi July 24, 2020, 1:45 p.m. UTC | #4
(please, no top-posting ;-)

Hi,

Amelie DELAUNAY <amelie.delaunay@st.com> writes:

> Hi Felipe,
>
> I saw that you took DT patch (ARM: dts: stm32: enable usb-role-switch on 
> USB OTG on stm32mp15xx-dkx) in your next branch. As it was already in
> Alex' stm32-next branch, a potential merge conflict could occurred.

Thanks for letting me know, I have dropped it.