Commit Graph

101 Commits

Author SHA1 Message Date
Francois Ramu
8401644416 tests: drivers: clock_control rename stm32 ahb test configuration
rename to pll_msis_ahb_2_40

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-08-10 14:32:14 +02:00
Erwan Gouriou
1ef9e9eb9b include: drivers: stm32 clock_control: Replace OPT by DOMAIN
In the continuation of the previous commit, replace _OPT_ by _DOMAIN_
in macros relating to this feature.
hen, adapt drivers and tests to this new wording.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-08-08 14:17:07 +02:00
Fabio Baltieri
def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Erwan Gouriou
97d75a6f59 tests: clock_control: stm32u5: Add tests to check HSE and HSI as sysclk src
This allows to complete test coverage on this driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-07-30 08:23:35 -05:00
Erwan Gouriou
5fe7b47e52 tests: clock_control: stm32u5 device: Fix clk_msik configuration
In tests/drivers/clock_control/stm32_clock_configuration/stm32u5_devices
test suite, core_init.overlay configure msis to use pll-mode.
Since pll-mode is not configured for msik in spi1_msik variant the test
fails since both clocks should support the same configuration regarding
pll mode (an assert in raised in the driver).

Fix this in spi1_msik test variant.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-07-30 08:23:35 -05:00
Kumar Gala
2014c59d20 clock_control: remove defconfig/proj setting of clock control drivers
Now that clock control drivers are enabled based on devicetree we
can remove any cases of them getting enabled by *defconfig and
proj.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-29 14:12:12 +02:00
Ederson de Souza
49d1583e2a soc/xtensa/intel_adsp: Enable WOVCRO based on platform support
Instead of enabling WOVCRO clock based on the SOC, use a configuration
to indicate support, so that each platform can specify if WOVCRO is
supported or not.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-07-28 11:04:05 -04:00
Anas Nashif
43371d0414 intel_adsp: move cavs to be a series
Intel ADSP CAVS is now a proper series with all CAVS SoCs running under
it. This will give us to Intel ADSP series:
- CAVS
- ACE v1.x

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-25 16:50:24 -04:00
Tomislav Milkovic
0fe2c1fe90 everywhere: Fix legacy include paths
Any project with Kconfig option CONFIG_LEGACY_INCLUDE_PATH set to n
couldn't be built because some files were missing zephyr/ prefix in
includes
Re-run the migrate_includes.py script to fix all legacy include paths

Signed-off-by: Tomislav Milkovic <milkovic@byte-lab.com>
2022-07-18 16:16:47 +00:00
Johann Fischer
d66e047e5b tests: use unsigned int for irq_lock()
irq_lock() returns an unsigned integer key.
Generated by spatch using semantic patch
scripts/coccinelle/irq_lock.cocci

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-07-14 14:37:13 -05:00
Kumar Gala
284611f3f1 tests: clock_control_api: Rework test to use struct device
Move to pass 'struct device *' instead of a 'char *'.  This lets us move
from device_get_binding to DEVICE_DT_GET.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-11 10:21:26 +02:00
Kumar Gala
9985f2d281 tests: drivers: nrf_clock_calibration: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:04:38 +02:00
Kumar Gala
ef26ab7e85 tests: clock_control: on_off: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:03:49 +02:00
Kumar Gala
e42cffb058 tests: clock_control: nrf_onoff_and_bt: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:03:36 +02:00
Thomas Stranger
33eba217de tests/drivers/clock_control: stm32_common_devices: add adc alt. clk. src
This commit adds a test case that configures an alternative clock source
for an ADC peripheral.

In case no alt clock is available, only the gating clock is enabled
and disabled.
Unlike the i2c and lptim test, the actual gating clock frequency is
not checked, because for the adc there seems to be no uniform way
to retrieve the frequency via the hal.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-07-04 16:41:24 +02:00
Thomas Stranger
a6f4d604b6 tests/drivers/clock_control: stm32 add adc-pll_p overlays(g0,g4,wl)
For the STM32G0, STM32G4, and STM32WL enable the adc node in one
configuration, and select the PLL_P output as its clock source.
PLL_P divider is chosen to be 20 to make sure it's a unique frequency.
- g0, and g4 have pll as sysclk
- wl has hse as sysclock

The test configurations and the overlay-files are renamed accordingly.
All overlays that don't specify an alternative clock source still
make sure that the adc node is "okay" to be able to perform basic test.
The basic test only turns on and off the gate clock without checking the
frequency.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-07-04 16:41:24 +02:00
Thomas Stranger
1feaea34aa tests/drivers/clock_control: stm32_common_devices: lptim check disabled
The test checks if the peripheral gating clock was correctly disabled
after the test, but accidentally the I2C_CLK was checked instead of the
LPTIM_CLK.

This commit fixes this by using __HAL_RCC_LPTIM1_IS_CLK_ENABLED instead.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-07-04 16:41:24 +02:00
Thomas Stranger
fd49f4df1b tests: drivers: clock_control: stm32_wl fix external clock dts
The nucleo_wl55jc according to the datasheet does have a
NT2016SF-32M-END5875A 32MHz TCXO as HSE, therefore needs
enable the "hse-tcxo;" property to work, this was not the case
for the clock_configuration/stm32_common_devices test cases.

Additionally, remove the comment about about ST-Link clock,
because the source is the tcxo and not the ST-Link.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-07-04 16:41:24 +02:00
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