From: Arnaud Minier <arnaud.minier@telecom-paris.fr>
To: qemu-devel@nongnu.org
Cc: "Laurent Vivier" <lvivier@redhat.com>,
"Alistair Francis" <alistair@alistair23.me>,
"Inès Varhol" <ines.varhol@telecom-paris.fr>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
qemu-arm@nongnu.org,
"Arnaud Minier" <arnaud.minier@telecom-paris.fr>
Subject: [PATCH v4 0/8] Add device STM32L4x5 RCC
Date: Tue, 30 Jan 2024 17:06:48 +0100 [thread overview]
Message-ID: <20240130160656.113112-1-arnaud.minier@telecom-paris.fr> (raw)
This patch adds the STM32L4x5 RCC (Reset and Clock Control) device and is part
of a series implementing the STM32L4x5 with a few peripherals.
Due to the high number of lines, I tried to split the patch into several independent commits.
Each commit compiles on its own but I had to add temporary workarounds in intermediary commits to allow them to compile even if some functions are not used. However, they have been removed once the functions were used. Tell me if this is ok or if I should remove them.
Also, the tests are not very exhaustive for the moment. I have not found a way to test the clocks' frequency from the qtests, which limits severely the exhaustiveness of the tests.
Thanks to Philippe Mathieu-Daudé and Luc Michel for guiding me toward the hw/misc/bcm2835_cprman.c implementation and answering my questions about clock emulation in qemu !
Changes from v1 to v2:
- Removed a mention in the tests
- Added an early return to prevent a clang compilation error in rcc_update_pllsaixcfgr()
Changes from v2 to v3:
- Changed the timeout method used in the tests
- Added a real value for ICSR register
- Replaced some TODOs with correct error handling
- Added a commit that implements correct write protections for the CR register
Changes from v3 to v4:
- Rebased on top of current master
- Implemented reset functions for the multiplexers and the PLLs
- Added explanatory messages to every commit
- Addded logs for unimplemented registers
- Completed the VMState for the multiplexers and the PLLs
Arnaud Minier (8):
Implement STM32L4x5_RCC skeleton
Add an internal clock multiplexer object
Add an internal PLL Clock object
Add initialization information for PLLs and clock multiplexers
RCC: Handle Register Updates
Add write protections to CR register
STM32L4x5: Use the RCC Sysclk
Add tests for the STM32L4x5_RCC
MAINTAINERS | 5 +-
docs/system/arm/b-l475e-iot01a.rst | 2 +-
hw/arm/Kconfig | 1 +
hw/arm/b-l475e-iot01a.c | 10 +-
hw/arm/stm32l4x5_soc.c | 45 +-
hw/misc/Kconfig | 3 +
hw/misc/meson.build | 1 +
hw/misc/stm32l4x5_rcc.c | 1415 +++++++++++++++++++++
hw/misc/trace-events | 14 +
include/hw/arm/stm32l4x5_soc.h | 5 +-
include/hw/misc/stm32l4x5_rcc.h | 239 ++++
include/hw/misc/stm32l4x5_rcc_internals.h | 1042 +++++++++++++++
tests/qtest/meson.build | 3 +-
tests/qtest/stm32l4x5_rcc-test.c | 207 +++
14 files changed, 2947 insertions(+), 45 deletions(-)
create mode 100644 hw/misc/stm32l4x5_rcc.c
create mode 100644 include/hw/misc/stm32l4x5_rcc.h
create mode 100644 include/hw/misc/stm32l4x5_rcc_internals.h
create mode 100644 tests/qtest/stm32l4x5_rcc-test.c
--
2.34.1
next reply other threads:[~2024-01-30 16:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 16:06 Arnaud Minier [this message]
2024-01-30 16:06 ` [PATCH v4 1/8] Implement STM32L4x5_RCC skeleton Arnaud Minier
2024-02-01 0:09 ` Alistair Francis
2024-01-30 16:06 ` [PATCH v4 2/8] Add an internal clock multiplexer object Arnaud Minier
2024-01-30 16:06 ` [PATCH v4 3/8] Add an internal PLL Clock object Arnaud Minier
2024-02-01 0:18 ` Alistair Francis
2024-02-12 19:33 ` Arnaud Minier
2024-01-30 16:06 ` [PATCH v4 4/8] Add initialization information for PLLs and clock multiplexers Arnaud Minier
2024-01-30 16:06 ` [PATCH v4 5/8] RCC: Handle Register Updates Arnaud Minier
2024-01-30 16:06 ` [PATCH v4 6/8] Add write protections to CR register Arnaud Minier
2024-01-30 16:06 ` [PATCH v4 7/8] STM32L4x5: Use the RCC Sysclk Arnaud Minier
2024-02-01 0:20 ` Alistair Francis
2024-01-30 16:13 ` [PATCH v4 8/8] Add tests for the STM32L4x5_RCC Arnaud Minier
2024-01-31 6:04 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240130160656.113112-1-arnaud.minier@telecom-paris.fr \
--to=arnaud.minier@telecom-paris.fr \
--cc=alistair@alistair23.me \
--cc=ines.varhol@telecom-paris.fr \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).