1*aa1a8ff2SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2*aa1a8ff2SEmmanuel Vadot# Copyright 2023 Realtek Semiconductor Corporation 3*aa1a8ff2SEmmanuel Vadot%YAML 1.2 4*aa1a8ff2SEmmanuel Vadot--- 5*aa1a8ff2SEmmanuel Vadot$id: http://devicetree.org/schemas/phy/realtek,usb2phy.yaml# 6*aa1a8ff2SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 7*aa1a8ff2SEmmanuel Vadot 8*aa1a8ff2SEmmanuel Vadottitle: Realtek DHC SoCs USB 2.0 PHY 9*aa1a8ff2SEmmanuel Vadot 10*aa1a8ff2SEmmanuel Vadotmaintainers: 11*aa1a8ff2SEmmanuel Vadot - Stanley Chang <stanley_chang@realtek.com> 12*aa1a8ff2SEmmanuel Vadot 13*aa1a8ff2SEmmanuel Vadotdescription: | 14*aa1a8ff2SEmmanuel Vadot Realtek USB 2.0 PHY support the digital home center (DHC) RTD series SoCs. 15*aa1a8ff2SEmmanuel Vadot The USB 2.0 PHY driver is designed to support the XHCI controller. The SoCs 16*aa1a8ff2SEmmanuel Vadot support multiple XHCI controllers. One PHY device node maps to one XHCI 17*aa1a8ff2SEmmanuel Vadot controller. 18*aa1a8ff2SEmmanuel Vadot 19*aa1a8ff2SEmmanuel Vadot RTD1295/RTD1619 SoCs USB 20*aa1a8ff2SEmmanuel Vadot The USB architecture includes three XHCI controllers. 21*aa1a8ff2SEmmanuel Vadot Each XHCI maps to one USB 2.0 PHY and map one USB 3.0 PHY on some 22*aa1a8ff2SEmmanuel Vadot controllers. 23*aa1a8ff2SEmmanuel Vadot XHCI controller#0 -- usb2phy -- phy#0 24*aa1a8ff2SEmmanuel Vadot |- usb3phy -- phy#0 25*aa1a8ff2SEmmanuel Vadot XHCI controller#1 -- usb2phy -- phy#0 26*aa1a8ff2SEmmanuel Vadot XHCI controller#2 -- usb2phy -- phy#0 27*aa1a8ff2SEmmanuel Vadot |- usb3phy -- phy#0 28*aa1a8ff2SEmmanuel Vadot 29*aa1a8ff2SEmmanuel Vadot RTD1395 SoCs USB 30*aa1a8ff2SEmmanuel Vadot The USB architecture includes two XHCI controllers. 31*aa1a8ff2SEmmanuel Vadot The controller#0 has one USB 2.0 PHY. The controller#1 includes two USB 2.0 32*aa1a8ff2SEmmanuel Vadot PHY. 33*aa1a8ff2SEmmanuel Vadot XHCI controller#0 -- usb2phy -- phy#0 34*aa1a8ff2SEmmanuel Vadot XHCI controller#1 -- usb2phy -- phy#0 35*aa1a8ff2SEmmanuel Vadot |- phy#1 36*aa1a8ff2SEmmanuel Vadot 37*aa1a8ff2SEmmanuel Vadot RTD1319/RTD1619b SoCs USB 38*aa1a8ff2SEmmanuel Vadot The USB architecture includes three XHCI controllers. 39*aa1a8ff2SEmmanuel Vadot Each XHCI maps to one USB 2.0 PHY and map one USB 3.0 PHY on controllers#2. 40*aa1a8ff2SEmmanuel Vadot XHCI controller#0 -- usb2phy -- phy#0 41*aa1a8ff2SEmmanuel Vadot XHCI controller#1 -- usb2phy -- phy#0 42*aa1a8ff2SEmmanuel Vadot XHCI controller#2 -- usb2phy -- phy#0 43*aa1a8ff2SEmmanuel Vadot |- usb3phy -- phy#0 44*aa1a8ff2SEmmanuel Vadot 45*aa1a8ff2SEmmanuel Vadot RTD1319d SoCs USB 46*aa1a8ff2SEmmanuel Vadot The USB architecture includes three XHCI controllers. 47*aa1a8ff2SEmmanuel Vadot Each xhci maps to one USB 2.0 PHY and map one USB 3.0 PHY on controllers#0. 48*aa1a8ff2SEmmanuel Vadot XHCI controller#0 -- usb2phy -- phy#0 49*aa1a8ff2SEmmanuel Vadot |- usb3phy -- phy#0 50*aa1a8ff2SEmmanuel Vadot XHCI controller#1 -- usb2phy -- phy#0 51*aa1a8ff2SEmmanuel Vadot XHCI controller#2 -- usb2phy -- phy#0 52*aa1a8ff2SEmmanuel Vadot 53*aa1a8ff2SEmmanuel Vadot RTD1312c/RTD1315e SoCs USB 54*aa1a8ff2SEmmanuel Vadot The USB architecture includes three XHCI controllers. 55*aa1a8ff2SEmmanuel Vadot Each XHCI maps to one USB 2.0 PHY. 56*aa1a8ff2SEmmanuel Vadot XHCI controller#0 -- usb2phy -- phy#0 57*aa1a8ff2SEmmanuel Vadot XHCI controller#1 -- usb2phy -- phy#0 58*aa1a8ff2SEmmanuel Vadot XHCI controller#2 -- usb2phy -- phy#0 59*aa1a8ff2SEmmanuel Vadot 60*aa1a8ff2SEmmanuel Vadotproperties: 61*aa1a8ff2SEmmanuel Vadot compatible: 62*aa1a8ff2SEmmanuel Vadot enum: 63*aa1a8ff2SEmmanuel Vadot - realtek,rtd1295-usb2phy 64*aa1a8ff2SEmmanuel Vadot - realtek,rtd1312c-usb2phy 65*aa1a8ff2SEmmanuel Vadot - realtek,rtd1315e-usb2phy 66*aa1a8ff2SEmmanuel Vadot - realtek,rtd1319-usb2phy 67*aa1a8ff2SEmmanuel Vadot - realtek,rtd1319d-usb2phy 68*aa1a8ff2SEmmanuel Vadot - realtek,rtd1395-usb2phy 69*aa1a8ff2SEmmanuel Vadot - realtek,rtd1395-usb2phy-2port 70*aa1a8ff2SEmmanuel Vadot - realtek,rtd1619-usb2phy 71*aa1a8ff2SEmmanuel Vadot - realtek,rtd1619b-usb2phy 72*aa1a8ff2SEmmanuel Vadot 73*aa1a8ff2SEmmanuel Vadot reg: 74*aa1a8ff2SEmmanuel Vadot items: 75*aa1a8ff2SEmmanuel Vadot - description: PHY data registers 76*aa1a8ff2SEmmanuel Vadot - description: PHY control registers 77*aa1a8ff2SEmmanuel Vadot 78*aa1a8ff2SEmmanuel Vadot "#phy-cells": 79*aa1a8ff2SEmmanuel Vadot const: 0 80*aa1a8ff2SEmmanuel Vadot 81*aa1a8ff2SEmmanuel Vadot nvmem-cells: 82*aa1a8ff2SEmmanuel Vadot maxItems: 2 83*aa1a8ff2SEmmanuel Vadot description: 84*aa1a8ff2SEmmanuel Vadot Phandles to nvmem cell that contains the trimming data. 85*aa1a8ff2SEmmanuel Vadot If unspecified, default value is used. 86*aa1a8ff2SEmmanuel Vadot 87*aa1a8ff2SEmmanuel Vadot nvmem-cell-names: 88*aa1a8ff2SEmmanuel Vadot items: 89*aa1a8ff2SEmmanuel Vadot - const: usb-dc-cal 90*aa1a8ff2SEmmanuel Vadot - const: usb-dc-dis 91*aa1a8ff2SEmmanuel Vadot description: 92*aa1a8ff2SEmmanuel Vadot The following names, which correspond to each nvmem-cells. 93*aa1a8ff2SEmmanuel Vadot usb-dc-cal is the driving level for each phy specified via efuse. 94*aa1a8ff2SEmmanuel Vadot usb-dc-dis is the disconnection level for each phy specified via efuse. 95*aa1a8ff2SEmmanuel Vadot 96*aa1a8ff2SEmmanuel Vadot realtek,inverse-hstx-sync-clock: 97*aa1a8ff2SEmmanuel Vadot description: 98*aa1a8ff2SEmmanuel Vadot For one of the phys of RTD1619b SoC, the synchronous clock of the 99*aa1a8ff2SEmmanuel Vadot high-speed tx must be inverted. 100*aa1a8ff2SEmmanuel Vadot type: boolean 101*aa1a8ff2SEmmanuel Vadot 102*aa1a8ff2SEmmanuel Vadot realtek,driving-level: 103*aa1a8ff2SEmmanuel Vadot description: 104*aa1a8ff2SEmmanuel Vadot Control the magnitude of High speed Dp/Dm output swing (mV). 105*aa1a8ff2SEmmanuel Vadot For a different board or port, the original magnitude maybe not meet 106*aa1a8ff2SEmmanuel Vadot the specification. In this situation we can adjust the value to meet 107*aa1a8ff2SEmmanuel Vadot the specification. 108*aa1a8ff2SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 109*aa1a8ff2SEmmanuel Vadot default: 8 110*aa1a8ff2SEmmanuel Vadot minimum: 0 111*aa1a8ff2SEmmanuel Vadot maximum: 31 112*aa1a8ff2SEmmanuel Vadot 113*aa1a8ff2SEmmanuel Vadot realtek,driving-level-compensate: 114*aa1a8ff2SEmmanuel Vadot description: 115*aa1a8ff2SEmmanuel Vadot For RTD1315e SoC, the driving level can be adjusted by reading the 116*aa1a8ff2SEmmanuel Vadot efuse table. This property provides drive compensation. 117*aa1a8ff2SEmmanuel Vadot If the magnitude of High speed Dp/Dm output swing still not meet the 118*aa1a8ff2SEmmanuel Vadot specification, then we can set this value to meet the specification. 119*aa1a8ff2SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/int32 120*aa1a8ff2SEmmanuel Vadot default: 0 121*aa1a8ff2SEmmanuel Vadot minimum: -8 122*aa1a8ff2SEmmanuel Vadot maximum: 8 123*aa1a8ff2SEmmanuel Vadot 124*aa1a8ff2SEmmanuel Vadot realtek,disconnection-compensate: 125*aa1a8ff2SEmmanuel Vadot description: 126*aa1a8ff2SEmmanuel Vadot This adjusts the disconnection level compensation for the different 127*aa1a8ff2SEmmanuel Vadot boards with different disconnection level. 128*aa1a8ff2SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/int32 129*aa1a8ff2SEmmanuel Vadot default: 0 130*aa1a8ff2SEmmanuel Vadot minimum: -8 131*aa1a8ff2SEmmanuel Vadot maximum: 8 132*aa1a8ff2SEmmanuel Vadot 133*aa1a8ff2SEmmanuel Vadotrequired: 134*aa1a8ff2SEmmanuel Vadot - compatible 135*aa1a8ff2SEmmanuel Vadot - reg 136*aa1a8ff2SEmmanuel Vadot - "#phy-cells" 137*aa1a8ff2SEmmanuel Vadot 138*aa1a8ff2SEmmanuel VadotallOf: 139*aa1a8ff2SEmmanuel Vadot - if: 140*aa1a8ff2SEmmanuel Vadot not: 141*aa1a8ff2SEmmanuel Vadot properties: 142*aa1a8ff2SEmmanuel Vadot compatible: 143*aa1a8ff2SEmmanuel Vadot contains: 144*aa1a8ff2SEmmanuel Vadot enum: 145*aa1a8ff2SEmmanuel Vadot - realtek,rtd1619b-usb2phy 146*aa1a8ff2SEmmanuel Vadot then: 147*aa1a8ff2SEmmanuel Vadot properties: 148*aa1a8ff2SEmmanuel Vadot realtek,inverse-hstx-sync-clock: false 149*aa1a8ff2SEmmanuel Vadot 150*aa1a8ff2SEmmanuel Vadot - if: 151*aa1a8ff2SEmmanuel Vadot not: 152*aa1a8ff2SEmmanuel Vadot properties: 153*aa1a8ff2SEmmanuel Vadot compatible: 154*aa1a8ff2SEmmanuel Vadot contains: 155*aa1a8ff2SEmmanuel Vadot enum: 156*aa1a8ff2SEmmanuel Vadot - realtek,rtd1315e-usb2phy 157*aa1a8ff2SEmmanuel Vadot then: 158*aa1a8ff2SEmmanuel Vadot properties: 159*aa1a8ff2SEmmanuel Vadot realtek,driving-level-compensate: false 160*aa1a8ff2SEmmanuel Vadot 161*aa1a8ff2SEmmanuel VadotadditionalProperties: false 162*aa1a8ff2SEmmanuel Vadot 163*aa1a8ff2SEmmanuel Vadotexamples: 164*aa1a8ff2SEmmanuel Vadot - | 165*aa1a8ff2SEmmanuel Vadot usb-phy@13214 { 166*aa1a8ff2SEmmanuel Vadot compatible = "realtek,rtd1619b-usb2phy"; 167*aa1a8ff2SEmmanuel Vadot reg = <0x13214 0x4>, <0x28280 0x4>; 168*aa1a8ff2SEmmanuel Vadot #phy-cells = <0>; 169*aa1a8ff2SEmmanuel Vadot nvmem-cells = <&otp_usb_port0_dc_cal>, <&otp_usb_port0_dc_dis>; 170*aa1a8ff2SEmmanuel Vadot nvmem-cell-names = "usb-dc-cal", "usb-dc-dis"; 171*aa1a8ff2SEmmanuel Vadot 172*aa1a8ff2SEmmanuel Vadot realtek,inverse-hstx-sync-clock; 173*aa1a8ff2SEmmanuel Vadot realtek,driving-level = <0xa>; 174*aa1a8ff2SEmmanuel Vadot realtek,disconnection-compensate = <(-1)>; 175*aa1a8ff2SEmmanuel Vadot }; 176