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

title: TI AM33xx/DM816 MUSB

maintainers:
  - Ravi B <ravibabu@ti.com>
  - Ajay Kumar Gupta <ajay.gupta@ti.com>

allOf:
  - $ref: /schemas/usb/usb-drd.yaml#

properties:
  compatible:
    enum:
      - ti,musb-am33xx
      - ti,musb-dm816

  reg:
    maxItems: 2

  reg-names:
    items:
      - const: mc
      - const: control

  interrupts:
    minItems: 1
    maxItems: 2

  interrupt-names:
    minItems: 1
    items:
      - const: mc
      - const: vbus

  mentor,multipoint:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Indicates the musb controller supports multipoint.
    enum: [0, 1]

  mentor,num-eps:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Specifies the number of endpoints.
    const: 16

  mentor,ram-bits:
    description: Specifies the ram address size.
    const: 12

  mentor,power:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Controller supply capacity (in mA) when operating in host mode.
    const: 500

  phys:
    maxItems: 1

  dmas:
    minItems: 1
    maxItems: 30

  dma-names:
    minItems: 1
    maxItems: 30
    items:
      pattern: "^(rx|tx)([1-9]|1[0-5])$"

  phy-names:
    const: usb2-phy

  interface-type:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Describes the type of interface between the controller and the PHY.
    enum: [ 0, 1 ]

required:
  - compatible
  - reg
  - reg-names
  - interrupts
  - interrupt-names
  - dr_mode
  - mentor,multipoint
  - mentor,num-eps
  - mentor,ram-bits
  - mentor,power
  - phys

unevaluatedProperties: false

examples:
  - |
    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>;
        dmas = <&cppi41dma 0 0 &cppi41dma 1 0>;
        dma-names = "rx1", "tx1";
    };