Commit graph

183 commits

Author SHA1 Message Date
TLIG Dhaou
933bd0e55a tests: drivers: clock_control: stm32_clock_configuartion add testcases
Add testcases when hsi used with the hsi div as system clock source.

Signed-off-by: TLIG Dhaou <dhaou.tlig-ext@st.com>
2022-07-04 15:20:06 +02:00
Erwan Gouriou
bced529f78 include: stm32: clock_control: Ease usage of STM32_DT_CLOCKS macro
STM32_DT_CLOCKS was designed to take a device tree node label name as
argument: STM32_DT_CLOCKS(uart1)
Change its implementation to take a node identifier instead:
STM32_DT_CLOCKS(DT_NODELABEL(uart1)).

This make its usage more flexible since the argument can now be extracted
from other DT macros such as DT_PARENT. Then, the following can be done:
STM32_DT_CLOCKS(DT_PARENT(child_node_label)).

Since it is now possible implement STM32_DT_INST_CLOCKS using
STM32_DT_CLOCKS.

Finally, update existing STM32_DT_CLOCKS users and convert
STM32_INST_CLOCK_INFO users to STM32_CLOCK_INFO.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-06-28 11:07:29 +02:00
Ederson de Souza
b56088ba6d drivers/clock_control: Add cAVS clock driver
Simple driver that allows one to choose the clock speed of xtensa cores.
It's basically a shim layer on top of SOC level driver.
Also, a really simple test case was added, mainly to ensure things are
build and are sane.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-06-27 12:42:04 +02:00
Erwan Gouriou
b52021189b tests/drivers/clock_control: stm32: Migrate includes to <zephyr/...>
Follow up of what was done in main branch during this development.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou
d9b9e12cd3 dts/bindings/clocks: stm32: 'clock-names' optional for source clock setting
Since implementation of clock source selection in consumer device drivers
could be achieved without usage of a clock-names property and no
example of usage is provided up to now, remove this property from existing
examples.
Additionally, make it clear in stm32 clock control binding that it is
driver's responsibility to correctly access clock source information
and use it as required.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou
ac61ea9e44 tests/drivers/clock_control: stm32: Add stm32_common_devices tests
Add a test section to enable device clock source selection testing.
Test targets I2C1 device which supports clock source selection
on all SOCs using this driver except L1
Initial test done on wb target.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou
17ace929f9 tests/drivers/clock_control: stm32_common: Move to stm32_common_core
Move stm32_common tests to stm32_common_core before adding new folder
for device source selection tests.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou
bc2a0b65a6 tests/drivers/clock_control: stm32u5: Fix pll_msis_80 test config
PLL input should be between 4 and 16MHz, so when MSI is set to 4MHz
fix PLLM can't be higher than 1.
Fix PLL1-NQR in consequence.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou
b821599abc tests/drivers/clock_control: stm32u5: Add a _devices test
Add a stm32u5_devices test which aims at testing devices
clock control configuration on stm32u5 targets

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou
c0238a7af3 tests/drivers/clock_control: stm32h7_device: Add test for CKPER source
Add 2 scenarios to test CKPER used as a clock source.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou
f61c4ae838 tests/drivers/clock_control: stm32h7_device: Use STM32_DT_CLOCKS_FOO
Make use of STM32_DT_CLOCKS_ macros to have the test work conditionally
based on alt clock presence.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Erwan Gouriou
78f40773b8 tests/drivers/clock_control: stm32h7: Add test for devices clock cfg
Add 2 clocks tests around device clock configuration on stm32h7.
For now, 'spi1_pllq_2_d1ppre_4' test variant is failed, which
illustrates issue reported in #41650.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-10 18:42:30 +02:00
Gerard Marull-Paretas
ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Erwan Gouriou
531c484958 tests/drivers/clock_control: stm32_common: Test HCLCK instead of SYSCLK
Rework test_*_freq to test HCLK freq instead of SYSCLK one, as it is not
correct to compare CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC with SYSCLK.

Additionally, add a test to verify use of AHB prescaler.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-04-21 14:09:44 +02:00
Erwan Gouriou
d8f5ef725f tests/drivers/clock_control: stm32u5: Rework to explicitly test HCLK
Instead of testing SysClockFreq setting, we should instead check HCLK
setting which is the real zephyr CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
counterpart (core clock freq) and takes AHB prescaler setting into
account.

Additionally, update one test configuration to explicitly verify AHB
prescaler is correctly taken into account by clock driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-04-21 14:09:44 +02:00
Erwan Gouriou
da370ea720 tests/drivers/clock_control: stm32l0/l1: MSI range 11 is not allowed
Remove L0 and L1 targets from "sysclksrc_msi_48" test case as this
MSI range 11 is not an allowed value on these series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-04-21 14:09:44 +02:00
Erwan Gouriou
fa85670f1b tests/drivers/clock_control: stm32f1: HSI clock is 8MHz
On STM32F series, HSI clock is 8MHz, fix test using 16MHz
and a test name.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-04-21 14:09:44 +02:00
Erwan Gouriou
ca842acdd7 tests/drivers/clock_control: stm32h7: Change clock_control champion
Change default board to fit board used on ST bench.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
058aa0d669 tests/drivers/clock_control: stm32: Remove prescalers from overlays
Test doesn't do any check on prescalers. Remove references and
existing user: wx_clear_clocks overlay.
Proceed to new factorization when possible.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
aeb4d29777 tests/drivers/clock_control: stm32: G4/G0 grouping
Factorize some G4/G0 cases.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
086fac7134 tests/drivers/clock_control: stm32: Revise TC order
Group TC by series, then clck srce

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
51494fb9bd tests/drivers/clock_control: stm32: Factorize wl/wb clear clocks overlay
Since they don't have impact on sysclock src configuration,
remove LSI/E clocks from clear clocks overlays.
This enables the possibility to factorize wl and wb clear clocks overlays
and brings some use cases factorizations as well.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
f9e0bc642e tests/drivers/clock_control: stm32: Revise TC naming
Revise test cases naming:
- Replace _<series>_ by a .<series>. field in test cases naming
- Rename clear_clocks_msi.overlay to clear_msi.overlay

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
101024e67c tests/drivers/clock_control: stm32: Fix board selection
Fix selection of boards used:
- Remove superfluous/redundant configs
- Adapt to boards available on ST test bench
- fix typos

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
8d6e8b6428 tests/drivers/clock_control: stm32: Fix fixture
To be functional, harness_config require a `harness: ztest` property,
add it.
Additionally, provide a comment to explain motivation behind this fixture.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
c3cffecd22 tests/drivers/clock_control: stm32u5: Rename to _core
Rename stm32u5 test to stm32u5_core before addition
of stm32u5_devices.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Erwan Gouriou
47d553d089 tests/drivers/clock_control: stm32h7: Move tests under stm32h7_core
Before introducing a new test for peripheral clocks,
rename existing stm32h7 test section by stm32h7_core.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-31 12:29:25 -05:00
Francois Ramu
8e0db1431e tests: drivers: stm32 clock control testing on stm32fx mcus
target is stm32fxx with clearing clock config
target is stm32fxx with pll from hsi clock config
target is stm32fxx with pll from hse clock config (with bypass)
target is stm32fxx with hse, hsi, clock config (no pll)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-23 09:25:47 -05:00
Francois Ramu
70d2b136ec tests: drivers: stm32 clock control testing on stm32l4 / l5 mcus
target is stm32l4x/l5x with clearing clock config
target is stm32l4x/l5x with pll 64MHz from hsi clock config
target is stm32l4x/l5x with pll 48MHz from msi clock config
target is stm32l4x/l5x with pll 64MHz from hse clock config (with bypass)
target is stm32l4x/l5x with hse, hsi, msi clock config (no pll)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-23 09:25:47 -05:00
Francois Ramu
68add9e7e1 tests: drivers: stm32 hse clock control testing on stm32g071 nucleo
Testing the HSE on the nucleo_stm32g071rb requires a hw fixture
on the hw board : MCO signal must given by the STLink to the mcu.
Put a hardware fixture to activate the hse clock with by-passed
only if the SB17 is closed on the HW.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-23 09:25:47 -05:00
Francois Ramu
676ddd72a9 tests: drivers: stm32 clock control testing on stm32wb55
target is stm32wb55 with clearing clock config
target is stm32wb55 with pll 48MHz from hsi clock config
target is stm32wb55 with pll 48MHz from msi clock config
target is stm32wb55 with pll 64Hz from hse clock config
target is stm32wb55 with hse, msi, hsi clock config (no pll)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-23 09:25:47 -05:00
Francois Ramu
30a65dc6d1 tests: drivers: stm32 clock control testing on stm32wl55
target is stm32wl55 with clearing clock config
target is stm32wl55 with pll 48MHz from hsi clock config
target is stm32wl55 with pll 48MHz from hse clock config
target is stm32wl55 with hse clock config (no pll)
target is stm32wl55 with msi clock config (no pll)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-23 09:25:47 -05:00
Francois Ramu
47933bf808 tests: drivers: stm32 clock control for stm32l0 and stm32l1
Fix build error for stm32 devices which have no function
to get the PLL ON bit from the RCC_CR register
Use the register access instead.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-23 09:25:47 -05:00
Francois Ramu
02c3e9ac6f tests: drivers: stm32 clock control testing on stm32l1 and stm32l0
target is stm32l1/l0 with pll 32MHz from hsi clock config
target is stm32l1/l0 with pll 32MHz from hse clock config
target is stm32l1/l0 with hse clock config (no pll)
target is stm32l1/l0 with hsi clock config (no pll)
target is stm32l1/l0 with msi clock config (no pll)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-23 09:25:47 -05:00
Francois Ramu
032fb610a4 tests: drivers: stm32 clock control testing on stm32g4
target is stm32g4 with pll 64MHz from hsi clock config
target is stm32g4 with pll 64MHz from hse clock config
target is stm32g4 with hsi clock config (no pll)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-23 09:25:47 -05:00
Francois Ramu
f3a1d03b5c tests: drivers: stm32 clock control testing on stm32g0
target is stm32g0 with pll 64MHz from hsi clock config
target is stm32g0 with pll 64MHz from hse clock config
target is stm32g0 with hsi clock config (no pll)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-23 09:25:47 -05:00
Francois Ramu
cb2c255332 tests: drivers: clock_control for stm32h7 config
fix comment when configuring the PLL with CSI clock source

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-23 09:25:47 -05:00
Nazar Kazakov
f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Gerard Marull-Paretas
9a02676d9e tests: drivers: clock_control: nrf_onoff_and_bt: use DEVICE_DT_GET
Use DEVICE_DT_GET to obtain a reference to the chosen entropy device.
The device is now global, and readiness is checked at the test setup
fixture.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-11 15:27:05 -08:00
Krzysztof Chruscinski
5cf70e4860 tests: drivers: clock_control: nrf_calibration: Skip test for nrf52832
On nrf52832 disabling low frequency clock results in RTC COUNTER
reset. It is unexpected and system clock can be disrupted and
test may hang. Disable test which restarts LF clock for nrf52832.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-01 14:16:18 -06:00
Krzysztof Chruscinski
18c0c7a2e5 tests: drivers: clock_control: api: nrf: Disable tests for nrf52832
On nrf52832 LF clock cannot be stopped during runtime because
it resets RTC COUNTER. Testsuite run on nrf clock control driver
assumes that it will not happen. Disabling testing of LF clock
for nrf52832.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-01 14:16:18 -06:00
Erwan Gouriou
b5b32b9b3e tests/drivers/clock_control: stm32: Add test suite for H7 series
Add clock_control test suite for H7 boards

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-07 18:19:16 +01:00
Erwan Gouriou
fc23da19af tests/drivers/clock_control: stm32u5: Factorize tests in yaml file
To ease maintenance, add a common section.
It appears that using DTC_OVERLAY_FILE in the common section
preserves the required overlay order.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-07 18:19:16 +01:00
Erwan Gouriou
73c1233461 tests/drivers/clock_control: stm32u5: Add a pll_msis_160 overlay
Instead of relying on default board configuration,
add a specific test for this config.

Additionally rename existing pll_msi_80 to pll_msis_160.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-07 18:19:16 +01:00
Erwan Gouriou
228a96e41e tests/drivers/clock_control: stm32u5: Use a clear_clocks overlay
Instead of relying on existing board clock configuration,
use a clear_clocks.overlay file to first reset the clock
configuration to the default .dtsi state, then apply a
new configuration.
This method should be more robust when trying to use on more
boards and has the benefit to provide correct configuration
examples.

This relies on the fact that overlays are applied in the order
they are provided in DTC_OVERLAY_FILE CMake variable.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-07 18:19:16 +01:00
Erwan Gouriou
c6fd75af54 tests/drivers/clock_control: stm32: Move u5 tests in dedicated folder
Before adding more tests, organize things a little.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-07 18:19:16 +01:00
Erwan Gouriou
f7f67ded53 tests/drivers/clock_control: stm32u5: Add tests on clock configs
Add a test suite to check various clocks configurations.
Test is based on HAL functions that read clock configuration
from registers.
One test is build only, as there is no available hw to test it today.
Others can be tested on target.

More configurations and test points could be added in future.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-12-09 19:45:41 -05:00
Henrik Brix Andersen
265cdf8dc6 cmake: use find_package() instead of literal include in tests and samples
Convert remaining tests and samples to using find_package() instead of
literally including the CMake boilerplate code.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-11-01 10:33:09 -04:00
Torsten Rasmussen
1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Gerard Marull-Paretas
9a2fcb7a97 tests: drivers: remove usage of device_pm_control_nop
device_pm_control_nop is now deprecated in favour of NULL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 12:53:09 -04:00