Patchwork [19/19] hw: compile most devices once

login
register
mail settings
Submitter Paolo Bonzini
Date Feb. 4, 2013, 5:30 p.m.
Message ID <1359999004-22982-20-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/218046/
State New
Headers show

Comments

Paolo Bonzini - Feb. 4, 2013, 5:30 p.m.
Most devices moved to hw/ subdirectories (other than hw/ARCH) can now be
compiled once only.

A notable exception is that many framebuffer devices have assumptions on
the target endianness.  I have no idea what would happen with OMAP in
armeb mode, for example, so I'm leaving them aside.

The ARM mptimer requires CPUState because of the per-CPU page, but
perhaps that can be fixed since it is a target-independent field.

Some bridges (lpc_ich9.c and host-typhoon.c) use interrupts from
target-specific devices or CPUs, and must be compiled in the target.
Perhaps they could use GPIO pins initialized in board code instead.
Similarly, host-gt64xxx.c has code that should be moved in
hw/mips.

hw/net/milkymist-minimac2.c needs the page size.  Probably it should
be hardcoded to 4k?

Finally, I'm leaving virtio devices as they are too.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/audio/Makefile.objs    |    6 +++---
 hw/block/Makefile.objs    |    2 +-
 hw/char/Makefile.objs     |   24 ++++++++++++------------
 hw/display/Makefile.objs  |   18 +++++++++---------
 hw/i2c/Makefile.objs      |    6 +++---
 hw/ide/Makefile.objs      |    4 ++--
 hw/input/Makefile.objs    |    6 +++---
 hw/isa/Makefile.objs      |    5 +++--
 hw/misc/Makefile.objs     |    4 ++--
 hw/net/Makefile.objs      |   11 ++++++-----
 hw/pci/Makefile.objs      |   22 +++++++++++++---------
 hw/scsi/Makefile.objs     |    2 +-
 hw/sd/Makefile.objs       |    6 +++---
 hw/ssi/Makefile.objs      |    4 ++--
 hw/timer/Makefile.objs    |   27 ++++++++++++++-------------
 hw/usb/Makefile.objs      |    2 +-
 hw/watchdog/Makefile.objs |    4 ++--
 17 files changed, 80 insertions(+), 73 deletions(-)

Patch

diff --git a/hw/audio/Makefile.objs b/hw/audio/Makefile.objs
index a3926f8..2375102 100644
--- a/hw/audio/Makefile.objs
+++ b/hw/audio/Makefile.objs
@@ -13,8 +13,8 @@  common-obj-$(CONFIG_PCSPK) += pcspk.o
 common-obj-$(CONFIG_WM8750) += wm8750.o
 common-obj-$(CONFIG_PL041) += pl041.o lm4549.o
 
-obj-$(CONFIG_CS4231) += cs4231.o
-obj-$(CONFIG_MARVELL_88W8618) += marvell_88w8618.o
-obj-$(CONFIG_MILKYMIST) += milkymist-ac97.o
+common-obj-$(CONFIG_CS4231) += cs4231.o
+common-obj-$(CONFIG_MARVELL_88W8618) += marvell_88w8618.o
+common-obj-$(CONFIG_MILKYMIST) += milkymist-ac97.o
 
 $(obj)/adlib.o $(obj)/fmopl.o: QEMU_CFLAGS += -DBUILD_Y8950=0
diff --git a/hw/block/Makefile.objs b/hw/block/Makefile.objs
index 8b5073e..3873207 100644
--- a/hw/block/Makefile.objs
+++ b/hw/block/Makefile.objs
@@ -5,6 +5,6 @@  common-obj-$(CONFIG_NAND) += nand.o
 common-obj-$(CONFIG_PFLASH_CFI01) += pflash_cfi01.o
 common-obj-$(CONFIG_PFLASH_CFI02) += pflash_cfi02.o
 
-obj-$(CONFIG_ONENAND) += onenand.o
+common-obj-$(CONFIG_ONENAND) += onenand.o
 
 obj-$(CONFIG_VIRTIO) += dataplane/ virtio-blk.o
diff --git a/hw/char/Makefile.objs b/hw/char/Makefile.objs
index a8850ef..7ae7dc6 100644
--- a/hw/char/Makefile.objs
+++ b/hw/char/Makefile.objs
@@ -8,17 +8,17 @@  common-obj-$(CONFIG_VIRTIO) += virtio-console.o
 common-obj-$(CONFIG_XILINX) += xilinx_uartlite.o
 common-obj-$(CONFIG_CADENCE) += cadence_uart.o
 
-obj-$(CONFIG_ETRAXFS) += etraxfs_ser.o
-obj-$(CONFIG_EXYNOS4) += exynos4210_uart.o
-obj-$(CONFIG_GRLIB) += grlib_apbuart.o
-obj-$(CONFIG_IMX) += imx_serial.o
-obj-$(CONFIG_LM32) += lm32_juart.o
-obj-$(CONFIG_LM32) += lm32_uart.o
-obj-$(CONFIG_COLDFIRE) += mcf_uart.o
-obj-$(CONFIG_MILKYMIST) += milkymist-uart.o
-obj-$(CONFIG_OMAP) += omap_uart.o
-obj-$(CONFIG_SH4) += sh_serial.o
-obj-$(CONFIG_PSERIES) += spapr_vty.o
-obj-$(CONFIG_SCLPCONSOLE) += sclpconsole.o
+common-obj-$(CONFIG_ETRAXFS) += etraxfs_ser.o
+common-obj-$(CONFIG_EXYNOS4) += exynos4210_uart.o
+common-obj-$(CONFIG_GRLIB) += grlib_apbuart.o
+common-obj-$(CONFIG_IMX) += imx_serial.o
+common-obj-$(CONFIG_LM32) += lm32_juart.o
+common-obj-$(CONFIG_LM32) += lm32_uart.o
+common-obj-$(CONFIG_COLDFIRE) += mcf_uart.o
+common-obj-$(CONFIG_MILKYMIST) += milkymist-uart.o
+common-obj-$(CONFIG_OMAP) += omap_uart.o
+common-obj-$(CONFIG_SH4) += sh_serial.o
+common-obj-$(CONFIG_PSERIES) += spapr_vty.o
+common-obj-$(CONFIG_SCLPCONSOLE) += sclpconsole.o
 
 obj-$(CONFIG_VIRTIO) += virtio-serial-bus.o
diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs
index 4a8ef17..4685098 100644
--- a/hw/display/Makefile.objs
+++ b/hw/display/Makefile.objs
@@ -11,19 +11,19 @@  common-obj-$(CONFIG_VGA_ISA) += vga-isa.o
 common-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
 common-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o
 
-obj-$(CONFIG_BLIZZARD) += blizzard.o
-obj-$(CONFIG_EXYNOS4) += exynos4210_fimd.o
-obj-$(CONFIG_FRAMEBUFFER) += framebuffer.o
-obj-$(CONFIG_MILKYMIST) += milkymist-vgafb.o
+common-obj-$(CONFIG_BLIZZARD) += blizzard.o
+common-obj-$(CONFIG_EXYNOS4) += exynos4210_fimd.o
+common-obj-$(CONFIG_FRAMEBUFFER) += framebuffer.o
+common-obj-$(CONFIG_MILKYMIST) += milkymist-vgafb.o
+
+ifeq ($(CONFIG_OPENGL),y)
+common-obj-$(CONFIG_MILKYMIST) += milkymist-tmu2.o
+endif
+
 obj-$(CONFIG_OMAP) += omap_dss.o
 obj-$(CONFIG_OMAP) += omap_lcdc.o
 obj-$(CONFIG_PXA2XX) += pxa2xx_lcd.o
 obj-$(CONFIG_SPICE) += qxl-logger.o qxl-render.o qxl.o
 obj-$(CONFIG_SM501) += sm501.o
 obj-$(CONFIG_TCX) += tcx.o
-
-ifeq ($(CONFIG_OPENGL),y)
-obj-$(CONFIG_MILKYMIST) += milkymist-tmu2.o
-endif
-
 obj-$(CONFIG_VGA) += vga.o
diff --git a/hw/i2c/Makefile.objs b/hw/i2c/Makefile.objs
index 18e0773..ee1e297 100644
--- a/hw/i2c/Makefile.objs
+++ b/hw/i2c/Makefile.objs
@@ -2,6 +2,6 @@  common-obj-y += core.o smbus.o smbus_eeprom.o
 common-obj-$(CONFIG_VERSATILE_I2C) += versatile_i2c.o
 common-obj-$(CONFIG_ACPI) += smbus_ich9.o
 common-obj-$(CONFIG_APM) += pm_smbus.o
-obj-$(CONFIG_BITBANG_I2C) += bitbang-i2c.o
-obj-$(CONFIG_EXYNOS4) += exynos4210_i2c.o
-obj-$(CONFIG_OMAP) += omap_i2c.o
+common-obj-$(CONFIG_BITBANG_I2C) += bitbang-i2c.o
+common-obj-$(CONFIG_EXYNOS4) += exynos4210_i2c.o
+common-obj-$(CONFIG_OMAP) += omap_i2c.o
diff --git a/hw/ide/Makefile.objs b/hw/ide/Makefile.objs
index 122f086..9823276 100644
--- a/hw/ide/Makefile.objs
+++ b/hw/ide/Makefile.objs
@@ -9,5 +9,5 @@  common-obj-$(CONFIG_IDE_VIA) += via.o
 common-obj-$(CONFIG_AHCI) += ahci.o
 common-obj-$(CONFIG_AHCI) += ich.o
 
-obj-$(CONFIG_MICRODRIVE) += microdrive.o
-obj-$(CONFIG_IDE_MMIO) += mmio.o
+common-obj-$(CONFIG_MICRODRIVE) += microdrive.o
+common-obj-$(CONFIG_IDE_MMIO) += mmio.o
diff --git a/hw/input/Makefile.objs b/hw/input/Makefile.objs
index ea1ff34..2996ed8 100644
--- a/hw/input/Makefile.objs
+++ b/hw/input/Makefile.objs
@@ -7,7 +7,7 @@  common-obj-y += ps2.o
 common-obj-$(CONFIG_STELLARIS_INPUT) += stellaris_input.o
 common-obj-$(CONFIG_TSC2005) += tsc2005.o
 
-obj-$(CONFIG_MILKYMIST) += milkymist-softusb.o
-obj-$(CONFIG_PXA2XX) += pxa2xx_keypad.o
-obj-$(CONFIG_TSC210X) += tsc210x.o
+common-obj-$(CONFIG_MILKYMIST) += milkymist-softusb.o
+common-obj-$(CONFIG_PXA2XX) += pxa2xx_keypad.o
+common-obj-$(CONFIG_TSC210X) += tsc210x.o
 
diff --git a/hw/isa/Makefile.objs b/hw/isa/Makefile.objs
index 2516657..939c3cf 100644
--- a/hw/isa/Makefile.objs
+++ b/hw/isa/Makefile.objs
@@ -8,6 +8,7 @@  common-obj-$(CONFIG_I8259) += i8259_common.o i8259.o
 common-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o
 common-obj-$(CONFIG_PC87312) += pc87312.o
 
-obj-$(CONFIG_ISA_DEBUG) += debugcon.o debugexit.o
+common-obj-$(CONFIG_ISA_DEBUG) += debugcon.o debugexit.o
+common-obj-$(CONFIG_FULONG) += vt82c686.o
+
 obj-$(CONFIG_LPC_ICH9) += lpc_ich9.o
-obj-$(CONFIG_FULONG) += vt82c686.o
diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs
index 8cc2834..a2889bd 100644
--- a/hw/misc/Makefile.objs
+++ b/hw/misc/Makefile.objs
@@ -34,6 +34,6 @@  common-obj-$(CONFIG_PUV3) += puv3_gpio.o
 common-obj-$(CONFIG_PUV3) += puv3_pm.o
 common-obj-$(CONFIG_PUV3) += puv3_dma.o
 
-obj-$(CONFIG_ECCMEMCTL) += eccmemctl.o
-obj-$(CONFIG_PXA2XX) += pxa2xx_pcmcia.o
+common-obj-$(CONFIG_ECCMEMCTL) += eccmemctl.o
+common-obj-$(CONFIG_PXA2XX) += pxa2xx_pcmcia.o
 
diff --git a/hw/net/Makefile.objs b/hw/net/Makefile.objs
index 5fd2cca..e9b6509 100644
--- a/hw/net/Makefile.objs
+++ b/hw/net/Makefile.objs
@@ -19,12 +19,13 @@  common-obj-$(CONFIG_XILINX_AXI) += xilinx_axienet.o
 
 common-obj-$(CONFIG_CADENCE) += cadence_gem.o
 
-obj-$(CONFIG_STELLARIS_ENET) += stellaris_enet.o
-obj-$(CONFIG_ETRAXFS) += etraxfs_eth.o
-obj-$(CONFIG_LANCE) += lance.o
-obj-$(CONFIG_COLDFIRE) += mcf_fec.o
+common-obj-$(CONFIG_STELLARIS_ENET) += stellaris_enet.o
+common-obj-$(CONFIG_ETRAXFS) += etraxfs_eth.o
+common-obj-$(CONFIG_LANCE) += lance.o
+common-obj-$(CONFIG_COLDFIRE) += mcf_fec.o
+common-obj-$(CONFIG_PSERIES) += spapr_llan.o
+
 obj-$(CONFIG_MILKYMIST) += milkymist-minimac2.o
-obj-$(CONFIG_PSERIES) += spapr_llan.o
 obj-$(CONFIG_XILINX_ETHLITE) += xilinx_ethlite.o
 
 obj-$(CONFIG_VIRTIO) += virtio-net.o
diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
index eba67d6..6af2ae6 100644
--- a/hw/pci/Makefile.objs
+++ b/hw/pci/Makefile.objs
@@ -34,15 +34,19 @@  obj-$(CONFIG_KVM) += ivshmem.o
 obj-$(CONFIG_LINUX) += vfio.o
 endif
 
-obj-$(CONFIG_PCI_APB) += host-apb.o
-obj-$(CONFIG_FULONG) += host-bonito.o
-obj-$(CONFIG_PCI_GT64XXX) += host-gt64xxx.o
-obj-$(CONFIG_PCI_PIIX) += host-piix.o
-obj-$(CONFIG_PCI_PPC4XX) += host-ppc4xx.o
-obj-$(CONFIG_Q35) += q35.o
-obj-$(CONFIG_SH4) += host-sh.o
-obj-$(CONFIG_PSERIES) += host-spapr.o
+common-obj-$(CONFIG_PCI_APB) += host-apb.o
+common-obj-$(CONFIG_FULONG) += host-bonito.o
+common-obj-$(CONFIG_PCI_PIIX) += host-piix.o
+common-obj-$(CONFIG_PCI_PPC4XX) += host-ppc4xx.o
+common-obj-$(CONFIG_Q35) += q35.o
+common-obj-$(CONFIG_SH4) += host-sh.o
+common-obj-$(CONFIG_PSERIES) += host-spapr.o
+common-obj-$(CONFIG_PSERIES) += spapr_pci.o
+
 obj-$(CONFIG_PCI_TYPHOON) += host-typhoon.o
-obj-$(CONFIG_PSERIES) += spapr_pci.o
+
+# This file embeds differences between big- and little-endian
+# Malta boards.  These should be only in hw/mips/.
+obj-$(CONFIG_PCI_GT64XXX) += host-gt64xxx.o
 
 obj-$(CONFIG_PCI_HOTPLUG) += pci-hotplug.o
diff --git a/hw/scsi/Makefile.objs b/hw/scsi/Makefile.objs
index dc00876..5aa2ce1 100644
--- a/hw/scsi/Makefile.objs
+++ b/hw/scsi/Makefile.objs
@@ -4,6 +4,6 @@  common-obj-$(CONFIG_LSI_SCSI_PCI) += lsi53c895a.o
 common-obj-$(CONFIG_MEGASAS_SCSI_PCI) += megasas.o
 common-obj-$(CONFIG_ESP) += esp.o
 common-obj-$(CONFIG_ESP_PCI) += esp-pci.o
-obj-$(CONFIG_PSERIES) += spapr_vscsi.o
+common-obj-$(CONFIG_PSERIES) += spapr_vscsi.o
 obj-$(CONFIG_VIRTIO) += virtio-scsi.o
 
diff --git a/hw/sd/Makefile.objs b/hw/sd/Makefile.objs
index 6d64c5e..6ac4a8b 100644
--- a/hw/sd/Makefile.objs
+++ b/hw/sd/Makefile.objs
@@ -1,6 +1,6 @@ 
 common-obj-$(CONFIG_PL181) += pl181.o
 common-obj-$(CONFIG_SSI_SD) += ssi-sd.o
 common-obj-$(CONFIG_SD) += sd.o
-obj-$(CONFIG_MILKYMIST) += milkymist-memcard.o
-obj-$(CONFIG_OMAP) += omap_mmc.o
-obj-$(CONFIG_PXA2XX) += pxa2xx_mmci.o
+common-obj-$(CONFIG_MILKYMIST) += milkymist-memcard.o
+common-obj-$(CONFIG_OMAP) += omap_mmc.o
+common-obj-$(CONFIG_PXA2XX) += pxa2xx_mmci.o
diff --git a/hw/ssi/Makefile.objs b/hw/ssi/Makefile.objs
index b388438..1cd2501 100644
--- a/hw/ssi/Makefile.objs
+++ b/hw/ssi/Makefile.objs
@@ -1,4 +1,4 @@ 
 common-obj-$(CONFIG_PL022) += pl022.o
 common-obj-$(CONFIG_SSI) += ssi.o
-obj-$(CONFIG_XILINX_SPI) += xilinx_spi.o
-obj-$(CONFIG_XILINX_SPIPS) += xilinx_spips.o
+common-obj-$(CONFIG_XILINX_SPI) += xilinx_spi.o
+common-obj-$(CONFIG_XILINX_SPIPS) += xilinx_spips.o
diff --git a/hw/timer/Makefile.objs b/hw/timer/Makefile.objs
index ce407bb..b96995a 100644
--- a/hw/timer/Makefile.objs
+++ b/hw/timer/Makefile.objs
@@ -9,19 +9,20 @@  common-obj-$(CONFIG_PUV3) += puv3_ost.o
 common-obj-$(CONFIG_TWL92230) += twl92230.o
 common-obj-$(CONFIG_XILINX) += xilinx_timer.o
 
-obj-$(CONFIG_SLAVIO) += slavio_timer.o
+common-obj-$(CONFIG_SLAVIO) += slavio_timer.o
+common-obj-$(CONFIG_ETRAXFS) += etraxfs_timer.o
+common-obj-$(CONFIG_EXYNOS4) += exynos4210_mct.o
+common-obj-$(CONFIG_EXYNOS4) += exynos4210_pwm.o
+common-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
+common-obj-$(CONFIG_GRLIB) += grlib_gptimer.o
+common-obj-$(CONFIG_IMX) += imx_timer.o
+common-obj-$(CONFIG_LM32) += lm32_timer.o
+common-obj-$(CONFIG_OMAP) += omap_gptimer.o
+common-obj-$(CONFIG_OMAP) += omap_synctimer.o
+common-obj-$(CONFIG_PXA2XX) += pxa2xx_timer.o
+common-obj-$(CONFIG_SH4) += sh_timer.o
+common-obj-$(CONFIG_TUSB6010) += tusb6010.o
+
 obj-$(CONFIG_ARM_MPTIMER) += arm_mptimer.o
-obj-$(CONFIG_ETRAXFS) += etraxfs_timer.o
-obj-$(CONFIG_EXYNOS4) += exynos4210_mct.o
-obj-$(CONFIG_EXYNOS4) += exynos4210_pwm.o
-obj-$(CONFIG_EXYNOS4) += exynos4210_rtc.o
-obj-$(CONFIG_GRLIB) += grlib_gptimer.o
-obj-$(CONFIG_IMX) += imx_timer.o
-obj-$(CONFIG_LM32) += lm32_timer.o
-obj-$(CONFIG_OMAP) += omap_gptimer.o
-obj-$(CONFIG_OMAP) += omap_synctimer.o
-obj-$(CONFIG_PXA2XX) += pxa2xx_timer.o
-obj-$(CONFIG_SH4) += sh_timer.o
-obj-$(CONFIG_TUSB6010) += tusb6010.o
 
 obj-$(CONFIG_MC146818RTC) += mc146818rtc.o
diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs
index 54029b2..6a17ddd 100644
--- a/hw/usb/Makefile.objs
+++ b/hw/usb/Makefile.objs
@@ -2,7 +2,7 @@  common-obj-$(CONFIG_USB_UHCI) += hcd-uhci.o
 common-obj-$(CONFIG_USB_OHCI) += hcd-ohci.o
 common-obj-$(CONFIG_USB_EHCI) += hcd-ehci.o hcd-ehci-pci.o hcd-ehci-sysbus.o
 common-obj-$(CONFIG_USB_XHCI) += hcd-xhci.o
-obj-$(CONFIG_USB_MUSB) += hcd-musb.o
+common-obj-$(CONFIG_USB_MUSB) += hcd-musb.o
 
 common-obj-y += libhw.o
 
diff --git a/hw/watchdog/Makefile.objs b/hw/watchdog/Makefile.objs
index 308510e..4b0374a 100644
--- a/hw/watchdog/Makefile.objs
+++ b/hw/watchdog/Makefile.objs
@@ -1,3 +1,3 @@ 
 common-obj-y += watchdog.o
-obj-$(CONFIG_WDT_IB6300ESB) += wdt_i6300esb.o
-obj-$(CONFIG_WDT_IB700) += wdt_ib700.o
+common-obj-$(CONFIG_WDT_IB6300ESB) += wdt_i6300esb.o
+common-obj-$(CONFIG_WDT_IB700) += wdt_ib700.o