Skip to content

Commit d6f2ba8

Browse files
mnkpcarlescufi
authored andcommitted
dts: add support for Atmel SAM Timer Counter (TC)
Add support for Timer Counter (TC) on SAM E70/V71 series. Signed-off-by: Piotr Mienkowski <[email protected]>
1 parent c50c0f6 commit d6f2ba8

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed

dts/arm/atmel/same70-pinctrl.dtsi

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,42 @@
108108
DT_ATMEL_PIN(usart2, rxd2, d, 15, b);
109109
DT_ATMEL_PIN(usart2, sck2, d, 17, b);
110110
DT_ATMEL_PIN(usart2, txd2, d, 16, b);
111+
DT_ATMEL_PIN(tc0, tclk0, a, 4, b);
112+
DT_ATMEL_PIN(tc0, tclk1, a, 28, b);
113+
DT_ATMEL_PIN(tc0, tclk2, a, 29, b);
114+
DT_ATMEL_PIN(tc0, tioa0, a, 0, b);
115+
DT_ATMEL_PIN(tc0, tioa1, a, 15, b);
116+
DT_ATMEL_PIN(tc0, tioa2, a, 26, b);
117+
DT_ATMEL_PIN(tc0, tiob0, a, 1, b);
118+
DT_ATMEL_PIN(tc0, tiob1, a, 16, b);
119+
DT_ATMEL_PIN(tc0, tiob2, a, 27, b);
120+
DT_ATMEL_PIN(tc1, tclk3, c, 25, b);
121+
DT_ATMEL_PIN(tc1, tclk4, c, 28, b);
122+
DT_ATMEL_PIN(tc1, tclk5, c, 31, b);
123+
DT_ATMEL_PIN(tc1, tioa3, c, 23, b);
124+
DT_ATMEL_PIN(tc1, tioa4, c, 26, b);
125+
DT_ATMEL_PIN(tc1, tioa5, c, 29, b);
126+
DT_ATMEL_PIN(tc1, tiob3, c, 24, b);
127+
DT_ATMEL_PIN(tc1, tiob4, c, 27, b);
128+
DT_ATMEL_PIN(tc1, tiob5, c, 30, b);
129+
DT_ATMEL_PIN(tc2, tclk6, c, 7, b);
130+
DT_ATMEL_PIN(tc2, tclk7, c, 10, b);
131+
DT_ATMEL_PIN(tc2, tclk8, c, 14, b);
132+
DT_ATMEL_PIN(tc2, tioa6, c, 5, b);
133+
DT_ATMEL_PIN(tc2, tioa7, c, 8, b);
134+
DT_ATMEL_PIN(tc2, tioa8, c, 11, b);
135+
DT_ATMEL_PIN(tc2, tiob6, c, 6, b);
136+
DT_ATMEL_PIN(tc2, tiob7, c, 9, b);
137+
DT_ATMEL_PIN(tc2, tiob8, c, 12, b);
138+
DT_ATMEL_PIN(tc3, tclk9, e, 2, b);
139+
DT_ATMEL_PIN(tc3, tclk10, e, 5, b);
140+
DT_ATMEL_PIN(tc3, tclk11, d, 24, c);
141+
DT_ATMEL_PIN(tc3, tioa9, e, 0, b);
142+
DT_ATMEL_PIN(tc3, tioa10, e, 3, b);
143+
DT_ATMEL_PIN(tc3, tioa11, d, 21, c);
144+
DT_ATMEL_PIN(tc3, tiob9, e, 1, b);
145+
DT_ATMEL_PIN(tc3, tiob10, e, 4, b);
146+
DT_ATMEL_PIN(tc3, tiob11, d, 22, c);
111147
};
112148
};
113149
};

dts/arm/atmel/same70.dtsi

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,50 @@
355355
&pd8a_gmac_gmdc &pd9a_gmac_gmdio>;
356356
};
357357

358+
tc0: tc@4000C000 {
359+
compatible = "atmel,sam-tc";
360+
reg = <0x4000C000 0x100>;
361+
interrupts = <23 0
362+
24 0
363+
25 0>;
364+
peripheral-id = <23 24 25>;
365+
status = "disabled";
366+
label = "TC0";
367+
};
368+
369+
tc1: tc@40010000 {
370+
compatible = "atmel,sam-tc";
371+
reg = <0x40010000 0x100>;
372+
interrupts = <26 0
373+
27 0
374+
28 0>;
375+
peripheral-id = <26 27 28>;
376+
status = "disabled";
377+
label = "TC1";
378+
};
379+
380+
tc2: tc@40014000 {
381+
compatible = "atmel,sam-tc";
382+
reg = <0x40014000 0x100>;
383+
interrupts = <47 0
384+
48 0
385+
49 0>;
386+
peripheral-id = <47 48 49>;
387+
status = "disabled";
388+
label = "TC2";
389+
};
390+
391+
tc3: tc@40054000 {
392+
compatible = "atmel,sam-tc";
393+
reg = <0x40054000 0x100>;
394+
interrupts = <50 0
395+
51 0
396+
52 0>;
397+
peripheral-id = <50 51 52>;
398+
status = "disabled";
399+
label = "TC3";
400+
};
401+
358402
trng: random@40070000 {
359403
compatible = "atmel,sam-trng";
360404
reg = <0x40070000 0x4000>;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
description: Atmel SAM Timer Counter (TC) node
4+
5+
compatible: "atmel,sam-tc"
6+
7+
include: base.yaml
8+
9+
properties:
10+
reg:
11+
required: true
12+
13+
interrupts:
14+
required: true
15+
16+
label:
17+
required: true
18+
19+
peripheral-id:
20+
type: array
21+
description: peripheral ID
22+
required: true
23+
24+
pinctrl-0:
25+
type: phandles
26+
required: false
27+
description: |
28+
PIO pin configuration for Timer Counter signals. We expect that
29+
the phandles will reference pinctrl nodes. These nodes will
30+
have a nodelabel that matches the Atmel SoC HAL defines and
31+
be of the form p<port><pin><periph>_<inst>_<signal>.
32+
33+
In Quadrature Decoder mode TIOA0 & TIOB0 signals are expected
34+
35+
For example the TC0 on SAME7x would be
36+
pinctrl-0 = <&pa0b_tc0_tioa0 &pa1b_tc0_tiob0>;

0 commit comments

Comments
 (0)