xref: /linux/Documentation/devicetree/bindings/clock/idt,versaclock5.yaml (revision 216d1a8013433bacb2001d492a467e3a58db91bc)
145c94018SLuca Ceresoli# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
245c94018SLuca Ceresoli%YAML 1.2
345c94018SLuca Ceresoli---
445c94018SLuca Ceresoli$id: http://devicetree.org/schemas/clock/idt,versaclock5.yaml#
545c94018SLuca Ceresoli$schema: http://devicetree.org/meta-schemas/core.yaml#
645c94018SLuca Ceresoli
745c94018SLuca Ceresolititle: Binding for IDT VersaClock 5 and 6 programmable I2C clock generators
845c94018SLuca Ceresoli
945c94018SLuca Ceresolidescription: |
1045c94018SLuca Ceresoli  The IDT VersaClock 5 and VersaClock 6 are programmable I2C
1145c94018SLuca Ceresoli  clock generators providing from 3 to 12 output clocks.
1245c94018SLuca Ceresoli
1345c94018SLuca Ceresoli  When referencing the provided clock in the DT using phandle and clock
1445c94018SLuca Ceresoli  specifier, the following mapping applies:
1545c94018SLuca Ceresoli
1645c94018SLuca Ceresoli  - 5P49V5923:
1745c94018SLuca Ceresoli    0 -- OUT0_SEL_I2CB
1845c94018SLuca Ceresoli    1 -- OUT1
1945c94018SLuca Ceresoli    2 -- OUT2
2045c94018SLuca Ceresoli
2145c94018SLuca Ceresoli  - 5P49V5933:
2245c94018SLuca Ceresoli    0 -- OUT0_SEL_I2CB
2345c94018SLuca Ceresoli    1 -- OUT1
2445c94018SLuca Ceresoli    2 -- OUT4
2545c94018SLuca Ceresoli
2645c94018SLuca Ceresoli  - other parts:
2745c94018SLuca Ceresoli    0 -- OUT0_SEL_I2CB
2845c94018SLuca Ceresoli    1 -- OUT1
2945c94018SLuca Ceresoli    2 -- OUT2
3045c94018SLuca Ceresoli    3 -- OUT3
3145c94018SLuca Ceresoli    4 -- OUT4
3245c94018SLuca Ceresoli
33275e4e2dSSean Anderson  The idt,shutdown and idt,output-enable-active properties control the
34275e4e2dSSean Anderson  SH (en_global_shutdown) and SP bits of the Primary Source and Shutdown
35275e4e2dSSean Anderson  Register, respectively. Their behavior is summarized by the following
36275e4e2dSSean Anderson  table:
37275e4e2dSSean Anderson
38275e4e2dSSean Anderson  SH SP Output when the SD/OE pin is Low/High
39275e4e2dSSean Anderson  == == =====================================
40275e4e2dSSean Anderson   0  0 Active/Inactive
41275e4e2dSSean Anderson   0  1 Inactive/Active
42275e4e2dSSean Anderson   1  0 Active/Shutdown
43275e4e2dSSean Anderson   1  1 Inactive/Shutdown
44275e4e2dSSean Anderson
45275e4e2dSSean Anderson  The case where SH and SP are both 1 is likely not very interesting.
46275e4e2dSSean Anderson
4745c94018SLuca Ceresolimaintainers:
48*216d1a80SLuca Ceresoli  - Luca Ceresoli <luca.ceresoli@bootlin.com>
4945c94018SLuca Ceresoli
5045c94018SLuca Ceresoliproperties:
5145c94018SLuca Ceresoli  compatible:
5245c94018SLuca Ceresoli    enum:
5345c94018SLuca Ceresoli      - idt,5p49v5923
5445c94018SLuca Ceresoli      - idt,5p49v5925
5545c94018SLuca Ceresoli      - idt,5p49v5933
5645c94018SLuca Ceresoli      - idt,5p49v5935
5745c94018SLuca Ceresoli      - idt,5p49v6901
5845c94018SLuca Ceresoli      - idt,5p49v6965
5945c94018SLuca Ceresoli
6045c94018SLuca Ceresoli  reg:
6145c94018SLuca Ceresoli    description: I2C device address
6245c94018SLuca Ceresoli    enum: [ 0x68, 0x6a ]
6345c94018SLuca Ceresoli
6445c94018SLuca Ceresoli  '#clock-cells':
6545c94018SLuca Ceresoli    const: 1
6645c94018SLuca Ceresoli
675be478f9SRob Herring  clock-names:
685be478f9SRob Herring    minItems: 1
695be478f9SRob Herring    maxItems: 2
705be478f9SRob Herring    items:
715be478f9SRob Herring      enum: [ xin, clkin ]
725be478f9SRob Herring  clocks:
735be478f9SRob Herring    minItems: 1
745be478f9SRob Herring    maxItems: 2
755be478f9SRob Herring
7631e7aa7eSAdam Ford  idt,xtal-load-femtofarads:
7731e7aa7eSAdam Ford    minimum: 9000
7831e7aa7eSAdam Ford    maximum: 22760
7931e7aa7eSAdam Ford    description: Optional load capacitor for XTAL1 and XTAL2
8031e7aa7eSAdam Ford
81275e4e2dSSean Anderson  idt,shutdown:
82275e4e2dSSean Anderson    $ref: /schemas/types.yaml#/definitions/uint32
83275e4e2dSSean Anderson    enum: [0, 1]
84275e4e2dSSean Anderson    description: |
85275e4e2dSSean Anderson      If 1, this enables the shutdown functionality: the chip will be
86275e4e2dSSean Anderson      shut down if the SD/OE pin is driven high. If 0, this disables the
87275e4e2dSSean Anderson      shutdown functionality: the chip will never be shut down based on
88275e4e2dSSean Anderson      the value of the SD/OE pin. This property corresponds to the SH
89275e4e2dSSean Anderson      bit of the Primary Source and Shutdown Register.
90275e4e2dSSean Anderson
91275e4e2dSSean Anderson  idt,output-enable-active:
92275e4e2dSSean Anderson    $ref: /schemas/types.yaml#/definitions/uint32
93275e4e2dSSean Anderson    enum: [0, 1]
94275e4e2dSSean Anderson    description: |
95275e4e2dSSean Anderson      If 1, this enables output when the SD/OE pin is high, and disables
96275e4e2dSSean Anderson      output when the SD/OE pin is low. If 0, this disables output when
97275e4e2dSSean Anderson      the SD/OE pin is high, and enables output when the SD/OE pin is
98275e4e2dSSean Anderson      low. This corresponds to the SP bit of the Primary Source and
99275e4e2dSSean Anderson      Shutdown Register.
100275e4e2dSSean Anderson
10145c94018SLuca CeresolipatternProperties:
10245c94018SLuca Ceresoli  "^OUT[1-4]$":
10345c94018SLuca Ceresoli    type: object
10445c94018SLuca Ceresoli    description:
10545c94018SLuca Ceresoli      Description of one of the outputs (OUT1..OUT4). See "Clock1 Output
10645c94018SLuca Ceresoli      Configuration" in the Versaclock 5/6/6E Family Register Description
10745c94018SLuca Ceresoli      and Programming Guide.
10845c94018SLuca Ceresoli    properties:
10945c94018SLuca Ceresoli      idt,mode:
11045c94018SLuca Ceresoli        description:
11145c94018SLuca Ceresoli          The output drive mode. Values defined in dt-bindings/clk/versaclock.h
11245c94018SLuca Ceresoli        $ref: /schemas/types.yaml#/definitions/uint32
11345c94018SLuca Ceresoli        minimum: 0
11445c94018SLuca Ceresoli        maximum: 6
11545c94018SLuca Ceresoli      idt,voltage-microvolt:
11645c94018SLuca Ceresoli        description: The output drive voltage.
11745c94018SLuca Ceresoli        enum: [ 1800000, 2500000, 3300000 ]
11845c94018SLuca Ceresoli      idt,slew-percent:
11945c94018SLuca Ceresoli        description: The Slew rate control for CMOS single-ended.
12045c94018SLuca Ceresoli        enum: [ 80, 85, 90, 100 ]
12189f8a707SSean Anderson    additionalProperties: false
12245c94018SLuca Ceresoli
12345c94018SLuca Ceresolirequired:
12445c94018SLuca Ceresoli  - compatible
12545c94018SLuca Ceresoli  - reg
12645c94018SLuca Ceresoli  - '#clock-cells'
127275e4e2dSSean Anderson  - idt,shutdown
128275e4e2dSSean Anderson  - idt,output-enable-active
12945c94018SLuca Ceresoli
13045c94018SLuca CeresoliallOf:
13145c94018SLuca Ceresoli  - if:
13245c94018SLuca Ceresoli      properties:
13345c94018SLuca Ceresoli        compatible:
13445c94018SLuca Ceresoli          enum:
13545c94018SLuca Ceresoli            - idt,5p49v5933
13645c94018SLuca Ceresoli            - idt,5p49v5935
13745c94018SLuca Ceresoli    then:
13845c94018SLuca Ceresoli      # Devices with builtin crystal + optional external input
13945c94018SLuca Ceresoli      properties:
14045c94018SLuca Ceresoli        clock-names:
14145c94018SLuca Ceresoli          const: clkin
14245c94018SLuca Ceresoli        clocks:
14345c94018SLuca Ceresoli          maxItems: 1
14445c94018SLuca Ceresoli    else:
14545c94018SLuca Ceresoli      # Devices without builtin crystal
14645c94018SLuca Ceresoli      required:
14745c94018SLuca Ceresoli        - clock-names
14845c94018SLuca Ceresoli        - clocks
14945c94018SLuca Ceresoli
1505be478f9SRob HerringadditionalProperties: false
1515be478f9SRob Herring
15245c94018SLuca Ceresoliexamples:
15345c94018SLuca Ceresoli  - |
15445c94018SLuca Ceresoli    #include <dt-bindings/clk/versaclock.h>
15545c94018SLuca Ceresoli
15645c94018SLuca Ceresoli    /* 25MHz reference crystal */
15745c94018SLuca Ceresoli    ref25: ref25m {
15845c94018SLuca Ceresoli        compatible = "fixed-clock";
15945c94018SLuca Ceresoli        #clock-cells = <0>;
16045c94018SLuca Ceresoli        clock-frequency = <25000000>;
16145c94018SLuca Ceresoli    };
16245c94018SLuca Ceresoli
16345c94018SLuca Ceresoli    i2c@0 {
16445c94018SLuca Ceresoli        reg = <0x0 0x100>;
16545c94018SLuca Ceresoli        #address-cells = <1>;
16645c94018SLuca Ceresoli        #size-cells = <0>;
16745c94018SLuca Ceresoli
16845c94018SLuca Ceresoli        /* IDT 5P49V5923 I2C clock generator */
16945c94018SLuca Ceresoli        vc5: clock-generator@6a {
17045c94018SLuca Ceresoli            compatible = "idt,5p49v5923";
17145c94018SLuca Ceresoli            reg = <0x6a>;
17245c94018SLuca Ceresoli            #clock-cells = <1>;
17345c94018SLuca Ceresoli
17445c94018SLuca Ceresoli            /* Connect XIN input to 25MHz reference */
17545c94018SLuca Ceresoli            clocks = <&ref25m>;
17645c94018SLuca Ceresoli            clock-names = "xin";
17745c94018SLuca Ceresoli
178275e4e2dSSean Anderson            /* Set the SD/OE pin's settings */
179275e4e2dSSean Anderson            idt,shutdown = <0>;
180275e4e2dSSean Anderson            idt,output-enable-active = <0>;
181275e4e2dSSean Anderson
18245c94018SLuca Ceresoli            OUT1 {
18389f8a707SSean Anderson                idt,mode = <VC5_CMOSD>;
18489f8a707SSean Anderson                idt,voltage-microvolt = <1800000>;
18545c94018SLuca Ceresoli                idt,slew-percent = <80>;
18645c94018SLuca Ceresoli            };
18745c94018SLuca Ceresoli
18845c94018SLuca Ceresoli            OUT4 {
18989f8a707SSean Anderson                idt,mode = <VC5_LVDS>;
19045c94018SLuca Ceresoli            };
19145c94018SLuca Ceresoli        };
19245c94018SLuca Ceresoli    };
19345c94018SLuca Ceresoli
19445c94018SLuca Ceresoli...
195