18c2ecf20Sopenharmony_ciSTMicroelectronics STi MIPHY365x PHY binding 28c2ecf20Sopenharmony_ci============================================ 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ciThis binding describes a miphy device that is used to control PHY hardware 58c2ecf20Sopenharmony_cifor SATA and PCIe. 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciRequired properties (controller (parent) node): 88c2ecf20Sopenharmony_ci- compatible : Should be "st,miphy365x-phy" 98c2ecf20Sopenharmony_ci- st,syscfg : Phandle / integer array property. Phandle of sysconfig group 108c2ecf20Sopenharmony_ci containing the miphy registers and integer array should contain 118c2ecf20Sopenharmony_ci an entry for each port sub-node, specifying the control 128c2ecf20Sopenharmony_ci register offset inside the sysconfig group. 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ciRequired nodes : A sub-node is required for each channel the controller 158c2ecf20Sopenharmony_ci provides. Address range information including the usual 168c2ecf20Sopenharmony_ci 'reg' and 'reg-names' properties are used inside these 178c2ecf20Sopenharmony_ci nodes to describe the controller's topology. These nodes 188c2ecf20Sopenharmony_ci are translated by the driver's .xlate() function. 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ciRequired properties (port (child) node): 218c2ecf20Sopenharmony_ci- #phy-cells : Should be 1 (See second example) 228c2ecf20Sopenharmony_ci Cell after port phandle is device type from: 238c2ecf20Sopenharmony_ci - PHY_TYPE_SATA 248c2ecf20Sopenharmony_ci - PHY_TYPE_PCI 258c2ecf20Sopenharmony_ci- reg : Address and length of register sets for each device in 268c2ecf20Sopenharmony_ci "reg-names" 278c2ecf20Sopenharmony_ci- reg-names : The names of the register addresses corresponding to the 288c2ecf20Sopenharmony_ci registers filled in "reg": 298c2ecf20Sopenharmony_ci - sata: For SATA devices 308c2ecf20Sopenharmony_ci - pcie: For PCIe devices 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ciOptional properties (port (child) node): 338c2ecf20Sopenharmony_ci- st,sata-gen : Generation of locally attached SATA IP. Expected values 348c2ecf20Sopenharmony_ci are {1,2,3). If not supplied generation 1 hardware will 358c2ecf20Sopenharmony_ci be expected 368c2ecf20Sopenharmony_ci- st,pcie-tx-pol-inv : Bool property to invert the polarity PCIe Tx (Txn/Txp) 378c2ecf20Sopenharmony_ci- st,sata-tx-pol-inv : Bool property to invert the polarity SATA Tx (Txn/Txp) 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ciExample: 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci miphy365x_phy: miphy365x@fe382000 { 428c2ecf20Sopenharmony_ci compatible = "st,miphy365x-phy"; 438c2ecf20Sopenharmony_ci st,syscfg = <&syscfg_rear 0x824 0x828>; 448c2ecf20Sopenharmony_ci #address-cells = <1>; 458c2ecf20Sopenharmony_ci #size-cells = <1>; 468c2ecf20Sopenharmony_ci ranges; 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci phy_port0: port@fe382000 { 498c2ecf20Sopenharmony_ci reg = <0xfe382000 0x100>, <0xfe394000 0x100>; 508c2ecf20Sopenharmony_ci reg-names = "sata", "pcie"; 518c2ecf20Sopenharmony_ci #phy-cells = <1>; 528c2ecf20Sopenharmony_ci st,sata-gen = <3>; 538c2ecf20Sopenharmony_ci }; 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci phy_port1: port@fe38a000 { 568c2ecf20Sopenharmony_ci reg = <0xfe38a000 0x100>, <0xfe804000 0x100>;; 578c2ecf20Sopenharmony_ci reg-names = "sata", "pcie", "syscfg"; 588c2ecf20Sopenharmony_ci #phy-cells = <1>; 598c2ecf20Sopenharmony_ci st,pcie-tx-pol-inv; 608c2ecf20Sopenharmony_ci }; 618c2ecf20Sopenharmony_ci }; 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ciSpecifying phy control of devices 648c2ecf20Sopenharmony_ci================================= 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ciDevice nodes should specify the configuration required in their "phys" 678c2ecf20Sopenharmony_ciproperty, containing a phandle to the phy port node and a device type. 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ciExample: 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci#include <dt-bindings/phy/phy.h> 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci sata0: sata@fe380000 { 748c2ecf20Sopenharmony_ci ... 758c2ecf20Sopenharmony_ci phys = <&phy_port0 PHY_TYPE_SATA>; 768c2ecf20Sopenharmony_ci ... 778c2ecf20Sopenharmony_ci }; 78