On Mon, 21 Jul 2025 at 21:11, <fanyi...@rt-thread.org> wrote: > > From: Yihao Fan <fanyi...@rt-thread.org> > > This patch adds support for the STM32F407 USART controllers device model. > > Signed-off-by: Yihao Fan <fanyi...@rt-thread.org> > --- > MAINTAINERS | 2 + > hw/arm/Kconfig | 1 + > hw/arm/stm32f407_soc.c | 25 +++ > hw/char/Kconfig | 3 + > hw/char/meson.build | 1 + > hw/char/stm32f4xx_usart.c | 236 ++++++++++++++++++++++++++++++ > include/hw/arm/stm32f407_soc.h | 8 + > include/hw/char/stm32f4xx_usart.h | 60 ++++++++
We generally prefer two separate patches for this: (1) implementation of the new device (2) add the new device to the SoC > --- /dev/null > +++ b/hw/char/stm32f4xx_usart.c > @@ -0,0 +1,236 @@ > +/* SPDX-License-Identifier: GPL-2.0-or-later */ > +#include "qemu/osdep.h" > +#include "hw/char/stm32f4xx_usart.h" > +#include "qemu/log.h" > +#include "hw/irq.h" > +#include "hw/qdev-properties.h" > +#include "hw/qdev-properties-system.h" > +#include "qemu/module.h" This looks very similar to the existing stm32f2xx USART. How different are these two devices? Could we share code by having them be two child classes which adjust what features the device exposes? thanks - PMM