xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/st,stm32-timers.yaml (revision 8bab661a3316d8bd9b9fbd11a3b4371b91507bd2)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/mfd/st,stm32-timers.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7*8bab661aSEmmanuel Vadottitle: STMicroelectronics STM32 Timers
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotdescription: |
10c66ec88fSEmmanuel Vadot  This hardware block provides 3 types of timer along with PWM functionality:
11c66ec88fSEmmanuel Vadot    - advanced-control timers consist of a 16-bit auto-reload counter driven
12c66ec88fSEmmanuel Vadot      by a programmable prescaler, break input feature, PWM outputs and
13c66ec88fSEmmanuel Vadot      complementary PWM outputs channels.
14c66ec88fSEmmanuel Vadot    - general-purpose timers consist of a 16-bit or 32-bit auto-reload counter
15c66ec88fSEmmanuel Vadot      driven by a programmable prescaler and PWM outputs.
16c66ec88fSEmmanuel Vadot    - basic timers consist of a 16-bit auto-reload counter driven by a
17c66ec88fSEmmanuel Vadot      programmable prescaler.
18c66ec88fSEmmanuel Vadot
19c66ec88fSEmmanuel Vadotmaintainers:
208cc087a1SEmmanuel Vadot  - Fabrice Gasnier <fabrice.gasnier@foss.st.com>
21c66ec88fSEmmanuel Vadot
22c66ec88fSEmmanuel Vadotproperties:
23c66ec88fSEmmanuel Vadot  compatible:
24c66ec88fSEmmanuel Vadot    const: st,stm32-timers
25c66ec88fSEmmanuel Vadot
26c66ec88fSEmmanuel Vadot  reg:
27c66ec88fSEmmanuel Vadot    maxItems: 1
28c66ec88fSEmmanuel Vadot
29c66ec88fSEmmanuel Vadot  clocks:
30c66ec88fSEmmanuel Vadot    maxItems: 1
31c66ec88fSEmmanuel Vadot
32c66ec88fSEmmanuel Vadot  clock-names:
33c66ec88fSEmmanuel Vadot    items:
34c66ec88fSEmmanuel Vadot      - const: int
35c66ec88fSEmmanuel Vadot
36b97ee269SEmmanuel Vadot  resets:
37c66ec88fSEmmanuel Vadot    maxItems: 1
38c66ec88fSEmmanuel Vadot
39c66ec88fSEmmanuel Vadot  dmas:
40c66ec88fSEmmanuel Vadot    minItems: 1
41c66ec88fSEmmanuel Vadot    maxItems: 7
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel Vadot  dma-names:
44c66ec88fSEmmanuel Vadot    items:
45c66ec88fSEmmanuel Vadot      enum: [ ch1, ch2, ch3, ch4, up, trig, com ]
46c66ec88fSEmmanuel Vadot    minItems: 1
47c66ec88fSEmmanuel Vadot    maxItems: 7
48c66ec88fSEmmanuel Vadot
49b97ee269SEmmanuel Vadot  interrupts:
50b97ee269SEmmanuel Vadot    oneOf:
51b97ee269SEmmanuel Vadot      - maxItems: 1
52b97ee269SEmmanuel Vadot      - maxItems: 4
53b97ee269SEmmanuel Vadot
54b97ee269SEmmanuel Vadot  interrupt-names:
55b97ee269SEmmanuel Vadot    oneOf:
56b97ee269SEmmanuel Vadot      - items:
57b97ee269SEmmanuel Vadot          - const: global
58b97ee269SEmmanuel Vadot      - items:
59b97ee269SEmmanuel Vadot          - const: brk
60b97ee269SEmmanuel Vadot          - const: up
61b97ee269SEmmanuel Vadot          - const: trg-com
62b97ee269SEmmanuel Vadot          - const: cc
63b97ee269SEmmanuel Vadot
64c66ec88fSEmmanuel Vadot  "#address-cells":
65c66ec88fSEmmanuel Vadot    const: 1
66c66ec88fSEmmanuel Vadot
67c66ec88fSEmmanuel Vadot  "#size-cells":
68c66ec88fSEmmanuel Vadot    const: 0
69c66ec88fSEmmanuel Vadot
70c66ec88fSEmmanuel Vadot  pwm:
71c66ec88fSEmmanuel Vadot    type: object
727ef62cebSEmmanuel Vadot    additionalProperties: false
73c66ec88fSEmmanuel Vadot
74c66ec88fSEmmanuel Vadot    properties:
75c66ec88fSEmmanuel Vadot      compatible:
76c66ec88fSEmmanuel Vadot        const: st,stm32-pwm
77c66ec88fSEmmanuel Vadot
78c66ec88fSEmmanuel Vadot      "#pwm-cells":
79c66ec88fSEmmanuel Vadot        const: 3
80c66ec88fSEmmanuel Vadot
81c66ec88fSEmmanuel Vadot      st,breakinput:
82c66ec88fSEmmanuel Vadot        description:
83c66ec88fSEmmanuel Vadot          One or two <index level filter> to describe break input
84c66ec88fSEmmanuel Vadot          configurations.
85c66ec88fSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32-matrix
86c66ec88fSEmmanuel Vadot        items:
87c66ec88fSEmmanuel Vadot          items:
88c66ec88fSEmmanuel Vadot            - description: |
89c66ec88fSEmmanuel Vadot                "index" indicates on which break input (0 or 1) the
90c66ec88fSEmmanuel Vadot                configuration should be applied.
91c66ec88fSEmmanuel Vadot              enum: [0, 1]
92c66ec88fSEmmanuel Vadot            - description: |
93c66ec88fSEmmanuel Vadot                "level" gives the active level (0=low or 1=high) of the
94c66ec88fSEmmanuel Vadot                input signal for this configuration
95c66ec88fSEmmanuel Vadot              enum: [0, 1]
96c66ec88fSEmmanuel Vadot            - description: |
97c66ec88fSEmmanuel Vadot                "filter" gives the filtering value (up to 15) to be applied.
98c66ec88fSEmmanuel Vadot              maximum: 15
99c66ec88fSEmmanuel Vadot        minItems: 1
100c66ec88fSEmmanuel Vadot        maxItems: 2
101c66ec88fSEmmanuel Vadot
102c66ec88fSEmmanuel Vadot    required:
103c66ec88fSEmmanuel Vadot      - "#pwm-cells"
104c66ec88fSEmmanuel Vadot      - compatible
105c66ec88fSEmmanuel Vadot
106b97ee269SEmmanuel Vadot  counter:
107b97ee269SEmmanuel Vadot    type: object
1087ef62cebSEmmanuel Vadot    additionalProperties: false
109b97ee269SEmmanuel Vadot
110b97ee269SEmmanuel Vadot    properties:
111b97ee269SEmmanuel Vadot      compatible:
112b97ee269SEmmanuel Vadot        const: st,stm32-timer-counter
113b97ee269SEmmanuel Vadot
114b97ee269SEmmanuel Vadot    required:
115b97ee269SEmmanuel Vadot      - compatible
116b97ee269SEmmanuel Vadot
117c66ec88fSEmmanuel VadotpatternProperties:
118c66ec88fSEmmanuel Vadot  "^timer@[0-9]+$":
119c66ec88fSEmmanuel Vadot    type: object
1207ef62cebSEmmanuel Vadot    additionalProperties: false
121c66ec88fSEmmanuel Vadot
122c66ec88fSEmmanuel Vadot    properties:
123c66ec88fSEmmanuel Vadot      compatible:
124c66ec88fSEmmanuel Vadot        enum:
125c66ec88fSEmmanuel Vadot          - st,stm32-timer-trigger
126c66ec88fSEmmanuel Vadot          - st,stm32h7-timer-trigger
127c66ec88fSEmmanuel Vadot
128c66ec88fSEmmanuel Vadot      reg:
129c66ec88fSEmmanuel Vadot        description: Identify trigger hardware block.
130c66ec88fSEmmanuel Vadot        items:
131c66ec88fSEmmanuel Vadot          minimum: 0
132c66ec88fSEmmanuel Vadot          maximum: 16
133c66ec88fSEmmanuel Vadot
134c66ec88fSEmmanuel Vadot    required:
135c66ec88fSEmmanuel Vadot      - compatible
136c66ec88fSEmmanuel Vadot      - reg
137c66ec88fSEmmanuel Vadot
138c66ec88fSEmmanuel Vadotrequired:
139c66ec88fSEmmanuel Vadot  - compatible
140c66ec88fSEmmanuel Vadot  - reg
141c66ec88fSEmmanuel Vadot  - clocks
142c66ec88fSEmmanuel Vadot  - clock-names
143c66ec88fSEmmanuel Vadot
144c66ec88fSEmmanuel VadotadditionalProperties: false
145c66ec88fSEmmanuel Vadot
146c66ec88fSEmmanuel Vadotexamples:
147c66ec88fSEmmanuel Vadot  - |
148c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/stm32mp1-clks.h>
1495def4c47SEmmanuel Vadot    timers2: timer@40000000 {
150c66ec88fSEmmanuel Vadot      #address-cells = <1>;
151c66ec88fSEmmanuel Vadot      #size-cells = <0>;
152c66ec88fSEmmanuel Vadot      compatible = "st,stm32-timers";
153c66ec88fSEmmanuel Vadot      reg = <0x40000000 0x400>;
154c66ec88fSEmmanuel Vadot      clocks = <&rcc TIM2_K>;
155c66ec88fSEmmanuel Vadot      clock-names = "int";
156c66ec88fSEmmanuel Vadot      dmas = <&dmamux1 18 0x400 0x1>,
157c66ec88fSEmmanuel Vadot             <&dmamux1 19 0x400 0x1>,
158c66ec88fSEmmanuel Vadot             <&dmamux1 20 0x400 0x1>,
159c66ec88fSEmmanuel Vadot             <&dmamux1 21 0x400 0x1>,
160c66ec88fSEmmanuel Vadot             <&dmamux1 22 0x400 0x1>;
161c66ec88fSEmmanuel Vadot      dma-names = "ch1", "ch2", "ch3", "ch4", "up";
162c66ec88fSEmmanuel Vadot      pwm {
163c66ec88fSEmmanuel Vadot        compatible = "st,stm32-pwm";
164c66ec88fSEmmanuel Vadot        #pwm-cells = <3>;
165c66ec88fSEmmanuel Vadot        st,breakinput = <0 1 5>;
166c66ec88fSEmmanuel Vadot      };
1675def4c47SEmmanuel Vadot      timer@1 {
168c66ec88fSEmmanuel Vadot        compatible = "st,stm32-timer-trigger";
1695def4c47SEmmanuel Vadot        reg = <1>;
170c66ec88fSEmmanuel Vadot      };
171c66ec88fSEmmanuel Vadot      counter {
172c66ec88fSEmmanuel Vadot        compatible = "st,stm32-timer-counter";
173c66ec88fSEmmanuel Vadot      };
174c66ec88fSEmmanuel Vadot    };
175c66ec88fSEmmanuel Vadot
176c66ec88fSEmmanuel Vadot...
177