build: convert pci.mak to Kconfig

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>
This commit is contained in:
Paolo Bonzini 2019-01-23 14:56:04 +08:00
parent e9947d18df
commit 7c28b925b7
30 changed files with 138 additions and 65 deletions

View File

@ -1,7 +1,8 @@
# Default configuration for alpha-softmmu # Default configuration for alpha-softmmu
include pci.mak
include usb.mak include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_SERIAL=y CONFIG_SERIAL=y
CONFIG_SERIAL_ISA=y CONFIG_SERIAL_ISA=y
CONFIG_I82374=y CONFIG_I82374=y

View File

@ -1,7 +1,8 @@
# Default configuration for arm-softmmu # Default configuration for arm-softmmu
include pci.mak
include usb.mak include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_VGA=y CONFIG_VGA=y
CONFIG_NAND=y CONFIG_NAND=y
CONFIG_ECC=y CONFIG_ECC=y
@ -163,3 +164,7 @@ CONFIG_PCI_EXPRESS_DESIGNWARE=y
CONFIG_STRONGARM=y CONFIG_STRONGARM=y
CONFIG_HIGHBANK=y CONFIG_HIGHBANK=y
CONFIG_MUSICPAL=y CONFIG_MUSICPAL=y
# for realview and versatilepb
CONFIG_SCSI=y
CONFIG_LSI_SCSI_PCI=y

View File

@ -1,5 +1,6 @@
include pci.mak
include usb.mak include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_SERIAL=y CONFIG_SERIAL=y
CONFIG_SERIAL_ISA=y CONFIG_SERIAL_ISA=y
CONFIG_ISA_BUS=y CONFIG_ISA_BUS=y
@ -7,6 +8,8 @@ CONFIG_I8259=y
CONFIG_E1000_PCI=y CONFIG_E1000_PCI=y
CONFIG_IDE_CMD646=y CONFIG_IDE_CMD646=y
# CONFIG_IDE_MMIO=y # CONFIG_IDE_MMIO=y
CONFIG_SCSI=y
CONFIG_LSI_SCSI_PCI=y
CONFIG_VIRTIO_VGA=y CONFIG_VIRTIO_VGA=y
CONFIG_MC146818RTC=y CONFIG_MC146818RTC=y
CONFIG_DINO=y CONFIG_DINO=y

View File

@ -1,12 +1,12 @@
# Default configuration for i386-softmmu # Default configuration for i386-softmmu
include pci.mak CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
include sound.mak include sound.mak
include usb.mak include usb.mak
include hyperv.mak include hyperv.mak
CONFIG_TEST_DEVICES=y CONFIG_TEST_DEVICES=y
CONFIG_VGA_ISA=y CONFIG_VGA_ISA=y
CONFIG_VGA_CIRRUS=y
CONFIG_VMWARE_VGA=y CONFIG_VMWARE_VGA=y
CONFIG_VMXNET3_PCI=y CONFIG_VMXNET3_PCI=y
CONFIG_VIRTIO_VGA=y CONFIG_VIRTIO_VGA=y
@ -54,7 +54,6 @@ CONFIG_MEM_DEVICE=y
CONFIG_DIMM=y CONFIG_DIMM=y
CONFIG_NVDIMM=y CONFIG_NVDIMM=y
CONFIG_ACPI_NVDIMM=y CONFIG_ACPI_NVDIMM=y
CONFIG_PCIE_PORT=y
CONFIG_XIO3130=y CONFIG_XIO3130=y
CONFIG_IOH3420=y CONFIG_IOH3420=y
CONFIG_I82801B11=y CONFIG_I82801B11=y

View File

@ -1,8 +1,9 @@
# Common mips*-softmmu CONFIG defines # Common mips*-softmmu CONFIG defines
include pci.mak
include sound.mak include sound.mak
include usb.mak include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_ESP=y CONFIG_ESP=y
CONFIG_SCSI=y CONFIG_SCSI=y
CONFIG_VGA_ISA=y CONFIG_VGA_ISA=y

View File

@ -10,6 +10,7 @@ CONFIG_JAZZ=y
CONFIG_G364FB=y CONFIG_G364FB=y
CONFIG_JAZZ_LED=y CONFIG_JAZZ_LED=y
CONFIG_VT82C686=y CONFIG_VT82C686=y
CONFIG_AHCI=y
CONFIG_MIPS_BOSTON=y CONFIG_MIPS_BOSTON=y
CONFIG_FITLOADER=y CONFIG_FITLOADER=y
CONFIG_PCI_EXPRESS=y CONFIG_PCI_EXPRESS=y

View File

@ -1,48 +0,0 @@
CONFIG_PCI=y
# For now, CONFIG_IDE_CORE requires ISA, so we enable it here
CONFIG_ISA_BUS=y
CONFIG_VIRTIO_PCI=y
include virtio.mak
CONFIG_USB_UHCI=y
CONFIG_USB_OHCI=y
CONFIG_USB_EHCI=y
CONFIG_USB_XHCI=y
CONFIG_USB_XHCI_NEC=y
CONFIG_NE2000_PCI=y
CONFIG_EEPRO100_PCI=y
CONFIG_PCNET_PCI=y
CONFIG_PCNET_COMMON=y
CONFIG_AC97=y
CONFIG_HDA=y
CONFIG_ES1370=y
CONFIG_SCSI=y
CONFIG_LSI_SCSI_PCI=y
CONFIG_VMW_PVSCSI_SCSI_PCI=y
CONFIG_MEGASAS_SCSI_PCI=y
CONFIG_MPTSAS_SCSI_PCI=y
CONFIG_RTL8139_PCI=y
CONFIG_E1000_PCI=y
CONFIG_E1000E_PCI_EXPRESS=y
CONFIG_AHCI=y
CONFIG_ESP=y
CONFIG_ESP_PCI=y
CONFIG_SERIAL=y
CONFIG_SERIAL_ISA=y
CONFIG_SERIAL_PCI=y
CONFIG_CAN_BUS=y
CONFIG_CAN_SJA1000=y
CONFIG_CAN_PCI=y
CONFIG_IPACK=y
CONFIG_WDT_IB6300ESB=y
CONFIG_PCI_TESTDEV=y
CONFIG_NVME_PCI=y
CONFIG_SD=y
CONFIG_SDHCI=y
CONFIG_EDU=y
CONFIG_VGA=y
CONFIG_VGA_PCI=y
CONFIG_BOCHS_DISPLAY=y
CONFIG_IVSHMEM_DEVICE=$(CONFIG_IVSHMEM)
CONFIG_ROCKER=y
CONFIG_VFIO_PCI=y
CONFIG_EDID=y

View File

@ -1,8 +1,9 @@
# Default configuration for ppc-softmmu # Default configuration for ppc-softmmu
include pci.mak
include sound.mak include sound.mak
include usb.mak include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_TEST_DEVICES=y CONFIG_TEST_DEVICES=y
# For embedded PPCs: # For embedded PPCs:

View File

@ -1,8 +1,8 @@
# Default configuration for riscv-softmmu # Default configuration for riscv-softmmu
include pci.mak
include usb.mak include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_SERIAL=y CONFIG_SERIAL=y
CONFIG_VIRTIO_MMIO=y CONFIG_VIRTIO_MMIO=y

View File

@ -1,8 +1,8 @@
# Default configuration for riscv-softmmu # Default configuration for riscv-softmmu
include pci.mak
include usb.mak include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_SERIAL=y CONFIG_SERIAL=y
CONFIG_VIRTIO_MMIO=y CONFIG_VIRTIO_MMIO=y

View File

@ -1,7 +1,8 @@
# Default configuration for sh4-softmmu # Default configuration for sh4-softmmu
include pci.mak
include usb.mak include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_SERIAL=y CONFIG_SERIAL=y
CONFIG_SERIAL_ISA=y CONFIG_SERIAL_ISA=y
CONFIG_PTIMER=y CONFIG_PTIMER=y

View File

@ -1,7 +1,8 @@
# Default configuration for sh4eb-softmmu # Default configuration for sh4eb-softmmu
include pci.mak
include usb.mak include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_SERIAL=y CONFIG_SERIAL=y
CONFIG_SERIAL_ISA=y CONFIG_SERIAL_ISA=y
CONFIG_PTIMER=y CONFIG_PTIMER=y

View File

@ -1,7 +1,8 @@
# Default configuration for sparc64-softmmu # Default configuration for sparc64-softmmu
include pci.mak
include usb.mak include usb.mak
CONFIG_PCI=y
CONFIG_PCI_DEVICES=y
CONFIG_M48T59=y CONFIG_M48T59=y
CONFIG_PTIMER=y CONFIG_PTIMER=y
CONFIG_SERIAL=y CONFIG_SERIAL=y

View File

@ -417,7 +417,6 @@ into each QEMU system and userspace emulator targets. They merely
contain a long list of config variable definitions. For example, contain a long list of config variable definitions. For example,
default-configs/x86_64-softmmu.mak has: default-configs/x86_64-softmmu.mak has:
include pci.mak
include sound.mak include sound.mak
include usb.mak include usb.mak
CONFIG_QXL=$(CONFIG_SPICE) CONFIG_QXL=$(CONFIG_SPICE)

View File

@ -3,9 +3,13 @@ config SB16
config ES1370 config ES1370
bool bool
default y if PCI_DEVICES
depends on PCI
config AC97 config AC97
bool bool
default y if PCI_DEVICES
depends on PCI
config ADLIB config ADLIB
bool bool
@ -18,6 +22,8 @@ config CS4231A
config HDA config HDA
bool bool
default y if PCI_DEVICES
depends on PCI
config PCSPK config PCSPK
bool bool

View File

@ -21,6 +21,8 @@ config ONENAND
config NVME_PCI config NVME_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
config VIRTIO_BLK config VIRTIO_BLK
bool bool

View File

@ -15,6 +15,8 @@ config SERIAL_ISA
config SERIAL_PCI config SERIAL_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
config VIRTIO_SERIAL config VIRTIO_SERIAL
bool bool

View File

@ -9,6 +9,9 @@ config ADS7846
config VGA_CIRRUS config VGA_CIRRUS
bool bool
default y if PCI_DEVICES
depends on PCI
select VGA
config G364FB config G364FB
bool bool
@ -30,6 +33,9 @@ config SSD0323
config VGA_PCI config VGA_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
select VGA
config VGA_ISA config VGA_ISA
bool bool
@ -39,9 +45,15 @@ config VGA_ISA_MM
config VMWARE_VGA config VMWARE_VGA
bool bool
default y if PCI_DEVICES
depends on PCI
select VGA
config BOCHS_DISPLAY config BOCHS_DISPLAY
bool bool
default y if PCI_DEVICES
depends on PCI
select VGA
config BLIZZARD config BLIZZARD
bool bool
@ -69,12 +81,16 @@ config VGA
config QXL config QXL
bool bool
depends on SPICE && PCI depends on SPICE && PCI
select VGA
config VIRTIO_GPU config VIRTIO_GPU
bool bool
config VIRTIO_VGA config VIRTIO_VGA
bool bool
default y if PCI_DEVICES
depends on VIRTIO_PCI
select VGA
config DPCD config DPCD
bool bool

View File

@ -7,6 +7,7 @@ config IDE_QDEV
config IDE_PCI config IDE_PCI
bool bool
depends on PCI
select IDE_CORE select IDE_CORE
config IDE_ISA config IDE_ISA
@ -42,6 +43,8 @@ config MICRODRIVE
config AHCI config AHCI
bool bool
default y if PCI_DEVICES
depends on PCI
select IDE_QDEV select IDE_QDEV
config IDE_SII3112 config IDE_SII3112

View File

@ -1,2 +1,4 @@
config IPACK config IPACK
bool bool
default y if PCI_DEVICES
depends on PCI

View File

@ -21,9 +21,13 @@ config ISA_TESTDEV
config PCI_TESTDEV config PCI_TESTDEV
bool bool
default y if TEST_DEVICES
depends on PCI
config EDU config EDU
bool bool
default y if TEST_DEVICES
depends on PCI
config PCA9552 config PCA9552
bool bool
@ -48,7 +52,7 @@ config MACIO
config IVSHMEM_DEVICE config IVSHMEM_DEVICE
bool bool
default y default y if PCI_DEVICES
depends on PCI && LINUX && IVSHMEM depends on PCI && LINUX && IVSHMEM
config ECCMEMCTL config ECCMEMCTL

View File

@ -3,27 +3,42 @@ config DP8393X
config NE2000_PCI config NE2000_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
config EEPRO100_PCI config EEPRO100_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
config PCNET_PCI config PCNET_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
select PCNET_COMMON
config PCNET_COMMON config PCNET_COMMON
bool bool
config E1000_PCI config E1000_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
config E1000E_PCI_EXPRESS config E1000E_PCI_EXPRESS
bool bool
default y if PCI_DEVICES
depends on PCI_EXPRESS
config RTL8139_PCI config RTL8139_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
config VMXNET3_PCI config VMXNET3_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
config SMC91C111 config SMC91C111
bool bool
@ -81,12 +96,20 @@ config ETSEC
config ROCKER config ROCKER
bool bool
default y if PCI_DEVICES
depends on PCI
config CAN_BUS config CAN_BUS
bool bool
config CAN_PCI config CAN_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
select CAN_BUS
config CAN_SJA1000 config CAN_SJA1000
bool bool
default y if PCI_DEVICES
depends on PCI
select CAN_BUS

View File

@ -1,17 +1,25 @@
config PCIE_PORT config PCIE_PORT
bool bool
default y if PCI_DEVICES
depends on PCI_EXPRESS
config PXB config PXB
bool bool
config XIO3130 config XIO3130
bool bool
default y if PCI_DEVICES
depends on PCI_EXPRESS
config IOH3420 config IOH3420
bool bool
default y if PCI_DEVICES
depends on PCI_EXPRESS
config I82801B11 config I82801B11
bool bool
default y if PCI_DEVICES
depends on PCI_EXPRESS
config DEC_PCI config DEC_PCI
bool bool

View File

@ -2,21 +2,27 @@ config PAM
bool bool
config PREP_PCI config PREP_PCI
select PCI
bool bool
config GRACKLE_PCI config GRACKLE_PCI
select PCI
bool bool
config UNIN_PCI config UNIN_PCI
select PCI
bool bool
config PPCE500_PCI config PPCE500_PCI
select PCI
bool bool
config VERSATILE_PCI config VERSATILE_PCI
select PCI
bool bool
config PCI_SABRE config PCI_SABRE
select PCI
bool bool
config PCI_PIIX config PCI_PIIX
@ -24,12 +30,16 @@ config PCI_PIIX
config PCI_EXPRESS_Q35 config PCI_EXPRESS_Q35
bool bool
select PCI_EXPRESS
config PCI_EXPRESS_GENERIC_BRIDGE config PCI_EXPRESS_GENERIC_BRIDGE
bool bool
select PCI_EXPRESS
config PCI_EXPRESS_XILINX config PCI_EXPRESS_XILINX
bool bool
select PCI_EXPRESS
config PCI_EXPRESS_DESIGNWARE config PCI_EXPRESS_DESIGNWARE
bool bool
select PCI_EXPRESS

View File

@ -4,3 +4,6 @@ config PCI
config PCI_EXPRESS config PCI_EXPRESS
bool bool
select PCI select PCI
config PCI_DEVICES
bool

View File

@ -3,21 +3,32 @@ config SCSI
config LSI_SCSI_PCI config LSI_SCSI_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
config MPTSAS_SCSI_PCI config MPTSAS_SCSI_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
config MEGASAS_SCSI_PCI config MEGASAS_SCSI_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
config VMW_PVSCSI_SCSI_PCI config VMW_PVSCSI_SCSI_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
config ESP config ESP
bool bool
config ESP_PCI config ESP_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
select ESP
config SPAPR_VSCSI config SPAPR_VSCSI
bool bool

View File

@ -9,3 +9,6 @@ config SD
config SDHCI config SDHCI
bool bool
default y if PCI_DEVICES
depends on PCI
select SD

View File

@ -3,21 +3,31 @@ config USB
config USB_UHCI config USB_UHCI
bool bool
default y if PCI_DEVICES
depends on PCI
config USB_OHCI config USB_OHCI
bool bool
default y if PCI_DEVICES
depends on PCI
config USB_EHCI config USB_EHCI
bool bool
default y if PCI_DEVICES
depends on PCI
config USB_EHCI_SYSBUS config USB_EHCI_SYSBUS
bool bool
config USB_XHCI config USB_XHCI
bool bool
default y if PCI_DEVICES
depends on PCI
config USB_XHCI_NEC config USB_XHCI_NEC
bool bool
default y if PCI_DEVICES
depends on PCI
config USB_MUSB config USB_MUSB
bool bool

View File

@ -6,6 +6,9 @@ config VIRTIO_RNG
config VIRTIO_PCI config VIRTIO_PCI
bool bool
default y if PCI_DEVICES
depends on PCI
select VIRTIO
config VIRTIO_MMIO config VIRTIO_MMIO
bool bool

View File

@ -3,6 +3,8 @@ config CMSDK_APB_WATCHDOG
config WDT_IB6300ESB config WDT_IB6300ESB
bool bool
default y if PCI_DEVICES
depends on PCI
config WDT_IB700 config WDT_IB700
bool bool