All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] DM for ci_udc
@ 2019-05-06 10:12 Sven Schwermer
  2019-05-06 10:28 ` Marek Vasut
  2019-05-20 12:13 ` Schrempf Frieder
  0 siblings, 2 replies; 6+ messages in thread
From: Sven Schwermer @ 2019-05-06 10:12 UTC (permalink / raw)
  To: u-boot

Hi,

I’m running into linking issues when enabling CONFIG_DM_USB_GADGET with CONFIG_CI_UDC because dm_usb_gadget_handle_interrupts is not available. That made me look into what’s required to port ci_udc to driver model. I have a few conceptual questions about this:

1. Some other USB gadget drivers (dwc3-generic, ti-musb) seem to create a wrapper driver that binds either the gadget or the host-mode driver to the USB device, depending on the configured mode. Is this the desired approach?

2. I’m working with a i.MX6 (7) device so the host-mode driver is ehci-mx6, but I’ve seen that ci_udc is also used with other host-mode drivers. How would a wrapper work in this case where there are multiple possible host-mode drivers but one gadget driver?

3. Any tips and hints are welcome :)

Best regards,
Sven

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] DM for ci_udc
  2019-05-06 10:12 [U-Boot] DM for ci_udc Sven Schwermer
@ 2019-05-06 10:28 ` Marek Vasut
  2019-05-06 12:17   ` Lukasz Majewski
  2019-05-20 12:13 ` Schrempf Frieder
  1 sibling, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2019-05-06 10:28 UTC (permalink / raw)
  To: u-boot

On 5/6/19 12:12 PM, Sven Schwermer wrote:
> Hi,
> 
> I’m running into linking issues when enabling CONFIG_DM_USB_GADGET with CONFIG_CI_UDC because dm_usb_gadget_handle_interrupts is not available. That made me look into what’s required to port ci_udc to driver model. I have a few conceptual questions about this:
> 
> 1. Some other USB gadget drivers (dwc3-generic, ti-musb) seem to create a wrapper driver that binds either the gadget or the host-mode driver to the USB device, depending on the configured mode. Is this the desired approach?
> 
> 2. I’m working with a i.MX6 (7) device so the host-mode driver is ehci-mx6, but I’ve seen that ci_udc is also used with other host-mode drivers. How would a wrapper work in this case where there are multiple possible host-mode drivers but one gadget driver?
> 
> 3. Any tips and hints are welcome :)

+CC Lukasz, UDC is his stuff.

-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] DM for ci_udc
  2019-05-06 10:28 ` Marek Vasut
@ 2019-05-06 12:17   ` Lukasz Majewski
  2019-05-07  7:21     ` Jean-Jacques Hiblot
  0 siblings, 1 reply; 6+ messages in thread
From: Lukasz Majewski @ 2019-05-06 12:17 UTC (permalink / raw)
  To: u-boot

Hi Sven, Marek, Jean-Jacques,

> On 5/6/19 12:12 PM, Sven Schwermer wrote:
> > Hi,
> > 
> > I’m running into linking issues when enabling CONFIG_DM_USB_GADGET
> > with CONFIG_CI_UDC because dm_usb_gadget_handle_interrupts is not
> > available. That made me look into what’s required to port ci_udc to
> > driver model. I have a few conceptual questions about this:
> > 
> > 1. Some other USB gadget drivers (dwc3-generic, ti-musb) seem to
> > create a wrapper driver that binds either the gadget or the
> > host-mode driver to the USB device, depending on the configured
> > mode. Is this the desired approach?

I think that we shall follow the already in-tree pattern.
Jean-Jacques Hiblot (CC'ed) did a great job on porting / developing
this code (moreover there is a u-boot command - bind/unbind which allows
binding usb devices)

> > 
> > 2. I’m working with a i.MX6 (7) device so the host-mode driver is
> > ehci-mx6, but I’ve seen that ci_udc is also used with other
> > host-mode drivers. How would a wrapper work in this case where
> > there are multiple possible host-mode drivers but one gadget driver?
> > 

As fair as I understood the "bind/unbind" command would allow you to do
it [1]. Jean-Jacques am I right here ?

> > 3. Any tips and hints are welcome :)  

I can offer myself as a tester for imx6q (as I do have a few of them
queued for the DM/DTS conversion).

> 
> +CC Lukasz, UDC is his stuff.
> 

Note:
[1] - https://lists.denx.de/pipermail/u-boot/2018-June/333105.html


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190506/5717df60/attachment.sig>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] DM for ci_udc
  2019-05-06 12:17   ` Lukasz Majewski
@ 2019-05-07  7:21     ` Jean-Jacques Hiblot
  0 siblings, 0 replies; 6+ messages in thread
From: Jean-Jacques Hiblot @ 2019-05-07  7:21 UTC (permalink / raw)
  To: u-boot

Hi,

On 06/05/2019 14:17, Lukasz Majewski wrote:
> Hi Sven, Marek, Jean-Jacques,
>
>> On 5/6/19 12:12 PM, Sven Schwermer wrote:
>>> Hi,
>>>
>>> I’m running into linking issues when enabling CONFIG_DM_USB_GADGET
>>> with CONFIG_CI_UDC because dm_usb_gadget_handle_interrupts is not
>>> available. That made me look into what’s required to port ci_udc to
>>> driver model. I have a few conceptual questions about this:
>>>
>>> 1. Some other USB gadget drivers (dwc3-generic, ti-musb) seem to
>>> create a wrapper driver that binds either the gadget or the
>>> host-mode driver to the USB device, depending on the configured
>>> mode. Is this the desired approach?

This approach has the advantage to support both modes and select one at 
runtime usually based on DT configuration.

It could also go further and support a true OTG, but most application do 
not require it and it would probably be more complex.

> I think that we shall follow the already in-tree pattern.
> Jean-Jacques Hiblot (CC'ed) did a great job on porting / developing
> this code (moreover there is a u-boot command - bind/unbind which allows
> binding usb devices)
In this UDCcase the bind/unbind commands are used only to bind the UDC 
ethernet (usbether). Other operations, like DFU, bind the UDC by themselves.
>>> 2. I’m working with a i.MX6 (7) device so the host-mode driver is
>>> ehci-mx6, but I’ve seen that ci_udc is also used with other
>>> host-mode drivers. How would a wrapper work in this case where
>>> there are multiple possible host-mode drivers but one gadget driver?

The wrapper, the UDC driver and the host driver are separate driver. You 
have the ci_udc driver completely separate from the wrapper.

The wrapper itself must somehow be aware of the host and of the udc 
driver. it could be hard-coded (DWC3 case) or it could get this info 
from the compatible in the DT

> As fair as I understood the "bind/unbind" command would allow you to do
> it [1]. Jean-Jacques am I right here ?
Bind/unbind commands could be used if no wrapper is provided, because 
the role of the wrapper is primarily to bind one driver or the other. 
But the wrapper usually also performs some kind of HW initialization, so 
I would keep a wrapper driver.


JJ

>
>>> 3. Any tips and hints are welcome :)
> I can offer myself as a tester for imx6q (as I do have a few of them
> queued for the DM/DTS conversion).
>
>> +CC Lukasz, UDC is his stuff.
>>
> Note:
> [1] - https://lists.denx.de/pipermail/u-boot/2018-June/333105.html
>
>
> Best regards,
>
> Lukasz Majewski
>
> --
>
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] DM for ci_udc
  2019-05-06 10:12 [U-Boot] DM for ci_udc Sven Schwermer
  2019-05-06 10:28 ` Marek Vasut
@ 2019-05-20 12:13 ` Schrempf Frieder
  2019-05-20 13:36   ` Adam Ford
  1 sibling, 1 reply; 6+ messages in thread
From: Schrempf Frieder @ 2019-05-20 12:13 UTC (permalink / raw)
  To: u-boot

Hi Sven,

On 06.05.19 12:12, Sven Schwermer wrote:
> Hi,
> 
> I’m running into linking issues when enabling CONFIG_DM_USB_GADGET with CONFIG_CI_UDC because dm_usb_gadget_handle_interrupts is not available. That made me look into what’s required to port ci_udc to driver model. I have a few conceptual questions about this:
> 
> 1. Some other USB gadget drivers (dwc3-generic, ti-musb) seem to create a wrapper driver that binds either the gadget or the host-mode driver to the USB device, depending on the configured mode. Is this the desired approach?
> 
> 2. I’m working with a i.MX6 (7) device so the host-mode driver is ehci-mx6, but I’ve seen that ci_udc is also used with other host-mode drivers. How would a wrapper work in this case where there are multiple possible host-mode drivers but one gadget driver?
> 
> 3. Any tips and hints are welcome :)

Did you make any progress with getting ci_udc to work with DM in SPL on 
i.MX?
The reason I'm asking is, that I need the SDP feature and I also want to 
use DM for USB.

Thanks,
Frieder

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] DM for ci_udc
  2019-05-20 12:13 ` Schrempf Frieder
@ 2019-05-20 13:36   ` Adam Ford
  0 siblings, 0 replies; 6+ messages in thread
From: Adam Ford @ 2019-05-20 13:36 UTC (permalink / raw)
  To: u-boot

On Mon, May 20, 2019 at 7:13 AM Schrempf Frieder
<frieder.schrempf@kontron.de> wrote:
>
> Hi Sven,
>
> On 06.05.19 12:12, Sven Schwermer wrote:
> > Hi,
> >
> > I’m running into linking issues when enabling CONFIG_DM_USB_GADGET with CONFIG_CI_UDC because dm_usb_gadget_handle_interrupts is not available. That made me look into what’s required to port ci_udc to driver model. I have a few conceptual questions about this:
> >
> > 1. Some other USB gadget drivers (dwc3-generic, ti-musb) seem to create a wrapper driver that binds either the gadget or the host-mode driver to the USB device, depending on the configured mode. Is this the desired approach?
> >
> > 2. I’m working with a i.MX6 (7) device so the host-mode driver is ehci-mx6, but I’ve seen that ci_udc is also used with other host-mode drivers. How would a wrapper work in this case where there are multiple possible host-mode drivers but one gadget driver?
> >
> > 3. Any tips and hints are welcome :)

I started a wrapper a while ago.  I posted an RFC to the mailing list,
but i never heard anything.  As of right now, my wrapper only supports
the host side, but it could easily be adapter to add the gadget.

https://patchwork.ozlabs.org/patch/1076080/

adam
>
> Did you make any progress with getting ci_udc to work with DM in SPL on
> i.MX?
> The reason I'm asking is, that I need the SDP feature and I also want to
> use DM for USB.
>
> Thanks,
> Frieder
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-20 13:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-06 10:12 [U-Boot] DM for ci_udc Sven Schwermer
2019-05-06 10:28 ` Marek Vasut
2019-05-06 12:17   ` Lukasz Majewski
2019-05-07  7:21     ` Jean-Jacques Hiblot
2019-05-20 12:13 ` Schrempf Frieder
2019-05-20 13:36   ` Adam Ford

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.