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 -- 2.34.1