Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: phy: tegra20-usb-phy: Convert to schema

Convert NVIDIA Tegra20 USB PHY binding to schema.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20210912181718.1328-2-digetx@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Osipenko and committed by
Greg Kroah-Hartman
6941d194 20269858

+357 -74
-74
Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.txt
··· 1 - Tegra SOC USB PHY 2 - 3 - The device node for Tegra SOC USB PHY: 4 - 5 - Required properties : 6 - - compatible : For Tegra20, must contain "nvidia,tegra20-usb-phy". 7 - For Tegra30, must contain "nvidia,tegra30-usb-phy". Otherwise, must contain 8 - "nvidia,<chip>-usb-phy" plus at least one of the above, where <chip> is 9 - tegra114, tegra124, tegra132, or tegra210. 10 - - reg : Defines the following set of registers, in the order listed: 11 - - The PHY's own register set. 12 - Always present. 13 - - The register set of the PHY containing the UTMI pad control registers. 14 - Present if-and-only-if phy_type == utmi. 15 - - phy_type : Should be one of "utmi", "ulpi" or "hsic". 16 - - clocks : Defines the clocks listed in the clock-names property. 17 - - clock-names : The following clock names must be present: 18 - - reg: The clock needed to access the PHY's own registers. This is the 19 - associated EHCI controller's clock. Always present. 20 - - pll_u: PLL_U. Always present. 21 - - timer: The timeout clock (clk_m). Present if phy_type == utmi. 22 - - utmi-pads: The clock needed to access the UTMI pad control registers. 23 - Present if phy_type == utmi. 24 - - ulpi-link: The clock Tegra provides to the ULPI PHY (usually pad DAP_MCLK2 25 - with pad group aka "nvidia,pins" cdev2 and pin mux option config aka 26 - "nvidia,function" pllp_out4). 27 - Present if phy_type == ulpi, and ULPI link mode is in use. 28 - - resets : Must contain an entry for each entry in reset-names. 29 - See ../reset/reset.txt for details. 30 - - reset-names : Must include the following entries: 31 - - usb: The PHY's own reset signal. 32 - - utmi-pads: The reset of the PHY containing the chip-wide UTMI pad control 33 - registers. Required even if phy_type == ulpi. 34 - 35 - Required properties for phy_type == ulpi: 36 - - nvidia,phy-reset-gpio : The GPIO used to reset the PHY. 37 - 38 - Required PHY timing params for utmi phy, for all chips: 39 - - nvidia,hssync-start-delay : Number of 480 Mhz clock cycles to wait before 40 - start of sync launches RxActive 41 - - nvidia,elastic-limit : Variable FIFO Depth of elastic input store 42 - - nvidia,idle-wait-delay : Number of 480 Mhz clock cycles of idle to wait 43 - before declare IDLE. 44 - - nvidia,term-range-adj : Range adjusment on terminations 45 - - Either one of the following for HS driver output control: 46 - - nvidia,xcvr-setup : integer, uses the provided value. 47 - - nvidia,xcvr-setup-use-fuses : boolean, indicates that the value is read 48 - from the on-chip fuses 49 - If both are provided, nvidia,xcvr-setup-use-fuses takes precedence. 50 - - nvidia,xcvr-lsfslew : LS falling slew rate control. 51 - - nvidia,xcvr-lsrslew : LS rising slew rate control. 52 - 53 - Required PHY timing params for utmi phy, only on Tegra30 and above: 54 - - nvidia,xcvr-hsslew : HS slew rate control. 55 - - nvidia,hssquelch-level : HS squelch detector level. 56 - - nvidia,hsdiscon-level : HS disconnect detector level. 57 - 58 - Optional properties: 59 - - nvidia,has-legacy-mode : boolean indicates whether this controller can 60 - operate in legacy mode (as APX 2500 / 2600). In legacy mode some 61 - registers are accessed through the APB_MISC base address instead of 62 - the USB controller. 63 - - nvidia,is-wired : boolean. Indicates whether we can do certain kind of power 64 - optimizations for the devices that are always connected. e.g. modem. 65 - - dr_mode : dual role mode. Indicates the working mode for the PHY. Can be 66 - "host", "peripheral", or "otg". Defaults to "host" if not defined. 67 - host means this is a host controller 68 - peripheral means it is device controller 69 - otg means it can operate as either ("on the go") 70 - - nvidia,has-utmi-pad-registers : boolean indicates whether this controller 71 - contains the UTMI pad control registers common to all USB controllers. 72 - 73 - VBUS control (required for dr_mode == otg, optional for dr_mode == host): 74 - - vbus-supply: regulator for VBUS
+357
Documentation/devicetree/bindings/phy/nvidia,tegra20-usb-phy.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/phy/nvidia,tegra20-usb-phy.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NVIDIA Tegra USB PHY 8 + 9 + maintainers: 10 + - Dmitry Osipenko <digetx@gmail.com> 11 + - Jon Hunter <jonathanh@nvidia.com> 12 + - Thierry Reding <thierry.reding@gmail.com> 13 + 14 + properties: 15 + compatible: 16 + oneOf: 17 + - items: 18 + - enum: 19 + - nvidia,tegra124-usb-phy 20 + - nvidia,tegra114-usb-phy 21 + - enum: 22 + - nvidia,tegra30-usb-phy 23 + - items: 24 + - enum: 25 + - nvidia,tegra30-usb-phy 26 + - nvidia,tegra20-usb-phy 27 + 28 + reg: 29 + minItems: 1 30 + maxItems: 2 31 + description: | 32 + PHY0 and PHY2 share power and ground, PHY0 contains shared registers. 33 + PHY0 and PHY2 must specify two register sets, where the first set is 34 + PHY own registers and the second set is the PHY0 registers. 35 + 36 + clocks: 37 + anyOf: 38 + - items: 39 + - description: Registers clock 40 + - description: Main PHY clock 41 + 42 + - items: 43 + - description: Registers clock 44 + - description: Main PHY clock 45 + - description: ULPI PHY clock 46 + 47 + - items: 48 + - description: Registers clock 49 + - description: Main PHY clock 50 + - description: UTMI pads control registers clock 51 + 52 + - items: 53 + - description: Registers clock 54 + - description: Main PHY clock 55 + - description: UTMI timeout clock 56 + - description: UTMI pads control registers clock 57 + 58 + clock-names: 59 + oneOf: 60 + - items: 61 + - const: reg 62 + - const: pll_u 63 + 64 + - items: 65 + - const: reg 66 + - const: pll_u 67 + - const: ulpi-link 68 + 69 + - items: 70 + - const: reg 71 + - const: pll_u 72 + - const: utmi-pads 73 + 74 + - items: 75 + - const: reg 76 + - const: pll_u 77 + - const: timer 78 + - const: utmi-pads 79 + 80 + resets: 81 + oneOf: 82 + - maxItems: 1 83 + description: PHY reset 84 + 85 + - items: 86 + - description: PHY reset 87 + - description: UTMI pads reset 88 + 89 + reset-names: 90 + oneOf: 91 + - const: usb 92 + 93 + - items: 94 + - const: usb 95 + - const: utmi-pads 96 + 97 + "#phy-cells": 98 + const: 0 99 + 100 + phy_type: 101 + $ref: /schemas/types.yaml#/definitions/string 102 + enum: [utmi, ulpi, hsic] 103 + 104 + dr_mode: 105 + $ref: /schemas/types.yaml#/definitions/string 106 + enum: [host, peripheral, otg] 107 + default: host 108 + 109 + vbus-supply: 110 + description: Regulator controlling USB VBUS. 111 + 112 + nvidia,has-legacy-mode: 113 + description: | 114 + Indicates whether this controller can operate in legacy mode 115 + (as APX 2500 / 2600). In legacy mode some registers are accessed 116 + through the APB_MISC base address instead of the USB controller. 117 + type: boolean 118 + 119 + nvidia,is-wired: 120 + description: | 121 + Indicates whether we can do certain kind of power optimizations for 122 + the devices that are always connected. e.g. modem. 123 + type: boolean 124 + 125 + nvidia,has-utmi-pad-registers: 126 + description: | 127 + Indicates whether this controller contains the UTMI pad control 128 + registers common to all USB controllers. 129 + type: boolean 130 + 131 + nvidia,hssync-start-delay: 132 + $ref: /schemas/types.yaml#/definitions/uint32 133 + minimum: 0 134 + maximum: 31 135 + description: | 136 + Number of 480 MHz clock cycles to wait before start of sync launches 137 + RxActive. 138 + 139 + nvidia,elastic-limit: 140 + $ref: /schemas/types.yaml#/definitions/uint32 141 + minimum: 0 142 + maximum: 31 143 + description: Variable FIFO Depth of elastic input store. 144 + 145 + nvidia,idle-wait-delay: 146 + $ref: /schemas/types.yaml#/definitions/uint32 147 + minimum: 0 148 + maximum: 31 149 + description: | 150 + Number of 480 MHz clock cycles of idle to wait before declare IDLE. 151 + 152 + nvidia,term-range-adj: 153 + $ref: /schemas/types.yaml#/definitions/uint32 154 + minimum: 0 155 + maximum: 15 156 + description: Range adjustment on terminations. 157 + 158 + nvidia,xcvr-setup: 159 + $ref: /schemas/types.yaml#/definitions/uint32 160 + minimum: 0 161 + maximum: 127 162 + description: Input of XCVR cell, HS driver output control. 163 + 164 + nvidia,xcvr-setup-use-fuses: 165 + description: Indicates that the value is read from the on-chip fuses. 166 + type: boolean 167 + 168 + nvidia,xcvr-lsfslew: 169 + $ref: /schemas/types.yaml#/definitions/uint32 170 + minimum: 0 171 + maximum: 3 172 + description: LS falling slew rate control. 173 + 174 + nvidia,xcvr-lsrslew: 175 + $ref: /schemas/types.yaml#/definitions/uint32 176 + minimum: 0 177 + maximum: 3 178 + description: LS rising slew rate control. 179 + 180 + nvidia,xcvr-hsslew: 181 + $ref: /schemas/types.yaml#/definitions/uint32 182 + minimum: 0 183 + maximum: 511 184 + description: HS slew rate control. 185 + 186 + nvidia,hssquelch-level: 187 + $ref: /schemas/types.yaml#/definitions/uint32 188 + minimum: 0 189 + maximum: 3 190 + description: HS squelch detector level. 191 + 192 + nvidia,hsdiscon-level: 193 + $ref: /schemas/types.yaml#/definitions/uint32 194 + minimum: 0 195 + maximum: 7 196 + description: HS disconnect detector level. 197 + 198 + nvidia,phy-reset-gpio: 199 + maxItems: 1 200 + description: GPIO used to reset the PHY. 201 + 202 + required: 203 + - compatible 204 + - reg 205 + - clocks 206 + - clock-names 207 + - resets 208 + - reset-names 209 + - "#phy-cells" 210 + - phy_type 211 + 212 + additionalProperties: false 213 + 214 + allOf: 215 + - if: 216 + properties: 217 + phy_type: 218 + const: utmi 219 + 220 + then: 221 + properties: 222 + reg: 223 + minItems: 2 224 + maxItems: 2 225 + 226 + resets: 227 + maxItems: 2 228 + 229 + reset-names: 230 + maxItems: 2 231 + 232 + required: 233 + - nvidia,hssync-start-delay 234 + - nvidia,elastic-limit 235 + - nvidia,idle-wait-delay 236 + - nvidia,term-range-adj 237 + - nvidia,xcvr-lsfslew 238 + - nvidia,xcvr-lsrslew 239 + 240 + anyOf: 241 + - required: ["nvidia,xcvr-setup"] 242 + - required: ["nvidia,xcvr-setup-use-fuses"] 243 + 244 + if: 245 + properties: 246 + compatible: 247 + contains: 248 + const: nvidia,tegra30-usb-phy 249 + 250 + then: 251 + properties: 252 + clocks: 253 + maxItems: 3 254 + 255 + clock-names: 256 + items: 257 + - const: reg 258 + - const: pll_u 259 + - const: utmi-pads 260 + 261 + required: 262 + - nvidia,xcvr-hsslew 263 + - nvidia,hssquelch-level 264 + - nvidia,hsdiscon-level 265 + 266 + else: 267 + properties: 268 + clocks: 269 + maxItems: 4 270 + 271 + clock-names: 272 + items: 273 + - const: reg 274 + - const: pll_u 275 + - const: timer 276 + - const: utmi-pads 277 + 278 + - if: 279 + properties: 280 + phy_type: 281 + const: ulpi 282 + 283 + then: 284 + properties: 285 + reg: 286 + minItems: 1 287 + maxItems: 1 288 + 289 + clocks: 290 + minItems: 2 291 + maxItems: 3 292 + 293 + clock-names: 294 + minItems: 2 295 + maxItems: 3 296 + 297 + oneOf: 298 + - items: 299 + - const: reg 300 + - const: pll_u 301 + 302 + - items: 303 + - const: reg 304 + - const: pll_u 305 + - const: ulpi-link 306 + 307 + resets: 308 + minItems: 1 309 + maxItems: 2 310 + 311 + reset-names: 312 + minItems: 1 313 + maxItems: 2 314 + 315 + examples: 316 + - | 317 + #include <dt-bindings/clock/tegra124-car.h> 318 + 319 + usb-phy@7d008000 { 320 + compatible = "nvidia,tegra124-usb-phy", "nvidia,tegra30-usb-phy"; 321 + reg = <0x7d008000 0x4000>, 322 + <0x7d000000 0x4000>; 323 + phy_type = "utmi"; 324 + clocks = <&tegra_car TEGRA124_CLK_USB3>, 325 + <&tegra_car TEGRA124_CLK_PLL_U>, 326 + <&tegra_car TEGRA124_CLK_USBD>; 327 + clock-names = "reg", "pll_u", "utmi-pads"; 328 + resets = <&tegra_car 59>, <&tegra_car 22>; 329 + reset-names = "usb", "utmi-pads"; 330 + #phy-cells = <0>; 331 + nvidia,hssync-start-delay = <0>; 332 + nvidia,idle-wait-delay = <17>; 333 + nvidia,elastic-limit = <16>; 334 + nvidia,term-range-adj = <6>; 335 + nvidia,xcvr-setup = <9>; 336 + nvidia,xcvr-lsfslew = <0>; 337 + nvidia,xcvr-lsrslew = <3>; 338 + nvidia,hssquelch-level = <2>; 339 + nvidia,hsdiscon-level = <5>; 340 + nvidia,xcvr-hsslew = <12>; 341 + }; 342 + 343 + - | 344 + #include <dt-bindings/clock/tegra20-car.h> 345 + 346 + usb-phy@c5004000 { 347 + compatible = "nvidia,tegra20-usb-phy"; 348 + reg = <0xc5004000 0x4000>; 349 + phy_type = "ulpi"; 350 + clocks = <&tegra_car TEGRA20_CLK_USB2>, 351 + <&tegra_car TEGRA20_CLK_PLL_U>, 352 + <&tegra_car TEGRA20_CLK_CDEV2>; 353 + clock-names = "reg", "pll_u", "ulpi-link"; 354 + resets = <&tegra_car 58>, <&tegra_car 22>; 355 + reset-names = "usb", "utmi-pads"; 356 + #phy-cells = <0>; 357 + };