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