Re: [PATCH RFC 2/2] arm: dts: marvell: armada-38x: add description for usb phys

Josua Mayer
2024-07-16T12:55:43Z

Am 15.07.24 um 19:47 schrieb Josua Mayer:
> 3. utmi phy driver access just three registers using syscon: all-ports
> power-up (probably enables clocks), device-mode mux, per-port power-up.
>
> Assign these registers individually to the phy device-node, and
> implement access in driver when syscon is not available.
>
> If this is preferred, which dt property should s[ecify their address?
> reg, ranges, ...?

I think I have my answer, with reg-names it seems manageable -
please see the example below:

utmi: utmi@c0000 {
compatible = "marvell,armada-380-utmi-phy";
reg = <0xc0000 0x6000>, <0x18420 4>, <0x18440 12>;
reg-names = "utmi", "usb-cfg", "utmi-cfg";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";

utmi0: usb-phy@0 {
reg = <0>;
#phy-cells = <0>;
};

utmi1: usb-phy@1 {
reg = <1>;
#phy-cells = <0>;
};

utmi2: usb-phy@2 {
reg = <2>;
#phy-cells = <0>;
};
};

If registers named "usb-cfg" and "utmi-cfg" are given, the driver can be extended
to optionally use those.

I have tested on armada-388-clearfog-pro,
and will send a v2 after tidying up my changes:

/* USB-2.0 Host, CON3 - nearest power */
&usb0 {
phys = <&utmi0>;
phy-names = "utmi";
status = "okay";
};

/* USB-2.0 Host, CON2 - nearest CPU */
&usb3_0 {
phys = <&utmi1>;
phy-names = "utmi";
status = "okay";
};

/* SRDS #3 - USB-2.0/3.0 Host, Type-A connector */
&usb3_1 {
phys = <&utmi2>;
phy-names = "utmi";
status = "okay";
};

&utmi {
status = "okay";
};