developer | 53b0618 | 2019-08-22 12:26:54 +0200 | [diff] [blame] | 1 | MediaTek T-PHY binding |
| 2 | -------------------------- |
| 3 | |
| 4 | T-phy controller supports physical layer functionality for a number of |
| 5 | controllers on MediaTek SoCs, such as, USB2.0, USB3.0, PCIe, and SATA. |
| 6 | |
| 7 | Required properties (controller (parent) node): |
| 8 | - compatible : should be one of |
| 9 | "mediatek,generic-tphy-v1" |
developer | b666513 | 2020-05-02 11:35:20 +0200 | [diff] [blame] | 10 | "mediatek,generic-tphy-v2" |
developer | 23ec33f | 2023-02-17 17:04:11 +0800 | [diff] [blame] | 11 | "mediatek,mt8195-tphy" |
developer | b666513 | 2020-05-02 11:35:20 +0200 | [diff] [blame] | 12 | |
| 13 | - #address-cells: the number of cells used to represent physical |
| 14 | base addresses. |
| 15 | - #size-cells: the number of cells used to represent the size of an address. |
| 16 | - ranges: the address mapping relationship to the parent, defined with |
| 17 | - empty value: if optional 'reg' is used. |
| 18 | - non-empty value: if optional 'reg' is not used. should set |
| 19 | the child's base address to 0, the physical address |
| 20 | within parent's address space, and the length of |
| 21 | the address map. |
developer | 53b0618 | 2019-08-22 12:26:54 +0200 | [diff] [blame] | 22 | |
| 23 | Required nodes : a sub-node is required for each port the controller |
| 24 | provides. Address range information including the usual |
| 25 | 'reg' property is used inside these nodes to describe |
| 26 | the controller's topology. |
| 27 | |
| 28 | Optional properties (controller (parent) node): |
| 29 | - reg : offset and length of register shared by multiple ports, |
| 30 | exclude port's private register. |
| 31 | - mediatek,src-ref-clk-mhz : frequency of reference clock for slew rate |
| 32 | calibrate |
| 33 | - mediatek,src-coef : coefficient for slew rate calibrate, depends on |
| 34 | SoC process |
| 35 | |
| 36 | Required properties (port (child) node): |
| 37 | - reg : address and length of the register set for the port. |
developer | 53b0618 | 2019-08-22 12:26:54 +0200 | [diff] [blame] | 38 | - #phy-cells : should be 1 (See second example) |
| 39 | cell after port phandle is phy type from: |
| 40 | - PHY_TYPE_USB2 |
| 41 | - PHY_TYPE_USB3 |
| 42 | - PHY_TYPE_PCIE |
| 43 | - PHY_TYPE_SATA |
| 44 | |
developer | b666513 | 2020-05-02 11:35:20 +0200 | [diff] [blame] | 45 | Optional properties (port (child) node): |
| 46 | - clocks : a list of phandle + clock-specifier pairs, one for each |
| 47 | entry in clock-names |
| 48 | - clock-names : may contain |
| 49 | "ref": 48M reference clock for HighSpeed (digital) phy; and 26M |
| 50 | reference clock for SuperSpeed (digital) phy, sometimes is |
| 51 | 24M, 25M or 27M, depended on platform. |
| 52 | "da_ref": the reference clock of analog phy, used if the clocks |
| 53 | of analog and digital phys are separated, otherwise uses |
| 54 | "ref" clock only if needed. |
developer | 61e1496 | 2023-12-13 14:41:33 +0800 | [diff] [blame^] | 55 | - mediatek,eye-vrt : The selection of VRT reference voltage (U2 phy), |
| 56 | the value is [1, 7] |
| 57 | - mediatek,eye-term : The selection of HS_TX TERM reference voltage (U2 phy), |
| 58 | the value is [1, 7] |
| 59 | - mediatek,discth : The selection of disconnect threshold (U2 phy), |
| 60 | the value is [1, 15] |
| 61 | - mediatek,pre-emphasis : The level of pre-emphasis which used to widen |
| 62 | the eye opening and boost eye swing, |
| 63 | the value is [1, 3] |
developer | b666513 | 2020-05-02 11:35:20 +0200 | [diff] [blame] | 64 | |
developer | 53b0618 | 2019-08-22 12:26:54 +0200 | [diff] [blame] | 65 | Example: |
| 66 | |
| 67 | u3phy2: usb-phy@1a244000 { |
| 68 | compatible = "mediatek,generic-tphy-v1"; |
| 69 | reg = <0x1a244000 0x0700>; |
| 70 | #address-cells = <1>; |
| 71 | #size-cells = <1>; |
| 72 | ranges; |
| 73 | status = "disabled"; |
| 74 | |
| 75 | u2port1: usb-phy@1a244800 { |
| 76 | reg = <0x1a244800 0x0100>; |
| 77 | clocks = <&topckgen CLK_TOP_USB_PHY48M>; |
| 78 | clock-names = "ref"; |
| 79 | #phy-cells = <1>; |
| 80 | status = "okay"; |
| 81 | }; |
| 82 | |
| 83 | u3port1: usb-phy@1a244900 { |
| 84 | reg = <0x1a244900 0x0700>; |
| 85 | clocks = <&clk26m>; |
| 86 | clock-names = "ref"; |
| 87 | #phy-cells = <1>; |
| 88 | status = "okay"; |
| 89 | }; |
| 90 | }; |
| 91 | |
| 92 | Specifying phy control of devices |
| 93 | --------------------------------- |
| 94 | |
| 95 | Device nodes should specify the configuration required in their "phys" |
| 96 | property, containing a phandle to the phy port node and a device type; |
| 97 | phy-names for each port are optional. |
| 98 | |
| 99 | Example: |
| 100 | |
| 101 | #include <dt-bindings/phy/phy.h> |
| 102 | |
| 103 | usb30: usb@11270000 { |
| 104 | ... |
| 105 | phys = <&u2port0 PHY_TYPE_USB2>, <&u3port0 PHY_TYPE_USB3>; |
| 106 | phy-names = "usb2-0", "usb3-0"; |
| 107 | ... |
| 108 | }; |
developer | b666513 | 2020-05-02 11:35:20 +0200 | [diff] [blame] | 109 | |
| 110 | Layout differences of banks between TPHY V1 and V2 |
| 111 | ------------------------------------------------------------- |
| 112 | IP V1: |
| 113 | port offset bank |
| 114 | shared 0x0000 SPLLC |
| 115 | 0x0100 FMREG |
| 116 | u2 port0 0x0800 U2PHY_COM |
| 117 | u3 port0 0x0900 U3PHYD |
| 118 | 0x0a00 U3PHYD_BANK2 |
| 119 | 0x0b00 U3PHYA |
| 120 | 0x0c00 U3PHYA_DA |
| 121 | u2 port1 0x1000 U2PHY_COM |
| 122 | u3 port1 0x1100 U3PHYD |
| 123 | 0x1200 U3PHYD_BANK2 |
| 124 | 0x1300 U3PHYA |
| 125 | 0x1400 U3PHYA_DA |
| 126 | u2 port2 0x1800 U2PHY_COM |
| 127 | ... |
| 128 | |
| 129 | IP V2: |
| 130 | port offset bank |
| 131 | u2 port0 0x0000 MISC |
| 132 | 0x0100 FMREG |
| 133 | 0x0300 U2PHY_COM |
| 134 | u3 port0 0x0700 SPLLC |
| 135 | 0x0800 CHIP |
| 136 | 0x0900 U3PHYD |
| 137 | 0x0a00 U3PHYD_BANK2 |
| 138 | 0x0b00 U3PHYA |
| 139 | 0x0c00 U3PHYA_DA |
| 140 | u2 port1 0x1000 MISC |
| 141 | 0x1100 FMREG |
| 142 | 0x1300 U2PHY_COM |
| 143 | u3 port1 0x1700 SPLLC |
| 144 | 0x1800 CHIP |
| 145 | 0x1900 U3PHYD |
| 146 | 0x1a00 U3PHYD_BANK2 |
| 147 | 0x1b00 U3PHYA |
| 148 | 0x1c00 U3PHYA_DA |
| 149 | u2 port2 0x2000 MISC |
| 150 | ... |
| 151 | |
| 152 | SPLLC shared by u3 ports and FMREG shared by u2 ports on |
| 153 | TPHY V1 are put back into each port; a new bank MISC for |
| 154 | u2 ports and CHIP for u3 ports are added on TPHY V2. |