Back to home page

OSCL-LXR

 
 

    


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,mtk-xhci.yaml#
0006 $schema: http://devicetree.org/meta-schemas/core.yaml#
0007 
0008 title: MediaTek USB3 xHCI Device Tree Bindings
0009 
0010 maintainers:
0011   - Chunfeng Yun <chunfeng.yun@mediatek.com>
0012 
0013 allOf:
0014   - $ref: "usb-xhci.yaml"
0015 
0016 description: |
0017   There are two scenarios:
0018   case 1: only supports xHCI driver;
0019   case 2: supports dual-role mode, and the host is based on xHCI driver.
0020 
0021 properties:
0022   # common properties for both case 1 and case 2
0023   compatible:
0024     items:
0025       - enum:
0026           - mediatek,mt2701-xhci
0027           - mediatek,mt2712-xhci
0028           - mediatek,mt7622-xhci
0029           - mediatek,mt7623-xhci
0030           - mediatek,mt7629-xhci
0031           - mediatek,mt8173-xhci
0032           - mediatek,mt8183-xhci
0033           - mediatek,mt8186-xhci
0034           - mediatek,mt8188-xhci
0035           - mediatek,mt8192-xhci
0036           - mediatek,mt8195-xhci
0037       - const: mediatek,mtk-xhci
0038 
0039   reg:
0040     minItems: 1
0041     items:
0042       - description: the registers of xHCI MAC
0043       - description: the registers of IP Port Control
0044 
0045   reg-names:
0046     minItems: 1
0047     items:
0048       - const: mac
0049       - const: ippc  # optional, only needed for case 1.
0050 
0051   interrupts:
0052     description:
0053       use "interrupts-extended" when the interrupts are connected to the
0054       separate interrupt controllers
0055     minItems: 1
0056     items:
0057       - description: xHCI host controller interrupt
0058       - description: optional, wakeup interrupt used to support runtime PM
0059 
0060   interrupt-names:
0061     minItems: 1
0062     items:
0063       - const: host
0064       - const: wakeup
0065 
0066   power-domains:
0067     description: A phandle to USB power domain node to control USB's MTCMOS
0068     maxItems: 1
0069 
0070   clocks:
0071     minItems: 1
0072     items:
0073       - description: Controller clock used by normal mode
0074       - description: Reference clock used by low power mode etc
0075       - description: Mcu bus clock for register access
0076       - description: DMA bus clock for data transfer
0077       - description: controller clock
0078 
0079   clock-names:
0080     minItems: 1
0081     items:
0082       - const: sys_ck  # required, the following ones are optional
0083       - const: ref_ck
0084       - const: mcu_ck
0085       - const: dma_ck
0086       - const: xhci_ck
0087 
0088   assigned-clocks:
0089     minItems: 1
0090     maxItems: 5
0091 
0092   assigned-clock-parents:
0093     minItems: 1
0094     maxItems: 5
0095 
0096   phys:
0097     description:
0098       List of all PHYs used on this HCD, it's better to keep PHYs in order
0099       as the hardware layout
0100     minItems: 1
0101     items:
0102       - description: USB2/HS PHY    # required, others are optional
0103       - description: USB3/SS(P) PHY
0104       - description: USB2/HS PHY
0105       - description: USB3/SS(P) PHY
0106       - description: USB2/HS PHY
0107       - description: USB3/SS(P) PHY
0108       - description: USB2/HS PHY
0109       - description: USB3/SS(P) PHY
0110       - description: USB2/HS PHY
0111 
0112   vusb33-supply:
0113     description: Regulator of USB AVDD3.3v
0114 
0115   vbus-supply:
0116     description: Regulator of USB VBUS5v
0117 
0118   resets:
0119     maxItems: 1
0120 
0121   usb3-lpm-capable: true
0122 
0123   usb2-lpm-disable: true
0124 
0125   imod-interval-ns:
0126     description:
0127       Interrupt moderation interval value, it is 8 times as much as that
0128       defined in the xHCI spec on MTK's controller.
0129     default: 5000
0130 
0131   # the following properties are only used for case 1
0132   wakeup-source:
0133     description: enable USB remote wakeup, see power/wakeup-source.txt
0134     type: boolean
0135 
0136   mediatek,syscon-wakeup:
0137     $ref: /schemas/types.yaml#/definitions/phandle-array
0138     maxItems: 1
0139     description:
0140       A phandle to syscon used to access the register of the USB wakeup glue
0141       layer between xHCI and SPM, the field should always be 3 cells long.
0142     items:
0143       items:
0144         - description:
0145             The first cell represents a phandle to syscon
0146         - description:
0147             The second cell represents the register base address of the glue
0148             layer in syscon
0149         - description: |
0150             The third cell represents the hardware version of the glue layer,
0151             1 - used by mt8173 etc, revision 1 without following IPM rule;
0152             2 - used by mt2712 etc, revision 2 following IPM rule;
0153             101 - used by mt8183, specific 1.01;
0154             102 - used by mt8192, specific 1.02;
0155             103 - used by mt8195, IP0, specific 1.03;
0156             104 - used by mt8195, IP1, specific 1.04;
0157             105 - used by mt8195, IP2, specific 1.05;
0158             106 - used by mt8195, IP3, specific 1.06;
0159           enum: [1, 2, 101, 102, 103, 104, 105, 106]
0160 
0161   mediatek,u3p-dis-msk:
0162     $ref: /schemas/types.yaml#/definitions/uint32
0163     description: The mask to disable u3ports, bit0 for u3port0,
0164       bit1 for u3port1, ... etc
0165 
0166   mediatek,u2p-dis-msk:
0167     $ref: /schemas/types.yaml#/definitions/uint32
0168     description: The mask to disable u2ports, bit0 for u2port0,
0169       bit1 for u2port1, ... etc
0170 
0171   "#address-cells":
0172     const: 1
0173 
0174   "#size-cells":
0175     const: 0
0176 
0177 patternProperties:
0178   "@[0-9a-f]{1}$":
0179     type: object
0180     description: The hard wired USB devices.
0181 
0182 dependencies:
0183   wakeup-source: [ 'mediatek,syscon-wakeup' ]
0184 
0185 required:
0186   - compatible
0187   - reg
0188   - reg-names
0189   - interrupts
0190   - clocks
0191   - clock-names
0192 
0193 additionalProperties: false
0194 
0195 examples:
0196   - |
0197     #include <dt-bindings/clock/mt8173-clk.h>
0198     #include <dt-bindings/interrupt-controller/arm-gic.h>
0199     #include <dt-bindings/interrupt-controller/irq.h>
0200     #include <dt-bindings/phy/phy.h>
0201     #include <dt-bindings/power/mt8173-power.h>
0202 
0203     usb@11270000 {
0204         compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci";
0205         reg = <0x11270000 0x1000>, <0x11280700 0x0100>;
0206         reg-names = "mac", "ippc";
0207         interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_LOW>;
0208         power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>;
0209         clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>;
0210         clock-names = "sys_ck", "ref_ck";
0211         phys = <&u3port0 PHY_TYPE_USB3>, <&u2port1 PHY_TYPE_USB2>;
0212         vusb33-supply = <&mt6397_vusb_reg>;
0213         vbus-supply = <&usb_p1_vbus>;
0214         imod-interval-ns = <10000>;
0215         mediatek,syscon-wakeup = <&pericfg 0x400 1>;
0216         wakeup-source;
0217         usb3-lpm-capable;
0218     };
0219 ...