15def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 25def4c47SEmmanuel Vadot# Copyright (c) 2020 MediaTek 35def4c47SEmmanuel Vadot%YAML 1.2 45def4c47SEmmanuel Vadot--- 55def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/phy/mediatek,tphy.yaml# 65def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 75def4c47SEmmanuel Vadot 87ef62cebSEmmanuel Vadottitle: MediaTek T-PHY Controller 95def4c47SEmmanuel Vadot 105def4c47SEmmanuel Vadotmaintainers: 115def4c47SEmmanuel Vadot - Chunfeng Yun <chunfeng.yun@mediatek.com> 125def4c47SEmmanuel Vadot 135def4c47SEmmanuel Vadotdescription: | 145def4c47SEmmanuel Vadot The T-PHY controller supports physical layer functionality for a number of 155def4c47SEmmanuel Vadot controllers on MediaTek SoCs, includes USB2.0, USB3.0, PCIe and SATA. 165def4c47SEmmanuel Vadot 175def4c47SEmmanuel Vadot Layout differences of banks between T-PHY V1 (mt8173/mt2701) and 18354d7675SEmmanuel Vadot T-PHY V2 (mt2712) / V3 (mt8195) when works on USB mode: 195def4c47SEmmanuel Vadot ----------------------------------- 205def4c47SEmmanuel Vadot Version 1: 215def4c47SEmmanuel Vadot port offset bank 225def4c47SEmmanuel Vadot shared 0x0000 SPLLC 235def4c47SEmmanuel Vadot 0x0100 FMREG 245def4c47SEmmanuel Vadot u2 port0 0x0800 U2PHY_COM 255def4c47SEmmanuel Vadot u3 port0 0x0900 U3PHYD 265def4c47SEmmanuel Vadot 0x0a00 U3PHYD_BANK2 275def4c47SEmmanuel Vadot 0x0b00 U3PHYA 285def4c47SEmmanuel Vadot 0x0c00 U3PHYA_DA 295def4c47SEmmanuel Vadot u2 port1 0x1000 U2PHY_COM 305def4c47SEmmanuel Vadot u3 port1 0x1100 U3PHYD 315def4c47SEmmanuel Vadot 0x1200 U3PHYD_BANK2 325def4c47SEmmanuel Vadot 0x1300 U3PHYA 335def4c47SEmmanuel Vadot 0x1400 U3PHYA_DA 345def4c47SEmmanuel Vadot u2 port2 0x1800 U2PHY_COM 355def4c47SEmmanuel Vadot ... 365def4c47SEmmanuel Vadot 37354d7675SEmmanuel Vadot Version 2/3: 385def4c47SEmmanuel Vadot port offset bank 395def4c47SEmmanuel Vadot u2 port0 0x0000 MISC 405def4c47SEmmanuel Vadot 0x0100 FMREG 415def4c47SEmmanuel Vadot 0x0300 U2PHY_COM 425def4c47SEmmanuel Vadot u3 port0 0x0700 SPLLC 435def4c47SEmmanuel Vadot 0x0800 CHIP 445def4c47SEmmanuel Vadot 0x0900 U3PHYD 455def4c47SEmmanuel Vadot 0x0a00 U3PHYD_BANK2 465def4c47SEmmanuel Vadot 0x0b00 U3PHYA 475def4c47SEmmanuel Vadot 0x0c00 U3PHYA_DA 485def4c47SEmmanuel Vadot u2 port1 0x1000 MISC 495def4c47SEmmanuel Vadot 0x1100 FMREG 505def4c47SEmmanuel Vadot 0x1300 U2PHY_COM 515def4c47SEmmanuel Vadot u3 port1 0x1700 SPLLC 525def4c47SEmmanuel Vadot 0x1800 CHIP 535def4c47SEmmanuel Vadot 0x1900 U3PHYD 545def4c47SEmmanuel Vadot 0x1a00 U3PHYD_BANK2 555def4c47SEmmanuel Vadot 0x1b00 U3PHYA 565def4c47SEmmanuel Vadot 0x1c00 U3PHYA_DA 575def4c47SEmmanuel Vadot u2 port2 0x2000 MISC 585def4c47SEmmanuel Vadot ... 595def4c47SEmmanuel Vadot 605def4c47SEmmanuel Vadot SPLLC shared by u3 ports and FMREG shared by u2 ports on V1 are put back 615def4c47SEmmanuel Vadot into each port; a new bank MISC for u2 ports and CHIP for u3 ports are 62354d7675SEmmanuel Vadot added on V2; the FMREG bank for slew rate calibration is not used anymore 63354d7675SEmmanuel Vadot and reserved on V3; 645def4c47SEmmanuel Vadot 655def4c47SEmmanuel Vadotproperties: 665def4c47SEmmanuel Vadot $nodename: 67aa1a8ff2SEmmanuel Vadot pattern: "^t-phy(@[0-9a-f]+)?$" 685def4c47SEmmanuel Vadot 695def4c47SEmmanuel Vadot compatible: 705def4c47SEmmanuel Vadot oneOf: 715def4c47SEmmanuel Vadot - items: 725def4c47SEmmanuel Vadot - enum: 735def4c47SEmmanuel Vadot - mediatek,mt2701-tphy 745def4c47SEmmanuel Vadot - mediatek,mt7623-tphy 755def4c47SEmmanuel Vadot - mediatek,mt7622-tphy 765def4c47SEmmanuel Vadot - mediatek,mt8516-tphy 775def4c47SEmmanuel Vadot - const: mediatek,generic-tphy-v1 785def4c47SEmmanuel Vadot - items: 795def4c47SEmmanuel Vadot - enum: 805def4c47SEmmanuel Vadot - mediatek,mt2712-tphy 815def4c47SEmmanuel Vadot - mediatek,mt7629-tphy 82cb7aa33aSEmmanuel Vadot - mediatek,mt7986-tphy 835def4c47SEmmanuel Vadot - mediatek,mt8183-tphy 84c9ccf3a3SEmmanuel Vadot - mediatek,mt8186-tphy 85c9ccf3a3SEmmanuel Vadot - mediatek,mt8192-tphy 86b97ee269SEmmanuel Vadot - mediatek,mt8365-tphy 875def4c47SEmmanuel Vadot - const: mediatek,generic-tphy-v2 88354d7675SEmmanuel Vadot - items: 89354d7675SEmmanuel Vadot - enum: 90b97ee269SEmmanuel Vadot - mediatek,mt8188-tphy 91354d7675SEmmanuel Vadot - mediatek,mt8195-tphy 92354d7675SEmmanuel Vadot - const: mediatek,generic-tphy-v3 935def4c47SEmmanuel Vadot - const: mediatek,mt2701-u3phy 945def4c47SEmmanuel Vadot deprecated: true 955def4c47SEmmanuel Vadot - const: mediatek,mt2712-u3phy 965def4c47SEmmanuel Vadot deprecated: true 975def4c47SEmmanuel Vadot - const: mediatek,mt8173-u3phy 985def4c47SEmmanuel Vadot 995def4c47SEmmanuel Vadot reg: 1005def4c47SEmmanuel Vadot description: 1015def4c47SEmmanuel Vadot Register shared by multiple ports, exclude port's private register. 1025def4c47SEmmanuel Vadot It is needed for T-PHY V1, such as mt2701 and mt8173, but not for 103354d7675SEmmanuel Vadot T-PHY V2/V3, such as mt2712. 1045def4c47SEmmanuel Vadot maxItems: 1 1055def4c47SEmmanuel Vadot 1065def4c47SEmmanuel Vadot "#address-cells": 1075def4c47SEmmanuel Vadot enum: [1, 2] 1085def4c47SEmmanuel Vadot 1095def4c47SEmmanuel Vadot "#size-cells": 1105def4c47SEmmanuel Vadot enum: [1, 2] 1115def4c47SEmmanuel Vadot 1125def4c47SEmmanuel Vadot # Used with non-empty value if optional 'reg' is not provided. 1135def4c47SEmmanuel Vadot # The format of the value is an arbitrary number of triplets of 1145def4c47SEmmanuel Vadot # (child-bus-address, parent-bus-address, length). 1155def4c47SEmmanuel Vadot ranges: true 1165def4c47SEmmanuel Vadot 1175def4c47SEmmanuel Vadot mediatek,src-ref-clk-mhz: 1185def4c47SEmmanuel Vadot description: 1195def4c47SEmmanuel Vadot Frequency of reference clock for slew rate calibrate 1205def4c47SEmmanuel Vadot default: 26 1215def4c47SEmmanuel Vadot 1225def4c47SEmmanuel Vadot mediatek,src-coef: 1235def4c47SEmmanuel Vadot description: 1245def4c47SEmmanuel Vadot Coefficient for slew rate calibrate, depends on SoC process 1255def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 1265def4c47SEmmanuel Vadot default: 28 1275def4c47SEmmanuel Vadot 1285def4c47SEmmanuel Vadot# Required child node: 1295def4c47SEmmanuel VadotpatternProperties: 1302eb4d8dcSEmmanuel Vadot "^(usb|pcie|sata)-phy@[0-9a-f]+$": 1315def4c47SEmmanuel Vadot type: object 1325def4c47SEmmanuel Vadot description: 1335def4c47SEmmanuel Vadot A sub-node is required for each port the controller provides. 1345def4c47SEmmanuel Vadot Address range information including the usual 'reg' property 1355def4c47SEmmanuel Vadot is used inside these nodes to describe the controller's topology. 1365def4c47SEmmanuel Vadot 1375def4c47SEmmanuel Vadot properties: 1385def4c47SEmmanuel Vadot reg: 1395def4c47SEmmanuel Vadot maxItems: 1 1405def4c47SEmmanuel Vadot 1415def4c47SEmmanuel Vadot clocks: 1425def4c47SEmmanuel Vadot minItems: 1 1435def4c47SEmmanuel Vadot items: 1445def4c47SEmmanuel Vadot - description: Reference clock, (HS is 48Mhz, SS/P is 24~27Mhz) 1455def4c47SEmmanuel Vadot - description: Reference clock of analog phy 1465def4c47SEmmanuel Vadot description: 1475def4c47SEmmanuel Vadot Uses both clocks if the clock of analog and digital phys are 1485def4c47SEmmanuel Vadot separated, otherwise uses "ref" clock only if needed. 1495def4c47SEmmanuel Vadot 1505def4c47SEmmanuel Vadot clock-names: 1515def4c47SEmmanuel Vadot minItems: 1 1525def4c47SEmmanuel Vadot items: 1535def4c47SEmmanuel Vadot - const: ref 1545def4c47SEmmanuel Vadot - const: da_ref 1555def4c47SEmmanuel Vadot 1565def4c47SEmmanuel Vadot "#phy-cells": 1575def4c47SEmmanuel Vadot const: 1 1585def4c47SEmmanuel Vadot description: | 1595def4c47SEmmanuel Vadot The cells contain the following arguments. 1605def4c47SEmmanuel Vadot 1615def4c47SEmmanuel Vadot - description: The PHY type 1625def4c47SEmmanuel Vadot enum: 1635def4c47SEmmanuel Vadot - PHY_TYPE_USB2 1645def4c47SEmmanuel Vadot - PHY_TYPE_USB3 1655def4c47SEmmanuel Vadot - PHY_TYPE_PCIE 1665def4c47SEmmanuel Vadot - PHY_TYPE_SATA 1677ef62cebSEmmanuel Vadot - PHY_TYPE_SGMII 1685def4c47SEmmanuel Vadot 169e67e8565SEmmanuel Vadot nvmem-cells: 170e67e8565SEmmanuel Vadot items: 171e67e8565SEmmanuel Vadot - description: internal R efuse for U2 PHY or U3/PCIe PHY 172e67e8565SEmmanuel Vadot - description: rx_imp_sel efuse for U3/PCIe PHY 173e67e8565SEmmanuel Vadot - description: tx_imp_sel efuse for U3/PCIe PHY 174e67e8565SEmmanuel Vadot description: | 175e67e8565SEmmanuel Vadot Phandles to nvmem cell that contains the efuse data; 176e67e8565SEmmanuel Vadot Available only for U2 PHY or U3/PCIe PHY of version 2/3, these 177e67e8565SEmmanuel Vadot three items should be provided at the same time for U3/PCIe PHY, 178e67e8565SEmmanuel Vadot when use software to load efuse; 179e67e8565SEmmanuel Vadot If unspecified, will use hardware auto-load efuse. 180e67e8565SEmmanuel Vadot 181e67e8565SEmmanuel Vadot nvmem-cell-names: 182e67e8565SEmmanuel Vadot items: 183e67e8565SEmmanuel Vadot - const: intr 184e67e8565SEmmanuel Vadot - const: rx_imp 185e67e8565SEmmanuel Vadot - const: tx_imp 186e67e8565SEmmanuel Vadot 1875def4c47SEmmanuel Vadot # The following optional vendor properties are only for debug or HQA test 1885def4c47SEmmanuel Vadot mediatek,eye-src: 1895def4c47SEmmanuel Vadot description: 1905def4c47SEmmanuel Vadot The value of slew rate calibrate (U2 phy) 1915def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 1925def4c47SEmmanuel Vadot minimum: 1 1935def4c47SEmmanuel Vadot maximum: 7 1945def4c47SEmmanuel Vadot 1955def4c47SEmmanuel Vadot mediatek,eye-vrt: 1965def4c47SEmmanuel Vadot description: 1975def4c47SEmmanuel Vadot The selection of VRT reference voltage (U2 phy) 1985def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 1995def4c47SEmmanuel Vadot minimum: 1 2005def4c47SEmmanuel Vadot maximum: 7 2015def4c47SEmmanuel Vadot 2025def4c47SEmmanuel Vadot mediatek,eye-term: 2035def4c47SEmmanuel Vadot description: 2045def4c47SEmmanuel Vadot The selection of HS_TX TERM reference voltage (U2 phy) 2055def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 2065def4c47SEmmanuel Vadot minimum: 1 2075def4c47SEmmanuel Vadot maximum: 7 2085def4c47SEmmanuel Vadot 2095def4c47SEmmanuel Vadot mediatek,intr: 2105def4c47SEmmanuel Vadot description: 2115def4c47SEmmanuel Vadot The selection of internal resistor (U2 phy) 2125def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 2135def4c47SEmmanuel Vadot minimum: 1 2145def4c47SEmmanuel Vadot maximum: 31 2155def4c47SEmmanuel Vadot 2165def4c47SEmmanuel Vadot mediatek,discth: 2175def4c47SEmmanuel Vadot description: 2185def4c47SEmmanuel Vadot The selection of disconnect threshold (U2 phy) 2195def4c47SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 2205def4c47SEmmanuel Vadot minimum: 1 2215def4c47SEmmanuel Vadot maximum: 15 2225def4c47SEmmanuel Vadot 2237ef62cebSEmmanuel Vadot mediatek,pre-emphasis: 2247ef62cebSEmmanuel Vadot description: 2257ef62cebSEmmanuel Vadot The level of pre-emphasis which used to widen the eye opening and 2267ef62cebSEmmanuel Vadot boost eye swing, the unit step is about 4.16% increment; e.g. the 2277ef62cebSEmmanuel Vadot level 1 means amplitude increases about 4.16%, the level 2 is about 2287ef62cebSEmmanuel Vadot 8.3% etc. (U2 phy) 2297ef62cebSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 2307ef62cebSEmmanuel Vadot minimum: 1 2317ef62cebSEmmanuel Vadot maximum: 3 2327ef62cebSEmmanuel Vadot 2335def4c47SEmmanuel Vadot mediatek,bc12: 2345def4c47SEmmanuel Vadot description: 2355def4c47SEmmanuel Vadot Specify the flag to enable BC1.2 if support it 2365def4c47SEmmanuel Vadot type: boolean 2375def4c47SEmmanuel Vadot 238*8d13bc63SEmmanuel Vadot mediatek,force-mode: 239*8d13bc63SEmmanuel Vadot description: 240*8d13bc63SEmmanuel Vadot The force mode is used to manually switch the shared phy mode between 241*8d13bc63SEmmanuel Vadot USB3 and PCIe, when USB3 phy type is selected by the consumer, and 242*8d13bc63SEmmanuel Vadot force-mode is set, will cause phy's power and pipe toggled and force 243*8d13bc63SEmmanuel Vadot phy as USB3 mode which switched from default PCIe mode. But perfer to 244*8d13bc63SEmmanuel Vadot use the property "mediatek,syscon-type" for newer SoCs that support it. 245*8d13bc63SEmmanuel Vadot type: boolean 246*8d13bc63SEmmanuel Vadot 247354d7675SEmmanuel Vadot mediatek,syscon-type: 248354d7675SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/phandle-array 249354d7675SEmmanuel Vadot maxItems: 1 250354d7675SEmmanuel Vadot description: 251354d7675SEmmanuel Vadot A phandle to syscon used to access the register of type switch, 252354d7675SEmmanuel Vadot the field should always be 3 cells long. 253354d7675SEmmanuel Vadot items: 254354d7675SEmmanuel Vadot items: 255354d7675SEmmanuel Vadot - description: 256354d7675SEmmanuel Vadot The first cell represents a phandle to syscon 257354d7675SEmmanuel Vadot - description: 258354d7675SEmmanuel Vadot The second cell represents the register offset 259354d7675SEmmanuel Vadot - description: 260354d7675SEmmanuel Vadot The third cell represents the index of config segment 261354d7675SEmmanuel Vadot enum: [0, 1, 2, 3] 262354d7675SEmmanuel Vadot 2635def4c47SEmmanuel Vadot required: 2645def4c47SEmmanuel Vadot - reg 2655def4c47SEmmanuel Vadot - "#phy-cells" 2665def4c47SEmmanuel Vadot 2675def4c47SEmmanuel Vadot additionalProperties: false 2685def4c47SEmmanuel Vadot 2695def4c47SEmmanuel Vadotrequired: 2705def4c47SEmmanuel Vadot - compatible 2715def4c47SEmmanuel Vadot - "#address-cells" 2725def4c47SEmmanuel Vadot - "#size-cells" 2735def4c47SEmmanuel Vadot - ranges 2745def4c47SEmmanuel Vadot 2755def4c47SEmmanuel VadotadditionalProperties: false 2765def4c47SEmmanuel Vadot 2775def4c47SEmmanuel Vadotexamples: 2785def4c47SEmmanuel Vadot - | 2795def4c47SEmmanuel Vadot #include <dt-bindings/clock/mt8173-clk.h> 2805def4c47SEmmanuel Vadot #include <dt-bindings/interrupt-controller/arm-gic.h> 2815def4c47SEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 2825def4c47SEmmanuel Vadot #include <dt-bindings/phy/phy.h> 2835def4c47SEmmanuel Vadot usb@11271000 { 2845def4c47SEmmanuel Vadot compatible = "mediatek,mt8173-mtu3", "mediatek,mtu3"; 2855def4c47SEmmanuel Vadot reg = <0x11271000 0x3000>, <0x11280700 0x0100>; 2865def4c47SEmmanuel Vadot reg-names = "mac", "ippc"; 2875def4c47SEmmanuel Vadot phys = <&u2port0 PHY_TYPE_USB2>, 2885def4c47SEmmanuel Vadot <&u3port0 PHY_TYPE_USB3>, 2895def4c47SEmmanuel Vadot <&u2port1 PHY_TYPE_USB2>; 2905def4c47SEmmanuel Vadot interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>; 2915def4c47SEmmanuel Vadot clocks = <&topckgen CLK_TOP_USB30_SEL>; 2925def4c47SEmmanuel Vadot clock-names = "sys_ck"; 2935def4c47SEmmanuel Vadot }; 2945def4c47SEmmanuel Vadot 2955def4c47SEmmanuel Vadot t-phy@11290000 { 2965def4c47SEmmanuel Vadot compatible = "mediatek,mt8173-u3phy"; 2975def4c47SEmmanuel Vadot reg = <0x11290000 0x800>; 2985def4c47SEmmanuel Vadot #address-cells = <1>; 2995def4c47SEmmanuel Vadot #size-cells = <1>; 3005def4c47SEmmanuel Vadot ranges; 3015def4c47SEmmanuel Vadot 3025def4c47SEmmanuel Vadot u2port0: usb-phy@11290800 { 3035def4c47SEmmanuel Vadot reg = <0x11290800 0x100>; 3045def4c47SEmmanuel Vadot clocks = <&apmixedsys CLK_APMIXED_REF2USB_TX>, <&clk48m>; 3055def4c47SEmmanuel Vadot clock-names = "ref", "da_ref"; 3065def4c47SEmmanuel Vadot #phy-cells = <1>; 3075def4c47SEmmanuel Vadot }; 3085def4c47SEmmanuel Vadot 3095def4c47SEmmanuel Vadot u3port0: usb-phy@11290900 { 3105def4c47SEmmanuel Vadot reg = <0x11290900 0x700>; 3115def4c47SEmmanuel Vadot clocks = <&clk26m>; 3125def4c47SEmmanuel Vadot clock-names = "ref"; 3135def4c47SEmmanuel Vadot #phy-cells = <1>; 3145def4c47SEmmanuel Vadot }; 3155def4c47SEmmanuel Vadot 3165def4c47SEmmanuel Vadot u2port1: usb-phy@11291000 { 3175def4c47SEmmanuel Vadot reg = <0x11291000 0x100>; 3185def4c47SEmmanuel Vadot #phy-cells = <1>; 3195def4c47SEmmanuel Vadot }; 3205def4c47SEmmanuel Vadot }; 3215def4c47SEmmanuel Vadot 3225def4c47SEmmanuel Vadot... 323