18c2ecf20Sopenharmony_ciMediaTek XS-PHY binding
28c2ecf20Sopenharmony_ci--------------------------
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ciThe XS-PHY controller supports physical layer functionality for USB3.1
58c2ecf20Sopenharmony_ciGEN2 controller on MediaTek SoCs.
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciRequired properties (controller (parent) node):
88c2ecf20Sopenharmony_ci - compatible	: should be "mediatek,<soc-model>-xsphy", "mediatek,xsphy",
98c2ecf20Sopenharmony_ci		  soc-model is the name of SoC, such as mt3611 etc;
108c2ecf20Sopenharmony_ci		  when using "mediatek,xsphy" compatible string, you need SoC specific
118c2ecf20Sopenharmony_ci		  ones in addition, one of:
128c2ecf20Sopenharmony_ci		  - "mediatek,mt3611-xsphy"
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci - #address-cells, #size-cells : should use the same values as the root node
158c2ecf20Sopenharmony_ci - ranges: must be present
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciOptional properties (controller (parent) node):
188c2ecf20Sopenharmony_ci - reg		: offset and length of register shared by multiple U3 ports,
198c2ecf20Sopenharmony_ci		  exclude port's private register, if only U2 ports provided,
208c2ecf20Sopenharmony_ci		  shouldn't use the property.
218c2ecf20Sopenharmony_ci - mediatek,src-ref-clk-mhz	: u32, frequency of reference clock for slew rate
228c2ecf20Sopenharmony_ci		  calibrate
238c2ecf20Sopenharmony_ci - mediatek,src-coef	: u32, coefficient for slew rate calibrate, depends on
248c2ecf20Sopenharmony_ci		  SoC process
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciRequired nodes	: a sub-node is required for each port the controller
278c2ecf20Sopenharmony_ci		  provides. Address range information including the usual
288c2ecf20Sopenharmony_ci		  'reg' property is used inside these nodes to describe
298c2ecf20Sopenharmony_ci		  the controller's topology.
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciRequired properties (port (child) node):
328c2ecf20Sopenharmony_ci- reg		: address and length of the register set for the port.
338c2ecf20Sopenharmony_ci- clocks	: a list of phandle + clock-specifier pairs, one for each
348c2ecf20Sopenharmony_ci		  entry in clock-names
358c2ecf20Sopenharmony_ci- clock-names	: must contain
368c2ecf20Sopenharmony_ci		  "ref": 48M reference clock for HighSpeed analog phy; and 26M
378c2ecf20Sopenharmony_ci			reference clock for SuperSpeedPlus analog phy, sometimes is
388c2ecf20Sopenharmony_ci			24M, 25M or 27M, depended on platform.
398c2ecf20Sopenharmony_ci- #phy-cells	: should be 1
408c2ecf20Sopenharmony_ci		  cell after port phandle is phy type from:
418c2ecf20Sopenharmony_ci			- PHY_TYPE_USB2
428c2ecf20Sopenharmony_ci			- PHY_TYPE_USB3
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ciThe following optional properties are only for debug or HQA test
458c2ecf20Sopenharmony_ciOptional properties (PHY_TYPE_USB2 port (child) node):
468c2ecf20Sopenharmony_ci- mediatek,eye-src	: u32, the value of slew rate calibrate
478c2ecf20Sopenharmony_ci- mediatek,eye-vrt	: u32, the selection of VRT reference voltage
488c2ecf20Sopenharmony_ci- mediatek,eye-term	: u32, the selection of HS_TX TERM reference voltage
498c2ecf20Sopenharmony_ci- mediatek,efuse-intr	: u32, the selection of Internal Resistor
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciOptional properties (PHY_TYPE_USB3 port (child) node):
528c2ecf20Sopenharmony_ci- mediatek,efuse-intr	: u32, the selection of Internal Resistor
538c2ecf20Sopenharmony_ci- mediatek,efuse-tx-imp	: u32, the selection of TX Impedance
548c2ecf20Sopenharmony_ci- mediatek,efuse-rx-imp	: u32, the selection of RX Impedance
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ciBanks layout of xsphy
578c2ecf20Sopenharmony_ci-------------------------------------------------------------
588c2ecf20Sopenharmony_ciport        offset    bank
598c2ecf20Sopenharmony_ciu2 port0    0x0000    MISC
608c2ecf20Sopenharmony_ci            0x0100    FMREG
618c2ecf20Sopenharmony_ci            0x0300    U2PHY_COM
628c2ecf20Sopenharmony_ciu2 port1    0x1000    MISC
638c2ecf20Sopenharmony_ci            0x1100    FMREG
648c2ecf20Sopenharmony_ci            0x1300    U2PHY_COM
658c2ecf20Sopenharmony_ciu2 port2    0x2000    MISC
668c2ecf20Sopenharmony_ci            ...
678c2ecf20Sopenharmony_ciu31 common  0x3000    DIG_GLB
688c2ecf20Sopenharmony_ci            0x3100    PHYA_GLB
698c2ecf20Sopenharmony_ciu31 port0   0x3400    DIG_LN_TOP
708c2ecf20Sopenharmony_ci            0x3500    DIG_LN_TX0
718c2ecf20Sopenharmony_ci            0x3600    DIG_LN_RX0
728c2ecf20Sopenharmony_ci            0x3700    DIG_LN_DAIF
738c2ecf20Sopenharmony_ci            0x3800    PHYA_LN
748c2ecf20Sopenharmony_ciu31 port1   0x3a00    DIG_LN_TOP
758c2ecf20Sopenharmony_ci            0x3b00    DIG_LN_TX0
768c2ecf20Sopenharmony_ci            0x3c00    DIG_LN_RX0
778c2ecf20Sopenharmony_ci            0x3d00    DIG_LN_DAIF
788c2ecf20Sopenharmony_ci            0x3e00    PHYA_LN
798c2ecf20Sopenharmony_ci            ...
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ciDIG_GLB & PHYA_GLB are shared by U31 ports.
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ciExample:
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ciu3phy: usb-phy@11c40000 {
868c2ecf20Sopenharmony_ci	compatible = "mediatek,mt3611-xsphy", "mediatek,xsphy";
878c2ecf20Sopenharmony_ci	reg = <0 0x11c43000 0 0x0200>;
888c2ecf20Sopenharmony_ci	mediatek,src-ref-clk-mhz = <26>;
898c2ecf20Sopenharmony_ci	mediatek,src-coef = <17>;
908c2ecf20Sopenharmony_ci	#address-cells = <2>;
918c2ecf20Sopenharmony_ci	#size-cells = <2>;
928c2ecf20Sopenharmony_ci	ranges;
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci	u2port0: usb-phy@11c40000 {
958c2ecf20Sopenharmony_ci		reg = <0 0x11c40000 0 0x0400>;
968c2ecf20Sopenharmony_ci		clocks = <&clk48m>;
978c2ecf20Sopenharmony_ci		clock-names = "ref";
988c2ecf20Sopenharmony_ci		mediatek,eye-src = <4>;
998c2ecf20Sopenharmony_ci		#phy-cells = <1>;
1008c2ecf20Sopenharmony_ci	};
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci	u3port0: usb-phy@11c43000 {
1038c2ecf20Sopenharmony_ci		reg = <0 0x11c43400 0 0x0500>;
1048c2ecf20Sopenharmony_ci		clocks = <&clk26m>;
1058c2ecf20Sopenharmony_ci		clock-names = "ref";
1068c2ecf20Sopenharmony_ci		mediatek,efuse-intr = <28>;
1078c2ecf20Sopenharmony_ci		#phy-cells = <1>;
1088c2ecf20Sopenharmony_ci	};
1098c2ecf20Sopenharmony_ci};
110