xref: /openbmc/linux/Documentation/devicetree/bindings/timer/samsung,exynos4210-mct.yaml (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
165eba0dbSKrzysztof Kozlowski# SPDX-License-Identifier: GPL-2.0
265eba0dbSKrzysztof Kozlowski%YAML 1.2
365eba0dbSKrzysztof Kozlowski---
465eba0dbSKrzysztof Kozlowski$id: http://devicetree.org/schemas/timer/samsung,exynos4210-mct.yaml#
565eba0dbSKrzysztof Kozlowski$schema: http://devicetree.org/meta-schemas/core.yaml#
665eba0dbSKrzysztof Kozlowski
765eba0dbSKrzysztof Kozlowskititle: Samsung Exynos SoC Multi Core Timer (MCT)
865eba0dbSKrzysztof Kozlowski
965eba0dbSKrzysztof Kozlowskimaintainers:
1065eba0dbSKrzysztof Kozlowski  - Krzysztof Kozlowski <krzk@kernel.org>
1165eba0dbSKrzysztof Kozlowski
1265eba0dbSKrzysztof Kozlowskidescription: |+
1365eba0dbSKrzysztof Kozlowski  The Samsung's Multi Core Timer (MCT) module includes two main blocks, the
1465eba0dbSKrzysztof Kozlowski  global timer and CPU local timers. The global timer is a 64-bit free running
1565eba0dbSKrzysztof Kozlowski  up-counter and can generate 4 interrupts when the counter reaches one of the
1665eba0dbSKrzysztof Kozlowski  four preset counter values. The CPU local timers are 32-bit free running
1765eba0dbSKrzysztof Kozlowski  down-counters and generate an interrupt when the counter expires. There is
1865eba0dbSKrzysztof Kozlowski  one CPU local timer instantiated in MCT for every CPU in the system.
1965eba0dbSKrzysztof Kozlowski
2065eba0dbSKrzysztof Kozlowskiproperties:
2165eba0dbSKrzysztof Kozlowski  compatible:
225fe58019SKrzysztof Kozlowski    oneOf:
235fe58019SKrzysztof Kozlowski      - enum:
2465eba0dbSKrzysztof Kozlowski          - samsung,exynos4210-mct
2565eba0dbSKrzysztof Kozlowski          - samsung,exynos4412-mct
265fe58019SKrzysztof Kozlowski      - items:
275fe58019SKrzysztof Kozlowski          - enum:
28*99b701fdSVincent Whitchurch              - axis,artpec8-mct
295fe58019SKrzysztof Kozlowski              - samsung,exynos3250-mct
305fe58019SKrzysztof Kozlowski              - samsung,exynos5250-mct
315fe58019SKrzysztof Kozlowski              - samsung,exynos5260-mct
325fe58019SKrzysztof Kozlowski              - samsung,exynos5420-mct
335fe58019SKrzysztof Kozlowski              - samsung,exynos5433-mct
345fe58019SKrzysztof Kozlowski              - samsung,exynos850-mct
355fe58019SKrzysztof Kozlowski              - tesla,fsd-mct
365fe58019SKrzysztof Kozlowski          - const: samsung,exynos4210-mct
3765eba0dbSKrzysztof Kozlowski
386a1aa955SKrzysztof Kozlowski  clocks:
396a1aa955SKrzysztof Kozlowski    maxItems: 2
406a1aa955SKrzysztof Kozlowski
416a1aa955SKrzysztof Kozlowski  clock-names:
426a1aa955SKrzysztof Kozlowski    items:
43ee77ef0dSKrzysztof Kozlowski      - const: fin_pll
44ee77ef0dSKrzysztof Kozlowski      - const: mct
456a1aa955SKrzysztof Kozlowski
4665eba0dbSKrzysztof Kozlowski  reg:
4765eba0dbSKrzysztof Kozlowski    maxItems: 1
4865eba0dbSKrzysztof Kozlowski
49*99b701fdSVincent Whitchurch  samsung,frc-shared:
50*99b701fdSVincent Whitchurch    type: boolean
51*99b701fdSVincent Whitchurch    description: |
52*99b701fdSVincent Whitchurch      Indicates that the hardware requires that this processor share the
53*99b701fdSVincent Whitchurch      free-running counter with a different (main) processor.
54*99b701fdSVincent Whitchurch
55*99b701fdSVincent Whitchurch  samsung,local-timers:
56*99b701fdSVincent Whitchurch    $ref: /schemas/types.yaml#/definitions/uint32-array
57*99b701fdSVincent Whitchurch    minItems: 1
58*99b701fdSVincent Whitchurch    maxItems: 16
59*99b701fdSVincent Whitchurch    description: |
60*99b701fdSVincent Whitchurch      List of indices of local timers usable from this processor.
61*99b701fdSVincent Whitchurch
6265eba0dbSKrzysztof Kozlowski  interrupts:
6365eba0dbSKrzysztof Kozlowski    description: |
6465eba0dbSKrzysztof Kozlowski      Interrupts should be put in specific order. This is, the local timer
6565eba0dbSKrzysztof Kozlowski      interrupts should be specified after the four global timer interrupts
6665eba0dbSKrzysztof Kozlowski      have been specified:
6765eba0dbSKrzysztof Kozlowski      0: Global Timer Interrupt 0
6865eba0dbSKrzysztof Kozlowski      1: Global Timer Interrupt 1
6965eba0dbSKrzysztof Kozlowski      2: Global Timer Interrupt 2
7065eba0dbSKrzysztof Kozlowski      3: Global Timer Interrupt 3
7165eba0dbSKrzysztof Kozlowski      4: Local Timer Interrupt 0
7265eba0dbSKrzysztof Kozlowski      5: Local Timer Interrupt 1
7365eba0dbSKrzysztof Kozlowski      6: ..
7465eba0dbSKrzysztof Kozlowski      7: ..
7565eba0dbSKrzysztof Kozlowski      i: Local Timer Interrupt n
7665eba0dbSKrzysztof Kozlowski      For MCT block that uses a per-processor interrupt for local timers, such
7765eba0dbSKrzysztof Kozlowski      as ones compatible with "samsung,exynos4412-mct", only one local timer
7865eba0dbSKrzysztof Kozlowski      interrupt might be specified, meaning that all local timers use the same
7965eba0dbSKrzysztof Kozlowski      per processor interrupt.
8065eba0dbSKrzysztof Kozlowski    minItems: 5               # 4 Global + 1 local
8165eba0dbSKrzysztof Kozlowski    maxItems: 20              # 4 Global + 16 local
8265eba0dbSKrzysztof Kozlowski
8365eba0dbSKrzysztof Kozlowskirequired:
8465eba0dbSKrzysztof Kozlowski  - compatible
856a1aa955SKrzysztof Kozlowski  - clock-names
866a1aa955SKrzysztof Kozlowski  - clocks
8765eba0dbSKrzysztof Kozlowski  - interrupts
8865eba0dbSKrzysztof Kozlowski  - reg
8965eba0dbSKrzysztof Kozlowski
905fe58019SKrzysztof KozlowskiallOf:
915fe58019SKrzysztof Kozlowski  - if:
92*99b701fdSVincent Whitchurch      not:
93*99b701fdSVincent Whitchurch        properties:
94*99b701fdSVincent Whitchurch          compatible:
95*99b701fdSVincent Whitchurch            contains:
96*99b701fdSVincent Whitchurch              enum:
97*99b701fdSVincent Whitchurch                - axis,artpec8-mct
98*99b701fdSVincent Whitchurch    then:
99*99b701fdSVincent Whitchurch      properties:
100*99b701fdSVincent Whitchurch        samsung,local-timers: false
101*99b701fdSVincent Whitchurch        samsung,frc-shared: false
102*99b701fdSVincent Whitchurch  - if:
1035fe58019SKrzysztof Kozlowski      properties:
1045fe58019SKrzysztof Kozlowski        compatible:
1055fe58019SKrzysztof Kozlowski          contains:
1065fe58019SKrzysztof Kozlowski            const: samsung,exynos3250-mct
1075fe58019SKrzysztof Kozlowski    then:
1085fe58019SKrzysztof Kozlowski      properties:
1095fe58019SKrzysztof Kozlowski        interrupts:
1105fe58019SKrzysztof Kozlowski          minItems: 8
1115fe58019SKrzysztof Kozlowski          maxItems: 8
1125fe58019SKrzysztof Kozlowski
1135fe58019SKrzysztof Kozlowski  - if:
1145fe58019SKrzysztof Kozlowski      properties:
1155fe58019SKrzysztof Kozlowski        compatible:
1165fe58019SKrzysztof Kozlowski          contains:
1175fe58019SKrzysztof Kozlowski            const: samsung,exynos5250-mct
1185fe58019SKrzysztof Kozlowski    then:
1195fe58019SKrzysztof Kozlowski      properties:
1205fe58019SKrzysztof Kozlowski        interrupts:
1215fe58019SKrzysztof Kozlowski          minItems: 6
1225fe58019SKrzysztof Kozlowski          maxItems: 6
1235fe58019SKrzysztof Kozlowski
1245fe58019SKrzysztof Kozlowski  - if:
1255fe58019SKrzysztof Kozlowski      properties:
1265fe58019SKrzysztof Kozlowski        compatible:
1275fe58019SKrzysztof Kozlowski          contains:
1285fe58019SKrzysztof Kozlowski            enum:
129*99b701fdSVincent Whitchurch              - axis,artpec8-mct
1305fe58019SKrzysztof Kozlowski              - samsung,exynos5260-mct
1315fe58019SKrzysztof Kozlowski              - samsung,exynos5420-mct
1325fe58019SKrzysztof Kozlowski              - samsung,exynos5433-mct
1335fe58019SKrzysztof Kozlowski              - samsung,exynos850-mct
1345fe58019SKrzysztof Kozlowski    then:
1355fe58019SKrzysztof Kozlowski      properties:
1365fe58019SKrzysztof Kozlowski        interrupts:
1375fe58019SKrzysztof Kozlowski          minItems: 12
1385fe58019SKrzysztof Kozlowski          maxItems: 12
1395fe58019SKrzysztof Kozlowski
1405fe58019SKrzysztof Kozlowski  - if:
1415fe58019SKrzysztof Kozlowski      properties:
1425fe58019SKrzysztof Kozlowski        compatible:
1435fe58019SKrzysztof Kozlowski          contains:
1445fe58019SKrzysztof Kozlowski            enum:
1455fe58019SKrzysztof Kozlowski              - tesla,fsd-mct
1465fe58019SKrzysztof Kozlowski    then:
1475fe58019SKrzysztof Kozlowski      properties:
1485fe58019SKrzysztof Kozlowski        interrupts:
1495fe58019SKrzysztof Kozlowski          minItems: 16
1505fe58019SKrzysztof Kozlowski          maxItems: 16
1515fe58019SKrzysztof Kozlowski
1527f464532SRob HerringadditionalProperties: false
1537f464532SRob Herring
15465eba0dbSKrzysztof Kozlowskiexamples:
15565eba0dbSKrzysztof Kozlowski  - |
15665eba0dbSKrzysztof Kozlowski    // In this example, the IP contains two local timers, using separate
15765eba0dbSKrzysztof Kozlowski    // interrupts, so two local timer interrupts have been specified,
15865eba0dbSKrzysztof Kozlowski    // in addition to four global timer interrupts.
1596a1aa955SKrzysztof Kozlowski    #include <dt-bindings/clock/exynos4.h>
1604b73b6f7SKrzysztof Kozlowski    #include <dt-bindings/interrupt-controller/arm-gic.h>
16165eba0dbSKrzysztof Kozlowski
16265eba0dbSKrzysztof Kozlowski    timer@10050000 {
16365eba0dbSKrzysztof Kozlowski        compatible = "samsung,exynos4210-mct";
16465eba0dbSKrzysztof Kozlowski        reg = <0x10050000 0x800>;
1656a1aa955SKrzysztof Kozlowski        clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MCT>;
1666a1aa955SKrzysztof Kozlowski        clock-names = "fin_pll", "mct";
1676a1aa955SKrzysztof Kozlowski
1684b73b6f7SKrzysztof Kozlowski        interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
1694b73b6f7SKrzysztof Kozlowski                     <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
1704b73b6f7SKrzysztof Kozlowski                     <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
1714b73b6f7SKrzysztof Kozlowski                     <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
1724b73b6f7SKrzysztof Kozlowski                     <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>,
1734b73b6f7SKrzysztof Kozlowski                     <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
17465eba0dbSKrzysztof Kozlowski    };
17565eba0dbSKrzysztof Kozlowski
17665eba0dbSKrzysztof Kozlowski  - |
17765eba0dbSKrzysztof Kozlowski    // In this example, the timer interrupts are connected to two separate
17865eba0dbSKrzysztof Kozlowski    // interrupt controllers. Hence, an interrupts-extended is needed.
1796a1aa955SKrzysztof Kozlowski    #include <dt-bindings/clock/exynos4.h>
1804b73b6f7SKrzysztof Kozlowski    #include <dt-bindings/interrupt-controller/arm-gic.h>
18165eba0dbSKrzysztof Kozlowski
18265eba0dbSKrzysztof Kozlowski    timer@101c0000 {
18365eba0dbSKrzysztof Kozlowski        compatible = "samsung,exynos4210-mct";
18465eba0dbSKrzysztof Kozlowski        reg = <0x101C0000 0x800>;
1856a1aa955SKrzysztof Kozlowski        clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MCT>;
1866a1aa955SKrzysztof Kozlowski        clock-names = "fin_pll", "mct";
1876a1aa955SKrzysztof Kozlowski
1884b73b6f7SKrzysztof Kozlowski        interrupts-extended = <&gic GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
1894b73b6f7SKrzysztof Kozlowski                              <&gic GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
19065eba0dbSKrzysztof Kozlowski                              <&combiner 12 6>,
19165eba0dbSKrzysztof Kozlowski                              <&combiner 12 7>,
1924b73b6f7SKrzysztof Kozlowski                              <&gic GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>,
1934b73b6f7SKrzysztof Kozlowski                              <&gic GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
19465eba0dbSKrzysztof Kozlowski    };
19565eba0dbSKrzysztof Kozlowski
19665eba0dbSKrzysztof Kozlowski  - |
19765eba0dbSKrzysztof Kozlowski    // In this example, the IP contains four local timers, but using
19865eba0dbSKrzysztof Kozlowski    // a per-processor interrupt to handle them. Only one first local
19965eba0dbSKrzysztof Kozlowski    // interrupt is specified.
2006a1aa955SKrzysztof Kozlowski    #include <dt-bindings/clock/exynos4.h>
2014b73b6f7SKrzysztof Kozlowski    #include <dt-bindings/interrupt-controller/arm-gic.h>
20265eba0dbSKrzysztof Kozlowski
20365eba0dbSKrzysztof Kozlowski    timer@10050000 {
20465eba0dbSKrzysztof Kozlowski        compatible = "samsung,exynos4412-mct";
20565eba0dbSKrzysztof Kozlowski        reg = <0x10050000 0x800>;
2066a1aa955SKrzysztof Kozlowski        clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MCT>;
2076a1aa955SKrzysztof Kozlowski        clock-names = "fin_pll", "mct";
20865eba0dbSKrzysztof Kozlowski
2094b73b6f7SKrzysztof Kozlowski        interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
2104b73b6f7SKrzysztof Kozlowski                     <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
2114b73b6f7SKrzysztof Kozlowski                     <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
2124b73b6f7SKrzysztof Kozlowski                     <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
2134b73b6f7SKrzysztof Kozlowski                     <GIC_PPI 42 IRQ_TYPE_LEVEL_HIGH>;
21465eba0dbSKrzysztof Kozlowski    };
21565eba0dbSKrzysztof Kozlowski
21665eba0dbSKrzysztof Kozlowski  - |
21765eba0dbSKrzysztof Kozlowski    // In this example, the IP contains four local timers, but using
21865eba0dbSKrzysztof Kozlowski    // a per-processor interrupt to handle them. All the local timer
21965eba0dbSKrzysztof Kozlowski    // interrupts are specified.
2206a1aa955SKrzysztof Kozlowski    #include <dt-bindings/clock/exynos4.h>
2214b73b6f7SKrzysztof Kozlowski    #include <dt-bindings/interrupt-controller/arm-gic.h>
22265eba0dbSKrzysztof Kozlowski
22365eba0dbSKrzysztof Kozlowski    timer@10050000 {
22465eba0dbSKrzysztof Kozlowski        compatible = "samsung,exynos4412-mct";
22565eba0dbSKrzysztof Kozlowski        reg = <0x10050000 0x800>;
2266a1aa955SKrzysztof Kozlowski        clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MCT>;
2276a1aa955SKrzysztof Kozlowski        clock-names = "fin_pll", "mct";
22865eba0dbSKrzysztof Kozlowski
2294b73b6f7SKrzysztof Kozlowski        interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
2304b73b6f7SKrzysztof Kozlowski                     <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
2314b73b6f7SKrzysztof Kozlowski                     <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
2324b73b6f7SKrzysztof Kozlowski                     <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
2334b73b6f7SKrzysztof Kozlowski                     <GIC_PPI 42 IRQ_TYPE_LEVEL_HIGH>,
2344b73b6f7SKrzysztof Kozlowski                     <GIC_PPI 42 IRQ_TYPE_LEVEL_HIGH>,
2354b73b6f7SKrzysztof Kozlowski                     <GIC_PPI 42 IRQ_TYPE_LEVEL_HIGH>,
2364b73b6f7SKrzysztof Kozlowski                     <GIC_PPI 42 IRQ_TYPE_LEVEL_HIGH>;
23765eba0dbSKrzysztof Kozlowski    };
238