[PATCH v3 0/4] Check clock connection between STM32L4x5 RCC and peripherals

Inès Varhol posted 4 patches 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240523194441.21036-1-ines.varhol@telecom-paris.fr
Maintainers: Luc Michel <luc@lmichel.fr>, Damien Hedde <damien.hedde@dahe.fr>, Arnaud Minier <arnaud.minier@telecom-paris.fr>, "Inès Varhol" <ines.varhol@telecom-paris.fr>, Peter Maydell <peter.maydell@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Alistair Francis <alistair@alistair23.me>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
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
[PATCH v3 0/4] Check clock connection between STM32L4x5 RCC and peripherals
Posted by Inès Varhol 6 months ago
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.varhol@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