qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 25/27] kconfig: express dependency of individual boards on libfdt
Date: Sun, 12 May 2024 12:49:43 +0200	[thread overview]
Message-ID: <20240512104945.130198-26-pbonzini@redhat.com> (raw)
In-Reply-To: <20240512104945.130198-1-pbonzini@redhat.com>

Now that boards are enabled by default and the "CONFIG_FOO=y"
entries are gone from configs/devices/, there cannot be any more
a conflicts between the default contents of configs/devices/
and a failed "depends on" clause.

With this change, each individual board or target can express
whether it needs FDT.  It can then include the common code in the
build via "select DEVICE_TREE", which will also as tell meson to link
with libfdt.

This allows building non-microvm x86 emulators without having
libfdt available.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Kconfig.host              |  1 -
 hw/arm/Kconfig            |  5 +++++
 hw/i386/Kconfig           |  3 ++-
 hw/loongarch/Kconfig      |  3 ++-
 hw/mips/Kconfig           |  3 ++-
 hw/openrisc/Kconfig       |  2 ++
 hw/ppc/Kconfig            | 15 ++++++++-------
 hw/riscv/Kconfig          |  4 ++++
 hw/rx/Kconfig             |  3 ++-
 hw/xtensa/Kconfig         |  1 +
 target/arm/Kconfig        |  2 ++
 target/microblaze/Kconfig |  1 +
 target/openrisc/Kconfig   |  1 +
 target/riscv/Kconfig      |  2 ++
 14 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/Kconfig.host b/Kconfig.host
index a0d4a52131e..17f405004b3 100644
--- a/Kconfig.host
+++ b/Kconfig.host
@@ -25,7 +25,6 @@ config TPM
 
 config FDT
     bool
-    select DEVICE_TREE
 
 config VHOST_USER
     bool
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 98c264ed219..8b97683a45e 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -15,6 +15,7 @@ config ARM_VIRT
     select ACPI
     select ARM_SMMUV3
     select GPIO_KEY
+    select DEVICE_TREE
     select FW_CFG_DMA
     select PCI_EXPRESS
     select PCI_EXPRESS_GENERIC_BRIDGE
@@ -265,6 +266,7 @@ config SBSA_REF
     default y
     depends on TCG && AARCH64
     imply PCI_DEVICES
+    select DEVICE_TREE
     select AHCI
     select ARM_SMMUV3
     select GPIO_KEY
@@ -347,6 +349,7 @@ config VEXPRESS
     bool
     default y
     depends on TCG && ARM
+    select DEVICE_TREE
     select A9MPCORE
     select A15MPCORE
     select ARM_MPTIMER
@@ -492,6 +495,7 @@ config XLNX_ZYNQMP_ARM
     select CPU_CLUSTER
     select DDC
     select DPCD
+    select DEVICE_TREE
     select SDHCI
     select SSI
     select SSI_M25P80
@@ -509,6 +513,7 @@ config XLNX_VERSAL
     depends on TCG && AARCH64
     select ARM_GIC
     select CPU_CLUSTER
+    select DEVICE_TREE
     select PL011
     select CADENCE
     select VIRTIO_MMIO
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index 40b1e445808..f4a33b6c082 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -115,7 +115,8 @@ config Q35
 config MICROVM
     bool
     default y
-    depends on I386
+    depends on I386 && FDT
+    select DEVICE_TREE
     select SERIAL_ISA # for serial_hds_isa_init()
     select ISA_BUS
     select APIC
diff --git a/hw/loongarch/Kconfig b/hw/loongarch/Kconfig
index ad77502445a..90a0dba9d59 100644
--- a/hw/loongarch/Kconfig
+++ b/hw/loongarch/Kconfig
@@ -1,7 +1,8 @@
 config LOONGARCH_VIRT
     bool
     default y
-    depends on LOONGARCH64
+    depends on LOONGARCH64 && FDT
+    select DEVICE_TREE
     select PCI
     select PCI_EXPRESS_GENERIC_BRIDGE
     imply VIRTIO_VGA
diff --git a/hw/mips/Kconfig b/hw/mips/Kconfig
index 9bccb363eb9..a7f26edebe8 100644
--- a/hw/mips/Kconfig
+++ b/hw/mips/Kconfig
@@ -80,9 +80,10 @@ config MIPS_CPS
 config MIPS_BOSTON
     bool
     default y
-    depends on MIPS64 && !TARGET_BIG_ENDIAN
+    depends on MIPS64 && !TARGET_BIG_ENDIAN && FDT
     imply PCI_DEVICES
     imply TEST_DEVICES
+    select DEVICE_TREE
     select FITLOADER
     select MIPS_CPS
     select PCI_EXPRESS_XILINX
diff --git a/hw/openrisc/Kconfig b/hw/openrisc/Kconfig
index 9c9015e0a5d..76b953c62c2 100644
--- a/hw/openrisc/Kconfig
+++ b/hw/openrisc/Kconfig
@@ -2,6 +2,7 @@ config OR1K_SIM
     bool
     default y
     depends on OPENRISC
+    select DEVICE_TREE
     select SERIAL
     select OPENCORES_ETH
     select OMPIC
@@ -14,6 +15,7 @@ config OR1K_VIRT
     imply PCI_DEVICES
     imply VIRTIO_VGA
     imply TEST_DEVICES
+    select DEVICE_TREE
     select PCI
     select PCI_EXPRESS_GENERIC_BRIDGE
     select GOLDFISH_RTC
diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig
index 78f83e78ce5..347212f4dba 100644
--- a/hw/ppc/Kconfig
+++ b/hw/ppc/Kconfig
@@ -1,7 +1,7 @@
 config PSERIES
     bool
     default y
-    depends on PPC64
+    depends on PPC64 && FDT
     imply USB_OHCI_PCI
     imply PCI_DEVICES
     imply TEST_DEVICES
@@ -26,7 +26,7 @@ config SPAPR_RNG
 config POWERNV
     bool
     default y
-    depends on PPC64
+    depends on PPC64 && FDT
     imply PCI_DEVICES
     imply TEST_DEVICES
     select ISA_IPMI_BT
@@ -52,7 +52,7 @@ config PPC405
 config PPC440
     bool
     default y
-    depends on PPC
+    depends on PPC && FDT
     imply PCI_DEVICES
     imply TEST_DEVICES
     imply E1000_PCI
@@ -71,7 +71,7 @@ config PPC4XX
 config SAM460EX
     bool
     default y
-    depends on PPC
+    depends on PPC && FDT
     select PFLASH_CFI01
     select IDE_SII3112
     select M41T80
@@ -168,19 +168,19 @@ config E500
 config E500PLAT
     bool
     default y
-    depends on PPC
+    depends on PPC && FDT
     select E500
 
 config MPC8544DS
     bool
     default y
-    depends on PPC
+    depends on PPC && FDT
     select E500
 
 config VIRTEX
     bool
     default y
-    depends on PPC
+    depends on PPC && FDT
     select PPC4XX
     select PFLASH_CFI01
     select SERIAL
@@ -193,6 +193,7 @@ config FW_CFG_PPC
     bool
 
 config FDT_PPC
+    select DEVICE_TREE
     bool
 
 config VOF
diff --git a/hw/riscv/Kconfig b/hw/riscv/Kconfig
index 5f5f9e31bb0..a2030e3a6ff 100644
--- a/hw/riscv/Kconfig
+++ b/hw/riscv/Kconfig
@@ -12,6 +12,7 @@ config MICROCHIP_PFSOC
     depends on RISCV64
     select CADENCE_SDHCI
     select CPU_CLUSTER
+    select DEVICE_TREE
     select MCHP_PFSOC_DMC
     select MCHP_PFSOC_IOSCB
     select MCHP_PFSOC_MMUART
@@ -37,6 +38,7 @@ config RISCV_VIRT
     imply VIRTIO_VGA
     imply TEST_DEVICES
     imply TPM_TIS_SYSBUS
+    select DEVICE_TREE
     select RISCV_NUMA
     select GOLDFISH_RTC
     select PCI
@@ -82,6 +84,7 @@ config SIFIVE_U
     depends on RISCV32 || RISCV64
     select CADENCE
     select CPU_CLUSTER
+    select DEVICE_TREE
     select RISCV_ACLINT
     select SIFIVE_GPIO
     select SIFIVE_PDMA
@@ -99,6 +102,7 @@ config SPIKE
     bool
     default y
     depends on RISCV32 || RISCV64
+    select DEVICE_TREE
     select RISCV_NUMA
     select HTIF
     select RISCV_ACLINT
diff --git a/hw/rx/Kconfig b/hw/rx/Kconfig
index b2fa2b7eec3..aa9242d1ef6 100644
--- a/hw/rx/Kconfig
+++ b/hw/rx/Kconfig
@@ -8,5 +8,6 @@ config RX62N_MCU
 config RX_GDBSIM
     bool
     default y
-    depends on RX
+    depends on RX && FDT
+    select DEVICE_TREE
     select RX62N_MCU
diff --git a/hw/xtensa/Kconfig b/hw/xtensa/Kconfig
index 443b415c2ba..8ea283a7a3b 100644
--- a/hw/xtensa/Kconfig
+++ b/hw/xtensa/Kconfig
@@ -15,6 +15,7 @@ config XTENSA_XTFPGA
     bool
     default y
     depends on XTENSA
+    imply DEVICE_TREE
     select OPENCORES_ETH
     select PFLASH_CFI01
     select SERIAL
diff --git a/target/arm/Kconfig b/target/arm/Kconfig
index 5847c5a74a7..7f8a2217ae1 100644
--- a/target/arm/Kconfig
+++ b/target/arm/Kconfig
@@ -6,6 +6,8 @@ config ARM
     # translate.c v7m helpers under ARM_V7M.
     select ARM_V7M if TCG
 
+    select DEVICE_TREE # needed by boot.c
+
 config AARCH64
     bool
     select ARM
diff --git a/target/microblaze/Kconfig b/target/microblaze/Kconfig
index a5410d9218d..e91d58d88f2 100644
--- a/target/microblaze/Kconfig
+++ b/target/microblaze/Kconfig
@@ -1,2 +1,3 @@
 config MICROBLAZE
     bool
+    select DEVICE_TREE # needed by boot.c
diff --git a/target/openrisc/Kconfig b/target/openrisc/Kconfig
index e0da4ac1dfc..cd66c2e3b6c 100644
--- a/target/openrisc/Kconfig
+++ b/target/openrisc/Kconfig
@@ -1,2 +1,3 @@
 config OPENRISC
     bool
+    select DEVICE_TREE # needed by boot.c
diff --git a/target/riscv/Kconfig b/target/riscv/Kconfig
index adb7de3f37d..5f30df22f2f 100644
--- a/target/riscv/Kconfig
+++ b/target/riscv/Kconfig
@@ -1,7 +1,9 @@
 config RISCV32
     bool
     select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
+    select DEVICE_TREE # needed by boot.c
 
 config RISCV64
     bool
     select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
+    select DEVICE_TREE # needed by boot.c
-- 
2.45.0



  parent reply	other threads:[~2024-05-12 10:52 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-12 10:49 [PULL 00/27] Build/arch cleanups, target/i386 fixes for 2024-05-10 Paolo Bonzini
2024-05-12 10:49 ` [PULL 01/27] target/i386: remove PCOMMIT from TCG, deprecate property Paolo Bonzini
2024-05-12 10:49 ` [PULL 02/27] target/i386: fix operand size for DATA16 REX.W POPCNT Paolo Bonzini
2024-05-12 10:49 ` [PULL 03/27] target/i386: rdpkru/wrpkru are no-prefix instructions Paolo Bonzini
2024-05-12 10:49 ` [PULL 04/27] target/i386: move prefetch and multi-byte UD/NOP to new decoder Paolo Bonzini
2024-05-12 10:49 ` [PULL 05/27] target/i386: fix feature dependency for WAITPKG Paolo Bonzini
2024-05-12 10:49 ` [PULL 06/27] tests/tcg: cover lzcnt/tzcnt/popcnt Paolo Bonzini
2024-05-12 10:49 ` [PULL 07/27] configure: quote -D options that are passed through to meson Paolo Bonzini
2024-05-12 10:49 ` [PULL 08/27] sh4: select correct components for no-board build Paolo Bonzini
2024-05-12 10:49 ` [PULL 09/27] s390x: move s390_cpu_addr2state to target/s390x/sigp.c Paolo Bonzini
2024-05-12 10:49 ` [PULL 10/27] s390_flic: add migration-enabled property Paolo Bonzini
2024-05-12 10:49 ` [PULL 11/27] s390: move css_migration_enabled from machine to css.c Paolo Bonzini
2024-05-12 10:49 ` [PULL 12/27] s390x: select correct components for no-board build Paolo Bonzini
2024-05-12 10:49 ` [PULL 13/27] tests/qtest: s390x: fix operation in a build without any boards or devices Paolo Bonzini
2024-05-12 10:49 ` [PULL 14/27] xen: initialize legacy backends from xen_bus_init() Paolo Bonzini
2024-05-12 10:49 ` [PULL 15/27] xen: register legacy backends via xen_backend_init Paolo Bonzini
2024-05-12 10:49 ` [PULL 16/27] i386: correctly select code in hw/i386 that depends on other components Paolo Bonzini
2024-05-12 10:49 ` [PULL 17/27] i386: pc: remove unnecessary MachineClass overrides Paolo Bonzini
2024-05-12 10:49 ` [PULL 18/27] hw/i386: split x86.c in multiple parts Paolo Bonzini
2024-05-12 10:49 ` [PULL 19/27] hw/i386: move rtc-reset-reinjection command out of hw/rtc Paolo Bonzini
2024-05-12 10:49 ` [PULL 20/27] i386: select correct components for no-board build Paolo Bonzini
2024-05-12 10:49 ` [PULL 21/27] tests/qtest: arm: fix operation in a build without any boards or devices Paolo Bonzini
2024-05-12 10:49 ` [PULL 22/27] meson: pick libfdt from common_ss when building target-specific files Paolo Bonzini
2024-05-12 10:49 ` [PULL 23/27] meson: move libfdt together with other dependencies Paolo Bonzini
2024-05-12 10:49 ` [PULL 24/27] kconfig: allow compiling out QEMU device tree code per target Paolo Bonzini
2024-05-12 10:49 ` Paolo Bonzini [this message]
2024-05-12 10:49 ` [PULL 26/27] hw/xtensa: require libfdt Paolo Bonzini
2024-05-12 10:49 ` [PULL 27/27] configs: disable emulators that require it if libfdt is not found Paolo Bonzini
2024-05-14  8:51 ` [PULL 00/27] Build/arch cleanups, target/i386 fixes for 2024-05-10 Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240512104945.130198-26-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).