[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 3/3] hw/char: Extract serial-mm
From: |
Bernhard Beschow |
Subject: |
Re: [PATCH v2 3/3] hw/char: Extract serial-mm |
Date: |
Sat, 07 Sep 2024 17:33:47 +0000 |
Am 5. September 2024 12:26:35 UTC schrieb BALATON Zoltan <balaton@eik.bme.hu>:
>On Thu, 5 Sep 2024, Bernhard Beschow wrote:
>> hw/char/serial currently contains the implementation of both TYPE_SERIAL and
>> TYPE_SERIAL_MM. According to serial_class_init(), TYPE_SERIAL is an internal
>> class while TYPE_SERIAL_MM is used by numerous machine types directly. Let's
>> move the latter into its own module which makes the dependencies more obvious
>> and the code more tidy.
>>
>> The includes and the dependencies have been converted mechanically except in
>> the
>> hw/char directories which were updated manually. The result was
>> compile-tested.
>> Now, only hw/char makes direct use of TYPE_SERIAL:
>>
>> # grep -r -e "select SERIAL" | grep -v SERIAL_
>> hw/char/Kconfig: select SERIAL
>> hw/char/Kconfig: select SERIAL
>> hw/char/Kconfig: select SERIAL
>> hw/char/Kconfig: select SERIAL
>> hw/char/Kconfig: select SERIAL
>>
>> # grep -r -e "/serial\\.h"
>> include/hw/char/serial-mm.h:#include "hw/char/serial.h"
>> hw/char/serial-pci-multi.c:#include "hw/char/serial.h"
>> hw/char/serial.c:#include "hw/char/serial.h"
>> hw/char/serial-isa.c:#include "hw/char/serial.h"
>> hw/char/serial-pci.c:#include "hw/char/serial.h"
>>
>> Tested-by: Andrew Jeffery <andrew@codeconstruct.com.au>
>> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>> ---
>> include/hw/arm/aspeed_soc.h | 2 +-
>> include/hw/char/mchp_pfsoc_mmuart.h | 2 +-
>> include/hw/char/serial-mm.h | 52 +++++++++
>> include/hw/char/serial.h | 19 ----
>> hw/arm/allwinner-a10.c | 2 +-
>> hw/arm/allwinner-h3.c | 2 +-
>> hw/arm/allwinner-r40.c | 2 +-
>> hw/arm/aspeed_ast2400.c | 2 +-
>> hw/arm/aspeed_soc_common.c | 2 +-
>> hw/arm/kzm.c | 2 +-
>> hw/arm/msf2-soc.c | 2 +-
>> hw/arm/musicpal.c | 2 +-
>> hw/arm/npcm7xx.c | 2 +-
>> hw/arm/pxa2xx.c | 2 +-
>> hw/char/omap_uart.c | 2 +-
>> hw/char/serial-mm.c | 157 ++++++++++++++++++++++++++++
>> hw/char/serial.c | 126 ----------------------
>> hw/display/sm501.c | 2 +-
>> hw/hppa/machine.c | 2 +-
>> hw/loongarch/virt.c | 2 +-
>> hw/microblaze/petalogix_ml605_mmu.c | 2 +-
>> hw/mips/boston.c | 2 +-
>> hw/mips/jazz.c | 2 +-
>> hw/mips/loongson3_virt.c | 2 +-
>> hw/mips/malta.c | 2 +-
>> hw/mips/mipssim.c | 2 +-
>> hw/openrisc/openrisc_sim.c | 2 +-
>> hw/openrisc/virt.c | 2 +-
>> hw/ppc/e500.c | 2 +-
>> hw/ppc/ppc405_uc.c | 2 +-
>> hw/ppc/ppc440_bamboo.c | 2 +-
>> hw/ppc/sam460ex.c | 2 +-
>> hw/ppc/virtex_ml507.c | 2 +-
>> hw/riscv/virt.c | 2 +-
>> hw/sparc64/niagara.c | 2 +-
>> hw/sparc64/sun4u.c | 2 +-
>> hw/xtensa/xtfpga.c | 2 +-
>> hw/arm/Kconfig | 20 ++--
>> hw/char/Kconfig | 4 +
>> hw/char/meson.build | 1 +
>> hw/display/Kconfig | 2 +-
>> hw/hppa/Kconfig | 2 +-
>> hw/loongarch/Kconfig | 2 +-
>> hw/microblaze/Kconfig | 2 +-
>> hw/mips/Kconfig | 10 +-
>> hw/openrisc/Kconfig | 4 +-
>> hw/ppc/Kconfig | 10 +-
>> hw/riscv/Kconfig | 2 +-
>> hw/sparc64/Kconfig | 1 +
>> hw/xtensa/Kconfig | 2 +-
>> 50 files changed, 276 insertions(+), 206 deletions(-)
>> create mode 100644 include/hw/char/serial-mm.h
>> create mode 100644 hw/char/serial-mm.c
>>
>> diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
>> index 624d489e0d..689f52dae8 100644
>> --- a/include/hw/arm/aspeed_soc.h
>> +++ b/include/hw/arm/aspeed_soc.h
>> @@ -39,7 +39,7 @@
>> #include "hw/misc/unimp.h"
>> #include "hw/misc/aspeed_peci.h"
>> #include "hw/fsi/aspeed_apb2opb.h"
>> -#include "hw/char/serial.h"
>> +#include "hw/char/serial-mm.h"
>> #include "hw/intc/arm_gicv3.h"
>>
>> #define ASPEED_SPIS_NUM 2
>> diff --git a/include/hw/char/mchp_pfsoc_mmuart.h
>> b/include/hw/char/mchp_pfsoc_mmuart.h
>> index b0e14ca355..a7b8b1b08b 100644
>> --- a/include/hw/char/mchp_pfsoc_mmuart.h
>> +++ b/include/hw/char/mchp_pfsoc_mmuart.h
>> @@ -29,7 +29,7 @@
>> #define HW_MCHP_PFSOC_MMUART_H
>>
>> #include "hw/sysbus.h"
>> -#include "hw/char/serial.h"
>> +#include "hw/char/serial-mm.h"
>>
>> #define MCHP_PFSOC_MMUART_REG_COUNT 13
>>
>> diff --git a/include/hw/char/serial-mm.h b/include/hw/char/serial-mm.h
>> new file mode 100644
>> index 0000000000..62a8489d69
>> --- /dev/null
>> +++ b/include/hw/char/serial-mm.h
>> @@ -0,0 +1,52 @@
>> +/*
>> + * QEMU 16550A UART emulation
>
>This is now only "memory mapped 16550A compatible UART emulation" or something
>like that, the actual 16550A emulation is in serial.c where this was moved
>from. Maybe worth making it clear in this comment and in serial-mm.c as well.
I'll send a v3 then.
Best regards,
Bernhard
>
>Regards,
>BALATON Zoltan