Atmel Timer Counter Block

Schema identifier ($id): "http://devicetree.org/schemas/soc/microchip/atmel,at91rm9200-tcb.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Alexandre Belloni <alexandre.belloni@bootlin.com>"

The Atmel (now Microchip) SoCs have timers named Timer Counter Block. Each timer has three channels with two counters each.

Properties and child nodes (properties) #

compatible — required here #

Exactly one of these rules must match (oneOf) #

Rule 1

Array item rules (items)

Item 1

Allowed values (enum): "atmel,at91rm9200-tcb", "atmel,at91sam9x5-tcb", "atmel,sama5d2-tcb"

Item 2

Exact value (const): "simple-mfd"

Item 3

Exact value (const): "syscon"

Rule 2

Array item rules (items)

Item 1

Exact value (const): "microchip,sam9x7-tcb"

Item 2

Exact value (const): "atmel,sama5d2-tcb"

Item 3

Exact value (const): "simple-mfd"

Item 4

Exact value (const): "syscon"

reg — required here #

Maximum number of items (maxItems): 1

interrupts — required here #

List of interrupts. One interrupt per TCB channel if available or one interrupt for the TC block

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 3

clock-names — required here #

List of clock names. Always includes t0_clk and slow clk. Also includes t1_clk and t2_clk if a clock per channel is available.

Minimum number of items (minItems): 2

Maximum number of items (maxItems): 4

clocks — required here #

Minimum number of items (minItems): 2

Maximum number of items (maxItems): 4

#address-cells — required here #

Exact value (const): 1

#size-cells — required here #

Exact value (const): 0

Properties matching a name pattern (patternProperties) #

^timer@[0-2]$ — name matches this regular expression #

The timer block channels that are used as timers or counters.

Value type (type): "object"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Properties and child nodes (properties) #

compatible — required here

Array item rules (items)

Item 1

Allowed values (enum): "atmel,tcb-timer", "atmel,tcb-pwm", "microchip,tcb-capture"

reg — required here

List of channels to use for this particular timer. In Microchip TCB capture mode channels are registered as a counter devices, for the qdec mode TCB0's channel <0> and <1> are required.

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 3

Required in this object (required): "compatible", "reg"

^pwm@[0-2]$ — name matches this regular expression #

The timer block channels that are used as PWMs.

Shared schema rule ($ref): /schemas/pwm/pwm.yaml#

Value type (type): "object"

Properties and child nodes (properties) #

compatible — required here

Exact value (const): "atmel,tcb-pwm"

reg — required here

TCB channel to use for this PWM.

Allowed values (enum): 0, 1, 2

#pwm-cells — required here

The only third cell flag supported by this binding is PWM_POLARITY_INVERTED.

Exact value (const): 3

Required in this object (required): "compatible", "reg", "#pwm-cells"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

All of these rules must match (allOf) #

Rule 1 #

Condition (if) #

Properties and child nodes (properties)

compatible — not listed as required here

Rule for matching array elements (contains)

Exact value (const): "atmel,sama5d2-tcb"

When the condition matches (then) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 3

Maximum number of items (maxItems): 3

clock-names — not listed as required here

Array item rules (items)

Item 1

Exact value (const): "t0_clk"

Item 2

Exact value (const): "gclk"

Item 3

Exact value (const): "slow_clk"

When the condition does not match (else) #

Properties and child nodes (properties)

clocks — not listed as required here

Minimum number of items (minItems): 2

Maximum number of items (maxItems): 4

clock-names — not listed as required here

Exactly one of these rules must match (oneOf)

Rule 1

Array item rules (items)

Item 1

Exact value (const): "t0_clk"

Item 2

Exact value (const): "slow_clk"

Rule 2

Array item rules (items)

Item 1

Exact value (const): "t0_clk"

Item 2

Exact value (const): "t1_clk"

Item 3

Exact value (const): "t2_clk"

Item 4

Exact value (const): "slow_clk"

Required in this object (required): "compatible", "reg", "interrupts", "clocks", "clock-names", "#address-cells", "#size-cells"

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

false

Not allowed by this rule.

Examples (examples) #

/* One interrupt per TC block: */
    tcb0: timer@fff7c000 {
            compatible = "atmel,at91rm9200-tcb", "simple-mfd", "syscon";
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <0xfff7c000 0x100>;
            interrupts = <18 4>;
            clocks = <&tcb0_clk>, <&clk32k>;
            clock-names = "t0_clk", "slow_clk";

            timer@0 {
                    compatible = "atmel,tcb-timer";
                    reg = <0>, <1>;
            };

            timer@2 {
                    compatible = "atmel,tcb-timer";
                    reg = <2>;
            };
    };

/* One interrupt per TC channel in a TC block: */
    tcb1: timer@fffdc000 {
            compatible = "atmel,at91rm9200-tcb", "simple-mfd", "syscon";
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <0xfffdc000 0x100>;
            interrupts = <26 4>, <27 4>, <28 4>;
            clocks = <&tcb1_clk>, <&clk32k>;
            clock-names = "t0_clk", "slow_clk";

            timer@0 {
                    compatible = "atmel,tcb-timer";
                    reg = <0>;
            };

            timer@1 {
                    compatible = "atmel,tcb-timer";
                    reg = <1>;
            };

            pwm@2 {
                    compatible = "atmel,tcb-pwm";
                    reg = <2>;
                    #pwm-cells = <3>;
            };
     };
/* TCB0 Capture with QDEC: */
    timer@f800c000 {
            compatible = "atmel,at91rm9200-tcb", "simple-mfd", "syscon";
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <0xfff7c000 0x100>;
            interrupts = <18 4>;
            clocks = <&tcb0_clk>, <&clk32k>;
            clock-names = "t0_clk", "slow_clk";

            timer@0 {
                    compatible = "microchip,tcb-capture";
                    reg = <0>, <1>;
            };

            timer@2 {
                    compatible = "atmel,tcb-timer";
                    reg = <2>;
            };
    };

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)

Edit this page