1*c66ec88fSEmmanuel VadotTI AM654 SERDES 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotRequired properties: 4*c66ec88fSEmmanuel Vadot - compatible: Should be "ti,phy-am654-serdes" 5*c66ec88fSEmmanuel Vadot - reg : Address and length of the register set for the device. 6*c66ec88fSEmmanuel Vadot - #phy-cells: determine the number of cells that should be given in the 7*c66ec88fSEmmanuel Vadot phandle while referencing this phy. Should be "2". The 1st cell 8*c66ec88fSEmmanuel Vadot corresponds to the phy type (should be one of the types specified in 9*c66ec88fSEmmanuel Vadot include/dt-bindings/phy/phy.h) and the 2nd cell should be the serdes 10*c66ec88fSEmmanuel Vadot lane function. 11*c66ec88fSEmmanuel Vadot If SERDES0 is referenced 2nd cell should be: 12*c66ec88fSEmmanuel Vadot 0 - USB3 13*c66ec88fSEmmanuel Vadot 1 - PCIe0 Lane0 14*c66ec88fSEmmanuel Vadot 2 - ICSS2 SGMII Lane0 15*c66ec88fSEmmanuel Vadot If SERDES1 is referenced 2nd cell should be: 16*c66ec88fSEmmanuel Vadot 0 - PCIe1 Lane0 17*c66ec88fSEmmanuel Vadot 1 - PCIe0 Lane1 18*c66ec88fSEmmanuel Vadot 2 - ICSS2 SGMII Lane1 19*c66ec88fSEmmanuel Vadot - power-domains: As documented by the generic PM domain bindings in 20*c66ec88fSEmmanuel Vadot Documentation/devicetree/bindings/power/power_domain.txt. 21*c66ec88fSEmmanuel Vadot - clocks: List of clock-specifiers representing the input to the SERDES. 22*c66ec88fSEmmanuel Vadot Should have 3 items representing the left input clock, external 23*c66ec88fSEmmanuel Vadot reference clock and right input clock in that order. 24*c66ec88fSEmmanuel Vadot - clock-output-names: List of clock names for each of the clock outputs of 25*c66ec88fSEmmanuel Vadot SERDES. Should have 3 items for CMU reference clock, 26*c66ec88fSEmmanuel Vadot left output clock and right output clock in that order. 27*c66ec88fSEmmanuel Vadot - assigned-clocks: As defined in 28*c66ec88fSEmmanuel Vadot Documentation/devicetree/bindings/clock/clock-bindings.txt 29*c66ec88fSEmmanuel Vadot - assigned-clock-parents: As defined in 30*c66ec88fSEmmanuel Vadot Documentation/devicetree/bindings/clock/clock-bindings.txt 31*c66ec88fSEmmanuel Vadot - #clock-cells: Should be <1> to choose between the 3 output clocks. 32*c66ec88fSEmmanuel Vadot Defined in Documentation/devicetree/bindings/clock/clock-bindings.txt 33*c66ec88fSEmmanuel Vadot 34*c66ec88fSEmmanuel Vadot The following macros are defined in dt-bindings/phy/phy-am654-serdes.h 35*c66ec88fSEmmanuel Vadot for selecting the correct reference clock. This can be used while 36*c66ec88fSEmmanuel Vadot specifying the clocks created by SERDES. 37*c66ec88fSEmmanuel Vadot => AM654_SERDES_CMU_REFCLK 38*c66ec88fSEmmanuel Vadot => AM654_SERDES_LO_REFCLK 39*c66ec88fSEmmanuel Vadot => AM654_SERDES_RO_REFCLK 40*c66ec88fSEmmanuel Vadot 41*c66ec88fSEmmanuel Vadot - mux-controls: Phandle to the multiplexer that is used to select the lane 42*c66ec88fSEmmanuel Vadot function. See #phy-cells above to see the multiplex values. 43*c66ec88fSEmmanuel Vadot 44*c66ec88fSEmmanuel VadotExample: 45*c66ec88fSEmmanuel Vadot 46*c66ec88fSEmmanuel VadotExample for SERDES0 is given below. It has 3 clock inputs; 47*c66ec88fSEmmanuel Vadotleft input reference clock as indicated by <&k3_clks 153 4>, external 48*c66ec88fSEmmanuel Vadotreference clock as indicated by <&k3_clks 153 1> and right input 49*c66ec88fSEmmanuel Vadotreference clock as indicated by <&serdes1 AM654_SERDES_LO_REFCLK>. (The 50*c66ec88fSEmmanuel Vadotright input of SERDES0 is connected to the left output of SERDES1). 51*c66ec88fSEmmanuel Vadot 52*c66ec88fSEmmanuel VadotSERDES0 registers 3 clock outputs as indicated in clock-output-names. The 53*c66ec88fSEmmanuel Vadotfirst refers to the CMU reference clock, second refers to the left output 54*c66ec88fSEmmanuel Vadotreference clock and the third refers to the right output reference clock. 55*c66ec88fSEmmanuel Vadot 56*c66ec88fSEmmanuel VadotThe assigned-clocks and assigned-clock-parents is used here to set the 57*c66ec88fSEmmanuel Vadotparent of left input reference clock to MAINHSDIV_CLKOUT4 and parent of 58*c66ec88fSEmmanuel VadotCMU reference clock to left input reference clock. 59*c66ec88fSEmmanuel Vadot 60*c66ec88fSEmmanuel Vadotserdes0: serdes@900000 { 61*c66ec88fSEmmanuel Vadot compatible = "ti,phy-am654-serdes"; 62*c66ec88fSEmmanuel Vadot reg = <0x0 0x900000 0x0 0x2000>; 63*c66ec88fSEmmanuel Vadot reg-names = "serdes"; 64*c66ec88fSEmmanuel Vadot #phy-cells = <2>; 65*c66ec88fSEmmanuel Vadot power-domains = <&k3_pds 153>; 66*c66ec88fSEmmanuel Vadot clocks = <&k3_clks 153 4>, <&k3_clks 153 1>, 67*c66ec88fSEmmanuel Vadot <&serdes1 AM654_SERDES_LO_REFCLK>; 68*c66ec88fSEmmanuel Vadot clock-output-names = "serdes0_cmu_refclk", "serdes0_lo_refclk", 69*c66ec88fSEmmanuel Vadot "serdes0_ro_refclk"; 70*c66ec88fSEmmanuel Vadot assigned-clocks = <&k3_clks 153 4>, <&serdes0 AM654_SERDES_CMU_REFCLK>; 71*c66ec88fSEmmanuel Vadot assigned-clock-parents = <&k3_clks 153 8>, <&k3_clks 153 4>; 72*c66ec88fSEmmanuel Vadot ti,serdes-clk = <&serdes0_clk>; 73*c66ec88fSEmmanuel Vadot mux-controls = <&serdes_mux 0>; 74*c66ec88fSEmmanuel Vadot #clock-cells = <1>; 75*c66ec88fSEmmanuel Vadot}; 76*c66ec88fSEmmanuel Vadot 77*c66ec88fSEmmanuel VadotExample for PCIe consumer node using the SERDES PHY specifier is given below. 78*c66ec88fSEmmanuel Vadot&pcie0_rc { 79*c66ec88fSEmmanuel Vadot num-lanes = <2>; 80*c66ec88fSEmmanuel Vadot phys = <&serdes0 PHY_TYPE_PCIE 1>, <&serdes1 PHY_TYPE_PCIE 1>; 81*c66ec88fSEmmanuel Vadot phy-names = "pcie-phy0", "pcie-phy1"; 82*c66ec88fSEmmanuel Vadot}; 83