All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] usb: dwc3: Handle case where setup_phy is not needed
@ 2019-04-01  6:10 Siva Durga Prasad Paladugu
  2019-04-01  7:32 ` Lukasz Majewski
  0 siblings, 1 reply; 8+ messages in thread
From: Siva Durga Prasad Paladugu @ 2019-04-01  6:10 UTC (permalink / raw)
  To: u-boot

If CONFIG_PHY is not enabled then the dwc3_setup_phy()
returns ENOTSUPP which can be still valid and intentional
so modify error check to handle this -ENOTSUPP.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
---
 drivers/usb/dwc3/dwc3-generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 3e6c494..a261d8d 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -47,7 +47,7 @@ static int dwc3_generic_peripheral_probe(struct udevice *dev)
 	struct dwc3 *dwc3 = &priv->dwc3;
 
 	rc = dwc3_setup_phy(dev, &priv->phys, &priv->num_phys);
-	if (rc)
+	if (rc && rc != -ENOTSUPP)
 		return rc;
 
 	dwc3->regs = map_physmem(priv->base, DWC3_OTG_REGS_END, MAP_NOCACHE);
-- 
2.7.4

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

* [U-Boot] [PATCH] usb: dwc3: Handle case where setup_phy is not needed
  2019-04-01  6:10 [U-Boot] [PATCH] usb: dwc3: Handle case where setup_phy is not needed Siva Durga Prasad Paladugu
@ 2019-04-01  7:32 ` Lukasz Majewski
  2019-04-01 10:23   ` Siva Durga Prasad Paladugu
  0 siblings, 1 reply; 8+ messages in thread
From: Lukasz Majewski @ 2019-04-01  7:32 UTC (permalink / raw)
  To: u-boot

Hi Siva Durga Prasad Paladugu,

> If CONFIG_PHY is not enabled then the dwc3_setup_phy()
> returns ENOTSUPP which can be still valid and intentional
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - could you
                                elaborate on this a bit more?

What is the use case when -ENOTSUPP is valid and intentional ?

> so modify error check to handle this -ENOTSUPP.
> 
> Signed-off-by: Siva Durga Prasad Paladugu
> <siva.durga.paladugu@xilinx.com> ---
>  drivers/usb/dwc3/dwc3-generic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-generic.c
> b/drivers/usb/dwc3/dwc3-generic.c index 3e6c494..a261d8d 100644
> --- a/drivers/usb/dwc3/dwc3-generic.c
> +++ b/drivers/usb/dwc3/dwc3-generic.c
> @@ -47,7 +47,7 @@ static int dwc3_generic_peripheral_probe(struct
> udevice *dev) struct dwc3 *dwc3 = &priv->dwc3;
>  
>  	rc = dwc3_setup_phy(dev, &priv->phys, &priv->num_phys);
> -	if (rc)
> +	if (rc && rc != -ENOTSUPP)
>  		return rc;
>  
>  	dwc3->regs = map_physmem(priv->base, DWC3_OTG_REGS_END,
> MAP_NOCACHE);




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/20190401/d89f7183/attachment.sig>

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

* [U-Boot] [PATCH] usb: dwc3: Handle case where setup_phy is not needed
  2019-04-01  7:32 ` Lukasz Majewski
@ 2019-04-01 10:23   ` Siva Durga Prasad Paladugu
  2019-04-01 10:34     ` Lukasz Majewski
  0 siblings, 1 reply; 8+ messages in thread
From: Siva Durga Prasad Paladugu @ 2019-04-01 10:23 UTC (permalink / raw)
  To: u-boot

Hi Lukasz,

> -----Original Message-----
> From: Lukasz Majewski [mailto:lukma at denx.de]
> Sent: Monday, April 01, 2019 1:03 PM
> To: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
> sjg at chromium.org; patrick.delaunay at st.com; Michal Simek
> <michals@xilinx.com>
> Subject: Re: [PATCH] usb: dwc3: Handle case where setup_phy is not
> needed
> 
> Hi Siva Durga Prasad Paladugu,
> 
> > If CONFIG_PHY is not enabled then the dwc3_setup_phy() returns
> > ENOTSUPP which can be still valid and intentional
>                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - could you
>                                 elaborate on this a bit more?
> 
> What is the use case when -ENOTSUPP is valid and intentional ?

In the cases where phy will be setup by First stage boot loader itself and don't want to do it again at u-boot.

Thanks,
Siva

> 
> > so modify error check to handle this -ENOTSUPP.
> >
> > Signed-off-by: Siva Durga Prasad Paladugu
> > <siva.durga.paladugu@xilinx.com> ---  drivers/usb/dwc3/dwc3-generic.c
> > | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/dwc3/dwc3-generic.c
> > b/drivers/usb/dwc3/dwc3-generic.c index 3e6c494..a261d8d 100644
> > --- a/drivers/usb/dwc3/dwc3-generic.c
> > +++ b/drivers/usb/dwc3/dwc3-generic.c
> > @@ -47,7 +47,7 @@ static int dwc3_generic_peripheral_probe(struct
> > udevice *dev) struct dwc3 *dwc3 = &priv->dwc3;
> >
> >  	rc = dwc3_setup_phy(dev, &priv->phys, &priv->num_phys);
> > -	if (rc)
> > +	if (rc && rc != -ENOTSUPP)
> >  		return rc;
> >
> >  	dwc3->regs = map_physmem(priv->base, DWC3_OTG_REGS_END,
> > MAP_NOCACHE);
> 
> 
> 
> 
> 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] 8+ messages in thread

* [U-Boot] [PATCH] usb: dwc3: Handle case where setup_phy is not needed
  2019-04-01 10:23   ` Siva Durga Prasad Paladugu
@ 2019-04-01 10:34     ` Lukasz Majewski
  2019-04-01 10:38       ` Siva Durga Prasad Paladugu
  0 siblings, 1 reply; 8+ messages in thread
From: Lukasz Majewski @ 2019-04-01 10:34 UTC (permalink / raw)
  To: u-boot

On Mon, 1 Apr 2019 10:23:42 +0000
Siva Durga Prasad Paladugu <sivadur@xilinx.com> wrote:

> Hi Lukasz,
> 
> > -----Original Message-----
> > From: Lukasz Majewski [mailto:lukma at denx.de]
> > Sent: Monday, April 01, 2019 1:03 PM
> > To: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> > Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
> > sjg at chromium.org; patrick.delaunay at st.com; Michal Simek
> > <michals@xilinx.com>
> > Subject: Re: [PATCH] usb: dwc3: Handle case where setup_phy is not
> > needed
> > 
> > Hi Siva Durga Prasad Paladugu,
> >   
> > > If CONFIG_PHY is not enabled then the dwc3_setup_phy() returns
> > > ENOTSUPP which can be still valid and intentional  
> >                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - could
> > you elaborate on this a bit more?
> > 
> > What is the use case when -ENOTSUPP is valid and intentional ?  
> 
> In the cases where phy will be setup by First stage boot loader
> itself and don't want to do it again at u-boot.

I think that I saw some time ago similar patch for uart - on IMX IIRC
(it was also setup by BootROM on SoC).

Maybe we would need some kind of switch in Kconfig to indicate this use
case?

Another option would be to mark this in DTS as TI specific property?

My point is that we shall not proceed with the flow when we do receive
-ENOTSUPP 

> 
> Thanks,
> Siva
> 
> >   
> > > so modify error check to handle this -ENOTSUPP.
> > >
> > > Signed-off-by: Siva Durga Prasad Paladugu
> > > <siva.durga.paladugu@xilinx.com> ---
> > > drivers/usb/dwc3/dwc3-generic.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/usb/dwc3/dwc3-generic.c
> > > b/drivers/usb/dwc3/dwc3-generic.c index 3e6c494..a261d8d 100644
> > > --- a/drivers/usb/dwc3/dwc3-generic.c
> > > +++ b/drivers/usb/dwc3/dwc3-generic.c
> > > @@ -47,7 +47,7 @@ static int dwc3_generic_peripheral_probe(struct
> > > udevice *dev) struct dwc3 *dwc3 = &priv->dwc3;
> > >
> > >  	rc = dwc3_setup_phy(dev, &priv->phys, &priv->num_phys);
> > > -	if (rc)
> > > +	if (rc && rc != -ENOTSUPP)
> > >  		return rc;
> > >
> > >  	dwc3->regs = map_physmem(priv->base, DWC3_OTG_REGS_END,
> > > MAP_NOCACHE);  
> > 
> > 
> > 
> > 
> > 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  




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/20190401/1916899a/attachment.sig>

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

* [U-Boot] [PATCH] usb: dwc3: Handle case where setup_phy is not needed
  2019-04-01 10:34     ` Lukasz Majewski
@ 2019-04-01 10:38       ` Siva Durga Prasad Paladugu
  2019-04-01 10:39         ` Michal Simek
  0 siblings, 1 reply; 8+ messages in thread
From: Siva Durga Prasad Paladugu @ 2019-04-01 10:38 UTC (permalink / raw)
  To: u-boot

Hi Lukasz,

> -----Original Message-----
> From: Lukasz Majewski [mailto:lukma at denx.de]
> Sent: Monday, April 01, 2019 4:04 PM
> To: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
> sjg at chromium.org; patrick.delaunay at st.com; Michal Simek
> <michals@xilinx.com>
> Subject: Re: [PATCH] usb: dwc3: Handle case where setup_phy is not
> needed
> 
> On Mon, 1 Apr 2019 10:23:42 +0000
> Siva Durga Prasad Paladugu <sivadur@xilinx.com> wrote:
> 
> > Hi Lukasz,
> >
> > > -----Original Message-----
> > > From: Lukasz Majewski [mailto:lukma at denx.de]
> > > Sent: Monday, April 01, 2019 1:03 PM
> > > To: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> > > Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
> > > sjg at chromium.org; patrick.delaunay at st.com; Michal Simek
> > > <michals@xilinx.com>
> > > Subject: Re: [PATCH] usb: dwc3: Handle case where setup_phy is not
> > > needed
> > >
> > > Hi Siva Durga Prasad Paladugu,
> > >
> > > > If CONFIG_PHY is not enabled then the dwc3_setup_phy() returns
> > > > ENOTSUPP which can be still valid and intentional
> > >                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - could
> > > you elaborate on this a bit more?
> > >
> > > What is the use case when -ENOTSUPP is valid and intentional ?
> >
> > In the cases where phy will be setup by First stage boot loader itself
> > and don't want to do it again at u-boot.
> 
> I think that I saw some time ago similar patch for uart - on IMX IIRC (it was
> also setup by BootROM on SoC).
> 
> Maybe we would need some kind of switch in Kconfig to indicate this use
> case?
> 
> Another option would be to mark this in DTS as TI specific property?
> 
> My point is that we shall not proceed with the flow when we do receive -
> ENOTSUPP

TBH, I feel we should not call dwc3_setup_phy() if CONFIG_PHY is not enabled. If we look at dwc3_setup_phy() definition, it is under CONFIG_PHY.

Thanks,
Siva

> 
> >
> > Thanks,
> > Siva
> >
> > >
> > > > so modify error check to handle this -ENOTSUPP.
> > > >
> > > > Signed-off-by: Siva Durga Prasad Paladugu
> > > > <siva.durga.paladugu@xilinx.com> ---
> > > > drivers/usb/dwc3/dwc3-generic.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/usb/dwc3/dwc3-generic.c
> > > > b/drivers/usb/dwc3/dwc3-generic.c index 3e6c494..a261d8d 100644
> > > > --- a/drivers/usb/dwc3/dwc3-generic.c
> > > > +++ b/drivers/usb/dwc3/dwc3-generic.c
> > > > @@ -47,7 +47,7 @@ static int dwc3_generic_peripheral_probe(struct
> > > > udevice *dev) struct dwc3 *dwc3 = &priv->dwc3;
> > > >
> > > >  	rc = dwc3_setup_phy(dev, &priv->phys, &priv->num_phys);
> > > > -	if (rc)
> > > > +	if (rc && rc != -ENOTSUPP)
> > > >  		return rc;
> > > >
> > > >  	dwc3->regs = map_physmem(priv->base, DWC3_OTG_REGS_END,
> > > > MAP_NOCACHE);
> > >
> > >
> > >
> > >
> > > 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
> 
> 
> 
> 
> 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] 8+ messages in thread

* [U-Boot] [PATCH] usb: dwc3: Handle case where setup_phy is not needed
  2019-04-01 10:38       ` Siva Durga Prasad Paladugu
@ 2019-04-01 10:39         ` Michal Simek
  2019-05-28 10:06           ` Siva Durga Prasad Paladugu
  0 siblings, 1 reply; 8+ messages in thread
From: Michal Simek @ 2019-04-01 10:39 UTC (permalink / raw)
  To: u-boot

On 01. 04. 19 12:38, Siva Durga Prasad Paladugu wrote:
> Hi Lukasz,
> 
>> -----Original Message-----
>> From: Lukasz Majewski [mailto:lukma at denx.de]
>> Sent: Monday, April 01, 2019 4:04 PM
>> To: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
>> Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
>> sjg at chromium.org; patrick.delaunay at st.com; Michal Simek
>> <michals@xilinx.com>
>> Subject: Re: [PATCH] usb: dwc3: Handle case where setup_phy is not
>> needed
>>
>> On Mon, 1 Apr 2019 10:23:42 +0000
>> Siva Durga Prasad Paladugu <sivadur@xilinx.com> wrote:
>>
>>> Hi Lukasz,
>>>
>>>> -----Original Message-----
>>>> From: Lukasz Majewski [mailto:lukma at denx.de]
>>>> Sent: Monday, April 01, 2019 1:03 PM
>>>> To: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
>>>> Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
>>>> sjg at chromium.org; patrick.delaunay at st.com; Michal Simek
>>>> <michals@xilinx.com>
>>>> Subject: Re: [PATCH] usb: dwc3: Handle case where setup_phy is not
>>>> needed
>>>>
>>>> Hi Siva Durga Prasad Paladugu,
>>>>
>>>>> If CONFIG_PHY is not enabled then the dwc3_setup_phy() returns
>>>>> ENOTSUPP which can be still valid and intentional
>>>>                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - could
>>>> you elaborate on this a bit more?
>>>>
>>>> What is the use case when -ENOTSUPP is valid and intentional ?
>>>
>>> In the cases where phy will be setup by First stage boot loader itself
>>> and don't want to do it again at u-boot.
>>
>> I think that I saw some time ago similar patch for uart - on IMX IIRC (it was
>> also setup by BootROM on SoC).
>>
>> Maybe we would need some kind of switch in Kconfig to indicate this use
>> case?
>>
>> Another option would be to mark this in DTS as TI specific property?
>>
>> My point is that we shall not proceed with the flow when we do receive -
>> ENOTSUPP
> 
> TBH, I feel we should not call dwc3_setup_phy() if CONFIG_PHY is not enabled. If we look at dwc3_setup_phy() definition, it is under 
CONFIG_PHY.

+1 on this.

M

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

* [U-Boot] [PATCH] usb: dwc3: Handle case where setup_phy is not needed
  2019-04-01 10:39         ` Michal Simek
@ 2019-05-28 10:06           ` Siva Durga Prasad Paladugu
  2019-06-06 10:13             ` Siva Durga Prasad Paladugu
  0 siblings, 1 reply; 8+ messages in thread
From: Siva Durga Prasad Paladugu @ 2019-05-28 10:06 UTC (permalink / raw)
  To: u-boot

Hi,

> -----Original Message-----
> From: Michal Simek [mailto:michal.simek at xilinx.com]
> Sent: Monday, April 1, 2019 4:10 PM
> To: Siva Durga Prasad Paladugu <sivadur@xilinx.com>; Lukasz Majewski
> <lukma@denx.de>
> Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
> sjg at chromium.org; patrick.delaunay at st.com
> Subject: Re: [PATCH] usb: dwc3: Handle case where setup_phy is not needed
> 
> On 01. 04. 19 12:38, Siva Durga Prasad Paladugu wrote:
> > Hi Lukasz,
> >
> >> -----Original Message-----
> >> From: Lukasz Majewski [mailto:lukma at denx.de]
> >> Sent: Monday, April 01, 2019 4:04 PM
> >> To: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> >> Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
> >> sjg at chromium.org; patrick.delaunay at st.com; Michal Simek
> >> <michals@xilinx.com>
> >> Subject: Re: [PATCH] usb: dwc3: Handle case where setup_phy is not
> >> needed
> >>
> >> On Mon, 1 Apr 2019 10:23:42 +0000
> >> Siva Durga Prasad Paladugu <sivadur@xilinx.com> wrote:
> >>
> >>> Hi Lukasz,
> >>>
> >>>> -----Original Message-----
> >>>> From: Lukasz Majewski [mailto:lukma at denx.de]
> >>>> Sent: Monday, April 01, 2019 1:03 PM
> >>>> To: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> >>>> Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
> >>>> sjg at chromium.org; patrick.delaunay at st.com; Michal Simek
> >>>> <michals@xilinx.com>
> >>>> Subject: Re: [PATCH] usb: dwc3: Handle case where setup_phy is not
> >>>> needed
> >>>>
> >>>> Hi Siva Durga Prasad Paladugu,
> >>>>
> >>>>> If CONFIG_PHY is not enabled then the dwc3_setup_phy() returns
> >>>>> ENOTSUPP which can be still valid and intentional
> >>>>                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - could
> >>>> you elaborate on this a bit more?
> >>>>
> >>>> What is the use case when -ENOTSUPP is valid and intentional ?
> >>>
> >>> In the cases where phy will be setup by First stage boot loader
> >>> itself and don't want to do it again at u-boot.
> >>
> >> I think that I saw some time ago similar patch for uart - on IMX IIRC
> >> (it was also setup by BootROM on SoC).
> >>
> >> Maybe we would need some kind of switch in Kconfig to indicate this
> >> use case?
> >>
> >> Another option would be to mark this in DTS as TI specific property?
> >>
> >> My point is that we shall not proceed with the flow when we do
> >> receive - ENOTSUPP
> >
> > TBH, I feel we should not call dwc3_setup_phy() if CONFIG_PHY is not
> > enabled. If we look at dwc3_setup_phy() definition, it is under
> CONFIG_PHY.
> 
> +1 on this.

Any update on this patch?

Thanks,
Siva

> 
> M

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

* [U-Boot] [PATCH] usb: dwc3: Handle case where setup_phy is not needed
  2019-05-28 10:06           ` Siva Durga Prasad Paladugu
@ 2019-06-06 10:13             ` Siva Durga Prasad Paladugu
  0 siblings, 0 replies; 8+ messages in thread
From: Siva Durga Prasad Paladugu @ 2019-06-06 10:13 UTC (permalink / raw)
  To: u-boot

Hi,

> -----Original Message-----
> From: Siva Durga Prasad Paladugu
> Sent: Tuesday, May 28, 2019 3:36 PM
> To: Michal Simek <michal.simek@xilinx.com>; Lukasz Majewski
> <lukma@denx.de>
> Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
> sjg at chromium.org; patrick.delaunay at st.com
> Subject: RE: [PATCH] usb: dwc3: Handle case where setup_phy is not needed
> 
> Hi,
> 
> > -----Original Message-----
> > From: Michal Simek [mailto:michal.simek at xilinx.com]
> > Sent: Monday, April 1, 2019 4:10 PM
> > To: Siva Durga Prasad Paladugu <sivadur@xilinx.com>; Lukasz Majewski
> > <lukma@denx.de>
> > Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
> > sjg at chromium.org; patrick.delaunay at st.com
> > Subject: Re: [PATCH] usb: dwc3: Handle case where setup_phy is not
> > needed
> >
> > On 01. 04. 19 12:38, Siva Durga Prasad Paladugu wrote:
> > > Hi Lukasz,
> > >
> > >> -----Original Message-----
> > >> From: Lukasz Majewski [mailto:lukma at denx.de]
> > >> Sent: Monday, April 01, 2019 4:04 PM
> > >> To: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> > >> Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
> > >> sjg at chromium.org; patrick.delaunay at st.com; Michal Simek
> > >> <michals@xilinx.com>
> > >> Subject: Re: [PATCH] usb: dwc3: Handle case where setup_phy is not
> > >> needed
> > >>
> > >> On Mon, 1 Apr 2019 10:23:42 +0000
> > >> Siva Durga Prasad Paladugu <sivadur@xilinx.com> wrote:
> > >>
> > >>> Hi Lukasz,
> > >>>
> > >>>> -----Original Message-----
> > >>>> From: Lukasz Majewski [mailto:lukma at denx.de]
> > >>>> Sent: Monday, April 01, 2019 1:03 PM
> > >>>> To: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> > >>>> Cc: u-boot at lists.denx.de; marex at denx.de; jjhiblot at ti.com;
> > >>>> sjg at chromium.org; patrick.delaunay at st.com; Michal Simek
> > >>>> <michals@xilinx.com>
> > >>>> Subject: Re: [PATCH] usb: dwc3: Handle case where setup_phy is
> > >>>> not needed
> > >>>>
> > >>>> Hi Siva Durga Prasad Paladugu,
> > >>>>
> > >>>>> If CONFIG_PHY is not enabled then the dwc3_setup_phy() returns
> > >>>>> ENOTSUPP which can be still valid and intentional
> > >>>>                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -
> > >>>> could you elaborate on this a bit more?
> > >>>>
> > >>>> What is the use case when -ENOTSUPP is valid and intentional ?
> > >>>
> > >>> In the cases where phy will be setup by First stage boot loader
> > >>> itself and don't want to do it again at u-boot.
> > >>
> > >> I think that I saw some time ago similar patch for uart - on IMX
> > >> IIRC (it was also setup by BootROM on SoC).
> > >>
> > >> Maybe we would need some kind of switch in Kconfig to indicate this
> > >> use case?
> > >>
> > >> Another option would be to mark this in DTS as TI specific property?
> > >>
> > >> My point is that we shall not proceed with the flow when we do
> > >> receive - ENOTSUPP
> > >
> > > TBH, I feel we should not call dwc3_setup_phy() if CONFIG_PHY is not
> > > enabled. If we look at dwc3_setup_phy() definition, it is under
> > CONFIG_PHY.
> >
> > +1 on this.
> 
> Any update on this patch?

This is how its already being handled in drivers/usb/host/xhci-dwc3.c at line 127 in routine xhci_dwc3_probe() (snippet below)

ret = dwc3_setup_phy(dev, &plat->usb_phys, &plat->num_phys);
if (ret && (ret != -ENOTSUPP))
	return ret;

We have two options either treat -ENOTSUPP as valid as above patch which I sent or don’t invoke dwc3_setup_phy() if CONFIG_PHY is not enabled.

Thanks,
Siva
> 
> Thanks,
> Siva
> 
> >
> > M

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

end of thread, other threads:[~2019-06-06 10:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-01  6:10 [U-Boot] [PATCH] usb: dwc3: Handle case where setup_phy is not needed Siva Durga Prasad Paladugu
2019-04-01  7:32 ` Lukasz Majewski
2019-04-01 10:23   ` Siva Durga Prasad Paladugu
2019-04-01 10:34     ` Lukasz Majewski
2019-04-01 10:38       ` Siva Durga Prasad Paladugu
2019-04-01 10:39         ` Michal Simek
2019-05-28 10:06           ` Siva Durga Prasad Paladugu
2019-06-06 10:13             ` Siva Durga Prasad Paladugu

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.