xref: /freebsd/sys/contrib/device-tree/Bindings/usb/mediatek,musb.yaml (revision 5def4c47d4bd90b209b9b4a4ba9faec15846d8fd)
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,musb.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: MediaTek MUSB DRD/OTG Controller Device Tree Bindings
9
10maintainers:
11  - Min Guo <min.guo@mediatek.com>
12
13properties:
14  $nodename:
15    pattern: '^usb@[0-9a-f]+$'
16
17  compatible:
18    items:
19      - enum:
20          - mediatek,mt8516-musb
21          - mediatek,mt2701-musb
22      - const: mediatek,mtk-musb
23
24  reg:
25    maxItems: 1
26
27  interrupts:
28    maxItems: 1
29
30  interrupt-names:
31    items:
32      - const: mc
33
34  clocks:
35    items:
36      - description: The main/core clock
37      - description: The system bus clock
38      - description: The 48Mhz clock
39
40  clock-names:
41    items:
42      - const: main
43      - const: mcu
44      - const: univpll
45
46  phys:
47    maxItems: 1
48
49  usb-role-switch:
50    $ref: /schemas/types.yaml#/definitions/flag
51    description: Support role switch. See usb/generic.txt
52    type: boolean
53
54  dr_mode:
55    enum:
56      - host
57      - otg
58      - peripheral
59
60  power-domains:
61    description: A phandle to USB power domain node to control USB's MTCMOS
62    maxItems: 1
63
64  connector:
65    $ref: /connector/usb-connector.yaml#
66    description: Connector for dual role switch
67    type: object
68
69dependencies:
70  usb-role-switch: [ 'connector' ]
71  connector: [ 'usb-role-switch' ]
72
73required:
74  - compatible
75  - reg
76  - interrupts
77  - interrupt-names
78  - phys
79  - clocks
80  - clock-names
81
82additionalProperties: false
83
84examples:
85  - |
86    #include <dt-bindings/clock/mt2701-clk.h>
87    #include <dt-bindings/gpio/gpio.h>
88    #include <dt-bindings/interrupt-controller/arm-gic.h>
89    #include <dt-bindings/interrupt-controller/irq.h>
90    #include <dt-bindings/phy/phy.h>
91    #include <dt-bindings/power/mt2701-power.h>
92
93    usb@11200000 {
94        compatible = "mediatek,mt2701-musb", "mediatek,mtk-musb";
95        reg = <0x11200000 0x1000>;
96        interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
97        interrupt-names = "mc";
98        phys = <&u2port2 PHY_TYPE_USB2>;
99        dr_mode = "otg";
100        clocks = <&pericfg CLK_PERI_USB0>,
101                 <&pericfg CLK_PERI_USB0_MCU>,
102                 <&pericfg CLK_PERI_USB_SLV>;
103        clock-names = "main","mcu","univpll";
104        power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>;
105        usb-role-switch;
106
107        connector {
108            compatible = "gpio-usb-b-connector", "usb-b-connector";
109            type = "micro";
110            id-gpios = <&pio 44 GPIO_ACTIVE_HIGH>;
111            vbus-supply = <&usb_vbus>;
112        };
113    };
114...
115