[PATCH v2] arm64: dts: rockchip: enable UFS controller on FriendlyElec NanoPi M5
Alexey Charkov
alchark at gmail.com
Mon Dec 22 05:28:07 PST 2025
Hi Heiko,
On Mon, Dec 22, 2025 at 4:41 PM Heiko Stuebner <heiko at sntech.de> wrote:
>
> Hi Alexey,
>
> Am Donnerstag, 18. Dezember 2025, 15:05:39 Mitteleuropäische Normalzeit schrieb Alexey Charkov:
> > Hi Heiko,
> >
> > On Mon, Dec 1, 2025 at 3:35 PM Alexey Charkov <alchark at gmail.com> wrote:
> > >
> > > The NanoPi M5 board supports pluggable UFS modules using the UFSHC
> > > inside its Rockchip RK3576 SoC.
> > >
> > > Enable the respective devicetree node and add its supply regulators.
> > >
> > > Link: https://wiki.friendlyelec.com/wiki/images/9/97/NanoPi_M5_LP5_2411_SCH.pdf
> > > Signed-off-by: Alexey Charkov <alchark at gmail.com>
> > > ---
> > > Changes in v2:
> > > - Describe UFS supply regulators
> > > - Add link to schematic
> > > - Link to v1: https://lore.kernel.org/r/20251127-nanopi-m5-ufs-v1-1-0d28d157712c@gmail.com
> > > ---
> > > arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts | 27 +++++++++++++++++++++++
> > > 1 file changed, 27 insertions(+)
> >
> > Would you mind pulling this one, or do you have any reservations?
> > There hasn't been any discussion, but it looks like a pretty simple
> > change, runtime tested and schema-tested.
>
> Your patch fell directly into the dead-zone between -rc7 and -rc1 ;-)
Understood :)
> > + vcc1v2_ufs_vccq: regulator-vcc1v2-ufs-vccq {
> > + compatible = "regulator-fixed";
> > + regulator-min-microvolt = <1200000>;
> > + regulator-max-microvolt = <1200000>;
> > + regulator-name = "vcc1v2_ufs_vccq";
> > + vin-supply = <&vcc5v0_sys_s5>;
> > + en-supply = <&vcc_3v3_s3>;
> > + };
> > +
> > + vcc1v8_ufs_vccq2: regulator-vcc1v8-ufs-vccq2 {
> > + compatible = "regulator-fixed";
> > + regulator-min-microvolt = <1800000>;
> > + regulator-max-microvolt = <1800000>;
> > + regulator-name = "vcc1v8_ufs_vccq2";
> > + vin-supply = <&vcc_1v8_s3>;
> > + en-supply = <&vdda_1v2_s0>;
> > + };
>
>
> But where does the "en-supply" come from? For the life of me, I can't find
> any reference to it in either the bindings in the kernel, nor the dt-schema.
>
> Can you please point me to the part of the documentation where that is
> described?
The bindings [1] describe supplies by a wildcard pattern '.*-supply$',
and the device in question is a DC-DC regulator (see page 17 of the
schematic [2]), which produces the 1.2V power for the chip, its VIN
pin directly wired to VCC5V0_SYS_S5 and its EN pin directly wired to
VCC_3V3_S3, both of which need to be active for the 1.2V feed to
appear - thus both are 'supplies' of sorts. VCCQ2 is similar, but
implemented using a simple gate circuit. This is done to ensure
correct power sequencing, from what I understood.
I've just checked the fixed regulator driver though, and it only
handles 'vin-supply', not any other '.*-supply$' - thus, technically,
it doesn't currently implement the full schema :) Not sure if there is
another existing facility to model multi-parent regulators that I
missed, or if it's a good idea to extend the fixed.c driver to handle
an arbitrary number of supplies?
Any guidance would be appreciated.
Thanks a lot,
Alexey
[1] https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/regulator/regulator.yaml#L246-L248
[2] https://wiki.friendlyelec.com/wiki/images/9/97/NanoPi_M5_LP5_2411_SCH.pdf
More information about the Linux-rockchip
mailing list