xref: /linux/Documentation/devicetree/bindings/mfd/st,stm32-timers.yaml (revision 84e85359f4999a439aa12e04bf0ae9e13e00fc66)
156fb34d8SBenjamin Gaignard# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
256fb34d8SBenjamin Gaignard%YAML 1.2
356fb34d8SBenjamin Gaignard---
456fb34d8SBenjamin Gaignard$id: http://devicetree.org/schemas/mfd/st,stm32-timers.yaml#
556fb34d8SBenjamin Gaignard$schema: http://devicetree.org/meta-schemas/core.yaml#
656fb34d8SBenjamin Gaignard
7*84e85359SKrzysztof Kozlowskititle: STMicroelectronics STM32 Timers
856fb34d8SBenjamin Gaignard
956fb34d8SBenjamin Gaignarddescription: |
1056fb34d8SBenjamin Gaignard  This hardware block provides 3 types of timer along with PWM functionality:
1156fb34d8SBenjamin Gaignard    - advanced-control timers consist of a 16-bit auto-reload counter driven
1256fb34d8SBenjamin Gaignard      by a programmable prescaler, break input feature, PWM outputs and
1356fb34d8SBenjamin Gaignard      complementary PWM outputs channels.
1456fb34d8SBenjamin Gaignard    - general-purpose timers consist of a 16-bit or 32-bit auto-reload counter
1556fb34d8SBenjamin Gaignard      driven by a programmable prescaler and PWM outputs.
1656fb34d8SBenjamin Gaignard    - basic timers consist of a 16-bit auto-reload counter driven by a
1756fb34d8SBenjamin Gaignard      programmable prescaler.
1856fb34d8SBenjamin Gaignard
1956fb34d8SBenjamin Gaignardmaintainers:
20f4eedebdSPatrice Chotard  - Fabrice Gasnier <fabrice.gasnier@foss.st.com>
2156fb34d8SBenjamin Gaignard
2256fb34d8SBenjamin Gaignardproperties:
2356fb34d8SBenjamin Gaignard  compatible:
2456fb34d8SBenjamin Gaignard    const: st,stm32-timers
2556fb34d8SBenjamin Gaignard
2656fb34d8SBenjamin Gaignard  reg:
2756fb34d8SBenjamin Gaignard    maxItems: 1
2856fb34d8SBenjamin Gaignard
2956fb34d8SBenjamin Gaignard  clocks:
3056fb34d8SBenjamin Gaignard    maxItems: 1
3156fb34d8SBenjamin Gaignard
3256fb34d8SBenjamin Gaignard  clock-names:
3356fb34d8SBenjamin Gaignard    items:
3456fb34d8SBenjamin Gaignard      - const: int
3556fb34d8SBenjamin Gaignard
36596f2d31SRob Herring  resets:
3756fb34d8SBenjamin Gaignard    maxItems: 1
3856fb34d8SBenjamin Gaignard
3956fb34d8SBenjamin Gaignard  dmas:
4056fb34d8SBenjamin Gaignard    minItems: 1
4156fb34d8SBenjamin Gaignard    maxItems: 7
4256fb34d8SBenjamin Gaignard
4356fb34d8SBenjamin Gaignard  dma-names:
4456fb34d8SBenjamin Gaignard    items:
4556fb34d8SBenjamin Gaignard      enum: [ ch1, ch2, ch3, ch4, up, trig, com ]
4656fb34d8SBenjamin Gaignard    minItems: 1
4756fb34d8SBenjamin Gaignard    maxItems: 7
4856fb34d8SBenjamin Gaignard
499875ab53SUwe Kleine-König  interrupts:
509875ab53SUwe Kleine-König    oneOf:
519875ab53SUwe Kleine-König      - maxItems: 1
529875ab53SUwe Kleine-König      - maxItems: 4
539875ab53SUwe Kleine-König
549875ab53SUwe Kleine-König  interrupt-names:
559875ab53SUwe Kleine-König    oneOf:
569875ab53SUwe Kleine-König      - items:
579875ab53SUwe Kleine-König          - const: global
589875ab53SUwe Kleine-König      - items:
599875ab53SUwe Kleine-König          - const: brk
609875ab53SUwe Kleine-König          - const: up
619875ab53SUwe Kleine-König          - const: trg-com
629875ab53SUwe Kleine-König          - const: cc
639875ab53SUwe Kleine-König
6456fb34d8SBenjamin Gaignard  "#address-cells":
6556fb34d8SBenjamin Gaignard    const: 1
6656fb34d8SBenjamin Gaignard
6756fb34d8SBenjamin Gaignard  "#size-cells":
6856fb34d8SBenjamin Gaignard    const: 0
6956fb34d8SBenjamin Gaignard
7056fb34d8SBenjamin Gaignard  pwm:
7156fb34d8SBenjamin Gaignard    type: object
7242839dcaSRob Herring    additionalProperties: false
7356fb34d8SBenjamin Gaignard
7456fb34d8SBenjamin Gaignard    properties:
7556fb34d8SBenjamin Gaignard      compatible:
7656fb34d8SBenjamin Gaignard        const: st,stm32-pwm
7756fb34d8SBenjamin Gaignard
7856fb34d8SBenjamin Gaignard      "#pwm-cells":
7956fb34d8SBenjamin Gaignard        const: 3
8056fb34d8SBenjamin Gaignard
8156fb34d8SBenjamin Gaignard      st,breakinput:
8256fb34d8SBenjamin Gaignard        description:
8356fb34d8SBenjamin Gaignard          One or two <index level filter> to describe break input
8456fb34d8SBenjamin Gaignard          configurations.
853d21a460SRob Herring        $ref: /schemas/types.yaml#/definitions/uint32-matrix
863d21a460SRob Herring        items:
8756fb34d8SBenjamin Gaignard          items:
8856fb34d8SBenjamin Gaignard            - description: |
8956fb34d8SBenjamin Gaignard                "index" indicates on which break input (0 or 1) the
9056fb34d8SBenjamin Gaignard                configuration should be applied.
9156fb34d8SBenjamin Gaignard              enum: [0, 1]
9256fb34d8SBenjamin Gaignard            - description: |
9356fb34d8SBenjamin Gaignard                "level" gives the active level (0=low or 1=high) of the
9456fb34d8SBenjamin Gaignard                input signal for this configuration
9556fb34d8SBenjamin Gaignard              enum: [0, 1]
9656fb34d8SBenjamin Gaignard            - description: |
9756fb34d8SBenjamin Gaignard                "filter" gives the filtering value (up to 15) to be applied.
9856fb34d8SBenjamin Gaignard              maximum: 15
9956fb34d8SBenjamin Gaignard        minItems: 1
10056fb34d8SBenjamin Gaignard        maxItems: 2
10156fb34d8SBenjamin Gaignard
10256fb34d8SBenjamin Gaignard    required:
10356fb34d8SBenjamin Gaignard      - "#pwm-cells"
10456fb34d8SBenjamin Gaignard      - compatible
10556fb34d8SBenjamin Gaignard
106ae4ccaedSRob Herring  counter:
107ae4ccaedSRob Herring    type: object
10842839dcaSRob Herring    additionalProperties: false
109ae4ccaedSRob Herring
110ae4ccaedSRob Herring    properties:
111ae4ccaedSRob Herring      compatible:
112ae4ccaedSRob Herring        const: st,stm32-timer-counter
113ae4ccaedSRob Herring
114ae4ccaedSRob Herring    required:
115ae4ccaedSRob Herring      - compatible
116ae4ccaedSRob Herring
11756fb34d8SBenjamin GaignardpatternProperties:
11856fb34d8SBenjamin Gaignard  "^timer@[0-9]+$":
11956fb34d8SBenjamin Gaignard    type: object
12042839dcaSRob Herring    additionalProperties: false
12156fb34d8SBenjamin Gaignard
12256fb34d8SBenjamin Gaignard    properties:
12356fb34d8SBenjamin Gaignard      compatible:
12456fb34d8SBenjamin Gaignard        enum:
12556fb34d8SBenjamin Gaignard          - st,stm32-timer-trigger
12656fb34d8SBenjamin Gaignard          - st,stm32h7-timer-trigger
12756fb34d8SBenjamin Gaignard
12856fb34d8SBenjamin Gaignard      reg:
12956fb34d8SBenjamin Gaignard        description: Identify trigger hardware block.
13056fb34d8SBenjamin Gaignard        items:
13156fb34d8SBenjamin Gaignard          minimum: 0
13256fb34d8SBenjamin Gaignard          maximum: 16
13356fb34d8SBenjamin Gaignard
13456fb34d8SBenjamin Gaignard    required:
13556fb34d8SBenjamin Gaignard      - compatible
13656fb34d8SBenjamin Gaignard      - reg
13756fb34d8SBenjamin Gaignard
13856fb34d8SBenjamin Gaignardrequired:
13956fb34d8SBenjamin Gaignard  - compatible
14056fb34d8SBenjamin Gaignard  - reg
14156fb34d8SBenjamin Gaignard  - clocks
14256fb34d8SBenjamin Gaignard  - clock-names
14356fb34d8SBenjamin Gaignard
14456fb34d8SBenjamin GaignardadditionalProperties: false
14556fb34d8SBenjamin Gaignard
14656fb34d8SBenjamin Gaignardexamples:
14756fb34d8SBenjamin Gaignard  - |
14856fb34d8SBenjamin Gaignard    #include <dt-bindings/clock/stm32mp1-clks.h>
1498f7e68bbSFabrice Gasnier    timers2: timer@40000000 {
15056fb34d8SBenjamin Gaignard      #address-cells = <1>;
15156fb34d8SBenjamin Gaignard      #size-cells = <0>;
15256fb34d8SBenjamin Gaignard      compatible = "st,stm32-timers";
15356fb34d8SBenjamin Gaignard      reg = <0x40000000 0x400>;
15456fb34d8SBenjamin Gaignard      clocks = <&rcc TIM2_K>;
15556fb34d8SBenjamin Gaignard      clock-names = "int";
15656fb34d8SBenjamin Gaignard      dmas = <&dmamux1 18 0x400 0x1>,
15756fb34d8SBenjamin Gaignard             <&dmamux1 19 0x400 0x1>,
15856fb34d8SBenjamin Gaignard             <&dmamux1 20 0x400 0x1>,
15956fb34d8SBenjamin Gaignard             <&dmamux1 21 0x400 0x1>,
16056fb34d8SBenjamin Gaignard             <&dmamux1 22 0x400 0x1>;
16156fb34d8SBenjamin Gaignard      dma-names = "ch1", "ch2", "ch3", "ch4", "up";
16256fb34d8SBenjamin Gaignard      pwm {
16356fb34d8SBenjamin Gaignard        compatible = "st,stm32-pwm";
16456fb34d8SBenjamin Gaignard        #pwm-cells = <3>;
16556fb34d8SBenjamin Gaignard        st,breakinput = <0 1 5>;
16656fb34d8SBenjamin Gaignard      };
1678f7e68bbSFabrice Gasnier      timer@1 {
16856fb34d8SBenjamin Gaignard        compatible = "st,stm32-timer-trigger";
1698f7e68bbSFabrice Gasnier        reg = <1>;
17056fb34d8SBenjamin Gaignard      };
17156fb34d8SBenjamin Gaignard      counter {
17256fb34d8SBenjamin Gaignard        compatible = "st,stm32-timer-counter";
17356fb34d8SBenjamin Gaignard      };
17456fb34d8SBenjamin Gaignard    };
17556fb34d8SBenjamin Gaignard
17656fb34d8SBenjamin Gaignard...
177