1*0cd4430aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2*0cd4430aSEmmanuel Vadot%YAML 1.2 3*0cd4430aSEmmanuel Vadot--- 4*0cd4430aSEmmanuel Vadot$id: http://devicetree.org/schemas/phy/apple,atcphy.yaml# 5*0cd4430aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6*0cd4430aSEmmanuel Vadot 7*0cd4430aSEmmanuel Vadottitle: Apple Type-C PHY (ATCPHY) 8*0cd4430aSEmmanuel Vadot 9*0cd4430aSEmmanuel Vadotmaintainers: 10*0cd4430aSEmmanuel Vadot - Sven Peter <sven@kernel.org> 11*0cd4430aSEmmanuel Vadot 12*0cd4430aSEmmanuel Vadotdescription: > 13*0cd4430aSEmmanuel Vadot The Apple Type-C PHY (ATCPHY) is a combined PHY for USB 2.0, USB 3.x, 14*0cd4430aSEmmanuel Vadot USB4/Thunderbolt, and DisplayPort connectivity via Type-C ports found in 15*0cd4430aSEmmanuel Vadot Apple Silicon SoCs. 16*0cd4430aSEmmanuel Vadot 17*0cd4430aSEmmanuel Vadot The PHY handles muxing between these different protocols and also provides the 18*0cd4430aSEmmanuel Vadot reset controller for the attached DWC3 USB controller. 19*0cd4430aSEmmanuel Vadot 20*0cd4430aSEmmanuel Vadot It is designed for USB4 operation and does not handle individual differential 21*0cd4430aSEmmanuel Vadot pairs as distinct DisplayPort lanes. Any reference to lane in this binding 22*0cd4430aSEmmanuel Vadot hence refers to two differential pairs (RX and TX) as used in USB terminology. 23*0cd4430aSEmmanuel Vadot 24*0cd4430aSEmmanuel Vadot In order to correctly setup these lanes for the various modes calibration 25*0cd4430aSEmmanuel Vadot values copied from Apple's firmware and converted to the format described 26*0cd4430aSEmmanuel Vadot below by our bootloader m1n1 are required. Without these only USB2 operation 27*0cd4430aSEmmanuel Vadot is possible. 28*0cd4430aSEmmanuel Vadot 29*0cd4430aSEmmanuel VadotallOf: 30*0cd4430aSEmmanuel Vadot - $ref: /schemas/usb/usb-switch.yaml# 31*0cd4430aSEmmanuel Vadot 32*0cd4430aSEmmanuel Vadot$defs: 33*0cd4430aSEmmanuel Vadot apple,tunable: 34*0cd4430aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32-matrix 35*0cd4430aSEmmanuel Vadot items: 36*0cd4430aSEmmanuel Vadot items: 37*0cd4430aSEmmanuel Vadot - description: Register offset 38*0cd4430aSEmmanuel Vadot - description: Mask to be applied to the register value 39*0cd4430aSEmmanuel Vadot - description: Bits to be set after applying the mask 40*0cd4430aSEmmanuel Vadot description: > 41*0cd4430aSEmmanuel Vadot List of (register offset, mask, value) tuples copied from Apple's Device 42*0cd4430aSEmmanuel Vadot Tree by our bootloader m1n1 and used to configure the PHY. These values 43*0cd4430aSEmmanuel Vadot even vary for a single product/device and likely contain calibration 44*0cd4430aSEmmanuel Vadot values determined by Apple at manufacturing time. 45*0cd4430aSEmmanuel Vadot Unless otherwise noted these tunables are always applied to the core 46*0cd4430aSEmmanuel Vadot register region. 47*0cd4430aSEmmanuel Vadot 48*0cd4430aSEmmanuel Vadotproperties: 49*0cd4430aSEmmanuel Vadot compatible: 50*0cd4430aSEmmanuel Vadot oneOf: 51*0cd4430aSEmmanuel Vadot - items: 52*0cd4430aSEmmanuel Vadot - enum: 53*0cd4430aSEmmanuel Vadot - apple,t6000-atcphy 54*0cd4430aSEmmanuel Vadot - apple,t6020-atcphy 55*0cd4430aSEmmanuel Vadot - apple,t8112-atcphy 56*0cd4430aSEmmanuel Vadot - const: apple,t8103-atcphy 57*0cd4430aSEmmanuel Vadot - const: apple,t8103-atcphy 58*0cd4430aSEmmanuel Vadot 59*0cd4430aSEmmanuel Vadot reg: 60*0cd4430aSEmmanuel Vadot items: 61*0cd4430aSEmmanuel Vadot - description: Common controls for all PHYs (USB2/3/4, DisplayPort, TBT) 62*0cd4430aSEmmanuel Vadot - description: DisplayPort Alternate Mode PHY specific controls 63*0cd4430aSEmmanuel Vadot - description: Type-C PHY AXI to Apple Fabric interconnect controls 64*0cd4430aSEmmanuel Vadot - description: USB2 PHY specific controls 65*0cd4430aSEmmanuel Vadot - description: USB3 PIPE interface controls 66*0cd4430aSEmmanuel Vadot 67*0cd4430aSEmmanuel Vadot reg-names: 68*0cd4430aSEmmanuel Vadot items: 69*0cd4430aSEmmanuel Vadot - const: core 70*0cd4430aSEmmanuel Vadot - const: lpdptx 71*0cd4430aSEmmanuel Vadot - const: axi2af 72*0cd4430aSEmmanuel Vadot - const: usb2phy 73*0cd4430aSEmmanuel Vadot - const: pipehandler 74*0cd4430aSEmmanuel Vadot 75*0cd4430aSEmmanuel Vadot "#phy-cells": 76*0cd4430aSEmmanuel Vadot const: 1 77*0cd4430aSEmmanuel Vadot 78*0cd4430aSEmmanuel Vadot "#reset-cells": 79*0cd4430aSEmmanuel Vadot const: 0 80*0cd4430aSEmmanuel Vadot 81*0cd4430aSEmmanuel Vadot mode-switch: true 82*0cd4430aSEmmanuel Vadot orientation-switch: true 83*0cd4430aSEmmanuel Vadot 84*0cd4430aSEmmanuel Vadot power-domains: 85*0cd4430aSEmmanuel Vadot maxItems: 1 86*0cd4430aSEmmanuel Vadot 87*0cd4430aSEmmanuel Vadot ports: 88*0cd4430aSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/ports 89*0cd4430aSEmmanuel Vadot properties: 90*0cd4430aSEmmanuel Vadot port@0: 91*0cd4430aSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/port 92*0cd4430aSEmmanuel Vadot description: Outgoing connection to the SS port of the Type-C connector. 93*0cd4430aSEmmanuel Vadot 94*0cd4430aSEmmanuel Vadot port@1: 95*0cd4430aSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/port 96*0cd4430aSEmmanuel Vadot description: Incoming endpoint from the USB3 controller. 97*0cd4430aSEmmanuel Vadot 98*0cd4430aSEmmanuel Vadot port@2: 99*0cd4430aSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/port 100*0cd4430aSEmmanuel Vadot description: Incoming endpoint from the DisplayPort controller. 101*0cd4430aSEmmanuel Vadot 102*0cd4430aSEmmanuel Vadot port@3: 103*0cd4430aSEmmanuel Vadot $ref: /schemas/graph.yaml#/properties/port 104*0cd4430aSEmmanuel Vadot description: Incoming endpoint from the USB4/Thunderbolt controller. 105*0cd4430aSEmmanuel Vadot 106*0cd4430aSEmmanuel Vadot apple,tunable-common-a: 107*0cd4430aSEmmanuel Vadot $ref: "#/$defs/apple,tunable" 108*0cd4430aSEmmanuel Vadot description: > 109*0cd4430aSEmmanuel Vadot Common tunables required for all modes, applied before tunable-axi2af. 110*0cd4430aSEmmanuel Vadot 111*0cd4430aSEmmanuel Vadot apple,tunable-axi2af: 112*0cd4430aSEmmanuel Vadot $ref: "#/$defs/apple,tunable" 113*0cd4430aSEmmanuel Vadot description: > 114*0cd4430aSEmmanuel Vadot AXI to Apple Fabric tunables, required for all modes. Unlike all other 115*0cd4430aSEmmanuel Vadot tunables these are applied to the axi2af region. 116*0cd4430aSEmmanuel Vadot 117*0cd4430aSEmmanuel Vadot apple,tunable-common-b: 118*0cd4430aSEmmanuel Vadot $ref: "#/$defs/apple,tunable" 119*0cd4430aSEmmanuel Vadot description: > 120*0cd4430aSEmmanuel Vadot Common tunables required for all modes, applied after tunable-axi2af. 121*0cd4430aSEmmanuel Vadot 122*0cd4430aSEmmanuel Vadot apple,tunable-lane0-usb: 123*0cd4430aSEmmanuel Vadot $ref: "#/$defs/apple,tunable" 124*0cd4430aSEmmanuel Vadot description: USB3 tunables for lane 0. 125*0cd4430aSEmmanuel Vadot 126*0cd4430aSEmmanuel Vadot apple,tunable-lane1-usb: 127*0cd4430aSEmmanuel Vadot $ref: "#/$defs/apple,tunable" 128*0cd4430aSEmmanuel Vadot description: USB3 tunables for lane 1. 129*0cd4430aSEmmanuel Vadot 130*0cd4430aSEmmanuel Vadot apple,tunable-lane0-cio: 131*0cd4430aSEmmanuel Vadot $ref: "#/$defs/apple,tunable" 132*0cd4430aSEmmanuel Vadot description: USB4/Thunderbolt ("Converged IO") tunables for lane 0. 133*0cd4430aSEmmanuel Vadot 134*0cd4430aSEmmanuel Vadot apple,tunable-lane1-cio: 135*0cd4430aSEmmanuel Vadot $ref: "#/$defs/apple,tunable" 136*0cd4430aSEmmanuel Vadot description: USB4/Thunderbolt ("Converged IO") tunables for lane 1. 137*0cd4430aSEmmanuel Vadot 138*0cd4430aSEmmanuel Vadot apple,tunable-lane0-dp: 139*0cd4430aSEmmanuel Vadot $ref: "#/$defs/apple,tunable" 140*0cd4430aSEmmanuel Vadot description: > 141*0cd4430aSEmmanuel Vadot DisplayPort tunables for lane 0. 142*0cd4430aSEmmanuel Vadot 143*0cd4430aSEmmanuel Vadot Note that lane here refers to a USB RX and TX pair re-used for DisplayPort 144*0cd4430aSEmmanuel Vadot and not to an individual DisplayPort differential lane. 145*0cd4430aSEmmanuel Vadot 146*0cd4430aSEmmanuel Vadot apple,tunable-lane1-dp: 147*0cd4430aSEmmanuel Vadot $ref: "#/$defs/apple,tunable" 148*0cd4430aSEmmanuel Vadot description: > 149*0cd4430aSEmmanuel Vadot DisplayPort tunables for lane 1. 150*0cd4430aSEmmanuel Vadot 151*0cd4430aSEmmanuel Vadot Note that lane here refers to a USB RX and TX pair re-used for DisplayPort 152*0cd4430aSEmmanuel Vadot and not to an individual DisplayPort differential lane. 153*0cd4430aSEmmanuel Vadot 154*0cd4430aSEmmanuel Vadotrequired: 155*0cd4430aSEmmanuel Vadot - compatible 156*0cd4430aSEmmanuel Vadot - reg 157*0cd4430aSEmmanuel Vadot - reg-names 158*0cd4430aSEmmanuel Vadot - "#phy-cells" 159*0cd4430aSEmmanuel Vadot - "#reset-cells" 160*0cd4430aSEmmanuel Vadot - orientation-switch 161*0cd4430aSEmmanuel Vadot - mode-switch 162*0cd4430aSEmmanuel Vadot - power-domains 163*0cd4430aSEmmanuel Vadot - ports 164*0cd4430aSEmmanuel Vadot 165*0cd4430aSEmmanuel VadotadditionalProperties: false 166*0cd4430aSEmmanuel Vadot 167*0cd4430aSEmmanuel Vadotexamples: 168*0cd4430aSEmmanuel Vadot - | 169*0cd4430aSEmmanuel Vadot phy@83000000 { 170*0cd4430aSEmmanuel Vadot compatible = "apple,t8103-atcphy"; 171*0cd4430aSEmmanuel Vadot reg = <0x83000000 0x4c000>, 172*0cd4430aSEmmanuel Vadot <0x83050000 0x8000>, 173*0cd4430aSEmmanuel Vadot <0x80000000 0x4000>, 174*0cd4430aSEmmanuel Vadot <0x82a90000 0x4000>, 175*0cd4430aSEmmanuel Vadot <0x82a84000 0x4000>; 176*0cd4430aSEmmanuel Vadot reg-names = "core", "lpdptx", "axi2af", "usb2phy", 177*0cd4430aSEmmanuel Vadot "pipehandler"; 178*0cd4430aSEmmanuel Vadot 179*0cd4430aSEmmanuel Vadot #phy-cells = <1>; 180*0cd4430aSEmmanuel Vadot #reset-cells = <0>; 181*0cd4430aSEmmanuel Vadot 182*0cd4430aSEmmanuel Vadot orientation-switch; 183*0cd4430aSEmmanuel Vadot mode-switch; 184*0cd4430aSEmmanuel Vadot power-domains = <&ps_atc0_usb>; 185*0cd4430aSEmmanuel Vadot 186*0cd4430aSEmmanuel Vadot ports { 187*0cd4430aSEmmanuel Vadot #address-cells = <1>; 188*0cd4430aSEmmanuel Vadot #size-cells = <0>; 189*0cd4430aSEmmanuel Vadot 190*0cd4430aSEmmanuel Vadot port@0 { 191*0cd4430aSEmmanuel Vadot reg = <0>; 192*0cd4430aSEmmanuel Vadot 193*0cd4430aSEmmanuel Vadot endpoint { 194*0cd4430aSEmmanuel Vadot remote-endpoint = <&typec_connector_ss>; 195*0cd4430aSEmmanuel Vadot }; 196*0cd4430aSEmmanuel Vadot }; 197*0cd4430aSEmmanuel Vadot 198*0cd4430aSEmmanuel Vadot port@1 { 199*0cd4430aSEmmanuel Vadot reg = <1>; 200*0cd4430aSEmmanuel Vadot 201*0cd4430aSEmmanuel Vadot endpoint { 202*0cd4430aSEmmanuel Vadot remote-endpoint = <&dwc3_ss_out>; 203*0cd4430aSEmmanuel Vadot }; 204*0cd4430aSEmmanuel Vadot }; 205*0cd4430aSEmmanuel Vadot 206*0cd4430aSEmmanuel Vadot port@2 { 207*0cd4430aSEmmanuel Vadot reg = <2>; 208*0cd4430aSEmmanuel Vadot 209*0cd4430aSEmmanuel Vadot endpoint { 210*0cd4430aSEmmanuel Vadot remote-endpoint = <&dcp_dp_out>; 211*0cd4430aSEmmanuel Vadot }; 212*0cd4430aSEmmanuel Vadot }; 213*0cd4430aSEmmanuel Vadot 214*0cd4430aSEmmanuel Vadot port@3 { 215*0cd4430aSEmmanuel Vadot reg = <3>; 216*0cd4430aSEmmanuel Vadot 217*0cd4430aSEmmanuel Vadot endpoint { 218*0cd4430aSEmmanuel Vadot remote-endpoint = <&acio_tbt_out>; 219*0cd4430aSEmmanuel Vadot }; 220*0cd4430aSEmmanuel Vadot }; 221*0cd4430aSEmmanuel Vadot }; 222*0cd4430aSEmmanuel Vadot }; 223