18c2ecf20Sopenharmony_ciTI AM654 SERDES
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciRequired properties:
48c2ecf20Sopenharmony_ci - compatible: Should be "ti,phy-am654-serdes"
58c2ecf20Sopenharmony_ci - reg : Address and length of the register set for the device.
68c2ecf20Sopenharmony_ci - #phy-cells: determine the number of cells that should be given in the
78c2ecf20Sopenharmony_ci	phandle while referencing this phy. Should be "2". The 1st cell
88c2ecf20Sopenharmony_ci	corresponds to the phy type (should be one of the types specified in
98c2ecf20Sopenharmony_ci	include/dt-bindings/phy/phy.h) and the 2nd cell should be the serdes
108c2ecf20Sopenharmony_ci	lane function.
118c2ecf20Sopenharmony_ci	If SERDES0 is referenced 2nd cell should be:
128c2ecf20Sopenharmony_ci		0 - USB3
138c2ecf20Sopenharmony_ci		1 - PCIe0 Lane0
148c2ecf20Sopenharmony_ci		2 - ICSS2 SGMII Lane0
158c2ecf20Sopenharmony_ci	If SERDES1 is referenced 2nd cell should be:
168c2ecf20Sopenharmony_ci		0 - PCIe1 Lane0
178c2ecf20Sopenharmony_ci		1 - PCIe0 Lane1
188c2ecf20Sopenharmony_ci		2 - ICSS2 SGMII Lane1
198c2ecf20Sopenharmony_ci - power-domains: As documented by the generic PM domain bindings in
208c2ecf20Sopenharmony_ci	Documentation/devicetree/bindings/power/power_domain.txt.
218c2ecf20Sopenharmony_ci - clocks: List of clock-specifiers representing the input to the SERDES.
228c2ecf20Sopenharmony_ci	Should have 3 items representing the left input clock, external
238c2ecf20Sopenharmony_ci	reference clock and right input clock in that order.
248c2ecf20Sopenharmony_ci - clock-output-names: List of clock names for each of the clock outputs of
258c2ecf20Sopenharmony_ci	SERDES. Should have 3 items for CMU reference clock,
268c2ecf20Sopenharmony_ci	left output clock and right output clock in that order.
278c2ecf20Sopenharmony_ci - assigned-clocks: As defined in
288c2ecf20Sopenharmony_ci	Documentation/devicetree/bindings/clock/clock-bindings.txt
298c2ecf20Sopenharmony_ci - assigned-clock-parents: As defined in
308c2ecf20Sopenharmony_ci	Documentation/devicetree/bindings/clock/clock-bindings.txt
318c2ecf20Sopenharmony_ci - #clock-cells: Should be <1> to choose between the 3 output clocks.
328c2ecf20Sopenharmony_ci	Defined in Documentation/devicetree/bindings/clock/clock-bindings.txt
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci   The following macros are defined in dt-bindings/phy/phy-am654-serdes.h
358c2ecf20Sopenharmony_ci   for selecting the correct reference clock. This can be used while
368c2ecf20Sopenharmony_ci   specifying the clocks created by SERDES.
378c2ecf20Sopenharmony_ci	=> AM654_SERDES_CMU_REFCLK
388c2ecf20Sopenharmony_ci	=> AM654_SERDES_LO_REFCLK
398c2ecf20Sopenharmony_ci	=> AM654_SERDES_RO_REFCLK
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci - mux-controls: Phandle to the multiplexer that is used to select the lane
428c2ecf20Sopenharmony_ci	function. See #phy-cells above to see the multiplex values.
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ciExample:
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ciExample for SERDES0 is given below. It has 3 clock inputs;
478c2ecf20Sopenharmony_cileft input reference clock as indicated by <&k3_clks 153 4>, external
488c2ecf20Sopenharmony_cireference clock as indicated by <&k3_clks 153 1> and right input
498c2ecf20Sopenharmony_cireference clock as indicated by <&serdes1 AM654_SERDES_LO_REFCLK>. (The
508c2ecf20Sopenharmony_ciright input of SERDES0 is connected to the left output of SERDES1).
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ciSERDES0 registers 3 clock outputs as indicated in clock-output-names. The
538c2ecf20Sopenharmony_cifirst refers to the CMU reference clock, second refers to the left output
548c2ecf20Sopenharmony_cireference clock and the third refers to the right output reference clock.
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ciThe assigned-clocks and assigned-clock-parents is used here to set the
578c2ecf20Sopenharmony_ciparent of left input reference clock to MAINHSDIV_CLKOUT4 and parent of
588c2ecf20Sopenharmony_ciCMU reference clock to left input reference clock.
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ciserdes0: serdes@900000 {
618c2ecf20Sopenharmony_ci	compatible = "ti,phy-am654-serdes";
628c2ecf20Sopenharmony_ci	reg = <0x0 0x900000 0x0 0x2000>;
638c2ecf20Sopenharmony_ci	reg-names = "serdes";
648c2ecf20Sopenharmony_ci	#phy-cells = <2>;
658c2ecf20Sopenharmony_ci	power-domains = <&k3_pds 153>;
668c2ecf20Sopenharmony_ci	clocks = <&k3_clks 153 4>, <&k3_clks 153 1>,
678c2ecf20Sopenharmony_ci			<&serdes1 AM654_SERDES_LO_REFCLK>;
688c2ecf20Sopenharmony_ci	clock-output-names = "serdes0_cmu_refclk", "serdes0_lo_refclk",
698c2ecf20Sopenharmony_ci				"serdes0_ro_refclk";
708c2ecf20Sopenharmony_ci	assigned-clocks = <&k3_clks 153 4>, <&serdes0 AM654_SERDES_CMU_REFCLK>;
718c2ecf20Sopenharmony_ci	assigned-clock-parents = <&k3_clks 153 8>, <&k3_clks 153 4>;
728c2ecf20Sopenharmony_ci	ti,serdes-clk = <&serdes0_clk>;
738c2ecf20Sopenharmony_ci	mux-controls = <&serdes_mux 0>;
748c2ecf20Sopenharmony_ci	#clock-cells = <1>;
758c2ecf20Sopenharmony_ci};
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ciExample for PCIe consumer node using the SERDES PHY specifier is given below.
788c2ecf20Sopenharmony_ci&pcie0_rc {
798c2ecf20Sopenharmony_ci        num-lanes = <2>;
808c2ecf20Sopenharmony_ci        phys = <&serdes0 PHY_TYPE_PCIE 1>, <&serdes1 PHY_TYPE_PCIE 1>;
818c2ecf20Sopenharmony_ci        phy-names = "pcie-phy0", "pcie-phy1";
828c2ecf20Sopenharmony_ci};
83