Among implemented STM32L4x5 devices, USART, GPIO and SYSCFG have a clock source, but none has a corresponding test in QEMU.
This patch makes sure that all 3 devices create a clock correctly, adds a QOM property to access clocks' periods from QTests, and adds QTests checking that clock enable in RCC has the expected results for all 3 devices. Thank you for the reviews. Changes from "v1" to v3: - adding a commit to expose `qtest-clock-period`, a QOM property for all clocks, only accessible from QTests, and mention it in clock.rst - adapt QTests so that they use clock period instead of clock frequency - remove `clock-freq-hz` QOM property in STM32L4x5 USART and SYSCFG - dropping the commit migrating GPIO clocks as it's already upstream Changes from v1 to an unfortunate second "v1": - upgrading `VMStateDescription` to version 2 to account for `VMSTATE_CLOCK()` - QTests : consolidating `get_clock_freq_hz()` in a header and making appropriate changes in stm32l4x5q_*-test.c Signed-off-by: Inès Varhol <ines.var...@telecom-paris.fr> Inès Varhol (4): hw/misc: Create STM32L4x5 SYSCFG clock hw/char: Use v2 VMStateDescription for STM32L4x5 USART hw/clock: Expose 'qtest-clock-period' QOM property for QTests tests/qtest: Check STM32L4x5 clock connections docs/devel/clocks.rst | 3 ++ include/hw/misc/stm32l4x5_syscfg.h | 1 + tests/qtest/stm32l4x5.h | 43 +++++++++++++++++++++++++++++ hw/arm/stm32l4x5_soc.c | 2 ++ hw/char/stm32l4x5_usart.c | 4 +-- hw/core/clock.c | 16 +++++++++++ hw/misc/stm32l4x5_syscfg.c | 19 +++++++++++-- tests/qtest/stm32l4x5_gpio-test.c | 23 +++++++++++++++ tests/qtest/stm32l4x5_syscfg-test.c | 20 ++++++++++++-- tests/qtest/stm32l4x5_usart-test.c | 26 +++++++++++++++++ 10 files changed, 151 insertions(+), 6 deletions(-) create mode 100644 tests/qtest/stm32l4x5.h -- 2.43.2