18c2ecf20Sopenharmony_ciSTMicroelectronics STi MIPHY28LP PHY binding 28c2ecf20Sopenharmony_ci============================================ 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ciThis binding describes a miphy device that is used to control PHY hardware 58c2ecf20Sopenharmony_cifor SATA, PCIe or USB3. 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciRequired properties (controller (parent) node): 88c2ecf20Sopenharmony_ci- compatible : Should be "st,miphy28lp-phy". 98c2ecf20Sopenharmony_ci- st,syscfg : Should be a phandle of the system configuration register group 108c2ecf20Sopenharmony_ci which contain the SATA, PCIe or USB3 mode setting bits. 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ciRequired nodes : A sub-node is required for each channel the controller 138c2ecf20Sopenharmony_ci provides. Address range information including the usual 148c2ecf20Sopenharmony_ci 'reg' and 'reg-names' properties are used inside these 158c2ecf20Sopenharmony_ci nodes to describe the controller's topology. These nodes 168c2ecf20Sopenharmony_ci are translated by the driver's .xlate() function. 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ciRequired properties (port (child) node): 198c2ecf20Sopenharmony_ci- #phy-cells : Should be 1 (See second example) 208c2ecf20Sopenharmony_ci Cell after port phandle is device type from: 218c2ecf20Sopenharmony_ci - PHY_TYPE_SATA 228c2ecf20Sopenharmony_ci - PHY_TYPE_PCI 238c2ecf20Sopenharmony_ci - PHY_TYPE_USB3 248c2ecf20Sopenharmony_ci- reg : Address and length of the register set for the device. 258c2ecf20Sopenharmony_ci- reg-names : The names of the register addresses corresponding to the registers 268c2ecf20Sopenharmony_ci filled in "reg". It can also contain the offset of the system configuration 278c2ecf20Sopenharmony_ci registers used as glue-logic to setup the device for SATA/PCIe or USB3 288c2ecf20Sopenharmony_ci devices. 298c2ecf20Sopenharmony_ci- st,syscfg : Offset of the parent configuration register. 308c2ecf20Sopenharmony_ci- resets : phandle to the parent reset controller. 318c2ecf20Sopenharmony_ci- reset-names : Associated name must be "miphy-sw-rst". 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ciOptional properties (port (child) node): 348c2ecf20Sopenharmony_ci- st,osc-rdy : to check the MIPHY0_OSC_RDY status in the glue-logic. This 358c2ecf20Sopenharmony_ci is not available in all the MiPHY. For example, for STiH407, only the 368c2ecf20Sopenharmony_ci MiPHY0 has this bit. 378c2ecf20Sopenharmony_ci- st,osc-force-ext : to select the external oscillator. This can change from 388c2ecf20Sopenharmony_ci different MiPHY inside the same SoC. 398c2ecf20Sopenharmony_ci- st,sata_gen : to select which SATA_SPDMODE has to be set in the SATA system config 408c2ecf20Sopenharmony_ci register. 418c2ecf20Sopenharmony_ci- st,px_rx_pol_inv : to invert polarity of RXn/RXp (respectively negative line and positive 428c2ecf20Sopenharmony_ci line). 438c2ecf20Sopenharmony_ci- st,scc-on : enable ssc to reduce effects of EMI (only for sata or PCIe). 448c2ecf20Sopenharmony_ci- st,tx-impedance-comp : to compensate tx impedance avoiding out of range values. 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ciexample: 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci miphy28lp_phy: miphy28lp@9b22000 { 498c2ecf20Sopenharmony_ci compatible = "st,miphy28lp-phy"; 508c2ecf20Sopenharmony_ci st,syscfg = <&syscfg_core>; 518c2ecf20Sopenharmony_ci #address-cells = <1>; 528c2ecf20Sopenharmony_ci #size-cells = <1>; 538c2ecf20Sopenharmony_ci ranges; 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci phy_port0: port@9b22000 { 568c2ecf20Sopenharmony_ci reg = <0x9b22000 0xff>, 578c2ecf20Sopenharmony_ci <0x9b09000 0xff>, 588c2ecf20Sopenharmony_ci <0x9b04000 0xff>; 598c2ecf20Sopenharmony_ci reg-names = "sata-up", 608c2ecf20Sopenharmony_ci "pcie-up", 618c2ecf20Sopenharmony_ci "pipew"; 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci st,syscfg = <0x114 0x818 0xe0 0xec>; 648c2ecf20Sopenharmony_ci #phy-cells = <1>; 658c2ecf20Sopenharmony_ci st,osc-rdy; 668c2ecf20Sopenharmony_ci reset-names = "miphy-sw-rst"; 678c2ecf20Sopenharmony_ci resets = <&softreset STIH407_MIPHY0_SOFTRESET>; 688c2ecf20Sopenharmony_ci }; 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci phy_port1: port@9b2a000 { 718c2ecf20Sopenharmony_ci reg = <0x9b2a000 0xff>, 728c2ecf20Sopenharmony_ci <0x9b19000 0xff>, 738c2ecf20Sopenharmony_ci <0x9b14000 0xff>; 748c2ecf20Sopenharmony_ci reg-names = "sata-up", 758c2ecf20Sopenharmony_ci "pcie-up", 768c2ecf20Sopenharmony_ci "pipew"; 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci st,syscfg = <0x118 0x81c 0xe4 0xf0>; 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci #phy-cells = <1>; 818c2ecf20Sopenharmony_ci st,osc-force-ext; 828c2ecf20Sopenharmony_ci reset-names = "miphy-sw-rst"; 838c2ecf20Sopenharmony_ci resets = <&softreset STIH407_MIPHY1_SOFTRESET>; 848c2ecf20Sopenharmony_ci }; 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci phy_port2: port@8f95000 { 878c2ecf20Sopenharmony_ci reg = <0x8f95000 0xff>, 888c2ecf20Sopenharmony_ci <0x8f90000 0xff>; 898c2ecf20Sopenharmony_ci reg-names = "pipew", 908c2ecf20Sopenharmony_ci "usb3-up"; 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_ci st,syscfg = <0x11c 0x820>; 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci #phy-cells = <1>; 958c2ecf20Sopenharmony_ci reset-names = "miphy-sw-rst"; 968c2ecf20Sopenharmony_ci resets = <&softreset STIH407_MIPHY2_SOFTRESET>; 978c2ecf20Sopenharmony_ci }; 988c2ecf20Sopenharmony_ci }; 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ciSpecifying phy control of devices 1028c2ecf20Sopenharmony_ci================================= 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ciDevice nodes should specify the configuration required in their "phys" 1058c2ecf20Sopenharmony_ciproperty, containing a phandle to the miphy device node and an index 1068c2ecf20Sopenharmony_cispecifying which configuration to use, as described in phy-bindings.txt. 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_ciexample: 1098c2ecf20Sopenharmony_ci sata0: sata@9b20000 { 1108c2ecf20Sopenharmony_ci ... 1118c2ecf20Sopenharmony_ci phys = <&phy_port0 PHY_TYPE_SATA>; 1128c2ecf20Sopenharmony_ci ... 1138c2ecf20Sopenharmony_ci }; 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ciMacro definitions for the supported miphy configuration can be found in: 1168c2ecf20Sopenharmony_ci 1178c2ecf20Sopenharmony_ciinclude/dt-bindings/phy/phy.h 118