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

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,
have a QOM property to access the clock frequency,
and adds QTests checking that clock enable in RCC has the
expected results.

Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>

Inès Varhol (4):
  hw/misc: Create STM32L4x5 SYSCFG clock
  hw/gpio: Handle clock migration in STM32L4x5 gpios
  hw/char: Add QOM property for STM32L4x5 USART clock frequency
  tests/qtest: Check STM32L4x5 clock connections

 include/hw/misc/stm32l4x5_syscfg.h  |  1 +
 hw/arm/stm32l4x5_soc.c              |  2 ++
 hw/char/stm32l4x5_usart.c           | 12 ++++++++
 hw/gpio/stm32l4x5_gpio.c            |  2 ++
 hw/misc/stm32l4x5_syscfg.c          | 26 ++++++++++++++++
 tests/qtest/stm32l4x5_gpio-test.c   | 39 +++++++++++++++++++++++
 tests/qtest/stm32l4x5_syscfg-test.c | 38 +++++++++++++++++++++--
 tests/qtest/stm32l4x5_usart-test.c  | 48 +++++++++++++++++++++++++++++
 8 files changed, 166 insertions(+), 2 deletions(-)

-- 
2.43.2



^ permalink raw reply	[flat|nested] 15+ messages in thread
* [PATCH 0/4] Check clock connection between STM32L4x5 RCC and peripherals
@ 2024-05-07 18:55 Inès Varhol
  2024-05-07 18:55 ` [PATCH 4/4] tests/qtest: Check STM32L4x5 clock connections Inès Varhol
  0 siblings, 1 reply; 15+ messages in thread
From: Inès Varhol @ 2024-05-07 18:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Thomas Huth, Philippe Mathieu-Daudé,
	Marc-André Lureau, qemu-arm, Alistair Francis,
	Inès Varhol, Peter Maydell, Arnaud Minier, Paolo Bonzini

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,
have a QOM property to access the clock frequency,
and adds QTests checking that clock enable in RCC has the
expected results.

Philippe Mathieu-Daudé suggested the following :
".. We could add the clock properties
directly in qdev_init_clock_in(). Seems useful for the QTest
framework."

However Peter Maydell pointed out the following :
"...Mostly "frequency" properties on devices are for the case
where they *don't* have a Clock input and instead have
ad-hoc legacy handling where the board/SoC that creates the
device sets an integer property to define the input frequency
because it doesn't model the clock tree with Clock objects."

You both agree on the fact that replicating the code in the
different devices is a bad idea, what should be the
alternative?

Thank you for the reviews.

Changes from 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/gpio: Handle clock migration in STM32L4x5 gpios
  hw/char: Add QOM property for STM32L4x5 USART clock frequency
  tests/qtest: Check STM32L4x5 clock connections

 include/hw/misc/stm32l4x5_syscfg.h  |  1 +
 tests/qtest/stm32l4x5.h             | 40 +++++++++++++++++++++++++++++
 hw/arm/stm32l4x5_soc.c              |  2 ++
 hw/char/stm32l4x5_usart.c           | 16 ++++++++++--
 hw/gpio/stm32l4x5_gpio.c            |  6 +++--
 hw/misc/stm32l4x5_syscfg.c          | 30 ++++++++++++++++++++--
 tests/qtest/stm32l4x5_gpio-test.c   | 23 +++++++++++++++++
 tests/qtest/stm32l4x5_syscfg-test.c | 19 ++++++++++++--
 tests/qtest/stm32l4x5_usart-test.c  | 26 +++++++++++++++++++
 9 files changed, 155 insertions(+), 8 deletions(-)
 create mode 100644 tests/qtest/stm32l4x5.h

-- 
2.43.2



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

end of thread, other threads:[~2024-05-08 14:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-05 14:05 [PATCH 0/4] Check clock connection between STM32L4x5 RCC and peripherals Inès Varhol
2024-05-05 14:05 ` [PATCH 1/4] hw/misc: Create STM32L4x5 SYSCFG clock Inès Varhol
2024-05-07  9:50   ` Peter Maydell
2024-05-07 17:30     ` Inès Varhol
2024-05-05 14:05 ` [PATCH 2/4] hw/gpio: Handle clock migration in STM32L4x5 gpios Inès Varhol
2024-05-06  9:38   ` Philippe Mathieu-Daudé
2024-05-05 14:05 ` [PATCH 3/4] hw/char: Add QOM property for STM32L4x5 USART clock frequency Inès Varhol
2024-05-06  9:34   ` Philippe Mathieu-Daudé
2024-05-06  9:43     ` Philippe Mathieu-Daudé
2024-05-07  9:54     ` Peter Maydell
2024-05-08 14:08       ` Philippe Mathieu-Daudé
2024-05-05 14:05 ` [PATCH 4/4] tests/qtest: Check STM32L4x5 clock connections Inès Varhol
2024-05-06  4:16   ` Thomas Huth
2024-05-06 17:57     ` Inès Varhol
  -- strict thread matches above, loose matches on Subject: below --
2024-05-07 18:55 [PATCH 0/4] Check clock connection between STM32L4x5 RCC and peripherals Inès Varhol
2024-05-07 18:55 ` [PATCH 4/4] tests/qtest: Check STM32L4x5 clock connections Inès Varhol

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).