1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2# Copyright (c) 2020 MediaTek
3%YAML 1.2
4---
5$id: http://devicetree.org/schemas/usb/mediatek,mtk-xhci.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: MediaTek USB3 xHCI
9
10maintainers:
11  - Chunfeng Yun <chunfeng.yun@mediatek.com>
12
13allOf:
14  - $ref: "usb-xhci.yaml"
15
16description: |
17  There are two scenarios:
18  case 1: only supports xHCI driver;
19  case 2: supports dual-role mode, and the host is based on xHCI driver.
20
21properties:
22  # common properties for both case 1 and case 2
23  compatible:
24    items:
25      - enum:
26          - mediatek,mt2701-xhci
27          - mediatek,mt2712-xhci
28          - mediatek,mt7622-xhci
29          - mediatek,mt7623-xhci
30          - mediatek,mt7629-xhci
31          - mediatek,mt7986-xhci
32          - mediatek,mt8173-xhci
33          - mediatek,mt8183-xhci
34          - mediatek,mt8186-xhci
35          - mediatek,mt8188-xhci
36          - mediatek,mt8192-xhci
37          - mediatek,mt8195-xhci
38      - const: mediatek,mtk-xhci
39
40  reg:
41    minItems: 1
42    items:
43      - description: the registers of xHCI MAC
44      - description: the registers of IP Port Control
45
46  reg-names:
47    minItems: 1
48    items:
49      - const: mac
50      - const: ippc  # optional, only needed for case 1.
51
52  interrupts:
53    description:
54      use "interrupts-extended" when the interrupts are connected to the
55      separate interrupt controllers
56    minItems: 1
57    items:
58      - description: xHCI host controller interrupt
59      - description: optional, wakeup interrupt used to support runtime PM
60
61  interrupt-names:
62    minItems: 1
63    items:
64      - const: host
65      - const: wakeup
66
67  power-domains:
68    description: A phandle to USB power domain node to control USB's MTCMOS
69    maxItems: 1
70
71  clocks:
72    minItems: 1
73    items:
74      - description: Controller clock used by normal mode
75      - description: Reference clock used by low power mode etc
76      - description: Mcu bus clock for register access
77      - description: DMA bus clock for data transfer
78      - description: controller clock
79
80  clock-names:
81    minItems: 1
82    items:
83      - const: sys_ck  # required, the following ones are optional
84      - const: ref_ck
85      - const: mcu_ck
86      - const: dma_ck
87      - const: xhci_ck
88
89  assigned-clocks:
90    minItems: 1
91    maxItems: 5
92
93  assigned-clock-parents:
94    minItems: 1
95    maxItems: 5
96
97  phys:
98    description:
99      List of all PHYs used on this HCD, it's better to keep PHYs in order
100      as the hardware layout
101    minItems: 1
102    items:
103      - description: USB2/HS PHY    # required, others are optional
104      - description: USB3/SS(P) PHY
105      - description: USB2/HS PHY
106      - description: USB3/SS(P) PHY
107      - description: USB2/HS PHY
108      - description: USB3/SS(P) PHY
109      - description: USB2/HS PHY
110      - description: USB3/SS(P) PHY
111      - description: USB2/HS PHY
112
113  vusb33-supply:
114    description: Regulator of USB AVDD3.3v
115
116  vbus-supply:
117    description: Regulator of USB VBUS5v
118
119  resets:
120    maxItems: 1
121
122  usb3-lpm-capable: true
123
124  usb2-lpm-disable: true
125
126  imod-interval-ns:
127    description:
128      Interrupt moderation interval value, it is 8 times as much as that
129      defined in the xHCI spec on MTK's controller.
130    default: 5000
131
132  # the following properties are only used for case 1
133  wakeup-source:
134    description: enable USB remote wakeup, see power/wakeup-source.txt
135    type: boolean
136
137  mediatek,syscon-wakeup:
138    $ref: /schemas/types.yaml#/definitions/phandle-array
139    maxItems: 1
140    description:
141      A phandle to syscon used to access the register of the USB wakeup glue
142      layer between xHCI and SPM, the field should always be 3 cells long.
143    items:
144      items:
145        - description:
146            The first cell represents a phandle to syscon
147        - description:
148            The second cell represents the register base address of the glue
149            layer in syscon
150        - description: |
151            The third cell represents the hardware version of the glue layer,
152            1 - used by mt8173 etc, revision 1 without following IPM rule;
153            2 - used by mt2712 etc, revision 2 following IPM rule;
154            101 - used by mt8183, specific 1.01;
155            102 - used by mt8192, specific 1.02;
156            103 - used by mt8195, IP0, specific 1.03;
157            104 - used by mt8195, IP1, specific 1.04;
158            105 - used by mt8195, IP2, specific 1.05;
159            106 - used by mt8195, IP3, specific 1.06;
160          enum: [1, 2, 101, 102, 103, 104, 105, 106]
161
162  mediatek,u3p-dis-msk:
163    $ref: /schemas/types.yaml#/definitions/uint32
164    description: The mask to disable u3ports, bit0 for u3port0,
165      bit1 for u3port1, ... etc
166
167  mediatek,u2p-dis-msk:
168    $ref: /schemas/types.yaml#/definitions/uint32
169    description: The mask to disable u2ports, bit0 for u2port0,
170      bit1 for u2port1, ... etc
171
172  "#address-cells":
173    const: 1
174
175  "#size-cells":
176    const: 0
177
178patternProperties:
179  "@[0-9a-f]{1}$":
180    type: object
181    description: The hard wired USB devices.
182
183dependencies:
184  wakeup-source: [ 'mediatek,syscon-wakeup' ]
185
186required:
187  - compatible
188  - reg
189  - reg-names
190  - interrupts
191  - clocks
192  - clock-names
193
194additionalProperties: false
195
196examples:
197  - |
198    #include <dt-bindings/clock/mt8173-clk.h>
199    #include <dt-bindings/interrupt-controller/arm-gic.h>
200    #include <dt-bindings/interrupt-controller/irq.h>
201    #include <dt-bindings/phy/phy.h>
202    #include <dt-bindings/power/mt8173-power.h>
203
204    usb@11270000 {
205        compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci";
206        reg = <0x11270000 0x1000>, <0x11280700 0x0100>;
207        reg-names = "mac", "ippc";
208        interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>;
209        power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>;
210        clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>;
211        clock-names = "sys_ck", "ref_ck";
212        phys = <&u3port0 PHY_TYPE_USB3>, <&u2port1 PHY_TYPE_USB2>;
213        vusb33-supply = <&mt6397_vusb_reg>;
214        vbus-supply = <&usb_p1_vbus>;
215        imod-interval-ns = <10000>;
216        mediatek,syscon-wakeup = <&pericfg 0x400 1>;
217        wakeup-source;
218        usb3-lpm-capable;
219    };
220...
221