1cbdf8f50SChunfeng Yun# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2cbdf8f50SChunfeng Yun# Copyright (c) 2020 MediaTek 3cbdf8f50SChunfeng Yun%YAML 1.2 4cbdf8f50SChunfeng Yun--- 5cbdf8f50SChunfeng Yun$id: http://devicetree.org/schemas/phy/mediatek,tphy.yaml# 6cbdf8f50SChunfeng Yun$schema: http://devicetree.org/meta-schemas/core.yaml# 7cbdf8f50SChunfeng Yun 8dd3cb467SAndrew Lunntitle: MediaTek T-PHY Controller 9cbdf8f50SChunfeng Yun 10cbdf8f50SChunfeng Yunmaintainers: 11cbdf8f50SChunfeng Yun - Chunfeng Yun <chunfeng.yun@mediatek.com> 12cbdf8f50SChunfeng Yun 13cbdf8f50SChunfeng Yundescription: | 14cbdf8f50SChunfeng Yun The T-PHY controller supports physical layer functionality for a number of 15cbdf8f50SChunfeng Yun controllers on MediaTek SoCs, includes USB2.0, USB3.0, PCIe and SATA. 16cbdf8f50SChunfeng Yun 17cbdf8f50SChunfeng Yun Layout differences of banks between T-PHY V1 (mt8173/mt2701) and 18c52c90dbSChunfeng Yun T-PHY V2 (mt2712) / V3 (mt8195) when works on USB mode: 19cbdf8f50SChunfeng Yun ----------------------------------- 20cbdf8f50SChunfeng Yun Version 1: 21cbdf8f50SChunfeng Yun port offset bank 22cbdf8f50SChunfeng Yun shared 0x0000 SPLLC 23cbdf8f50SChunfeng Yun 0x0100 FMREG 24cbdf8f50SChunfeng Yun u2 port0 0x0800 U2PHY_COM 25cbdf8f50SChunfeng Yun u3 port0 0x0900 U3PHYD 26cbdf8f50SChunfeng Yun 0x0a00 U3PHYD_BANK2 27cbdf8f50SChunfeng Yun 0x0b00 U3PHYA 28cbdf8f50SChunfeng Yun 0x0c00 U3PHYA_DA 29cbdf8f50SChunfeng Yun u2 port1 0x1000 U2PHY_COM 30cbdf8f50SChunfeng Yun u3 port1 0x1100 U3PHYD 31cbdf8f50SChunfeng Yun 0x1200 U3PHYD_BANK2 32cbdf8f50SChunfeng Yun 0x1300 U3PHYA 33cbdf8f50SChunfeng Yun 0x1400 U3PHYA_DA 34cbdf8f50SChunfeng Yun u2 port2 0x1800 U2PHY_COM 35cbdf8f50SChunfeng Yun ... 36cbdf8f50SChunfeng Yun 37c52c90dbSChunfeng Yun Version 2/3: 38cbdf8f50SChunfeng Yun port offset bank 39cbdf8f50SChunfeng Yun u2 port0 0x0000 MISC 40cbdf8f50SChunfeng Yun 0x0100 FMREG 41cbdf8f50SChunfeng Yun 0x0300 U2PHY_COM 42cbdf8f50SChunfeng Yun u3 port0 0x0700 SPLLC 43cbdf8f50SChunfeng Yun 0x0800 CHIP 44cbdf8f50SChunfeng Yun 0x0900 U3PHYD 45cbdf8f50SChunfeng Yun 0x0a00 U3PHYD_BANK2 46cbdf8f50SChunfeng Yun 0x0b00 U3PHYA 47cbdf8f50SChunfeng Yun 0x0c00 U3PHYA_DA 48cbdf8f50SChunfeng Yun u2 port1 0x1000 MISC 49cbdf8f50SChunfeng Yun 0x1100 FMREG 50cbdf8f50SChunfeng Yun 0x1300 U2PHY_COM 51cbdf8f50SChunfeng Yun u3 port1 0x1700 SPLLC 52cbdf8f50SChunfeng Yun 0x1800 CHIP 53cbdf8f50SChunfeng Yun 0x1900 U3PHYD 54cbdf8f50SChunfeng Yun 0x1a00 U3PHYD_BANK2 55cbdf8f50SChunfeng Yun 0x1b00 U3PHYA 56cbdf8f50SChunfeng Yun 0x1c00 U3PHYA_DA 57cbdf8f50SChunfeng Yun u2 port2 0x2000 MISC 58cbdf8f50SChunfeng Yun ... 59cbdf8f50SChunfeng Yun 60cbdf8f50SChunfeng Yun SPLLC shared by u3 ports and FMREG shared by u2 ports on V1 are put back 61cbdf8f50SChunfeng Yun into each port; a new bank MISC for u2 ports and CHIP for u3 ports are 62c52c90dbSChunfeng Yun added on V2; the FMREG bank for slew rate calibration is not used anymore 63c52c90dbSChunfeng Yun and reserved on V3; 64cbdf8f50SChunfeng Yun 65cbdf8f50SChunfeng Yunproperties: 66cbdf8f50SChunfeng Yun $nodename: 67188a447bSEugen Hristev pattern: "^t-phy(@[0-9a-f]+)?$" 68cbdf8f50SChunfeng Yun 69cbdf8f50SChunfeng Yun compatible: 70cbdf8f50SChunfeng Yun oneOf: 71cbdf8f50SChunfeng Yun - items: 72cbdf8f50SChunfeng Yun - enum: 73cbdf8f50SChunfeng Yun - mediatek,mt2701-tphy 74cbdf8f50SChunfeng Yun - mediatek,mt7623-tphy 75cbdf8f50SChunfeng Yun - mediatek,mt7622-tphy 76cbdf8f50SChunfeng Yun - mediatek,mt8516-tphy 77cbdf8f50SChunfeng Yun - const: mediatek,generic-tphy-v1 78cbdf8f50SChunfeng Yun - items: 79cbdf8f50SChunfeng Yun - enum: 80cbdf8f50SChunfeng Yun - mediatek,mt2712-tphy 81cbdf8f50SChunfeng Yun - mediatek,mt7629-tphy 828b3c08aaSFrank Wunderlich - mediatek,mt7986-tphy 83cbdf8f50SChunfeng Yun - mediatek,mt8183-tphy 841f1b0c10SAllen-KH Cheng - mediatek,mt8186-tphy 85abb29c47SAllen-KH Cheng - mediatek,mt8192-tphy 865abaa500SFabien Parent - mediatek,mt8365-tphy 87cbdf8f50SChunfeng Yun - const: mediatek,generic-tphy-v2 88c52c90dbSChunfeng Yun - items: 89c52c90dbSChunfeng Yun - enum: 9008680588SChunfeng Yun - mediatek,mt8188-tphy 91c52c90dbSChunfeng Yun - mediatek,mt8195-tphy 92c52c90dbSChunfeng Yun - const: mediatek,generic-tphy-v3 93cbdf8f50SChunfeng Yun - const: mediatek,mt2701-u3phy 94cbdf8f50SChunfeng Yun deprecated: true 95cbdf8f50SChunfeng Yun - const: mediatek,mt2712-u3phy 96cbdf8f50SChunfeng Yun deprecated: true 97cbdf8f50SChunfeng Yun - const: mediatek,mt8173-u3phy 98cbdf8f50SChunfeng Yun 99cbdf8f50SChunfeng Yun reg: 100cbdf8f50SChunfeng Yun description: 101cbdf8f50SChunfeng Yun Register shared by multiple ports, exclude port's private register. 102cbdf8f50SChunfeng Yun It is needed for T-PHY V1, such as mt2701 and mt8173, but not for 103c52c90dbSChunfeng Yun T-PHY V2/V3, such as mt2712. 104cbdf8f50SChunfeng Yun maxItems: 1 105cbdf8f50SChunfeng Yun 106cbdf8f50SChunfeng Yun "#address-cells": 107cbdf8f50SChunfeng Yun enum: [1, 2] 108cbdf8f50SChunfeng Yun 109cbdf8f50SChunfeng Yun "#size-cells": 110cbdf8f50SChunfeng Yun enum: [1, 2] 111cbdf8f50SChunfeng Yun 112cbdf8f50SChunfeng Yun # Used with non-empty value if optional 'reg' is not provided. 113cbdf8f50SChunfeng Yun # The format of the value is an arbitrary number of triplets of 114cbdf8f50SChunfeng Yun # (child-bus-address, parent-bus-address, length). 115cbdf8f50SChunfeng Yun ranges: true 116cbdf8f50SChunfeng Yun 117cbdf8f50SChunfeng Yun mediatek,src-ref-clk-mhz: 118cbdf8f50SChunfeng Yun description: 119cbdf8f50SChunfeng Yun Frequency of reference clock for slew rate calibrate 120cbdf8f50SChunfeng Yun default: 26 121cbdf8f50SChunfeng Yun 122cbdf8f50SChunfeng Yun mediatek,src-coef: 123cbdf8f50SChunfeng Yun description: 124cbdf8f50SChunfeng Yun Coefficient for slew rate calibrate, depends on SoC process 125cbdf8f50SChunfeng Yun $ref: /schemas/types.yaml#/definitions/uint32 126cbdf8f50SChunfeng Yun default: 28 127cbdf8f50SChunfeng Yun 128cbdf8f50SChunfeng Yun# Required child node: 129cbdf8f50SChunfeng YunpatternProperties: 1305c977c69SChunfeng Yun "^(usb|pcie|sata)-phy@[0-9a-f]+$": 131cbdf8f50SChunfeng Yun type: object 132cbdf8f50SChunfeng Yun description: 133cbdf8f50SChunfeng Yun A sub-node is required for each port the controller provides. 134cbdf8f50SChunfeng Yun Address range information including the usual 'reg' property 135cbdf8f50SChunfeng Yun is used inside these nodes to describe the controller's topology. 136cbdf8f50SChunfeng Yun 137cbdf8f50SChunfeng Yun properties: 138cbdf8f50SChunfeng Yun reg: 139cbdf8f50SChunfeng Yun maxItems: 1 140cbdf8f50SChunfeng Yun 141cbdf8f50SChunfeng Yun clocks: 142cbdf8f50SChunfeng Yun minItems: 1 143cbdf8f50SChunfeng Yun items: 144cbdf8f50SChunfeng Yun - description: Reference clock, (HS is 48Mhz, SS/P is 24~27Mhz) 145cbdf8f50SChunfeng Yun - description: Reference clock of analog phy 146cbdf8f50SChunfeng Yun description: 147cbdf8f50SChunfeng Yun Uses both clocks if the clock of analog and digital phys are 148cbdf8f50SChunfeng Yun separated, otherwise uses "ref" clock only if needed. 149cbdf8f50SChunfeng Yun 150cbdf8f50SChunfeng Yun clock-names: 151cbdf8f50SChunfeng Yun minItems: 1 152cbdf8f50SChunfeng Yun items: 153cbdf8f50SChunfeng Yun - const: ref 154cbdf8f50SChunfeng Yun - const: da_ref 155cbdf8f50SChunfeng Yun 156cbdf8f50SChunfeng Yun "#phy-cells": 157cbdf8f50SChunfeng Yun const: 1 158cbdf8f50SChunfeng Yun description: | 159cbdf8f50SChunfeng Yun The cells contain the following arguments. 160cbdf8f50SChunfeng Yun 161cbdf8f50SChunfeng Yun - description: The PHY type 162cbdf8f50SChunfeng Yun enum: 163cbdf8f50SChunfeng Yun - PHY_TYPE_USB2 164cbdf8f50SChunfeng Yun - PHY_TYPE_USB3 165cbdf8f50SChunfeng Yun - PHY_TYPE_PCIE 166cbdf8f50SChunfeng Yun - PHY_TYPE_SATA 1670d14f491SChunfeng Yun - PHY_TYPE_SGMII 168cbdf8f50SChunfeng Yun 169c6d92a28SChunfeng Yun nvmem-cells: 170c6d92a28SChunfeng Yun items: 171c6d92a28SChunfeng Yun - description: internal R efuse for U2 PHY or U3/PCIe PHY 172c6d92a28SChunfeng Yun - description: rx_imp_sel efuse for U3/PCIe PHY 173c6d92a28SChunfeng Yun - description: tx_imp_sel efuse for U3/PCIe PHY 174c6d92a28SChunfeng Yun description: | 175c6d92a28SChunfeng Yun Phandles to nvmem cell that contains the efuse data; 176c6d92a28SChunfeng Yun Available only for U2 PHY or U3/PCIe PHY of version 2/3, these 177c6d92a28SChunfeng Yun three items should be provided at the same time for U3/PCIe PHY, 178c6d92a28SChunfeng Yun when use software to load efuse; 179c6d92a28SChunfeng Yun If unspecified, will use hardware auto-load efuse. 180c6d92a28SChunfeng Yun 181c6d92a28SChunfeng Yun nvmem-cell-names: 182c6d92a28SChunfeng Yun items: 183c6d92a28SChunfeng Yun - const: intr 184c6d92a28SChunfeng Yun - const: rx_imp 185c6d92a28SChunfeng Yun - const: tx_imp 186c6d92a28SChunfeng Yun 187cbdf8f50SChunfeng Yun # The following optional vendor properties are only for debug or HQA test 188cbdf8f50SChunfeng Yun mediatek,eye-src: 189cbdf8f50SChunfeng Yun description: 190cbdf8f50SChunfeng Yun The value of slew rate calibrate (U2 phy) 191cbdf8f50SChunfeng Yun $ref: /schemas/types.yaml#/definitions/uint32 192cbdf8f50SChunfeng Yun minimum: 1 193cbdf8f50SChunfeng Yun maximum: 7 194cbdf8f50SChunfeng Yun 195cbdf8f50SChunfeng Yun mediatek,eye-vrt: 196cbdf8f50SChunfeng Yun description: 197cbdf8f50SChunfeng Yun The selection of VRT reference voltage (U2 phy) 198cbdf8f50SChunfeng Yun $ref: /schemas/types.yaml#/definitions/uint32 199cbdf8f50SChunfeng Yun minimum: 1 200cbdf8f50SChunfeng Yun maximum: 7 201cbdf8f50SChunfeng Yun 202cbdf8f50SChunfeng Yun mediatek,eye-term: 203cbdf8f50SChunfeng Yun description: 204cbdf8f50SChunfeng Yun The selection of HS_TX TERM reference voltage (U2 phy) 205cbdf8f50SChunfeng Yun $ref: /schemas/types.yaml#/definitions/uint32 206cbdf8f50SChunfeng Yun minimum: 1 207cbdf8f50SChunfeng Yun maximum: 7 208cbdf8f50SChunfeng Yun 209cbdf8f50SChunfeng Yun mediatek,intr: 210cbdf8f50SChunfeng Yun description: 211cbdf8f50SChunfeng Yun The selection of internal resistor (U2 phy) 212cbdf8f50SChunfeng Yun $ref: /schemas/types.yaml#/definitions/uint32 213cbdf8f50SChunfeng Yun minimum: 1 214cbdf8f50SChunfeng Yun maximum: 31 215cbdf8f50SChunfeng Yun 216cbdf8f50SChunfeng Yun mediatek,discth: 217cbdf8f50SChunfeng Yun description: 218cbdf8f50SChunfeng Yun The selection of disconnect threshold (U2 phy) 219cbdf8f50SChunfeng Yun $ref: /schemas/types.yaml#/definitions/uint32 220cbdf8f50SChunfeng Yun minimum: 1 221cbdf8f50SChunfeng Yun maximum: 15 222cbdf8f50SChunfeng Yun 22354511f20SChunfeng Yun mediatek,pre-emphasis: 22454511f20SChunfeng Yun description: 22554511f20SChunfeng Yun The level of pre-emphasis which used to widen the eye opening and 22654511f20SChunfeng Yun boost eye swing, the unit step is about 4.16% increment; e.g. the 22754511f20SChunfeng Yun level 1 means amplitude increases about 4.16%, the level 2 is about 22854511f20SChunfeng Yun 8.3% etc. (U2 phy) 22954511f20SChunfeng Yun $ref: /schemas/types.yaml#/definitions/uint32 23054511f20SChunfeng Yun minimum: 1 23154511f20SChunfeng Yun maximum: 3 23254511f20SChunfeng Yun 233cbdf8f50SChunfeng Yun mediatek,bc12: 234cbdf8f50SChunfeng Yun description: 235cbdf8f50SChunfeng Yun Specify the flag to enable BC1.2 if support it 236cbdf8f50SChunfeng Yun type: boolean 237cbdf8f50SChunfeng Yun 238cc230a4cSChunfeng Yun mediatek,force-mode: 239cc230a4cSChunfeng Yun description: 240cc230a4cSChunfeng Yun The force mode is used to manually switch the shared phy mode between 241cc230a4cSChunfeng Yun USB3 and PCIe, when USB3 phy type is selected by the consumer, and 242cc230a4cSChunfeng Yun force-mode is set, will cause phy's power and pipe toggled and force 243*a7fcc232SYu-Chun Lin phy as USB3 mode which switched from default PCIe mode. But prefer to 244cc230a4cSChunfeng Yun use the property "mediatek,syscon-type" for newer SoCs that support it. 245cc230a4cSChunfeng Yun type: boolean 246cc230a4cSChunfeng Yun 247c01608b3SChunfeng Yun mediatek,syscon-type: 248c01608b3SChunfeng Yun $ref: /schemas/types.yaml#/definitions/phandle-array 249c01608b3SChunfeng Yun maxItems: 1 250c01608b3SChunfeng Yun description: 251c01608b3SChunfeng Yun A phandle to syscon used to access the register of type switch, 252c01608b3SChunfeng Yun the field should always be 3 cells long. 253c01608b3SChunfeng Yun items: 254c01608b3SChunfeng Yun items: 255c01608b3SChunfeng Yun - description: 256c01608b3SChunfeng Yun The first cell represents a phandle to syscon 257c01608b3SChunfeng Yun - description: 258c01608b3SChunfeng Yun The second cell represents the register offset 259c01608b3SChunfeng Yun - description: 260c01608b3SChunfeng Yun The third cell represents the index of config segment 261c01608b3SChunfeng Yun enum: [0, 1, 2, 3] 262c01608b3SChunfeng Yun 263cbdf8f50SChunfeng Yun required: 264cbdf8f50SChunfeng Yun - reg 265cbdf8f50SChunfeng Yun - "#phy-cells" 266cbdf8f50SChunfeng Yun 267cbdf8f50SChunfeng Yun additionalProperties: false 268cbdf8f50SChunfeng Yun 269cbdf8f50SChunfeng Yunrequired: 270cbdf8f50SChunfeng Yun - compatible 271cbdf8f50SChunfeng Yun - "#address-cells" 272cbdf8f50SChunfeng Yun - "#size-cells" 273cbdf8f50SChunfeng Yun - ranges 274cbdf8f50SChunfeng Yun 275cbdf8f50SChunfeng YunadditionalProperties: false 276cbdf8f50SChunfeng Yun 277cbdf8f50SChunfeng Yunexamples: 278cbdf8f50SChunfeng Yun - | 279cbdf8f50SChunfeng Yun #include <dt-bindings/clock/mt8173-clk.h> 280cbdf8f50SChunfeng Yun #include <dt-bindings/interrupt-controller/arm-gic.h> 281cbdf8f50SChunfeng Yun #include <dt-bindings/interrupt-controller/irq.h> 282cbdf8f50SChunfeng Yun #include <dt-bindings/phy/phy.h> 283cbdf8f50SChunfeng Yun usb@11271000 { 284cbdf8f50SChunfeng Yun compatible = "mediatek,mt8173-mtu3", "mediatek,mtu3"; 285cbdf8f50SChunfeng Yun reg = <0x11271000 0x3000>, <0x11280700 0x0100>; 286cbdf8f50SChunfeng Yun reg-names = "mac", "ippc"; 287cbdf8f50SChunfeng Yun phys = <&u2port0 PHY_TYPE_USB2>, 288cbdf8f50SChunfeng Yun <&u3port0 PHY_TYPE_USB3>, 289cbdf8f50SChunfeng Yun <&u2port1 PHY_TYPE_USB2>; 290cbdf8f50SChunfeng Yun interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>; 291cbdf8f50SChunfeng Yun clocks = <&topckgen CLK_TOP_USB30_SEL>; 292cbdf8f50SChunfeng Yun clock-names = "sys_ck"; 293cbdf8f50SChunfeng Yun }; 294cbdf8f50SChunfeng Yun 295cbdf8f50SChunfeng Yun t-phy@11290000 { 296cbdf8f50SChunfeng Yun compatible = "mediatek,mt8173-u3phy"; 297cbdf8f50SChunfeng Yun reg = <0x11290000 0x800>; 298cbdf8f50SChunfeng Yun #address-cells = <1>; 299cbdf8f50SChunfeng Yun #size-cells = <1>; 300cbdf8f50SChunfeng Yun ranges; 301cbdf8f50SChunfeng Yun 302cbdf8f50SChunfeng Yun u2port0: usb-phy@11290800 { 303cbdf8f50SChunfeng Yun reg = <0x11290800 0x100>; 304cbdf8f50SChunfeng Yun clocks = <&apmixedsys CLK_APMIXED_REF2USB_TX>, <&clk48m>; 305cbdf8f50SChunfeng Yun clock-names = "ref", "da_ref"; 306cbdf8f50SChunfeng Yun #phy-cells = <1>; 307cbdf8f50SChunfeng Yun }; 308cbdf8f50SChunfeng Yun 309cbdf8f50SChunfeng Yun u3port0: usb-phy@11290900 { 310cbdf8f50SChunfeng Yun reg = <0x11290900 0x700>; 311cbdf8f50SChunfeng Yun clocks = <&clk26m>; 312cbdf8f50SChunfeng Yun clock-names = "ref"; 313cbdf8f50SChunfeng Yun #phy-cells = <1>; 314cbdf8f50SChunfeng Yun }; 315cbdf8f50SChunfeng Yun 316cbdf8f50SChunfeng Yun u2port1: usb-phy@11291000 { 317cbdf8f50SChunfeng Yun reg = <0x11291000 0x100>; 318cbdf8f50SChunfeng Yun #phy-cells = <1>; 319cbdf8f50SChunfeng Yun }; 320cbdf8f50SChunfeng Yun }; 321cbdf8f50SChunfeng Yun 322cbdf8f50SChunfeng Yun... 323