Re: [PATCH v5 2/2] phy: add a driver for T-Head TH1520 USB PHY
From: Icenowy Zheng
Date: Tue Dec 01 2026 - 07:51:00 EST
在 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).
However it might be valid to compile test it while using the NOP stubs in
<linux/reset.h>.
So is there a Kconfig option for such situation?
Although I am okay with removing this depends on in the next revision.
Thanks,
Icenowy
>
> regards
> Philipp