hw/char: Extract serial-mm

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>
Link: https://lore.kernel.org/r/20240905073832.16222-4-shentey@gmail.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Bernhard Beschow 2024-09-05 09:38:32 +02:00 committed by Paolo Bonzini
parent 37b724cdef
commit 7e6b5497ea
50 changed files with 276 additions and 206 deletions

View file

@ -136,7 +136,7 @@ config MUSICPAL
select MARVELL_88W8618
select PTIMER
select PFLASH_CFI02
select SERIAL
select SERIAL_MM
select WM8750
config NETDUINO2
@ -179,13 +179,13 @@ config OMAP
select NAND
select PFLASH_CFI01
select SD
select SERIAL
select SERIAL_MM
config PXA2XX
bool
select FRAMEBUFFER
select I2C
select SERIAL
select SERIAL_MM
select SD
select SSI
select USB_OHCI_SYSBUS
@ -399,7 +399,7 @@ config ALLWINNER_A10
select ALLWINNER_EMAC
select ALLWINNER_I2C
select AXP2XX_PMU
select SERIAL
select SERIAL_MM
select UNIMP
select USB_OHCI_SYSBUS
@ -411,7 +411,7 @@ config ALLWINNER_H3
select ALLWINNER_SUN8I_EMAC
select ALLWINNER_I2C
select ALLWINNER_WDT
select SERIAL
select SERIAL_MM
select ARM_TIMER
select ARM_GIC
select UNIMP
@ -427,7 +427,7 @@ config ALLWINNER_R40
select ALLWINNER_A10_PIT
select ALLWINNER_WDT
select AXP2XX_PMU
select SERIAL
select SERIAL_MM
select ARM_TIMER
select ARM_GIC
select UNIMP
@ -542,7 +542,7 @@ config NPCM7XX
select ISL_PMBUS_VR
select PL310 # cache controller
select PMBUS
select SERIAL
select SERIAL_MM
select SSI
select UNIMP
select PCA954X
@ -564,7 +564,7 @@ config FSL_IMX31
default y
depends on TCG && ARM
imply I2C_DEVICES
select SERIAL
select SERIAL_MM
select IMX
select IMX_I2C
select WDT_IMX2
@ -593,7 +593,7 @@ config ASPEED_SOC
select I2C
select DPS310
select PCA9552
select SERIAL
select SERIAL_MM
select SMBUS_EEPROM
select PCA954X
select SSI
@ -681,7 +681,7 @@ config MSF2
bool
select ARM_V7M
select PTIMER
select SERIAL
select SERIAL_MM
select SSI
select UNIMP

View file

@ -18,7 +18,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/module.h"
#include "hw/char/serial.h"
#include "hw/char/serial-mm.h"
#include "hw/sysbus.h"
#include "hw/arm/allwinner-a10.h"
#include "hw/misc/unimp.h"

View file

@ -24,7 +24,7 @@
#include "qemu/units.h"
#include "hw/qdev-core.h"
#include "hw/sysbus.h"
#include "hw/char/serial.h"
#include "hw/char/serial-mm.h"
#include "hw/misc/unimp.h"
#include "hw/usb/hcd-ehci.h"
#include "hw/loader.h"

View file

@ -26,7 +26,7 @@
#include "hw/boards.h"
#include "hw/qdev-core.h"
#include "hw/sysbus.h"
#include "hw/char/serial.h"
#include "hw/char/serial-mm.h"
#include "hw/misc/unimp.h"
#include "hw/usb/hcd-ehci.h"
#include "hw/loader.h"

View file

@ -15,7 +15,7 @@
#include "qapi/error.h"
#include "hw/misc/unimp.h"
#include "hw/arm/aspeed_soc.h"
#include "hw/char/serial.h"
#include "hw/char/serial-mm.h"
#include "qemu/module.h"
#include "qemu/error-report.h"
#include "hw/i2c/aspeed_i2c.h"

View file

@ -15,7 +15,7 @@
#include "hw/qdev-properties.h"
#include "hw/misc/unimp.h"
#include "hw/arm/aspeed_soc.h"
#include "hw/char/serial.h"
#include "hw/char/serial-mm.h"
const char *aspeed_soc_cpu_type(AspeedSoCClass *sc)

View file

@ -22,7 +22,7 @@
#include "exec/address-spaces.h"
#include "net/net.h"
#include "hw/net/lan9118.h"
#include "hw/char/serial.h"
#include "hw/char/serial-mm.h"
#include "sysemu/qtest.h"
#include "sysemu/sysemu.h"
#include "qemu/cutils.h"

View file

@ -26,7 +26,7 @@
#include "qemu/units.h"
#include "qapi/error.h"
#include "exec/address-spaces.h"
#include "hw/char/serial.h"
#include "hw/char/serial-mm.h"
#include "hw/arm/msf2-soc.h"
#include "hw/misc/unimp.h"
#include "hw/qdev-clock.h"

View file

@ -18,7 +18,7 @@
#include "net/net.h"
#include "sysemu/sysemu.h"
#include "hw/boards.h"
#include "hw/char/serial.h"
#include "hw/char/serial-mm.h"
#include "qemu/timer.h"
#include "hw/ptimer.h"
#include "hw/qdev-properties.h"

View file

@ -18,7 +18,7 @@
#include "hw/arm/boot.h"
#include "hw/arm/npcm7xx.h"
#include "hw/char/serial.h"
#include "hw/char/serial-mm.h"
#include "hw/loader.h"
#include "hw/misc/unimp.h"
#include "hw/qdev-clock.h"

View file

@ -17,7 +17,7 @@
#include "migration/vmstate.h"
#include "hw/arm/pxa.h"
#include "sysemu/sysemu.h"
#include "hw/char/serial.h"
#include "hw/char/serial-mm.h"
#include "hw/i2c/i2c.h"
#include "hw/irq.h"
#include "hw/qdev-properties.h"