kconfig: introduce kconfig files

The Kconfig files were generated mostly with this script:

  for i in `grep -ho CONFIG_[A-Z0-9_]* default-configs/* | sort -u`; do
    set fnord `git grep -lw $i -- 'hw/*/Makefile.objs' `
    shift
    if test $# = 1; then
      cat >> $(dirname $1)/Kconfig << EOF
config ${i#CONFIG_}
    bool

EOF
      git add $(dirname $1)/Kconfig
    else
      echo $i $*
    fi
  done
  sed -i '$d' hw/*/Kconfig
  for i in hw/*; do
    if test -d $i && ! test -f $i/Kconfig; then
      touch $i/Kconfig
      git add $i/Kconfig
    fi
  done

Whenever a symbol is referenced from multiple subdirectories, the
script prints the list of directories that reference the symbol.
These symbols have to be added manually to the Kconfig files.

Kconfig.host and hw/Kconfig were created manually.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20190123065618.3520-27-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2019-01-23 14:56:00 +08:00
parent 06266ecda7
commit 82f5181777
63 changed files with 1337 additions and 3 deletions

26
Kconfig.host Normal file
View File

@ -0,0 +1,26 @@
# These are "proxy" symbols used to pass config-host.mak values
# down to Kconfig.
config KVM
bool
config LINUX
bool
config OPENGL
bool
config SPICE
bool
config TPM
bool
config VHOST_USER
bool
config XEN
bool
config VIRTFS
bool

2
hw/9pfs/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config VIRTIO_9P
bool

68
hw/Kconfig Normal file
View File

@ -0,0 +1,68 @@
# devices Kconfig
source 9pfs/Kconfig
source acpi/Kconfig
source adc/Kconfig
source audio/Kconfig
source block/Kconfig
source bt/Kconfig
source char/Kconfig
source core/Kconfig
source display/Kconfig
source dma/Kconfig
source gpio/Kconfig
source hyperv/Kconfig
source i2c/Kconfig
source ide/Kconfig
source input/Kconfig
source intc/Kconfig
source ipack/Kconfig
source ipmi/Kconfig
source isa/Kconfig
source mem/Kconfig
source misc/Kconfig
source net/Kconfig
source nvram/Kconfig
source pci-bridge/Kconfig
source pci-host/Kconfig
source pcmcia/Kconfig
source pci/Kconfig
source scsi/Kconfig
source sd/Kconfig
source smbios/Kconfig
source ssi/Kconfig
source timer/Kconfig
source tpm/Kconfig
source usb/Kconfig
source virtio/Kconfig
source vfio/Kconfig
source watchdog/Kconfig
# arch Kconfig
source arm/Kconfig
source alpha/Kconfig
source cris/Kconfig
source hppa/Kconfig
source i386/Kconfig
source lm32/Kconfig
source m68k/Kconfig
source microblaze/Kconfig
source mips/Kconfig
source moxie/Kconfig
source nios2/Kconfig
source openrisc/Kconfig
source ppc/Kconfig
source riscv/Kconfig
source s390x/Kconfig
source sh4/Kconfig
source sparc/Kconfig
source sparc64/Kconfig
source tricore/Kconfig
source unicore32/Kconfig
source xtensa/Kconfig
# Symbols used by multiple targets
config XILINX
bool
config XILINX_AXI
bool

20
hw/acpi/Kconfig Normal file
View File

@ -0,0 +1,20 @@
config ACPI
bool
config ACPI_X86
bool
config ACPI_X86_ICH
bool
config ACPI_CPU_HOTPLUG
bool
config ACPI_MEMORY_HOTPLUG
bool
config ACPI_NVDIMM
bool
config ACPI_VMGENID
bool

2
hw/adc/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config STM32F2XX_ADC
bool

2
hw/alpha/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config DP264
bool

119
hw/arm/Kconfig Normal file
View File

@ -0,0 +1,119 @@
config ARM_VIRT
bool
config DIGIC
bool
config EXYNOS4
bool
config HIGHBANK
bool
config INTEGRATOR
bool
config MAINSTONE
bool
config MUSICPAL
bool
config NETDUINO2
bool
config NSERIES
bool
config OMAP
bool
config PXA2XX
bool
config REALVIEW
bool
config STELLARIS
bool
config STRONGARM
bool
config VERSATILE
bool
config ZYNQ
bool
config ARM_V7M
bool
config ALLWINNER_A10
bool
config RASPI
bool
config STM32F205_SOC
bool
config XLNX_ZYNQMP_ARM
bool
config XLNX_VERSAL
bool
config FSL_IMX25
bool
config FSL_IMX31
bool
config FSL_IMX6
bool
config ASPEED_SOC
bool
config MPS2
bool
config FSL_IMX7
bool
config ARM_SMMUV3
bool
config FSL_IMX6UL
bool
config NRF51_SOC
bool
config MSF2
bool
config ZAURUS
bool
config A9MPCORE
bool
config A15MPCORE
bool
config ARM11MPCORE
bool
config ARMSSE
bool
config ARMSSE_CPUID
bool
config ARMSSE_MHU
bool
config MUSCA
bool

35
hw/audio/Kconfig Normal file
View File

@ -0,0 +1,35 @@
config SB16
bool
config ES1370
bool
config AC97
bool
config ADLIB
bool
config GUS
bool
config CS4231A
bool
config HDA
bool
config PCSPK
bool
config WM8750
bool
config PL041
bool
config CS4231
bool
config MARVELL_88W8618
bool

29
hw/block/Kconfig Normal file
View File

@ -0,0 +1,29 @@
config FDC
bool
config SSI_M25P80
bool
config NAND
bool
config PFLASH_CFI01
bool
config PFLASH_CFI02
bool
config ECC
bool
config ONENAND
bool
config NVME_PCI
bool
config VIRTIO_BLK
bool
config VHOST_USER_BLK
bool

2
hw/bt/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config BLUETOOTH
bool

32
hw/char/Kconfig Normal file
View File

@ -0,0 +1,32 @@
config ESCC
bool
config PARALLEL
bool
config PL011
bool
config SERIAL
bool
config SERIAL_ISA
bool
config SERIAL_PCI
bool
config VIRTIO_SERIAL
bool
config STM32F2XX_USART
bool
config CMSDK_APB_UART
bool
config SCLPCONSOLE
bool
config TERMINAL3270
bool

11
hw/core/Kconfig Normal file
View File

@ -0,0 +1,11 @@
config EMPTY_SLOT
bool
config PTIMER
bool
config FITLOADER
bool
config PLATFORM_BUS
bool

8
hw/cpu/Kconfig Normal file
View File

@ -0,0 +1,8 @@
config ARM11MPCORE
bool
config A9MPCORE
bool
config A15MPCORE
bool

5
hw/cris/Kconfig Normal file
View File

@ -0,0 +1,5 @@
config AXIS
bool
config ETRAXFS
bool

77
hw/display/Kconfig Normal file
View File

@ -0,0 +1,77 @@
config EDID
bool
config FW_CFG_DMA
bool
config ADS7846
bool
config VGA_CIRRUS
bool
config G364FB
bool
config JAZZ_LED
bool
config PL110
bool
config SII9022
bool
config SSD0303
bool
config SSD0323
bool
config VGA_PCI
bool
config VGA_ISA
bool
config VGA_ISA_MM
bool
config VMWARE_VGA
bool
config BOCHS_DISPLAY
bool
config BLIZZARD
bool
config FRAMEBUFFER
bool
config MILKYMIST_TMU2
bool
config SM501
bool
config TCX
bool
config CG3
bool
config VGA
bool
config QXL
bool
config VIRTIO_GPU
bool
config VIRTIO_VGA
bool
config DPCD
bool

20
hw/dma/Kconfig Normal file
View File

@ -0,0 +1,20 @@
config RC4030
bool
config PL080
bool
config PL330
bool
config I82374
bool
config I8257
bool
config ZYNQ_DEVCFG
bool
config STP2000
bool

8
hw/gpio/Kconfig Normal file
View File

@ -0,0 +1,8 @@
config MAX7310
bool
config PL061
bool
config GPIO_KEY
bool

2
hw/hppa/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config DINO
bool

5
hw/hyperv/Kconfig Normal file
View File

@ -0,0 +1,5 @@
config HYPERV
bool
config HYPERV_TESTDEV
bool

20
hw/i2c/Kconfig Normal file
View File

@ -0,0 +1,20 @@
config I2C
bool
config SMBUS_EEPROM
bool
config DDC
bool
config VERSATILE_I2C
bool
config ACPI_SMBUS
bool
config BITBANG_I2C
bool
config IMX_I2C
bool

23
hw/i386/Kconfig Normal file
View File

@ -0,0 +1,23 @@
config SEV
bool
config I440FX
bool
config ISAPC
bool
config Q35
bool
config VTD
bool
config AMD_IOMMU
bool
config VMPORT
bool
config VMMOUSE
bool

35
hw/ide/Kconfig Normal file
View File

@ -0,0 +1,35 @@
config IDE_CORE
bool
config IDE_QDEV
bool
config IDE_PCI
bool
config IDE_ISA
bool
config IDE_PIIX
bool
config IDE_CMD646
bool
config IDE_MACIO
bool
config IDE_MMIO
bool
config IDE_VIA
bool
config MICRODRIVE
bool
config AHCI
bool
config IDE_SII3112
bool

23
hw/input/Kconfig Normal file
View File

@ -0,0 +1,23 @@
config ADB
bool
config LM832X
bool
config PCKBD
bool
config PL050
bool
config STELLARIS_INPUT
bool
config TSC2005
bool
config VIRTIO_INPUT
bool
config TSC210X
bool

47
hw/intc/Kconfig Normal file
View File

@ -0,0 +1,47 @@
config HEATHROW_PIC
bool
config I8259
bool
config PL190
bool
config IOAPIC
bool
config ARM_GIC
bool
config OPENPIC
bool
config APIC
bool
config ARM_GIC_KVM
bool
config OPENPIC_KVM
bool
config XICS
bool
config XICS_SPAPR
bool
config XICS_KVM
bool
config ALLWINNER_A10_PIC
bool
config S390_FLIC
bool
config S390_FLIC_KVM
bool
config OMPIC
bool

2
hw/ipack/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config IPACK
bool

14
hw/ipmi/Kconfig Normal file
View File

@ -0,0 +1,14 @@
config IPMI
bool
config IPMI_LOCAL
bool
config IPMI_EXTERN
bool
config ISA_IPMI_KCS
bool
config ISA_IPMI_BT
bool

23
hw/isa/Kconfig Normal file
View File

@ -0,0 +1,23 @@
config ISA_BUS
bool
config APM
bool
config I82378
bool
config PC87312
bool
config PIIX4
bool
config VT82C686
bool
config SMC37C669
bool
config LPC_ICH9
bool

5
hw/lm32/Kconfig Normal file
View File

@ -0,0 +1,5 @@
config LM32
bool
config MILKYMIST
bool

8
hw/m68k/Kconfig Normal file
View File

@ -0,0 +1,8 @@
config AN5206
bool
config MCF5206
bool
config MCF5208
bool

8
hw/mem/Kconfig Normal file
View File

@ -0,0 +1,8 @@
config DIMM
bool
config MEM_DEVICE
bool
config NVDIMM
bool

8
hw/microblaze/Kconfig Normal file
View File

@ -0,0 +1,8 @@
config PETALOGIX_S3ADSP1800
bool
config PETALOGIX_ML605
bool
config XLNX_ZYNQMP_PMU
bool

20
hw/mips/Kconfig Normal file
View File

@ -0,0 +1,20 @@
config R4K
bool
config MALTA
bool
config MIPSSIM
bool
config JAZZ
bool
config FULONG
bool
config MIPS_CPS
bool
config MIPS_BOSTON
bool

94
hw/misc/Kconfig Normal file
View File

@ -0,0 +1,94 @@
config APPLESMC
bool
config MAX111X
bool
config TMP105
bool
config TMP421
bool
config ISA_DEBUG
bool
config SGA
bool
config ISA_TESTDEV
bool
config PCI_TESTDEV
bool
config EDU
bool
config PCA9552
bool
config PL310
bool
config INTEGRATOR_DEBUG
bool
config A9SCU
bool
config ARM11SCU
bool
config MOS6522
bool
config MACIO
bool
config IVSHMEM_DEVICE
bool
config ECCMEMCTL
bool
config IMX
bool
config STM32F2XX_SYSCFG
bool
config MIPS_ITU
bool
config MPS2_FPGAIO
bool
config MPS2_SCC
bool
config TZ_MPC
bool
config TZ_MSC
bool
config TZ_PPC
bool
config IOTKIT_SECCTL
bool
config IOTKIT_SYSCTL
bool
config IOTKIT_SYSINFO
bool
config PVPANIC
bool
config AUX
bool
source macio/Kconfig

11
hw/misc/macio/Kconfig Normal file
View File

@ -0,0 +1,11 @@
config CUDA
bool
config MAC_PMU
bool
config MAC_DBDMA
bool
config MACIO_GPIO
bool

2
hw/moxie/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config MOXIESIM
bool

92
hw/net/Kconfig Normal file
View File

@ -0,0 +1,92 @@
config DP8393X
bool
config NE2000_PCI
bool
config EEPRO100_PCI
bool
config PCNET_PCI
bool
config PCNET_COMMON
bool
config E1000_PCI
bool
config E1000E_PCI_EXPRESS
bool
config RTL8139_PCI
bool
config VMXNET3_PCI
bool
config SMC91C111
bool
config LAN9118
bool
config NE2000_ISA
bool
config OPENCORES_ETH
bool
config XGMAC
bool
config MIPSNET
bool
config ALLWINNER_EMAC
bool
config IMX_FEC
bool
config CADENCE
bool
config STELLARIS_ENET
bool
config LANCE
bool
config SUNHME
bool
config FTGMAC100
bool
config SUNGEM
bool
config COLDFIRE
bool
config XILINX_ETHLITE
bool
config VIRTIO_NET
bool
config ETSEC
bool
config ROCKER
bool
config CAN_BUS
bool
config CAN_PCI
bool
config CAN_SJA1000
bool

5
hw/nios2/Kconfig Normal file
View File

@ -0,0 +1,5 @@
config NIOS2_10M50
bool
config NIOS2
bool

8
hw/nvram/Kconfig Normal file
View File

@ -0,0 +1,8 @@
config DS1225Y
bool
config AT24C
bool
config MAC_NVRAM
bool

2
hw/openrisc/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config OR1K_SIM
bool

20
hw/pci-bridge/Kconfig Normal file
View File

@ -0,0 +1,20 @@
config PCIE_PORT
bool
config PXB
bool
config XIO3130
bool
config IOH3420
bool
config I82801B11
bool
config DEC_PCI
bool
config SIMBA
bool

35
hw/pci-host/Kconfig Normal file
View File

@ -0,0 +1,35 @@
config PAM
bool
config PREP_PCI
bool
config GRACKLE_PCI
bool
config UNIN_PCI
bool
config PPCE500_PCI
bool
config VERSATILE_PCI
bool
config PCI_SABRE
bool
config PCI_PIIX
bool
config PCI_EXPRESS_Q35
bool
config PCI_EXPRESS_GENERIC_BRIDGE
bool
config PCI_EXPRESS_XILINX
bool
config PCI_EXPRESS_DESIGNWARE
bool

2
hw/pci/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config PCI
bool

2
hw/pcmcia/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config PCMCIA
bool

44
hw/ppc/Kconfig Normal file
View File

@ -0,0 +1,44 @@
config PSERIES
bool
config SPAPR_RNG
bool
config POWERNV
bool
config PPC405
bool
config PPC440
bool
config PPC4XX
bool
config SAM460EX
bool
config PREP
bool
config RS6000_MC
bool
config MAC_OLDWORLD
bool
config MAC_NEWWORLD
bool
config E500
bool
config VIRTEX
bool
config XIVE
bool
config XIVE_SPAPR
bool

20
hw/riscv/Kconfig Normal file
View File

@ -0,0 +1,20 @@
config HTIF
bool
config HART
bool
config SIFIVE
bool
config SIFIVE_E
bool
config SIFIVE_U
bool
config SPIKE
bool
config RISCV_VIRT
bool

2
hw/s390x/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config S390_CCW_VIRTIO
bool

26
hw/scsi/Kconfig Normal file
View File

@ -0,0 +1,26 @@
config SCSI
bool
config LSI_SCSI_PCI
bool
config MPTSAS_SCSI_PCI
bool
config MEGASAS_SCSI_PCI
bool
config VMW_PVSCSI_SCSI_PCI
bool
config ESP
bool
config ESP_PCI
bool
config VIRTIO_SCSI
bool
config VHOST_USER_SCSI
bool

11
hw/sd/Kconfig Normal file
View File

@ -0,0 +1,11 @@
config PL181
bool
config SSI_SD
bool
config SD
bool
config SDHCI
bool

11
hw/sh4/Kconfig Normal file
View File

@ -0,0 +1,11 @@
config R2D
bool
config SHIX
bool
config SH7750
bool
config SH4
bool

2
hw/smbios/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config SMBIOS
bool

11
hw/sparc/Kconfig Normal file
View File

@ -0,0 +1,11 @@
config SUN4M
bool
config LEON3
bool
config GRLIB
bool
config SLAVIO
bool

5
hw/sparc64/Kconfig Normal file
View File

@ -0,0 +1,5 @@
config SUN4U
bool
config NIAGARA
bool

14
hw/ssi/Kconfig Normal file
View File

@ -0,0 +1,14 @@
config PL022
bool
config SSI
bool
config XILINX_SPI
bool
config XILINX_SPIPS
bool
config STM32F2XX_SPI
bool

53
hw/timer/Kconfig Normal file
View File

@ -0,0 +1,53 @@
config ARM_TIMER
bool
config ARM_MPTIMER
bool
config A9_GTIMER
bool
config DS1338
bool
config HPET
bool
config I8254
bool
config M41T80
bool
config M48T59
bool
config PL031
bool
config TWL92230
bool
config XLNX_ZYNQMP
bool
config ALTERA_TIMER
bool
config MC146818RTC
bool
config ALLWINNER_A10_PIT
bool
config STM32F2XX_TIMER
bool
config SUN4V_RTC
bool
config CMSDK_APB_TIMER
bool
config CMSDK_APB_DUALTIMER
bool

14
hw/tpm/Kconfig Normal file
View File

@ -0,0 +1,14 @@
config TPM
bool
config TPM_TIS
bool
config TPM_CRB
bool
config TPM_PASSTHROUGH
bool
config TPM_EMULATOR
bool

2
hw/tricore/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config TRICORE
bool

2
hw/unicore32/Kconfig Normal file
View File

@ -0,0 +1,2 @@
config PUV3
bool

53
hw/usb/Kconfig Normal file
View File

@ -0,0 +1,53 @@
config USB
bool
config USB_UHCI
bool
config USB_OHCI
bool
config USB_EHCI
bool
config USB_EHCI_SYSBUS
bool
config USB_XHCI
bool
config USB_XHCI_NEC
bool
config USB_MUSB
bool
config TUSB6010
bool
config USB_TABLET_WACOM
bool
config USB_STORAGE_BOT
bool
config USB_STORAGE_UAS
bool
config USB_AUDIO
bool
config USB_SERIAL
bool
config USB_NETWORK
bool
config USB_BLUETOOTH
bool
config USB_SMARTCARD
bool
config USB_STORAGE_MTP
bool

20
hw/vfio/Kconfig Normal file
View File

@ -0,0 +1,20 @@
config VFIO
bool
config VFIO_PCI
bool
config VFIO_CCW
bool
config VFIO_PLATFORM
bool
config VFIO_XGMAC
bool
config VFIO_AMD_XGBE
bool
config VFIO_AP
bool

17
hw/virtio/Kconfig Normal file
View File

@ -0,0 +1,17 @@
config VIRTIO
bool
config VIRTIO_RNG
bool
config VIRTIO_PCI
bool
config VIRTIO_MMIO
bool
config VIRTIO_BALLOON
bool
config VIRTIO_CRYPTO
bool

11
hw/watchdog/Kconfig Normal file
View File

@ -0,0 +1,11 @@
config CMSDK_APB_WATCHDOG
bool
config WDT_IB6300ESB
bool
config WDT_IB700
bool
config WDT_DIAG288
bool

5
hw/xtensa/Kconfig Normal file
View File

@ -0,0 +1,5 @@
config XTENSA_SIM
bool
config XTENSA_FPGA
bool

View File

@ -13,6 +13,7 @@
from __future__ import print_function
import os
import sys
import re
__all__ = [ 'KconfigDataError', 'KconfigParserError',
'KconfigData', 'KconfigParser' ]
@ -350,6 +351,12 @@ class KconfigParser:
self.get_token()
self.parse_config()
def do_assignment(self, var, val):
if not var.startswith("CONFIG_"):
raise Error('assigned variable should start with CONFIG_')
var = self.data.do_var(var[7:])
self.data.do_assignment(var, val)
# file management -----
def error_path(self):
@ -645,6 +652,28 @@ class KconfigParser:
return None
if __name__ == '__main__':
fname = len(sys.argv) > 1 and sys.argv[1] or 'Kconfig.test'
data = KconfigParser.parse(open(fname, 'r'))
print data.compute_config()
argv = sys.argv
if len(argv) == 1:
print ("%s: at least one argument is required" % argv[0], file=sys.stderr)
sys.exit(1)
data = KconfigData()
parser = KconfigParser(data)
for arg in argv[3:]:
m = re.match(r'^(CONFIG_[A-Z0-9_]+)=([yn]?)$', arg)
if m is not None:
name, value = m.groups()
parser.do_assignment(name, value == 'y')
else:
fp = open(arg, 'r')
parser.parse_file(fp)
fp.close()
config = data.compute_config()
for key in sorted(config.keys()):
print ('CONFIG_%s=%s' % (key, ('y' if config[key] else 'n')))
deps = open(argv[2], 'w')
for fname in data.previously_included:
print ('%s: %s' % (argv[1], fname), file=deps)
deps.close()