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