MediaTek USB3 DRD Controller
Schema identifier ($id): "http://devicetree.org/schemas/usb/mediatek,mtu3.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
Maintainers (maintainers): "Chunfeng Yun <chunfeng.yun@mediatek.com>"
All of these rules must match (allOf) #
Rule 1 #
Shared schema rule (
$ref):usb-drd.yaml
The DRD controller has a glue layer IPPC (IP Port Control), and its host is based on xHCI.
Properties and child nodes (properties) #
compatible — required here #
Array item rules (items) #
Item 1
Allowed values (
enum):"mediatek,mt2712-mtu3","mediatek,mt8173-mtu3","mediatek,mt8183-mtu3","mediatek,mt8186-mtu3","mediatek,mt8188-mtu3","mediatek,mt8192-mtu3","mediatek,mt8195-mtu3","mediatek,mt8365-mtu3"
Item 2
Exact value (
const):"mediatek,mtu3"
reg — required here #
Array item rules (items) #
Item 1
the registers of device MAC
Item 2
the registers of IP Port Control
reg-names — required here #
Array item rules (items) #
Item 1
Exact value (
const):"mac"
Item 2
Exact value (
const):"ippc"
interrupts — required here #
use "interrupts-extended" when the interrupts are connected to the separate interrupt controllers
Minimum number of items (minItems): 1
Array item rules (items) #
Item 1
SSUSB device controller interrupt
Item 2
optional, wakeup interrupt used to support runtime PM
interrupt-names — not listed as required here #
Array item rules (items) #
Item 1
Exact value (
const):"device"
Item 2
Exact value (
const):"wakeup"
power-domains — not listed as required here #
A phandle to USB power domain node to control USB's MTCMOS
Maximum number of items (maxItems): 1
clocks — required here #
Minimum number of items (minItems): 1
Array item rules (items) #
Item 1
Controller clock used by normal mode
Item 2
Reference clock used by low power mode etc
Item 3
Mcu bus clock for register access
Item 4
DMA bus clock for data transfer
Item 5
DRD controller clock
Item 6
Frame count clock
clock-names — required here #
Minimum number of items (minItems): 1
Array item rules (items) #
Item 1
Exact value (
const):"sys_ck"
Item 2
Exact value (
const):"ref_ck"
Item 3
Exact value (
const):"mcu_ck"
Item 4
Exact value (
const):"dma_ck"
Item 5
Exact value (
const):"xhci_ck"
Item 6
Exact value (
const):"frmcnt_ck"
phys — not listed as required here #
List of all the USB PHYs used, it's better to keep the sequence as the hardware layout.
Minimum number of items (minItems): 1
Array item rules (items) #
Item 1
USB2/HS PHY
Item 2
USB3/SS(P) PHY
Item 3
USB2/HS PHY
Item 4
USB3/SS(P) PHY
Item 5
USB2/HS PHY
Item 6
USB3/SS(P) PHY
Item 7
USB2/HS PHY
Item 8
USB3/SS(P) PHY
Item 9
USB2/HS PHY
vusb33-supply — not listed as required here #
Regulator of USB AVDD3.3v
vbus-supply — not listed as required here #
Deprecated (deprecated): true
Regulator of USB VBUS5v, needed when supports dual-role mode. Particularly, if use an output GPIO to control a VBUS regulator, should model it as a regulator. See bindings/regulator/fixed-regulator.yaml It's considered valid for compatibility reasons, not allowed for new bindings, and put into a usb-connector node.
dr_mode — not listed as required here #
Allowed values (enum): "host", "peripheral", "otg"
Default value (default): "otg"
maximum-speed — not listed as required here #
Allowed values (enum): "super-speed-plus", "super-speed", "high-speed", "full-speed"
resets — not listed as required here #
Maximum number of items (maxItems): 1
#address-cells — not listed as required here #
#size-cells — not listed as required here #
ranges — not listed as required here #
true — No constraints added by this property rule.
extcon — not listed as required here #
Deprecated (deprecated): true
Phandle to the extcon device detecting the IDDIG state, needed when supports dual-role mode. It's considered valid for compatibility reasons, not allowed for new bindings, and use "usb-role-switch" property instead.
usb-role-switch — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag
Support role switch.
Value type (type): "boolean"
role-switch-default-mode — not listed as required here #
Allowed values (enum): "host", "peripheral"
Default value (default): "host"
connector — not listed as required here #
Shared schema rule ($ref): /schemas/connector/usb-connector.yaml#
Connector for dual role switch, especially for "gpio-usb-b-connector"
Value type (type): "object"
port — not listed as required here #
Any connector to the data bus of this controller should be modelled using the OF graph bindings specified, if the "usb-role-switch" property is used. See graph.txt
Shared schema rule ($ref): /schemas/graph.yaml#/properties/port
ports — not listed as required here #
Shared schema rule ($ref): /schemas/graph.yaml#/properties/ports
Properties and child nodes (properties) #
port@0 — not listed as required here
Shared schema rule ($ref): /schemas/graph.yaml#/properties/port
High Speed (HS) data bus.
port@1 — not listed as required here
Shared schema rule ($ref): /schemas/graph.yaml#/properties/port
Super Speed (SS) data bus.
enable-manual-drd — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag
supports manual dual-role switch via debugfs; usually used when receptacle is TYPE-A and also wants to support dual-role mode.
Value type (type): "boolean"
wakeup-source — not listed as required here #
enable USB remote wakeup, see power/wakeup-source.txt
Value type (type): "boolean"
mediatek,syscon-wakeup — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle-array
Maximum number of items (maxItems): 1
A phandle to syscon used to access the register of the USB wakeup glue layer between xHCI and SPM, the field should always be 3 cells long.
Array item rules (items) #
Array item rules (
items)Item 1
The first cell represents a phandle to syscon
Item 2
The second cell represents the register base address of the glue layer in syscon
Item 3
The third cell represents the hardware version of the glue layer, 1 - used by mt8173 etc, revision 1 without following IPM rule; 2 - used by mt2712 etc, revision 2 with following IPM rule; 101 - used by mt8183, specific 1.01; 102 - used by mt8192, specific 1.02; 103 - used by mt8195, IP0, specific 1.03; 105 - used by mt8195, IP2, specific 1.05; 106 - used by mt8195, IP3, specific 1.06;
mediatek,u3p-dis-msk — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
The mask to disable u3ports, bit0 for u3port0, bit1 for u3port1, ... etc
mediatek,u2p-dis-msk — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
The mask to disable u2ports, bit0 for u2port0, bit1 for u2port1, ... etc; but can't disable u2port0 if dual role mode is enabled, so will be skipped in this case.
Properties matching a name pattern (patternProperties) #
^usb@[0-9a-f]+$ — name matches this regular expression #
Value type (type): "object"
Shared schema rule ($ref): /schemas/usb/mediatek,mtk-xhci.yaml#
The xhci should be added as subnode to mtu3 as shown in the following example if the host mode is enabled.
Property dependencies (dependencies) #
connector — applies when this property is present #
Also requires: "usb-role-switch"
port — applies when this property is present #
Also requires: "usb-role-switch"
role-switch-default-mode — applies when this property is present #
Also requires: "usb-role-switch"
wakeup-source — applies when this property is present #
Also requires: "mediatek,syscon-wakeup"
Required in this object (required): "compatible", "reg", "reg-names", "interrupts", "clocks", "clock-names"
Properties not matched by properties or patternProperties in this schema (additionalProperties) #
false
Not allowed by this rule.
Examples (examples) #
#include <dt-bindings/clock/mt8173-clk.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/phy/phy.h>
#include <dt-bindings/power/mt8173-power.h>
usb@11271000 {
compatible = "mediatek,mt8173-mtu3", "mediatek,mtu3";
reg = <0x11271000 0x3000>, <0x11280700 0x0100>;
reg-names = "mac", "ippc";
interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_LOW>;
phys = <&phy_port0 PHY_TYPE_USB3>, <&phy_port1 PHY_TYPE_USB2>;
power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>;
clocks = <&topckgen CLK_TOP_USB30_SEL>;
clock-names = "sys_ck";
vusb33-supply = <&mt6397_vusb_reg>;
vbus-supply = <&usb_p0_vbus>;
extcon = <&extcon_usb>;
dr_mode = "otg";
wakeup-source;
mediatek,syscon-wakeup = <&pericfg 0x400 1>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
xhci: usb@11270000 {
compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci";
reg = <0x11270000 0x1000>;
reg-names = "mac";
interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>;
power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>;
clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>;
clock-names = "sys_ck", "ref_ck";
vusb33-supply = <&mt6397_vusb_reg>;
};
};
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/power/mt2712-power.h>
usb@112c1000 {
compatible = "mediatek,mt2712-mtu3", "mediatek,mtu3";
reg = <0x112c1000 0x3000>, <0x112d0700 0x0100>;
reg-names = "mac", "ippc";
interrupts = <GIC_SPI 248 IRQ_TYPE_LEVEL_LOW>;
phys = <&u2port2 PHY_TYPE_USB2>;
power-domains = <&scpsys MT2712_POWER_DOMAIN_USB2>;
clocks = <&topckgen CLK_TOP_USB30_SEL>;
clock-names = "sys_ck";
dr_mode = "otg";
usb-role-switch;
#address-cells = <1>;
#size-cells = <1>;
ranges;
host0: usb@11270000 {
compatible = "mediatek,mt2712-xhci", "mediatek,mtk-xhci";
reg = <0x11270000 0x1000>;
reg-names = "mac";
interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_LOW>;
power-domains = <&scpsys MT2712_POWER_DOMAIN_USB>;
clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>;
clock-names = "sys_ck", "ref_ck";
};
connector {
compatible = "gpio-usb-b-connector", "usb-b-connector";
type = "micro";
id-gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
vbus-supply = <&usb_p0_vbus>;
};
};
usb@11201000 {
compatible = "mediatek,mt8183-mtu3", "mediatek,mtu3";
reg = <0x11201000 0x2e00>, <0x11203e00 0x0100>;
reg-names = "mac", "ippc";
interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_LOW>;
phys = <&u2port0 PHY_TYPE_USB2>;
clocks = <&clk26m>;
clock-names = "sys_ck";
mediatek,syscon-wakeup = <&pericfg 0x400 1>;
wakeup-source;
dr_mode = "otg";
usb-role-switch;
role-switch-default-mode = "host";
#address-cells = <1>;
#size-cells = <1>;
ranges;
host: usb@11200000 {
compatible = "mediatek,mt8183-xhci", "mediatek,mtk-xhci";
reg = <0x11200000 0x1000>;
reg-names = "mac";
interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_LOW>;
clocks = <&clk26m>;
clock-names = "sys_ck";
};
port {
usb_role_sw: endpoint {
remote-endpoint = <&hs_ep>;
};
};
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
Line 2: Copyright (c) 2020 MediaTek
Line 75: required, others are optional
Line 88: required, others are optional
Line 90: the following for backward compatible
Line 216: Required child node when support dual-role
Line 242: Dual role switch by extcon
Line 281: Dual role switch by gpio-usb-b-connector
Line 319: Dual role switch with type-c