xref: /linux/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml (revision 6315d93541f8a5f77c5ef5c4f25233e66d189603)
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,mt7988-xhci
33          - mediatek,mt8173-xhci
34          - mediatek,mt8183-xhci
35          - mediatek,mt8186-xhci
36          - mediatek,mt8188-xhci
37          - mediatek,mt8192-xhci
38          - mediatek,mt8195-xhci
39          - mediatek,mt8365-xhci
40      - const: mediatek,mtk-xhci
41
42  reg:
43    minItems: 1
44    items:
45      - description: the registers of xHCI MAC
46      - description: the registers of IP Port Control
47
48  reg-names:
49    minItems: 1
50    items:
51      - const: mac
52      - const: ippc  # optional, only needed for case 1.
53
54  interrupts:
55    description:
56      use "interrupts-extended" when the interrupts are connected to the
57      separate interrupt controllers
58    minItems: 1
59    items:
60      - description: xHCI host controller interrupt
61      - description: optional, wakeup interrupt used to support runtime PM
62
63  interrupt-names:
64    minItems: 1
65    items:
66      - const: host
67      - const: wakeup
68
69  power-domains:
70    description: A phandle to USB power domain node to control USB's MTCMOS
71    maxItems: 1
72
73  clocks:
74    minItems: 1
75    items:
76      - description: Controller clock used by normal mode
77      - description: Reference clock used by low power mode etc
78      - description: Mcu bus clock for register access
79      - description: DMA bus clock for data transfer
80      - description: controller clock
81      - description: frame count clock
82
83  clock-names:
84    minItems: 1
85    items:
86      - const: sys_ck  # required, the following ones are optional
87      - const: ref_ck
88      - const: mcu_ck
89      - const: dma_ck
90      - const: xhci_ck
91      - const: frmcnt_ck
92
93  phys:
94    description:
95      List of all PHYs used on this HCD, it's better to keep PHYs in order
96      as the hardware layout
97    minItems: 1
98    items:
99      - description: USB2/HS PHY    # required, others are optional
100      - description: USB3/SS(P) PHY
101      - description: USB2/HS PHY
102      - description: USB3/SS(P) PHY
103      - description: USB2/HS PHY
104      - description: USB3/SS(P) PHY
105      - description: USB2/HS PHY
106      - description: USB3/SS(P) PHY
107      - description: USB2/HS PHY
108
109  port:
110    $ref: /schemas/graph.yaml#/properties/port
111    description: Super Speed (SS) Output endpoint to a Type-C connector
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  rx-fifo-depth:
133    $ref: /schemas/types.yaml#/definitions/uint32
134    description:
135      It is a quirk used to work around Gen1 isoc-in endpoint transfer issue
136      that still send out unexpected ACK after device finishes the burst
137      transfer with a short packet and cause an exception, specially on a 4K
138      camera device, it happens on controller before about IPM v1.6.0;
139      the side-effect is that it may cause performance drop about 10%,
140      including bulk transfer, prefer to use 3k here. The size is in bytes.
141    enum: [1024, 2048, 3072, 4096]
142
143  # the following properties are only used for case 1
144  wakeup-source:
145    description: enable USB remote wakeup, see power/wakeup-source.txt
146    type: boolean
147
148  mediatek,syscon-wakeup:
149    $ref: /schemas/types.yaml#/definitions/phandle-array
150    maxItems: 1
151    description:
152      A phandle to syscon used to access the register of the USB wakeup glue
153      layer between xHCI and SPM, the field should always be 3 cells long.
154    items:
155      items:
156        - description:
157            The first cell represents a phandle to syscon
158        - description:
159            The second cell represents the register base address of the glue
160            layer in syscon
161        - description: |
162            The third cell represents the hardware version of the glue layer,
163            1 - used by mt8173 etc, revision 1 without following IPM rule;
164            2 - used by mt2712 etc, revision 2 following IPM rule;
165            101 - used by mt8183, specific 1.01;
166            102 - used by mt8192, specific 1.02;
167            103 - used by mt8195, IP0, specific 1.03;
168            104 - used by mt8195, IP1, specific 1.04;
169            105 - used by mt8195, IP2, specific 1.05;
170            106 - used by mt8195, IP3, specific 1.06;
171          enum: [1, 2, 101, 102, 103, 104, 105, 106]
172
173  mediatek,u3p-dis-msk:
174    $ref: /schemas/types.yaml#/definitions/uint32
175    description: The mask to disable u3ports, bit0 for u3port0,
176      bit1 for u3port1, ... etc
177
178  mediatek,u2p-dis-msk:
179    $ref: /schemas/types.yaml#/definitions/uint32
180    description: The mask to disable u2ports, bit0 for u2port0,
181      bit1 for u2port1, ... etc
182
183  "#address-cells":
184    const: 1
185
186  "#size-cells":
187    const: 0
188
189patternProperties:
190  "@[0-9a-f]{1}$":
191    type: object
192    description: The hard wired USB devices.
193
194dependencies:
195  wakeup-source: [ 'mediatek,syscon-wakeup' ]
196
197required:
198  - compatible
199  - reg
200  - reg-names
201  - interrupts
202  - clocks
203  - clock-names
204
205additionalProperties: false
206
207examples:
208  - |
209    #include <dt-bindings/clock/mt8173-clk.h>
210    #include <dt-bindings/interrupt-controller/arm-gic.h>
211    #include <dt-bindings/interrupt-controller/irq.h>
212    #include <dt-bindings/phy/phy.h>
213    #include <dt-bindings/power/mt8173-power.h>
214
215    usb@11270000 {
216        compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci";
217        reg = <0x11270000 0x1000>, <0x11280700 0x0100>;
218        reg-names = "mac", "ippc";
219        interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>;
220        power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>;
221        clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>;
222        clock-names = "sys_ck", "ref_ck";
223        phys = <&u3port0 PHY_TYPE_USB3>, <&u2port1 PHY_TYPE_USB2>;
224        vusb33-supply = <&mt6397_vusb_reg>;
225        vbus-supply = <&usb_p1_vbus>;
226        imod-interval-ns = <10000>;
227        mediatek,syscon-wakeup = <&pericfg 0x400 1>;
228        wakeup-source;
229        usb3-lpm-capable;
230    };
231...
232