Skip to content

Commit 34c900e

Browse files
tests: drivers: clock_control: Added sam_e54_xpro test support files
Added mchp_v1_subsys.h and sam_e54_xpro.overlay file and .conf file Added Added sam_e54_xpro platform allow in testcase.yaml Signed-off-by: farsin NASAR V A <farsin.nasarva@microchip.com>
1 parent 80be486 commit 34c900e

File tree

5 files changed

+59
-0
lines changed

5 files changed

+59
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 Microchip Technology Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_CLOCK_CONTROL_MCHP_ASYNC_ON=y
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2025 Microchip Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&clock {
8+
mclkperiph: mclkperiph {
9+
compatible = "microchip,sam-d5x-e5x-mclkperiph";
10+
#clock-cells = <1>;
11+
12+
sercom3 {
13+
subsystem = <CLOCK_MCHP_MCLKPERIPH_ID_APBB_SERCOM3>;
14+
mclk-en = <1>;
15+
};
16+
};
17+
18+
gclkperiph: gclkperiph {
19+
compatible = "microchip,sam-d5x-e5x-gclkperiph";
20+
#clock-cells = <1>;
21+
22+
sercom4 {
23+
subsystem = <CLOCK_MCHP_GCLKPERIPH_ID_SERCOM4_CORE>;
24+
gclkperiph-src = "gclk0";
25+
gclkperiph-en = <1>;
26+
};
27+
};
28+
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2025 Microchip Technology Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include "device_subsys.h"
8+
#include <zephyr/drivers/clock_control/mchp_clock_sam_d5x_e5x.h>
9+
#include <zephyr/dt-bindings/clock/mchp_sam_d5x_e5x_clock.h>
10+
11+
#define XOSC_STARTUP_US 500
12+
13+
static const struct device_subsys_data subsys_data[] = {
14+
{.subsys = (void *)CLOCK_MCHP_MCLKPERIPH_ID_APBB_SERCOM3},
15+
{.subsys = (void *)CLOCK_MCHP_GCLKPERIPH_ID_SERCOM4_CORE},
16+
{
17+
.subsys = (void *)CLOCK_MCHP_XOSC_ID_XOSC1,
18+
.startup_us = XOSC_STARTUP_US,
19+
},
20+
{.subsys = (void *)CLOCK_MCHP_XOSC32K_ID_XOSC32K}};
21+
22+
static const struct device_data devices[] = {{.dev = DEVICE_DT_GET(DT_NODELABEL(clock)),
23+
.subsys_data = subsys_data,
24+
.subsys_cnt = ARRAY_SIZE(subsys_data)}};

tests/drivers/clock_control/clock_control_api/src/test_clock_control.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ LOG_MODULE_REGISTER(test);
1414
#include "esp32_device_subsys.h"
1515
#elif DT_HAS_COMPAT_STATUS_OKAY(silabs_series_clock)
1616
#include "silabs_device_subsys.h"
17+
#elif DT_HAS_COMPAT_STATUS_OKAY(microchip_sam_d5x_e5x_clock)
18+
#include "mchp_device_subsys.h"
1719
#else
1820
#error "Unsupported board"
1921
#endif

tests/drivers/clock_control/clock_control_api/testcase.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ tests:
1414
- xg27_dk2602a
1515
- xg29_rb4412a
1616
- bg29_rb4420a
17+
- sam_e54_xpro
1718
integration_platforms:
1819
- esp32_devkitc/esp32/procpu
1920
drivers.clock.clock_control_nrf5:

0 commit comments

Comments
 (0)