Skip to content

Commit dfa126f

Browse files
Farsin-Nasar-Microchipmchp-asif
authored andcommitted
tests: drivers: counter: added sam_e54 test support files
Added sam_e54_xpro.overlay files for tcc Added sam_e54_xpro platform allow in testcase.yaml. Signed-off-by: Farsin NASAR V A <[email protected]>
1 parent 31ea3a8 commit dfa126f

File tree

6 files changed

+94
-1
lines changed

6 files changed

+94
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2025 Microchip Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&tcc1 {
8+
compatible = "microchip,tcc-g1-counter";
9+
max-bit-width = <24>;
10+
prescaler = <64>;
11+
status = "okay";
12+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2025 Microchip Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&tcc2 {
8+
compatible = "microchip,tcc-g1-counter";
9+
max-bit-width = <24>;
10+
prescaler = <64>;
11+
status = "okay";
12+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2025 Microchip Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&tcc3 {
8+
compatible = "microchip,tcc-g1-counter";
9+
max-bit-width = <24>;
10+
prescaler = <64>;
11+
status = "okay";
12+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2025 Microchip Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&tcc4 {
8+
compatible = "microchip,tcc-g1-counter";
9+
max-bit-width = <24>;
10+
prescaler = <64>;
11+
status = "okay";
12+
};

tests/drivers/counter/counter_basic_api/src/test_counter.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright (c) 2018, Nordic Semiconductor ASA
33
* Copyright 2024, 2025 NXP
4+
* Copyright (c) 2025 Microchip Technology Inc.
45
*
56
* SPDX-License-Identifier: Apache-2.0
67
*/
@@ -23,6 +24,8 @@ void *exp_user_data = (void *)199;
2324
struct counter_alarm_cfg cntr_alarm_cfg;
2425
struct counter_alarm_cfg cntr_alarm_cfg2;
2526

27+
/* clang-format off */
28+
2629
#define DEVICE_DT_GET_AND_COMMA(node_id) DEVICE_DT_GET(node_id),
2730
/* Generate a list of devices for all instances of the "compat" */
2831
#define DEVS_FOR_DT_COMPAT(compat) \
@@ -153,12 +156,16 @@ static const struct device *const devices[] = {
153156
#ifdef CONFIG_COUNTER_RA_AGT
154157
DEVS_FOR_DT_COMPAT(renesas_ra_agt_counter)
155158
#endif
159+
156160
#ifdef CONFIG_COUNTER_RENESAS_RZ_CMTW
157161
DEVS_FOR_DT_COMPAT(renesas_rz_cmtw_counter)
158162
#endif
159163
#ifdef CONFIG_COUNTER_INFINEON_TCPWM
160164
DEVS_FOR_DT_COMPAT(infineon_tcpwm_counter)
161165
#endif
166+
#ifdef CONFIG_COUNTER_MCHP_G1_TCC
167+
DEVS_FOR_DT_COMPAT(microchip_tcc_g1_counter)
168+
#endif
162169
};
163170

164171
static const struct device *const period_devs[] = {
@@ -179,6 +186,7 @@ static const struct device *const period_devs[] = {
179186
#endif
180187
};
181188

189+
/* clang-format on */
182190
typedef void (*counter_test_func_t)(const struct device *dev);
183191
typedef bool (*counter_capability_func_t)(const struct device *dev);
184192

tests/drivers/counter/counter_basic_api/testcase.yaml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ tests:
55
- counter
66
depends_on: counter
77
min_ram: 16
8-
platform_exclude: nucleo_f302r8
8+
platform_exclude:
9+
- nucleo_f302r8
10+
- sam_e54_xpro
911
timeout: 600
1012
drivers.counter.basic_api.nrf_zli:
1113
tags:
@@ -51,3 +53,38 @@ tests:
5153
- CONFIG_TEST_DRIVER_COUNTER_MCUX_LPC_RTC_HIGHRES=n
5254
extra_args:
5355
DTC_OVERLAY_FILE="enable_standby.overlay"
56+
drivers.counter.basic_api.mchp_tcc1:
57+
tags:
58+
- drivers
59+
- counter
60+
depends_on: counter
61+
platform_allow: sam_e54_xpro
62+
timeout: 600
63+
extra_args:
64+
DTC_OVERLAY_FILE="boards/microchip/sam_e54_xpro_tcc1.overlay"
65+
drivers.counter.basic_api.mchp_tcc2:
66+
tags:
67+
- drivers
68+
- counter
69+
platform_allow: sam_e54_xpro
70+
timeout: 600
71+
extra_args:
72+
DTC_OVERLAY_FILE="boards/microchip/sam_e54_xpro_tcc2.overlay"
73+
drivers.counter.basic_api.mchp_tcc3:
74+
tags:
75+
- drivers
76+
- counter
77+
depends_on: counter
78+
platform_allow: sam_e54_xpro
79+
timeout: 600
80+
extra_args:
81+
DTC_OVERLAY_FILE="boards/microchip/sam_e54_xpro_tcc3.overlay"
82+
drivers.counter.basic_api.mchp_tcc4:
83+
tags:
84+
- drivers
85+
- counter
86+
depends_on: counter
87+
platform_allow: sam_e54_xpro
88+
timeout: 600
89+
extra_args:
90+
DTC_OVERLAY_FILE="boards/microchip/sam_e54_xpro_tcc4.overlay"

0 commit comments

Comments
 (0)