qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PING PATCH v5 0/3] Check clock connection between STM32L4x5 RCC and peripherals
@ 2024-10-03  8:10 Inès Varhol
  2024-10-03  8:10 ` [PING PATCH v5 1/3] hw/misc: Create STM32L4x5 SYSCFG clock Inès Varhol
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Inès Varhol @ 2024-10-03  8:10 UTC (permalink / raw)
  To: qemu-devel
  Cc: Arnaud Minier, Paolo Bonzini, Luc Michel, qemu-arm, Thomas Huth,
	Samuel Tardieu, Philippe Mathieu-Daudé, Alistair Francis,
	Peter Maydell, Marc-André Lureau, Damien Hedde,
	Inès Varhol, Laurent Vivier

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 v4 to v5: none
(just added new reviewers in commit messages)

Changes from v3 to v4:
- removed 2nd commit (it was bumping up version id in
`vmstate_stm32l4x5_usart_base`, which is useless when not adding
any fields), it was a misunderstanding
- in `clock.c`, `vmstate_stm32l4x5_usart_base`, renamed `freq_hz` to
`period`
- in `clocks.rst`, specified that `qtest-clock-period` is only usable
from the QTests and not QEMU
- in `qtest/stm32l4x5.h`, used macros from "clock.h" to compute
the expected clock period in the right unit
- in `qtest/stm32l4x5.h`, removed "osdep.h" include

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>
Reviewed-by: Luc Michel <luc@lmichel.fr>

Inès Varhol (3):
  hw/misc: Create STM32L4x5 SYSCFG clock
  hw/clock: Expose 'qtest-clock-period' QOM property for QTests
  tests/qtest: Check STM32L4x5 clock connections

 docs/devel/clocks.rst               |  6 +++++
 include/hw/misc/stm32l4x5_syscfg.h  |  1 +
 tests/qtest/stm32l4x5.h             | 42 +++++++++++++++++++++++++++++
 hw/arm/stm32l4x5_soc.c              |  2 ++
 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 ++++++++++++++++++
 9 files changed, 151 insertions(+), 4 deletions(-)
 create mode 100644 tests/qtest/stm32l4x5.h

-- 
2.45.2



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-10-15 14:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-03  8:10 [PING PATCH v5 0/3] Check clock connection between STM32L4x5 RCC and peripherals Inès Varhol
2024-10-03  8:10 ` [PING PATCH v5 1/3] hw/misc: Create STM32L4x5 SYSCFG clock Inès Varhol
2024-10-03  8:10 ` [PING PATCH v5 2/3] hw/clock: Expose 'qtest-clock-period' QOM property for QTests Inès Varhol
2024-10-03  8:10 ` [PING PATCH v5 3/3] tests/qtest: Check STM32L4x5 clock connections Inès Varhol
2024-10-15 14:20   ` Peter Maydell
2024-10-15 14:34     ` Inès Varhol
2024-10-04 18:23 ` [PING PATCH v5 0/3] Check clock connection between STM32L4x5 RCC and peripherals Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).