# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/usb/ti,am33xx-usb.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TI AM33xx USB Wrapper

description:
  The glue layer contains multiple child nodes. It is required to have at least
  a USB node and a PHY node. The second USB node and its PHY node are optional.
  The DMA node is also optional.

maintainers:
  - Sebastian Andrzej Siewior <bigeasy@linutronix.de>

properties:
  compatible:
    const: ti,am33xx-usb

  reg:
    maxItems: 1

  ranges: true

  "#address-cells":
    const: 1

  "#size-cells":
    const: 1

  ti,hwmods:
    $ref: /schemas/types.yaml#/definitions/string
    description: Name of the hwmod associated with the USB module.
    const: usb_otg_hs
    deprecated: true

patternProperties:
  "^(usb-)?phy@[0-9a-f]+$":
    $ref: /schemas/phy/ti,am335x-usb-phy.yaml#

  "^usb@[0-9a-f]+$":
    $ref: /schemas/usb/ti,musb-am33xx.yaml#

  "^dma-controller@[0-9a-f]+$":
    $ref: /schemas/dma/ti/ti,cppi41.yaml#

required:
  - compatible
  - reg
  - ranges
  - "#address-cells"
  - "#size-cells"

additionalProperties: false

examples:
  - |
    usb@47400000 {
        compatible = "ti,am33xx-usb";
        reg = <0x47400000 0x1000>;
        ranges;
        #address-cells = <1>;
        #size-cells = <1>;
        ti,hwmods = "usb_otg_hs";

        usb-phy@47401300 {
            compatible = "ti,am335x-usb-phy";
            reg = <0x47401300 0x100>;
            reg-names = "phy";
            ti,ctrl_mod = <&ctrl_mod>;
            #phy-cells = <0>;
        };

        usb@47401000 {
            compatible = "ti,musb-am33xx";
            reg = <0x47401400 0x400>,
                  <0x47401000 0x200>;
            reg-names = "mc", "control";
            interrupts = <18>;
            interrupt-names = "mc";
            dr_mode = "otg";
            mentor,multipoint = <1>;
            mentor,num-eps = <16>;
            mentor,ram-bits = <12>;
            mentor,power = <500>;
            phys = <&usb0_phy>;
        };

        dma-controller@7402000 {
            compatible = "ti,am3359-cppi41";
            reg = <0x47400000 0x1000>,
                  <0x47402000 0x1000>,
                  <0x47403000 0x1000>,
                  <0x47404000 0x4000>;
            reg-names = "glue", "controller", "scheduler", "queuemgr";
            interrupts = <17>;
            interrupt-names = "glue";
            #dma-cells = <2>;
            dma-channels = <30>;
            dma-requests = <256>;
        };
    };