diff --git a/tests/drivers/clock_control/clock_control_api/boards/sam_e54_xpro.conf b/tests/drivers/clock_control/clock_control_api/boards/sam_e54_xpro.conf new file mode 100644 index 0000000000000..772fd036e4934 --- /dev/null +++ b/tests/drivers/clock_control/clock_control_api/boards/sam_e54_xpro.conf @@ -0,0 +1,4 @@ +# Copyright (c) 2025 Microchip Technology Inc. +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_CLOCK_CONTROL_MCHP_ASYNC_ON=y diff --git a/tests/drivers/clock_control/clock_control_api/boards/sam_e54_xpro.overlay b/tests/drivers/clock_control/clock_control_api/boards/sam_e54_xpro.overlay new file mode 100644 index 0000000000000..82d45b0a92885 --- /dev/null +++ b/tests/drivers/clock_control/clock_control_api/boards/sam_e54_xpro.overlay @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2025 Microchip Technology Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&clock { + mclkperiph: mclkperiph { + compatible = "microchip,sam-d5x-e5x-mclkperiph"; + #clock-cells = <1>; + + sercom3 { + subsystem = ; + mclk-en = <1>; + }; + }; + + gclkperiph: gclkperiph { + compatible = "microchip,sam-d5x-e5x-gclkperiph"; + #clock-cells = <1>; + + sercom4 { + subsystem = ; + gclkperiph-src = "gclk0"; + gclkperiph-en = <1>; + }; + }; +}; diff --git a/tests/drivers/clock_control/clock_control_api/src/mchp_device_subsys.h b/tests/drivers/clock_control/clock_control_api/src/mchp_device_subsys.h new file mode 100644 index 0000000000000..11a4377eebe80 --- /dev/null +++ b/tests/drivers/clock_control/clock_control_api/src/mchp_device_subsys.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 Microchip Technology Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "device_subsys.h" +#include +#include + +#define XOSC_STARTUP_US 500 + +static const struct device_subsys_data subsys_data[] = { + {.subsys = (void *)CLOCK_MCHP_MCLKPERIPH_ID_APBB_SERCOM3}, + {.subsys = (void *)CLOCK_MCHP_GCLKPERIPH_ID_SERCOM4_CORE}, + { + .subsys = (void *)CLOCK_MCHP_XOSC_ID_XOSC1, + .startup_us = XOSC_STARTUP_US, + }, + {.subsys = (void *)CLOCK_MCHP_XOSC32K_ID_XOSC32K}}; + +static const struct device_data devices[] = {{.dev = DEVICE_DT_GET(DT_NODELABEL(clock)), + .subsys_data = subsys_data, + .subsys_cnt = ARRAY_SIZE(subsys_data)}}; diff --git a/tests/drivers/clock_control/clock_control_api/src/test_clock_control.c b/tests/drivers/clock_control/clock_control_api/src/test_clock_control.c index 91af56bd3d29f..e1c0eb2a2130c 100644 --- a/tests/drivers/clock_control/clock_control_api/src/test_clock_control.c +++ b/tests/drivers/clock_control/clock_control_api/src/test_clock_control.c @@ -14,6 +14,8 @@ LOG_MODULE_REGISTER(test); #include "esp32_device_subsys.h" #elif DT_HAS_COMPAT_STATUS_OKAY(silabs_series_clock) #include "silabs_device_subsys.h" +#elif DT_HAS_COMPAT_STATUS_OKAY(microchip_sam_d5x_e5x_clock) +#include "mchp_device_subsys.h" #else #error "Unsupported board" #endif diff --git a/tests/drivers/clock_control/clock_control_api/testcase.yaml b/tests/drivers/clock_control/clock_control_api/testcase.yaml index d3c2669641fc2..4e3d86d831863 100644 --- a/tests/drivers/clock_control/clock_control_api/testcase.yaml +++ b/tests/drivers/clock_control/clock_control_api/testcase.yaml @@ -14,6 +14,7 @@ tests: - xg27_dk2602a - xg29_rb4412a - bg29_rb4420a + - sam_e54_xpro integration_platforms: - esp32_devkitc/esp32/procpu drivers.clock.clock_control_nrf5: