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