xref: /openbmc/linux/Documentation/devicetree/bindings/timer/arm,sp804.yaml (revision 762f99f4f3cb41a775b5157dd761217beba65873)
1a85a4aa3SAndre Przywara# SPDX-License-Identifier: GPL-2.0
2a85a4aa3SAndre Przywara%YAML 1.2
3a85a4aa3SAndre Przywara---
4a85a4aa3SAndre Przywara$id: http://devicetree.org/schemas/timer/arm,sp804.yaml#
5a85a4aa3SAndre Przywara$schema: http://devicetree.org/meta-schemas/core.yaml#
6a85a4aa3SAndre Przywara
7a85a4aa3SAndre Przywaratitle: ARM sp804 Dual Timers
8a85a4aa3SAndre Przywara
9a85a4aa3SAndre Przywaramaintainers:
10a85a4aa3SAndre Przywara  - Haojian Zhuang <haojian.zhuang@linaro.org>
11a85a4aa3SAndre Przywara
12a85a4aa3SAndre Przywaradescription: |+
13a85a4aa3SAndre Przywara  The Arm SP804 IP implements two independent timers, configurable for
14a85a4aa3SAndre Przywara  16 or 32 bit operation and capable of running in one-shot, periodic, or
15a85a4aa3SAndre Przywara  free-running mode. The input clock is shared, but can be gated and prescaled
16a85a4aa3SAndre Przywara  independently for each timer.
17a85a4aa3SAndre Przywara
18eab1de67SZhen Lei  There is a viriant of Arm SP804: Hisilicon 64-bit SP804 timer. Some Hisilicon
19eab1de67SZhen Lei  SoCs, such as Hi1212, should use the dedicated compatible: "hisilicon,sp804".
20eab1de67SZhen Lei
21a85a4aa3SAndre Przywara# Need a custom select here or 'arm,primecell' will match on lots of nodes
22a85a4aa3SAndre Przywaraselect:
23a85a4aa3SAndre Przywara  properties:
24a85a4aa3SAndre Przywara    compatible:
25a85a4aa3SAndre Przywara      contains:
26*1c3ac086SRob Herring        enum:
27*1c3ac086SRob Herring          - arm,sp804
28*1c3ac086SRob Herring          - hisilicon,sp804
29a85a4aa3SAndre Przywara  required:
30a85a4aa3SAndre Przywara    - compatible
31a85a4aa3SAndre Przywara
32a85a4aa3SAndre Przywaraproperties:
33a85a4aa3SAndre Przywara  compatible:
34a85a4aa3SAndre Przywara    items:
35eab1de67SZhen Lei      - enum:
36eab1de67SZhen Lei          - arm,sp804
37eab1de67SZhen Lei          - hisilicon,sp804
38a85a4aa3SAndre Przywara      - const: arm,primecell
39a85a4aa3SAndre Przywara
40a85a4aa3SAndre Przywara  interrupts:
41a85a4aa3SAndre Przywara    description: |
42a85a4aa3SAndre Przywara      If two interrupts are listed, those are the interrupts for timer
43a85a4aa3SAndre Przywara      1 and 2, respectively. If there is only a single interrupt, it is
44a85a4aa3SAndre Przywara      either a combined interrupt or the sole interrupt of one timer, as
45a85a4aa3SAndre Przywara      specified by the "arm,sp804-has-irq" property.
46a85a4aa3SAndre Przywara    minItems: 1
47a85a4aa3SAndre Przywara    maxItems: 2
48a85a4aa3SAndre Przywara
49a85a4aa3SAndre Przywara  reg:
50a85a4aa3SAndre Przywara    description: The physical base address of the SP804 IP.
51a85a4aa3SAndre Przywara    maxItems: 1
52a85a4aa3SAndre Przywara
53a85a4aa3SAndre Przywara  clocks:
54a85a4aa3SAndre Przywara    description: |
55a85a4aa3SAndre Przywara      Clocks driving the dual timer hardware. This list should
56a85a4aa3SAndre Przywara      be 1 or 3 clocks. With 3 clocks, the order is timer0 clock, timer1
57a85a4aa3SAndre Przywara      clock, apb_pclk. A single clock can also be specified if the same
58a85a4aa3SAndre Przywara      clock is used for all clock inputs.
59a85a4aa3SAndre Przywara    oneOf:
60a85a4aa3SAndre Przywara      - items:
61a85a4aa3SAndre Przywara          - description: clock for timer 1
62a85a4aa3SAndre Przywara          - description: clock for timer 2
63a85a4aa3SAndre Przywara          - description: bus clock
64a85a4aa3SAndre Przywara      - items:
65a85a4aa3SAndre Przywara          - description: unified clock for both timers and the bus
66a85a4aa3SAndre Przywara
67a85a4aa3SAndre Przywara  clock-names: true
68a85a4aa3SAndre Przywara    # The original binding did not specify any clock names, and there is no
69a85a4aa3SAndre Przywara    # consistent naming used in the existing DTs. The primecell binding
70a85a4aa3SAndre Przywara    # requires the "apb_pclk" name, so we need this property.
71a85a4aa3SAndre Przywara    # Use "timer0clk", "timer1clk", "apb_pclk" for new DTs.
72a85a4aa3SAndre Przywara
73a85a4aa3SAndre Przywara  arm,sp804-has-irq:
74a85a4aa3SAndre Przywara    description: If only one interrupt line is connected to the interrupt
75a85a4aa3SAndre Przywara      controller, this property specifies which timer is connected to this
76a85a4aa3SAndre Przywara      line.
77a85a4aa3SAndre Przywara    $ref: /schemas/types.yaml#/definitions/uint32
78a85a4aa3SAndre Przywara    minimum: 1
79a85a4aa3SAndre Przywara    maximum: 2
80a85a4aa3SAndre Przywara
81a85a4aa3SAndre Przywararequired:
82a85a4aa3SAndre Przywara  - compatible
83a85a4aa3SAndre Przywara  - interrupts
84a85a4aa3SAndre Przywara  - reg
85a85a4aa3SAndre Przywara  - clocks
86a85a4aa3SAndre Przywara
87a85a4aa3SAndre PrzywaraadditionalProperties: false
88a85a4aa3SAndre Przywara
89a85a4aa3SAndre Przywaraexamples:
90a85a4aa3SAndre Przywara  - |
91a85a4aa3SAndre Przywara    timer0: timer@fc800000 {
92a85a4aa3SAndre Przywara        compatible = "arm,sp804", "arm,primecell";
93a85a4aa3SAndre Przywara        reg = <0xfc800000 0x1000>;
94a85a4aa3SAndre Przywara        interrupts = <0 0 4>, <0 1 4>;
95a85a4aa3SAndre Przywara        clocks = <&timclk1>, <&timclk2>, <&pclk>;
96a85a4aa3SAndre Przywara        clock-names = "timer1", "timer2", "apb_pclk";
97a85a4aa3SAndre Przywara    };
98