Re: [PATCH v5 2/2] phy: add a driver for T-Head TH1520 USB PHY

From: Philipp Zabel

Date: Tue Dec 01 2026 - 10:28:02 EST


On Di, 2026-12-01 at 20:50 +0800, Icenowy Zheng wrote:
> 在 2026-12-01二的 11:22 +0100,Philipp Zabel写道:
> > On Mo, 2026-11-30 at 17:07 +0800, Icenowy Zheng wrote:
> > > The USB PHY on T-Head TH1520 SoC is a Synopsys USB 3.0 FemtoPHY, with
> > > some PHY parameters exported as another system controller along with it.
> > >
> > > A few PHY parameters have unusable defaults. Add a driver that programs
> > > them before releasing the PHY from reset in addition to
> > > clock/reset/regulator management.
> > >
> > > Reviewed-by: Drew Fustini <fustini@xxxxxxxxxx>
> > > Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>
> > > Signed-off-by: Icenowy Zheng <zhengxingda@xxxxxxxxxxx>
> > > ---
> > > drivers/phy/Kconfig | 1 +
> > > drivers/phy/Makefile | 1 +
> > > drivers/phy/thead/Kconfig | 12 +++
> > > drivers/phy/thead/Makefile | 2 +
> > > drivers/phy/thead/phy-th1520-usb.c | 176 +++++++++++++++++++++++++++++++++++++
> > > 5 files changed, 192 insertions(+)
> > >
> > [...]
> > > diff --git a/drivers/phy/thead/Kconfig b/drivers/phy/thead/Kconfig
> > > new file mode 100644
> > > index 0000000000000..ba0ceac54c1b0
> > > --- /dev/null
> > > +++ b/drivers/phy/thead/Kconfig
> > > @@ -0,0 +1,12 @@
> > > +# SPDX-License-Identifier: GPL-2.0-only
> > > +config PHY_TH1520_USB
> > > + tristate "USB PHY driver for T-Head TH1520 SoC"
> > > + depends on ARCH_THEAD || COMPILE_TEST
> > > + depends on COMMON_CLK
> > > + depends on HAS_IOMEM
> > > + depends on OF
> > > + depends on RESET_CONTROLLER
> >
> > Drop this, only reset controller drivers need to depend on
> > RESET_CONTROLLER.
>
> I think this driver would not make sense if the real reset operations
> aren't available (because this driver tunes some MMIO PHY parameters while
> putting the PHY into reset).

The driver won't work if the reset controller driver - I assume
RESET_TH1520 - is missing, either.

I don't think Kbuild the right tool to enforce such runtime
dependencies per driver.

regards
Philipp