[U-Boot] [PATCH] usb: dwc3: Handle case where setup_phy is not needed

Siva Durga Prasad Paladugu sivadur at xilinx.com
Thu Jun 6 10:13:18 UTC 2019


Hi,

> -----Original Message-----
> From: Siva Durga Prasad Paladugu
> Sent: Tuesday, May 28, 2019 3:36 PM
> To: Michal Simek <michal.simek at xilinx.com>; Lukasz Majewski
> <lukma at 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 at xilinx.com>; Lukasz Majewski
> > <lukma at 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 at 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 at 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 at 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 at 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 at 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



More information about the U-Boot mailing list