0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 # Copyright (c) 2020 MediaTek
0003 %YAML 1.2
0004 ---
0005 $id: http://devicetree.org/schemas/usb/mediatek,musb.yaml#
0006 $schema: http://devicetree.org/meta-schemas/core.yaml#
0007
0008 title: MediaTek MUSB DRD/OTG Controller Device Tree Bindings
0009
0010 maintainers:
0011 - Min Guo <min.guo@mediatek.com>
0012
0013 properties:
0014 $nodename:
0015 pattern: '^usb@[0-9a-f]+$'
0016
0017 compatible:
0018 items:
0019 - enum:
0020 - mediatek,mt8516-musb
0021 - mediatek,mt2701-musb
0022 - mediatek,mt7623-musb
0023 - const: mediatek,mtk-musb
0024
0025 reg:
0026 maxItems: 1
0027
0028 interrupts:
0029 maxItems: 1
0030
0031 interrupt-names:
0032 items:
0033 - const: mc
0034
0035 clocks:
0036 items:
0037 - description: The main/core clock
0038 - description: The system bus clock
0039 - description: The 48Mhz clock
0040
0041 clock-names:
0042 items:
0043 - const: main
0044 - const: mcu
0045 - const: univpll
0046
0047 phys:
0048 maxItems: 1
0049
0050 usb-role-switch:
0051 $ref: /schemas/types.yaml#/definitions/flag
0052 description: Support role switch. See usb/generic.txt
0053 type: boolean
0054
0055 dr_mode:
0056 enum:
0057 - host
0058 - otg
0059 - peripheral
0060
0061 power-domains:
0062 description: A phandle to USB power domain node to control USB's MTCMOS
0063 maxItems: 1
0064
0065 connector:
0066 $ref: /schemas/connector/usb-connector.yaml#
0067 description: Connector for dual role switch
0068 type: object
0069
0070 dependencies:
0071 usb-role-switch: [ 'connector' ]
0072 connector: [ 'usb-role-switch' ]
0073
0074 required:
0075 - compatible
0076 - reg
0077 - interrupts
0078 - interrupt-names
0079 - phys
0080 - clocks
0081 - clock-names
0082
0083 additionalProperties: false
0084
0085 examples:
0086 - |
0087 #include <dt-bindings/clock/mt2701-clk.h>
0088 #include <dt-bindings/gpio/gpio.h>
0089 #include <dt-bindings/interrupt-controller/arm-gic.h>
0090 #include <dt-bindings/interrupt-controller/irq.h>
0091 #include <dt-bindings/phy/phy.h>
0092 #include <dt-bindings/power/mt2701-power.h>
0093
0094 usb@11200000 {
0095 compatible = "mediatek,mt2701-musb", "mediatek,mtk-musb";
0096 reg = <0x11200000 0x1000>;
0097 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
0098 interrupt-names = "mc";
0099 phys = <&u2port2 PHY_TYPE_USB2>;
0100 dr_mode = "otg";
0101 clocks = <&pericfg CLK_PERI_USB0>,
0102 <&pericfg CLK_PERI_USB0_MCU>,
0103 <&pericfg CLK_PERI_USB_SLV>;
0104 clock-names = "main","mcu","univpll";
0105 power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>;
0106 usb-role-switch;
0107
0108 connector {
0109 compatible = "gpio-usb-b-connector", "usb-b-connector";
0110 type = "micro";
0111 id-gpios = <&pio 44 GPIO_ACTIVE_HIGH>;
0112 vbus-supply = <&usb_vbus>;
0113 };
0114 };
0115 ...