Skip to content

Commit

Permalink
build: convert pci.mak to Kconfig
Browse files Browse the repository at this point in the history
Instead of including the same list of devices for each target,
set CONFIG_PCI to true, and make the devices default to present
whenever PCI is available.  However, s390x does not want all the
PCI devices, so there is a separate symbol to enable them.

Done mostly with the following script:

  while read i; do
     i=${i%=y}; i=${i#CONFIG_}
     sed -i -e'/^config '$i'$/!b' -en \
            -e'a\' -e'    default y if PCI_DEVICES\' -e'    depends on PCI' \
          `grep -lw $i hw/*/Kconfig`
  done < default-configs/pci.mak

followed by replacing a few "depends on" clauses with "select"
whenever the symbol is not really related to PCI.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20190123065618.3520-31-yang.zhong@intel.com>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Mar 7, 2019
1 parent e9947d1 commit 7c28b92
Show file tree
Hide file tree
Showing 30 changed files with 138 additions and 65 deletions.
3 changes: 2 additions & 1 deletion default-configs/alpha-softmmu.mak
@@ -1,7 +1,8 @@
# Default configuration for alpha-softmmu

include pci.mak
include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_SERIAL=y
CONFIG_SERIAL_ISA=y
CONFIG_I82374=y
Expand Down
7 changes: 6 additions & 1 deletion default-configs/arm-softmmu.mak
@@ -1,7 +1,8 @@
# Default configuration for arm-softmmu

include pci.mak
include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_VGA=y
CONFIG_NAND=y
CONFIG_ECC=y
Expand Down Expand Up @@ -163,3 +164,7 @@ CONFIG_PCI_EXPRESS_DESIGNWARE=y
CONFIG_STRONGARM=y
CONFIG_HIGHBANK=y
CONFIG_MUSICPAL=y

# for realview and versatilepb
CONFIG_SCSI=y
CONFIG_LSI_SCSI_PCI=y
5 changes: 4 additions & 1 deletion default-configs/hppa-softmmu.mak
@@ -1,12 +1,15 @@
include pci.mak
include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_SERIAL=y
CONFIG_SERIAL_ISA=y
CONFIG_ISA_BUS=y
CONFIG_I8259=y
CONFIG_E1000_PCI=y
CONFIG_IDE_CMD646=y
# CONFIG_IDE_MMIO=y
CONFIG_SCSI=y
CONFIG_LSI_SCSI_PCI=y
CONFIG_VIRTIO_VGA=y
CONFIG_MC146818RTC=y
CONFIG_DINO=y
5 changes: 2 additions & 3 deletions default-configs/i386-softmmu.mak
@@ -1,12 +1,12 @@
# Default configuration for i386-softmmu

include pci.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
include sound.mak
include usb.mak
include hyperv.mak
CONFIG_TEST_DEVICES=y
CONFIG_VGA_ISA=y
CONFIG_VGA_CIRRUS=y
CONFIG_VMWARE_VGA=y
CONFIG_VMXNET3_PCI=y
CONFIG_VIRTIO_VGA=y
Expand Down Expand Up @@ -54,7 +54,6 @@ CONFIG_MEM_DEVICE=y
CONFIG_DIMM=y
CONFIG_NVDIMM=y
CONFIG_ACPI_NVDIMM=y
CONFIG_PCIE_PORT=y
CONFIG_XIO3130=y
CONFIG_IOH3420=y
CONFIG_I82801B11=y
Expand Down
3 changes: 2 additions & 1 deletion default-configs/mips-softmmu-common.mak
@@ -1,8 +1,9 @@
# Common mips*-softmmu CONFIG defines

include pci.mak
include sound.mak
include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_ESP=y
CONFIG_SCSI=y
CONFIG_VGA_ISA=y
Expand Down
1 change: 1 addition & 0 deletions default-configs/mips64el-softmmu.mak
Expand Up @@ -10,6 +10,7 @@ CONFIG_JAZZ=y
CONFIG_G364FB=y
CONFIG_JAZZ_LED=y
CONFIG_VT82C686=y
CONFIG_AHCI=y
CONFIG_MIPS_BOSTON=y
CONFIG_FITLOADER=y
CONFIG_PCI_EXPRESS=y
Expand Down
48 changes: 0 additions & 48 deletions default-configs/pci.mak

This file was deleted.

3 changes: 2 additions & 1 deletion default-configs/ppc-softmmu.mak
@@ -1,8 +1,9 @@
# Default configuration for ppc-softmmu

include pci.mak
include sound.mak
include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_TEST_DEVICES=y

# For embedded PPCs:
Expand Down
4 changes: 2 additions & 2 deletions default-configs/riscv32-softmmu.mak
@@ -1,8 +1,8 @@
# Default configuration for riscv-softmmu

include pci.mak
include usb.mak

CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_SERIAL=y
CONFIG_VIRTIO_MMIO=y

Expand Down
4 changes: 2 additions & 2 deletions default-configs/riscv64-softmmu.mak
@@ -1,8 +1,8 @@
# Default configuration for riscv-softmmu

include pci.mak
include usb.mak

CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_SERIAL=y
CONFIG_VIRTIO_MMIO=y

Expand Down
3 changes: 2 additions & 1 deletion default-configs/sh4-softmmu.mak
@@ -1,7 +1,8 @@
# Default configuration for sh4-softmmu

include pci.mak
include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_SERIAL=y
CONFIG_SERIAL_ISA=y
CONFIG_PTIMER=y
Expand Down
3 changes: 2 additions & 1 deletion default-configs/sh4eb-softmmu.mak
@@ -1,7 +1,8 @@
# Default configuration for sh4eb-softmmu

include pci.mak
include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_SERIAL=y
CONFIG_SERIAL_ISA=y
CONFIG_PTIMER=y
Expand Down
3 changes: 2 additions & 1 deletion default-configs/sparc64-softmmu.mak
@@ -1,7 +1,8 @@
# Default configuration for sparc64-softmmu

include pci.mak
include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_M48T59=y
CONFIG_PTIMER=y
CONFIG_SERIAL=y
Expand Down
1 change: 0 additions & 1 deletion docs/devel/build-system.txt
Expand Up @@ -417,7 +417,6 @@ into each QEMU system and userspace emulator targets. They merely
contain a long list of config variable definitions. For example,
default-configs/x86_64-softmmu.mak has:

include pci.mak
include sound.mak
include usb.mak
CONFIG_QXL=$(CONFIG_SPICE)
Expand Down
6 changes: 6 additions & 0 deletions hw/audio/Kconfig
Expand Up @@ -3,9 +3,13 @@ config SB16

config ES1370
bool
default y if PCI_DEVICES
depends on PCI

config AC97
bool
default y if PCI_DEVICES
depends on PCI

config ADLIB
bool
Expand All @@ -18,6 +22,8 @@ config CS4231A

config HDA
bool
default y if PCI_DEVICES
depends on PCI

config PCSPK
bool
Expand Down
2 changes: 2 additions & 0 deletions hw/block/Kconfig
Expand Up @@ -21,6 +21,8 @@ config ONENAND

config NVME_PCI
bool
default y if PCI_DEVICES
depends on PCI

config VIRTIO_BLK
bool
Expand Down
2 changes: 2 additions & 0 deletions hw/char/Kconfig
Expand Up @@ -15,6 +15,8 @@ config SERIAL_ISA

config SERIAL_PCI
bool
default y if PCI_DEVICES
depends on PCI

config VIRTIO_SERIAL
bool
Expand Down
16 changes: 16 additions & 0 deletions hw/display/Kconfig
Expand Up @@ -9,6 +9,9 @@ config ADS7846

config VGA_CIRRUS
bool
default y if PCI_DEVICES
depends on PCI
select VGA

config G364FB
bool
Expand All @@ -30,6 +33,9 @@ config SSD0323

config VGA_PCI
bool
default y if PCI_DEVICES
depends on PCI
select VGA

config VGA_ISA
bool
Expand All @@ -39,9 +45,15 @@ config VGA_ISA_MM

config VMWARE_VGA
bool
default y if PCI_DEVICES
depends on PCI
select VGA

config BOCHS_DISPLAY
bool
default y if PCI_DEVICES
depends on PCI
select VGA

config BLIZZARD
bool
Expand Down Expand Up @@ -69,12 +81,16 @@ config VGA
config QXL
bool
depends on SPICE && PCI
select VGA

config VIRTIO_GPU
bool

config VIRTIO_VGA
bool
default y if PCI_DEVICES
depends on VIRTIO_PCI
select VGA

config DPCD
bool
3 changes: 3 additions & 0 deletions hw/ide/Kconfig
Expand Up @@ -7,6 +7,7 @@ config IDE_QDEV

config IDE_PCI
bool
depends on PCI
select IDE_CORE

config IDE_ISA
Expand Down Expand Up @@ -42,6 +43,8 @@ config MICRODRIVE

config AHCI
bool
default y if PCI_DEVICES
depends on PCI
select IDE_QDEV

config IDE_SII3112
Expand Down
2 changes: 2 additions & 0 deletions hw/ipack/Kconfig
@@ -1,2 +1,4 @@
config IPACK
bool
default y if PCI_DEVICES
depends on PCI
6 changes: 5 additions & 1 deletion hw/misc/Kconfig
Expand Up @@ -21,9 +21,13 @@ config ISA_TESTDEV

config PCI_TESTDEV
bool
default y if TEST_DEVICES
depends on PCI

config EDU
bool
default y if TEST_DEVICES
depends on PCI

config PCA9552
bool
Expand All @@ -48,7 +52,7 @@ config MACIO

config IVSHMEM_DEVICE
bool
default y
default y if PCI_DEVICES
depends on PCI && LINUX && IVSHMEM

config ECCMEMCTL
Expand Down

0 comments on commit 7c28b92

Please sign in to comment.