mbox series

[U-Boot,v1,0/7] Improvements for the dwc3_generic driver

Message ID 1527240762-27114-1-git-send-email-jjhiblot@ti.com
Headers show
Series Improvements for the dwc3_generic driver | expand

Message

Jean-Jacques Hiblot May 25, 2018, 9:32 a.m. UTC
This series aims at bringing improvements to the dwc3_generic driver so
that it can be used by most of the platforms using the dwc3 controller.

I tested this on with DRA7 and AM57x platforms for both Peripheral and Host
operations. The code to enable DM USB host & dev support for those
platforms will be submitted in a separate series.

Enhancements:
- use separate Kconfig option for DM USB Periphal and DM USB Host. This
allow platforms to keep their non-DM USB peripheral code and use the DM
USB host.
- fixes the bind/probe confusion in dwc3_generic. The probe is done when
the USB device is first needed.
- handles PHYs when in the peripheral mode. The code to handle the PHYs is
shared with the host side
- handles clock and reset
- bind host controller to the more generic driver 'xhci-dwc3'



Jean-Jacques Hiblot (7):
  usb: gadget: Do not call board_usb_xxx() directly in USB gadget
    drivers
  usb: introduce a separate config option for DM USB device
  usb: udc: implement DM versions of
    usb_gadget_initialize()/_release()/_handle_interrupt()
  dwc3_generic: do not probe the USB device driver when it's bound
  dwc3: move phy operation to core.c
  dwc3-generic: Handle the PHYs, the clocks and the reset lines
  dwc3-generic: Add select_dr_mode operation

 cmd/fastboot.c                    |   4 +-
 cmd/rockusb.c                     |   4 +-
 cmd/thordown.c                    |   4 +-
 cmd/usb_gadget_sdp.c              |   4 +-
 cmd/usb_mass_storage.c            |   4 +-
 common/dfu.c                      |   6 +-
 drivers/usb/Kconfig               |   6 ++
 drivers/usb/dwc3/Kconfig          |   7 +-
 drivers/usb/dwc3/core.c           |  86 +++++++++++++++-
 drivers/usb/dwc3/dwc3-generic.c   | 206 +++++++++++++++++++++++++++++---------
 drivers/usb/dwc3/ep0.c            |   1 -
 drivers/usb/gadget/ether.c        |  38 +------
 drivers/usb/gadget/udc/udc-core.c |  44 +++++++-
 drivers/usb/host/xhci-dwc3.c      |  93 ++---------------
 include/dwc3-uboot.h              |   7 ++
 include/linux/usb/gadget.h        |  18 ++++
 16 files changed, 348 insertions(+), 184 deletions(-)

Comments

Michal Simek May 28, 2018, 8:32 a.m. UTC | #1
Hi Jean,

On 25.5.2018 11:32, Jean-Jacques Hiblot wrote:
> This series aims at bringing improvements to the dwc3_generic driver so
> that it can be used by most of the platforms using the dwc3 controller.
> 
> I tested this on with DRA7 and AM57x platforms for both Peripheral and Host
> operations. The code to enable DM USB host & dev support for those
> platforms will be submitted in a separate series.
> 
> Enhancements:
> - use separate Kconfig option for DM USB Periphal and DM USB Host. This
> allow platforms to keep their non-DM USB peripheral code and use the DM
> USB host.
> - fixes the bind/probe confusion in dwc3_generic. The probe is done when
> the USB device is first needed.
> - handles PHYs when in the peripheral mode. The code to handle the PHYs is
> shared with the host side
> - handles clock and reset
> - bind host controller to the more generic driver 'xhci-dwc3'

I see two series which were sent recently without any description of
dependencies.
Will be good to push these patches somewhere to git and send a link that
I can easily test.

Thanks,
Michal

> 
> 
> 
> Jean-Jacques Hiblot (7):
>   usb: gadget: Do not call board_usb_xxx() directly in USB gadget
>     drivers
>   usb: introduce a separate config option for DM USB device
>   usb: udc: implement DM versions of
>     usb_gadget_initialize()/_release()/_handle_interrupt()
>   dwc3_generic: do not probe the USB device driver when it's bound
>   dwc3: move phy operation to core.c
>   dwc3-generic: Handle the PHYs, the clocks and the reset lines
>   dwc3-generic: Add select_dr_mode operation
> 
>  cmd/fastboot.c                    |   4 +-
>  cmd/rockusb.c                     |   4 +-
>  cmd/thordown.c                    |   4 +-
>  cmd/usb_gadget_sdp.c              |   4 +-
>  cmd/usb_mass_storage.c            |   4 +-
>  common/dfu.c                      |   6 +-
>  drivers/usb/Kconfig               |   6 ++
>  drivers/usb/dwc3/Kconfig          |   7 +-
>  drivers/usb/dwc3/core.c           |  86 +++++++++++++++-
>  drivers/usb/dwc3/dwc3-generic.c   | 206 +++++++++++++++++++++++++++++---------
>  drivers/usb/dwc3/ep0.c            |   1 -
>  drivers/usb/gadget/ether.c        |  38 +------
>  drivers/usb/gadget/udc/udc-core.c |  44 +++++++-
>  drivers/usb/host/xhci-dwc3.c      |  93 ++---------------
>  include/dwc3-uboot.h              |   7 ++
>  include/linux/usb/gadget.h        |  18 ++++
>  16 files changed, 348 insertions(+), 184 deletions(-)
>
Jean-Jacques Hiblot May 28, 2018, 9:47 a.m. UTC | #2
Hi Michal


On 28/05/2018 10:32, Michal Simek wrote:
> Hi Jean,
>
> On 25.5.2018 11:32, Jean-Jacques Hiblot wrote:
>> This series aims at bringing improvements to the dwc3_generic driver so
>> that it can be used by most of the platforms using the dwc3 controller.
>>
>> I tested this on with DRA7 and AM57x platforms for both Peripheral and Host
>> operations. The code to enable DM USB host & dev support for those
>> platforms will be submitted in a separate series.
>>
>> Enhancements:
>> - use separate Kconfig option for DM USB Periphal and DM USB Host. This
>> allow platforms to keep their non-DM USB peripheral code and use the DM
>> USB host.
>> - fixes the bind/probe confusion in dwc3_generic. The probe is done when
>> the USB device is first needed.
>> - handles PHYs when in the peripheral mode. The code to handle the PHYs is
>> shared with the host side
>> - handles clock and reset
>> - bind host controller to the more generic driver 'xhci-dwc3'
> I see two series which were sent recently without any description of
> dependencies.
Right I forgot. This series applies on to of the master branch of the 
USB tree
> Will be good to push these patches somewhere to git and send a link that
> I can easily test.
I pushed all on github : https://github.com/jjhiblot/u-boot

JJ

>
> Thanks,
> Michal
>
>>
>>
>> Jean-Jacques Hiblot (7):
>>    usb: gadget: Do not call board_usb_xxx() directly in USB gadget
>>      drivers
>>    usb: introduce a separate config option for DM USB device
>>    usb: udc: implement DM versions of
>>      usb_gadget_initialize()/_release()/_handle_interrupt()
>>    dwc3_generic: do not probe the USB device driver when it's bound
>>    dwc3: move phy operation to core.c
>>    dwc3-generic: Handle the PHYs, the clocks and the reset lines
>>    dwc3-generic: Add select_dr_mode operation
>>
>>   cmd/fastboot.c                    |   4 +-
>>   cmd/rockusb.c                     |   4 +-
>>   cmd/thordown.c                    |   4 +-
>>   cmd/usb_gadget_sdp.c              |   4 +-
>>   cmd/usb_mass_storage.c            |   4 +-
>>   common/dfu.c                      |   6 +-
>>   drivers/usb/Kconfig               |   6 ++
>>   drivers/usb/dwc3/Kconfig          |   7 +-
>>   drivers/usb/dwc3/core.c           |  86 +++++++++++++++-
>>   drivers/usb/dwc3/dwc3-generic.c   | 206 +++++++++++++++++++++++++++++---------
>>   drivers/usb/dwc3/ep0.c            |   1 -
>>   drivers/usb/gadget/ether.c        |  38 +------
>>   drivers/usb/gadget/udc/udc-core.c |  44 +++++++-
>>   drivers/usb/host/xhci-dwc3.c      |  93 ++---------------
>>   include/dwc3-uboot.h              |   7 ++
>>   include/linux/usb/gadget.h        |  18 ++++
>>   16 files changed, 348 insertions(+), 184 deletions(-)
>>
>
Michal Simek May 28, 2018, 10:25 a.m. UTC | #3
Hi,

On 28.5.2018 11:47, Jean-Jacques Hiblot wrote:
> Hi Michal
> 
> 
> On 28/05/2018 10:32, Michal Simek wrote:
>> Hi Jean,
>>
>> On 25.5.2018 11:32, Jean-Jacques Hiblot wrote:
>>> This series aims at bringing improvements to the dwc3_generic driver so
>>> that it can be used by most of the platforms using the dwc3 controller.
>>>
>>> I tested this on with DRA7 and AM57x platforms for both Peripheral
>>> and Host
>>> operations. The code to enable DM USB host & dev support for those
>>> platforms will be submitted in a separate series.
>>>
>>> Enhancements:
>>> - use separate Kconfig option for DM USB Periphal and DM USB Host. This
>>> allow platforms to keep their non-DM USB peripheral code and use the DM
>>> USB host.
>>> - fixes the bind/probe confusion in dwc3_generic. The probe is done when
>>> the USB device is first needed.
>>> - handles PHYs when in the peripheral mode. The code to handle the
>>> PHYs is
>>> shared with the host side
>>> - handles clock and reset
>>> - bind host controller to the more generic driver 'xhci-dwc3'
>> I see two series which were sent recently without any description of
>> dependencies.
> Right I forgot. This series applies on to of the master branch of the
> USB tree
>> Will be good to push these patches somewhere to git and send a link that
>> I can easily test.
> I pushed all on github : https://github.com/jjhiblot/u-boot

I didn't build all patches to identify which one is introducing the
issue. But look below at issues and please fix them. Then I will test.

Thanks,
Michal

[u-boot](dwc3)$ nice -n 19 ./tools/buildman/buildman -b dwc3  zynqmp  -o
../tmp/ -C -I  -c 1 -sSed
boards.cfg is up to date. Nothing to do.
Summary of 1 commit for 20 boards (8 threads, 1 job per thread)
01: board: ti: am57xx: remove USB platform code
   aarch64:  +   xilinx_zynqmp_zc1751_xm016_dc2
xilinx_zynqmp_zcu102_revA xilinx_zynqmp_zcu100_revC
xilinx_zynqmp_zcu104_revA xilinx_zynqmp_zc1751_xm017_dc3
xilinx_zynqmp_zcu102_revB xilinx_zynqmp_zcu106_revA
xilinx_zynqmp_zc1751_xm015_dc1 xilinx_zynqmp_zcu111_revA
xilinx_zynqmp_zcu102_rev1_0 xilinx_zynqmp_zcu104_revC
+common/built-in.o: In function `run_usb_dnl_gadget':
+build/../common/dfu.c:73: undefined reference to
`usb_gadget_handle_interrupts'
+build/../common/dfu.c:83: undefined reference to
`usb_gadget_handle_interrupts'
+make[1]: *** [u-boot] Error 139
+make: *** [sub-make] Error 2
+  usb_gadget_realease(controller_index);
+  ^~~~~~~~~~~~~~~~~~~
+cmd/built-in.o: In function `do_fastboot':
+build/../cmd/fastboot.c:50: undefined reference to
`usb_gadget_handle_interrupts'
+cmd/built-in.o: In function `do_thor_down':
+build/../cmd/thordown.c:58: undefined reference to `usb_gadget_realease'
+drivers/usb/gadget/built-in.o: In function `thor_rx_data':
+build/../drivers/usb/gadget/f_thor.c:555: undefined reference to
`usb_gadget_handle_interrupts'
+drivers/usb/gadget/built-in.o: In function `thor_tx_data':
+build/../drivers/usb/gadget/f_thor.c:589: undefined reference to
`usb_gadget_handle_interrupts'
+drivers/usb/gadget/built-in.o: In function `thor_init':
+build/../drivers/usb/gadget/f_thor.c:706: undefined reference to
`usb_gadget_handle_interrupts'
w+../cmd/thordown.c: In function ?do_thor_down?:
w+../cmd/thordown.c:58:2: warning: implicit declaration of function
?usb_gadget_realease? [-Wimplicit-function-declaration]
Jean-Jacques Hiblot May 29, 2018, 11:03 a.m. UTC | #4
On 28/05/2018 12:25, Michal Simek wrote:
> Hi,
>
> On 28.5.2018 11:47, Jean-Jacques Hiblot wrote:
>> Hi Michal
>>
>>
>> On 28/05/2018 10:32, Michal Simek wrote:
>>> Hi Jean,
>>>
>>> On 25.5.2018 11:32, Jean-Jacques Hiblot wrote:
>>>> This series aims at bringing improvements to the dwc3_generic driver so
>>>> that it can be used by most of the platforms using the dwc3 controller.
>>>>
>>>> I tested this on with DRA7 and AM57x platforms for both Peripheral
>>>> and Host
>>>> operations. The code to enable DM USB host & dev support for those
>>>> platforms will be submitted in a separate series.
>>>>
>>>> Enhancements:
>>>> - use separate Kconfig option for DM USB Periphal and DM USB Host. This
>>>> allow platforms to keep their non-DM USB peripheral code and use the DM
>>>> USB host.
>>>> - fixes the bind/probe confusion in dwc3_generic. The probe is done when
>>>> the USB device is first needed.
>>>> - handles PHYs when in the peripheral mode. The code to handle the
>>>> PHYs is
>>>> shared with the host side
>>>> - handles clock and reset
>>>> - bind host controller to the more generic driver 'xhci-dwc3'
>>> I see two series which were sent recently without any description of
>>> dependencies.
>> Right I forgot. This series applies on to of the master branch of the
>> USB tree
>>> Will be good to push these patches somewhere to git and send a link that
>>> I can easily test.
>> I pushed all on github : https://github.com/jjhiblot/u-boot
> I didn't build all patches to identify which one is introducing the
> issue. But look below at issues and please fix them. Then I will test.
The CONFIG_DM_USB_DEV is missing from configuration.
This will be fixed in v2


>
> Thanks,
> Michal
>
> [u-boot](dwc3)$ nice -n 19 ./tools/buildman/buildman -b dwc3  zynqmp  -o
> ../tmp/ -C -I  -c 1 -sSed
> boards.cfg is up to date. Nothing to do.
> Summary of 1 commit for 20 boards (8 threads, 1 job per thread)
> 01: board: ti: am57xx: remove USB platform code
>     aarch64:  +   xilinx_zynqmp_zc1751_xm016_dc2
> xilinx_zynqmp_zcu102_revA xilinx_zynqmp_zcu100_revC
> xilinx_zynqmp_zcu104_revA xilinx_zynqmp_zc1751_xm017_dc3
> xilinx_zynqmp_zcu102_revB xilinx_zynqmp_zcu106_revA
> xilinx_zynqmp_zc1751_xm015_dc1 xilinx_zynqmp_zcu111_revA
> xilinx_zynqmp_zcu102_rev1_0 xilinx_zynqmp_zcu104_revC
> +common/built-in.o: In function `run_usb_dnl_gadget':
> +build/../common/dfu.c:73: undefined reference to
> `usb_gadget_handle_interrupts'
> +build/../common/dfu.c:83: undefined reference to
> `usb_gadget_handle_interrupts'
> +make[1]: *** [u-boot] Error 139
> +make: *** [sub-make] Error 2
> +  usb_gadget_realease(controller_index);
> +  ^~~~~~~~~~~~~~~~~~~
> +cmd/built-in.o: In function `do_fastboot':
> +build/../cmd/fastboot.c:50: undefined reference to
> `usb_gadget_handle_interrupts'
> +cmd/built-in.o: In function `do_thor_down':
> +build/../cmd/thordown.c:58: undefined reference to `usb_gadget_realease'
> +drivers/usb/gadget/built-in.o: In function `thor_rx_data':
> +build/../drivers/usb/gadget/f_thor.c:555: undefined reference to
> `usb_gadget_handle_interrupts'
> +drivers/usb/gadget/built-in.o: In function `thor_tx_data':
> +build/../drivers/usb/gadget/f_thor.c:589: undefined reference to
> `usb_gadget_handle_interrupts'
> +drivers/usb/gadget/built-in.o: In function `thor_init':
> +build/../drivers/usb/gadget/f_thor.c:706: undefined reference to
> `usb_gadget_handle_interrupts'
> w+../cmd/thordown.c: In function ?do_thor_down?:
> w+../cmd/thordown.c:58:2: warning: implicit declaration of function
> ?usb_gadget_realease? [-Wimplicit-function-declaration]
>
>
Michal Simek May 29, 2018, 11:08 a.m. UTC | #5
On 29.5.2018 13:03, Jean-Jacques Hiblot wrote:
> 
> 
> On 28/05/2018 12:25, Michal Simek wrote:
>> Hi,
>>
>> On 28.5.2018 11:47, Jean-Jacques Hiblot wrote:
>>> Hi Michal
>>>
>>>
>>> On 28/05/2018 10:32, Michal Simek wrote:
>>>> Hi Jean,
>>>>
>>>> On 25.5.2018 11:32, Jean-Jacques Hiblot wrote:
>>>>> This series aims at bringing improvements to the dwc3_generic
>>>>> driver so
>>>>> that it can be used by most of the platforms using the dwc3
>>>>> controller.
>>>>>
>>>>> I tested this on with DRA7 and AM57x platforms for both Peripheral
>>>>> and Host
>>>>> operations. The code to enable DM USB host & dev support for those
>>>>> platforms will be submitted in a separate series.
>>>>>
>>>>> Enhancements:
>>>>> - use separate Kconfig option for DM USB Periphal and DM USB Host.
>>>>> This
>>>>> allow platforms to keep their non-DM USB peripheral code and use
>>>>> the DM
>>>>> USB host.
>>>>> - fixes the bind/probe confusion in dwc3_generic. The probe is done
>>>>> when
>>>>> the USB device is first needed.
>>>>> - handles PHYs when in the peripheral mode. The code to handle the
>>>>> PHYs is
>>>>> shared with the host side
>>>>> - handles clock and reset
>>>>> - bind host controller to the more generic driver 'xhci-dwc3'
>>>> I see two series which were sent recently without any description of
>>>> dependencies.
>>> Right I forgot. This series applies on to of the master branch of the
>>> USB tree
>>>> Will be good to push these patches somewhere to git and send a link
>>>> that
>>>> I can easily test.
>>> I pushed all on github : https://github.com/jjhiblot/u-boot
>> I didn't build all patches to identify which one is introducing the
>> issue. But look below at issues and please fix them. Then I will test.
> The CONFIG_DM_USB_DEV is missing from configuration.
> This will be fixed in v2

ok. Please send it with another link to git repo.

Thanks,
Michal