Skip to content

Commit 2cb3d4b

Browse files
committed
dts: arm: microchip: add tcc node for pwm peripheral
Adds the dts nodes and binding yamls for pwm driver using tcc peripheral. Signed-off-by: Muhammed Asif <[email protected]>
1 parent 727c15a commit 2cb3d4b

File tree

6 files changed

+228
-0
lines changed

6 files changed

+228
-0
lines changed

dts/arm/microchip/sam/sam_d5x_e5x/common/samd5xe5x.dtsi

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
#include <arm/armv7-m.dtsi>
8+
#include <zephyr/dt-bindings/pwm/pwm.h>
89
#include <zephyr/dt-bindings/clock/mchp_sam_d5x_e5x_clock.h>
910

1011
/ {
@@ -117,6 +118,39 @@
117118
clock-names = "mclk", "gclk";
118119
};
119120

121+
tcc0: tcc@41016000 {
122+
compatible = "microchip,tcc-g1";
123+
reg = <0x41016000 0x2000>;
124+
interrupts = <85 0>, <86 0>, <87 0>, <88 0>, <89 0>, <90 0>, <91 0>;
125+
clocks = <&mclkperiph CLOCK_MCHP_MCLKPERIPH_ID_APBB_TCC0>,
126+
<&gclkperiph CLOCK_MCHP_GCLKPERIPH_ID_TCC0>;
127+
clock-names = "mclk", "gclk";
128+
max-bit-width = <24>;
129+
channels = <6>;
130+
};
131+
132+
tcc1: tcc@41018000 {
133+
compatible = "microchip,tcc-g1";
134+
reg = <0x41018000 0x2000>;
135+
interrupts = <92 0>, <93 0>, <94 0>, <95 0>, <96 0>;
136+
clocks = <&mclkperiph CLOCK_MCHP_MCLKPERIPH_ID_APBB_TCC1>,
137+
<&gclkperiph CLOCK_MCHP_GCLKPERIPH_ID_TCC1>;
138+
clock-names = "mclk", "gclk";
139+
max-bit-width = <24>;
140+
channels = <4>;
141+
};
142+
143+
tcc2: tcc@42000c00 {
144+
compatible = "microchip,tcc-g1";
145+
reg = <0x42000c00 0x2000>;
146+
interrupts = <97 0>, <98 0>, <99 0>, <100 0>;
147+
clocks = <&mclkperiph CLOCK_MCHP_MCLKPERIPH_ID_APBC_TCC2>,
148+
<&gclkperiph CLOCK_MCHP_GCLKPERIPH_ID_TCC2>;
149+
clock-names = "mclk", "gclk";
150+
max-bit-width = <16>;
151+
channels = <3>;
152+
};
153+
120154
sercom4: sercom@43000000 {
121155
compatible = "microchip,sercom-g1";
122156
status = "disabled";
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2025 Microchip Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
soc {
9+
tcc3: tcc@42001000 {
10+
compatible = "microchip,tcc-g1";
11+
reg = <0x42001000 0x2000>;
12+
interrupts = <101 0>, <102 0>, <103 0>;
13+
clocks = <&mclkperiphperiph CLOCK_MCHP_MCLKPERIPH_ID_APBC_TCC3>,
14+
<&gclkperiph CLOCK_MCHP_GCLKPERIPH_ID_TCC3>;
15+
clock-names = "mclk", "gclk";
16+
max-bit-width = <16>;
17+
channels = <2>;
18+
};
19+
20+
tcc4: tcc@43001000 {
21+
compatible = "microchip,tcc-g1";
22+
reg = <0x43001000 0x2000>;
23+
interrupts = <104 0>, <105 0>, <106 0>;
24+
clocks = <&mclkperiphperiph CLOCK_MCHP_MCLKPERIPH_ID_APBD_TCC4>,
25+
<&gclkperiph CLOCK_MCHP_GCLKPERIPH_ID_TCC4>;
26+
clock-names = "mclk", "gclk";
27+
max-bit-width = <16>;
28+
channels = <2>;
29+
};
30+
};
31+
};
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2025 Microchip Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
soc {
9+
tcc3: tcc@42001000 {
10+
compatible = "microchip,tcc-g1";
11+
reg = <0x42001000 0x2000>;
12+
interrupts = <101 0>, <102 0>, <103 0>;
13+
clocks = <&mclkperiph CLOCK_MCHP_MCLKPERIPH_ID_APBC_TCC3>,
14+
<&gclkperiph CLOCK_MCHP_GCLKPERIPH_ID_TCC3>;
15+
clock-names = "mclk", "gclk";
16+
max-bit-width = <16>;
17+
channels = <2>;
18+
};
19+
20+
tcc4: tcc@43001000 {
21+
compatible = "microchip,tcc-g1";
22+
reg = <0x43001000 0x2000>;
23+
interrupts = <104 0>, <105 0>, <106 0>;
24+
clocks = <&mclkperiph CLOCK_MCHP_MCLKPERIPH_ID_APBD_TCC4>,
25+
<&gclkperiph CLOCK_MCHP_GCLKPERIPH_ID_TCC4>;
26+
clock-names = "mclk", "gclk";
27+
max-bit-width = <16>;
28+
channels = <2>;
29+
};
30+
};
31+
};
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2025 Microchip Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
soc {
9+
tcc3: tcc@42001000 {
10+
compatible = "microchip,tcc-g1";
11+
reg = <0x42001000 0x2000>;
12+
interrupts = <101 0>, <102 0>, <103 0>;
13+
clocks = <&mclkperiph CLOCK_MCHP_MCLKPERIPH_ID_APBC_TCC3>,
14+
<&gclkperiph CLOCK_MCHP_GCLKPERIPH_ID_TCC3>;
15+
clock-names = "mclk", "gclk";
16+
max-bit-width = <16>;
17+
channels = <2>;
18+
};
19+
20+
tcc4: tcc@43001000 {
21+
compatible = "microchip,tcc-g1";
22+
reg = <0x43001000 0x2000>;
23+
interrupts = <104 0>, <105 0>, <106 0>;
24+
clocks = <&mclkperiph CLOCK_MCHP_MCLKPERIPH_ID_APBD_TCC4>,
25+
<&gclkperiph CLOCK_MCHP_GCLKPERIPH_ID_TCC4>;
26+
clock-names = "mclk", "gclk";
27+
max-bit-width = <16>;
28+
channels = <2>;
29+
};
30+
};
31+
};
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Copyright (c) 2025 Microchip Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: |
5+
Microchip TCC G1 timer counter peripheral.
6+
7+
This peripheral is used for generating PWM signals.
8+
This compatible string is to be used for the following peripherals:
9+
- module name="TCC" id="U2213" version="3.1.0"
10+
11+
compatible: "microchip,tcc-g1"
12+
13+
include:
14+
- name: base.yaml
15+
- name: pinctrl-device.yaml
16+
17+
properties:
18+
reg:
19+
description: |
20+
Specifies the base address and size of the register set for the timer counter peripheral.
21+
required: true
22+
23+
interrupts:
24+
description: |
25+
Defines the interrupt lines used by the timer counter peripheral.
26+
27+
This property specifies the interrupt number and priority.
28+
required: true
29+
30+
clocks:
31+
description: |
32+
Specifies the clock sources and their configurations for the timer counter peripheral.
33+
34+
This property ensures the peripheral is provided with the necessary clock signals.
35+
required: true
36+
37+
prescaler:
38+
type: int
39+
description: |
40+
Timer prescaler values.
41+
42+
The prescaler divides the input clock frequency to
43+
achieve the desired timer frequency.
44+
enum:
45+
- 1
46+
- 2
47+
- 4
48+
- 8
49+
- 16
50+
- 64
51+
- 256
52+
- 1024
53+
54+
channels:
55+
type: int
56+
required: true
57+
description: |
58+
This specifies the maximum number of channels available for the peripheral instance.
59+
60+
max-bit-width:
61+
type: int
62+
required: true
63+
description: |
64+
Maximum bit width supported by the counter.
65+
66+
This property specifies the resolution of the counter. The value provided in the device tree
67+
should reflect the maximum supported by the hardware instance. It should only be overridden
68+
after consulting the relevant family datasheet to ensure compatibility.
69+
enum:
70+
- 16
71+
- 24
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2025 Microchip Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Description of the Microchip TCC PWM driver
5+
description: |
6+
Microchip TCC pwm driver.
7+
8+
This driver is used for configuring
9+
and managing TCC (Timer/ Counter for Control Applications)
10+
peripheral in Microchip microcontrollers. This peripherals
11+
support creating PWM signals. The supported peripherals are
12+
as follows:
13+
- module name="TCC" id="U2213" version="3.1.0"
14+
15+
compatible: "microchip,tcc-g1-pwm"
16+
17+
include:
18+
- base.yaml
19+
- pwm-controller.yaml
20+
- microchip,tcc-g1.yaml
21+
- pinctrl-device.yaml
22+
23+
properties:
24+
"#pwm-cells":
25+
const: 3
26+
27+
pwm-cells:
28+
- channel
29+
- period
30+
- polarity

0 commit comments

Comments
 (0)