ARM sp804 Dual Timers

Schema identifier ($id): "http://devicetree.org/schemas/timer/arm,sp804.yaml#"

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

Maintainers (maintainers): "Haojian Zhuang <haojian.zhuang@linaro.org>"

The Arm SP804 IP implements two independent timers, configurable for 16 or 32 bit operation and capable of running in one-shot, periodic, or free-running mode. The input clock is shared, but can be gated and prescaled independently for each timer.

There is a viriant of Arm SP804: Hisilicon 64-bit SP804 timer. Some Hisilicon SoCs, such as Hi1212, should use the dedicated compatible: "hisilicon,sp804".

Automatic schema selection (select) #

Properties and child nodes (properties) #

compatible — required here #

Rule for matching array elements (contains)

Allowed values (enum): "arm,sp804", "hisilicon,sp804"

Required in this object (required): "compatible"

Properties and child nodes (properties) #

compatible — required here #

Array item rules (items) #

Item 1

Allowed values (enum): "arm,sp804", "hisilicon,sp804"

Item 2

Exact value (const): "arm,primecell"

interrupts — required here #

If two interrupts are listed, those are the interrupts for timer 1 and 2, respectively. If there is only a single interrupt, it is either a combined interrupt or the sole interrupt of one timer, as specified by the "arm,sp804-has-irq" property.

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 2

reg — required here #

The physical base address of the SP804 IP.

Maximum number of items (maxItems): 1

clocks — required here #

Clocks driving the dual timer hardware. This list should be 1 or 3 clocks. With 3 clocks, the order is timer0 clock, timer1 clock, apb_pclk. A single clock can also be specified if the same clock is used for all clock inputs.

Exactly one of these rules must match (oneOf) #

Rule 1

Array item rules (items)

Item 1

clock for timer 1

Item 2

clock for timer 2

Item 3

bus clock

Rule 2

Array item rules (items)

Item 1

unified clock for both timers and the bus

clock-names — not listed as required here #

true — No constraints added by this property rule.

arm,sp804-has-irq — not listed as required here #

If only one interrupt line is connected to the interrupt controller, this property specifies which timer is connected to this line.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

Minimum value (minimum): 1

Maximum value (maximum): 2

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

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

false

Not allowed by this rule.

Examples (examples) #

timer0: timer@fc800000 {
    compatible = "arm,sp804", "arm,primecell";
    reg = <0xfc800000 0x1000>;
    interrupts = <0 0 4>, <0 1 4>;
    clocks = <&timclk1>, <&timclk2>, <&pclk>;
    clock-names = "timer1", "timer2", "apb_pclk";
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: GPL-2.0

Line 21: Need a custom select here or 'arm,primecell' will match on lots of nodes

Line 68: The original binding did not specify any clock names, and there is no

Line 69: consistent naming used in the existing DTs. The primecell binding

Line 70: requires the "apb_pclk" name, so we need this property.

Line 71: Use "timer0clk", "timer1clk", "apb_pclk" for new DTs.

Edit this page