0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/mfd/st,stm32-timers.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: STMicroelectronics STM32 Timers bindings
0008
0009 description: |
0010 This hardware block provides 3 types of timer along with PWM functionality:
0011 - advanced-control timers consist of a 16-bit auto-reload counter driven
0012 by a programmable prescaler, break input feature, PWM outputs and
0013 complementary PWM outputs channels.
0014 - general-purpose timers consist of a 16-bit or 32-bit auto-reload counter
0015 driven by a programmable prescaler and PWM outputs.
0016 - basic timers consist of a 16-bit auto-reload counter driven by a
0017 programmable prescaler.
0018
0019 maintainers:
0020 - Fabrice Gasnier <fabrice.gasnier@foss.st.com>
0021
0022 properties:
0023 compatible:
0024 const: st,stm32-timers
0025
0026 reg:
0027 maxItems: 1
0028
0029 clocks:
0030 maxItems: 1
0031
0032 clock-names:
0033 items:
0034 - const: int
0035
0036 resets:
0037 maxItems: 1
0038
0039 dmas:
0040 minItems: 1
0041 maxItems: 7
0042
0043 dma-names:
0044 items:
0045 enum: [ ch1, ch2, ch3, ch4, up, trig, com ]
0046 minItems: 1
0047 maxItems: 7
0048
0049 interrupts:
0050 oneOf:
0051 - maxItems: 1
0052 - maxItems: 4
0053
0054 interrupt-names:
0055 oneOf:
0056 - items:
0057 - const: global
0058 - items:
0059 - const: brk
0060 - const: up
0061 - const: trg-com
0062 - const: cc
0063
0064 "#address-cells":
0065 const: 1
0066
0067 "#size-cells":
0068 const: 0
0069
0070 pwm:
0071 type: object
0072
0073 properties:
0074 compatible:
0075 const: st,stm32-pwm
0076
0077 "#pwm-cells":
0078 const: 3
0079
0080 st,breakinput:
0081 description:
0082 One or two <index level filter> to describe break input
0083 configurations.
0084 $ref: /schemas/types.yaml#/definitions/uint32-matrix
0085 items:
0086 items:
0087 - description: |
0088 "index" indicates on which break input (0 or 1) the
0089 configuration should be applied.
0090 enum: [0, 1]
0091 - description: |
0092 "level" gives the active level (0=low or 1=high) of the
0093 input signal for this configuration
0094 enum: [0, 1]
0095 - description: |
0096 "filter" gives the filtering value (up to 15) to be applied.
0097 maximum: 15
0098 minItems: 1
0099 maxItems: 2
0100
0101 required:
0102 - "#pwm-cells"
0103 - compatible
0104
0105 counter:
0106 type: object
0107
0108 properties:
0109 compatible:
0110 const: st,stm32-timer-counter
0111
0112 required:
0113 - compatible
0114
0115 patternProperties:
0116 "^timer@[0-9]+$":
0117 type: object
0118
0119 properties:
0120 compatible:
0121 enum:
0122 - st,stm32-timer-trigger
0123 - st,stm32h7-timer-trigger
0124
0125 reg:
0126 description: Identify trigger hardware block.
0127 items:
0128 minimum: 0
0129 maximum: 16
0130
0131 required:
0132 - compatible
0133 - reg
0134
0135 required:
0136 - compatible
0137 - reg
0138 - clocks
0139 - clock-names
0140
0141 additionalProperties: false
0142
0143 examples:
0144 - |
0145 #include <dt-bindings/clock/stm32mp1-clks.h>
0146 timers2: timer@40000000 {
0147 #address-cells = <1>;
0148 #size-cells = <0>;
0149 compatible = "st,stm32-timers";
0150 reg = <0x40000000 0x400>;
0151 clocks = <&rcc TIM2_K>;
0152 clock-names = "int";
0153 dmas = <&dmamux1 18 0x400 0x1>,
0154 <&dmamux1 19 0x400 0x1>,
0155 <&dmamux1 20 0x400 0x1>,
0156 <&dmamux1 21 0x400 0x1>,
0157 <&dmamux1 22 0x400 0x1>;
0158 dma-names = "ch1", "ch2", "ch3", "ch4", "up";
0159 pwm {
0160 compatible = "st,stm32-pwm";
0161 #pwm-cells = <3>;
0162 st,breakinput = <0 1 5>;
0163 };
0164 timer@1 {
0165 compatible = "st,stm32-timer-trigger";
0166 reg = <1>;
0167 };
0168 counter {
0169 compatible = "st,stm32-timer-counter";
0170 };
0171 };
0172
0173 ...