1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: "http://devicetree.org/schemas/clock/renesas,rcar-usb2-clock-sel.yaml#"
5$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6
7title: Renesas R-Car USB 2.0 clock selector
8
9maintainers:
10  - Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
11
12description: |
13  If you connect an external clock to the USB_EXTAL pin only, you should set
14  the clock rate to "usb_extal" node only.
15  If you connect an oscillator to both the USB_XTAL and USB_EXTAL, this module
16  is not needed because this is default setting. (Of course, you can set the
17  clock rates to both "usb_extal" and "usb_xtal" nodes.
18
19  Case 1: An external clock connects to R-Car SoC
20    +----------+   +--- R-Car ---------------------+
21    |External  |---|USB_EXTAL ---> all usb channels|
22    |clock     |   |USB_XTAL                       |
23    +----------+   +-------------------------------+
24
25  In this case, we need this driver with "usb_extal" clock.
26
27  Case 2: An oscillator connects to R-Car SoC
28    +----------+   +--- R-Car ---------------------+
29    |Oscillator|---|USB_EXTAL -+-> all usb channels|
30    |          |---|USB_XTAL --+                   |
31    +----------+   +-------------------------------+
32  In this case, we don't need this selector.
33
34properties:
35  compatible:
36    items:
37      - enum:
38          - renesas,r8a7795-rcar-usb2-clock-sel  # R-Car H3
39          - renesas,r8a7796-rcar-usb2-clock-sel  # R-Car M3-W
40          - renesas,r8a77961-rcar-usb2-clock-sel # R-Car M3-W+
41      - const: renesas,rcar-gen3-usb2-clock-sel
42
43  reg:
44    maxItems: 1
45
46  clocks:
47    minItems: 4
48    maxItems: 4
49
50  clock-names:
51    items:
52      - const: ehci_ohci
53      - const: hs-usb-if
54      - const: usb_extal
55      - const: usb_xtal
56
57  '#clock-cells':
58    const: 0
59
60  power-domains:
61    maxItems: 1
62
63  resets:
64    minItems: 2
65    maxItems: 2
66
67  reset-names:
68    items:
69      - const: ehci_ohci
70      - const: hs-usb-if
71
72required:
73  - compatible
74  - reg
75  - clocks
76  - clock-names
77  - '#clock-cells'
78  - power-domains
79  - resets
80  - reset-names
81
82additionalProperties: false
83
84examples:
85  - |
86    #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
87    #include <dt-bindings/power/r8a7795-sysc.h>
88
89    usb2_clksel: clock-controller@e6590630 {
90        compatible = "renesas,r8a7795-rcar-usb2-clock-sel",
91                     "renesas,rcar-gen3-usb2-clock-sel";
92        reg = <0xe6590630 0x02>;
93        clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>,
94                 <&usb_extal>, <&usb_xtal>;
95        clock-names = "ehci_ohci", "hs-usb-if", "usb_extal", "usb_xtal";
96        #clock-cells = <0>;
97        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
98        resets = <&cpg 703>, <&cpg 704>;
99        reset-names = "ehci_ohci", "hs-usb-if";
100    };
101