mbox series

[v3,0/5] hw/char: Implement the STM32L4x5 USART, UART and LPUART

Message ID 20240329174402.60382-1-arnaud.minier@telecom-paris.fr (mailing list archive)
Headers show
Series hw/char: Implement the STM32L4x5 USART, UART and LPUART | expand

Message

Arnaud Minier March 29, 2024, 5:43 p.m. UTC
This patch adds the STM32L4x5 USART
(Universal Synchronous/Asynchronous Receiver/Transmitter)
device and is part of a series implementing the
STM32L4x5 with a few peripherals.

It implements the necessary functionalities to receive/send
characters over the serial port, which are useful to
communicate with the program currently running.

Thank you Peter and Thomas for your reviews !

Changes from v1 to v2:
- Use asynchronous transmission for serial communication
  (based on cmsdk-apb-uart implementation)
- Use qemu_log_mask instead of error_report
- Squash the commit that renamed the base struct
- Use switch statements where appropriate
- Fix RDR and TDR mask size
- Increase time limit in tests
- Remove the global qtest in the tests
- Use assert when checking the interrupt number in the tests
- Correct usage of g_autofree in the SoC

Changes from v2 to v3:
- Fix typos and comment formatting
- Declare variables at the start of code blocks in the SoC
- Use %u instead of %x in an error log
- Add ".abstract = true" to the base usart class
- Change tests to use meson harness timeout
- Drop merged RCC commit

Arnaud Minier (5):
  hw/char: Implement STM32L4x5 USART skeleton
  hw/char/stm32l4x5_usart: Enable serial read and write
  hw/char/stm32l4x5_usart: Add options for serial parameters setting
  hw/arm: Add the USART to the stm32l4x5 SoC
  tests/qtest: Add tests for the STM32L4x5 USART

 MAINTAINERS                        |   1 +
 docs/system/arm/b-l475e-iot01a.rst |   2 +-
 hw/arm/Kconfig                     |   1 +
 hw/arm/stm32l4x5_soc.c             |  82 +++-
 hw/char/Kconfig                    |   3 +
 hw/char/meson.build                |   1 +
 hw/char/stm32l4x5_usart.c          | 634 +++++++++++++++++++++++++++++
 hw/char/trace-events               |  12 +
 include/hw/arm/stm32l4x5_soc.h     |   7 +
 include/hw/char/stm32l4x5_usart.h  |  67 +++
 tests/qtest/meson.build            |   4 +-
 tests/qtest/stm32l4x5_usart-test.c | 325 +++++++++++++++
 12 files changed, 1131 insertions(+), 8 deletions(-)
 create mode 100644 hw/char/stm32l4x5_usart.c
 create mode 100644 include/hw/char/stm32l4x5_usart.h
 create mode 100644 tests/qtest/stm32l4x5_usart-test.c

Comments

Peter Maydell April 5, 2024, 2:27 p.m. UTC | #1
On Fri, 29 Mar 2024 at 17:44, Arnaud Minier
<arnaud.minier@telecom-paris.fr> wrote:
>
> This patch adds the STM32L4x5 USART
> (Universal Synchronous/Asynchronous Receiver/Transmitter)
> device and is part of a series implementing the
> STM32L4x5 with a few peripherals.
>
> It implements the necessary functionalities to receive/send
> characters over the serial port, which are useful to
> communicate with the program currently running.

All the patches here are reviewed, so once we reopen
for the 9.1 release (in another two or three weeks) it
should be ready to go in. I'll keep it on my list to apply
once I start collecting 9.1 patchsets.

thanks
-- PMM
Peter Maydell April 19, 2024, 2:42 p.m. UTC | #2
On Fri, 5 Apr 2024 at 15:27, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Fri, 29 Mar 2024 at 17:44, Arnaud Minier
> <arnaud.minier@telecom-paris.fr> wrote:
> >
> > This patch adds the STM32L4x5 USART
> > (Universal Synchronous/Asynchronous Receiver/Transmitter)
> > device and is part of a series implementing the
> > STM32L4x5 with a few peripherals.
> >
> > It implements the necessary functionalities to receive/send
> > characters over the serial port, which are useful to
> > communicate with the program currently running.
>
> All the patches here are reviewed, so once we reopen
> for the 9.1 release (in another two or three weeks) it
> should be ready to go in. I'll keep it on my list to apply
> once I start collecting 9.1 patchsets.

I've now applied this to target-arm.next for 9.1; thanks.

-- PMM