From: Doug Goldstein Date: Tue, 15 Dec 2015 13:14:00 +0000 (+0100) Subject: build: convert HAS_DEVICE_TREE use to Kconfig X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e7bb2a30a3e86b24883df9d606fbd57b9875fda3;p=people%2Fjulieng%2Fxen-unstable.git build: convert HAS_DEVICE_TREE use to Kconfig Use the Kconfig generated CONFIG_HAS_DEVICE_TREE defines in the code base. Signed-off-by: Doug Goldstein Acked-by: Jan Beulich Acked-by: Daniel De Graaf Acked-by: Ian Campbell --- diff --git a/xen/Rules.mk b/xen/Rules.mk index a8221475df..10e0b9d7fd 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -58,7 +58,6 @@ CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS CFLAGS-$(lock_profile) += -DLOCK_PROFILE CFLAGS-$(HAS_ACPI) += -DHAS_ACPI CFLAGS-$(HAS_GDBSX) += -DHAS_GDBSX -CFLAGS-$(HAS_DEVICE_TREE) += -DHAS_DEVICE_TREE CFLAGS-$(HAS_MEM_ACCESS) += -DHAS_MEM_ACCESS CFLAGS-$(HAS_MEM_PAGING) += -DHAS_MEM_PAGING CFLAGS-$(HAS_MEM_SHARING) += -DHAS_MEM_SHARING diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 0fd69a72ba..93e64f6697 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -16,6 +16,7 @@ config ARM_64 config ARM def_bool y + select HAS_DEVICE_TREE select HAS_PASSTHROUGH config ARCH_DEFCONFIG diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk index 86d7b81e81..4725374aa6 100644 --- a/xen/arch/arm/Rules.mk +++ b/xen/arch/arm/Rules.mk @@ -6,7 +6,6 @@ # 'make clean' before rebuilding. # -HAS_DEVICE_TREE := y HAS_VIDEO := y HAS_ARM_HDLCD := y HAS_PDX := y diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 0251856777..53ca33fdaa 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -1,4 +1,8 @@ menu "Common Features" +# Select HAS_DEVICE_TREE if device tree is supported +config HAS_DEVICE_TREE + bool + endmenu diff --git a/xen/common/Makefile b/xen/common/Makefile index 3547c8e2ce..5dc2bb288c 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -2,7 +2,7 @@ obj-y += bitmap.o obj-$(HAS_CORE_PARKING) += core_parking.o obj-y += cpu.o obj-y += cpupool.o -obj-$(HAS_DEVICE_TREE) += device_tree.o +obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o obj-y += domctl.o obj-y += domain.o obj-y += event_2l.o @@ -70,4 +70,4 @@ subdir-$(x86_64) += hvm subdir-$(coverage) += gcov subdir-y += libelf -subdir-$(HAS_DEVICE_TREE) += libfdt +subdir-$(CONFIG_HAS_DEVICE_TREE) += libfdt diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c index 09abca8a0f..e96e07227e 100644 --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -24,7 +24,7 @@ #include #include #include -#ifdef HAS_DEVICE_TREE +#ifdef CONFIG_HAS_DEVICE_TREE #include #endif #ifdef CONFIG_X86 @@ -1131,7 +1131,7 @@ void __init ns16550_init(int index, struct ns16550_defaults *defaults) ns16550_parse_port_config(uart, (index == 0) ? opt_com1 : opt_com2); } -#ifdef HAS_DEVICE_TREE +#ifdef CONFIG_HAS_DEVICE_TREE static int __init ns16550_uart_dt_init(struct dt_device_node *dev, const void *data) { diff --git a/xen/drivers/passthrough/Makefile b/xen/drivers/passthrough/Makefile index 16e9027a32..2bb5afb3d4 100644 --- a/xen/drivers/passthrough/Makefile +++ b/xen/drivers/passthrough/Makefile @@ -6,4 +6,4 @@ subdir-$(arm) += arm obj-y += iommu.o obj-$(x86) += io.o obj-$(HAS_PCI) += pci.o -obj-$(HAS_DEVICE_TREE) += device_tree.o +obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index 3d02550f73..8bb7df04c0 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -357,7 +357,7 @@ int iommu_do_domctl( ret = iommu_do_pci_domctl(domctl, d, u_domctl); #endif -#ifdef HAS_DEVICE_TREE +#ifdef CONFIG_HAS_DEVICE_TREE if ( ret == -ENODEV ) ret = iommu_do_dt_domctl(domctl, d, u_domctl); #endif diff --git a/xen/include/asm-arm/device.h b/xen/include/asm-arm/device.h index 5d0a4cd14b..b455bdf30f 100644 --- a/xen/include/asm-arm/device.h +++ b/xen/include/asm-arm/device.h @@ -16,7 +16,7 @@ struct dev_archdata { struct device { enum device_type type; -#ifdef HAS_DEVICE_TREE +#ifdef CONFIG_HAS_DEVICE_TREE struct dt_device_node *of_node; /* Used by drivers imported from Linux */ #endif struct dev_archdata archdata; diff --git a/xen/include/xen/hvm/iommu.h b/xen/include/xen/hvm/iommu.h index 106e08f104..c817eece86 100644 --- a/xen/include/xen/hvm/iommu.h +++ b/xen/include/xen/hvm/iommu.h @@ -29,7 +29,7 @@ struct hvm_iommu { /* iommu_ops */ const struct iommu_ops *platform_ops; -#ifdef HAS_DEVICE_TREE +#ifdef CONFIG_HAS_DEVICE_TREE /* List of DT devices assigned to this domain */ struct list_head dt_devices; #endif diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index 1f5d04a243..ac9b7f872c 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -109,7 +109,7 @@ void iommu_read_msi_from_ire(struct msi_desc *msi_desc, struct msi_msg *msg); #define PT_IRQ_TIME_OUT MILLISECS(8) #endif /* HAS_PCI */ -#ifdef HAS_DEVICE_TREE +#ifdef CONFIG_HAS_DEVICE_TREE #include int iommu_assign_dt_device(struct domain *d, struct dt_device_node *dev); diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 50b94a1457..c7de16514d 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -350,7 +350,7 @@ static XSM_INLINE int xsm_deassign_device(XSM_DEFAULT_ARG struct domain *d, uint #endif /* HAS_PASSTHROUGH && HAS_PCI */ -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE) static XSM_INLINE int xsm_test_assign_dtdevice(XSM_DEFAULT_ARG const char *dtpath) { XSM_ASSERT_ACTION(XSM_HOOK); diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index e5cb088c34..6ebb0e015e 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -121,7 +121,7 @@ struct xsm_operations { int (*deassign_device) (struct domain *d, uint32_t machine_bdf); #endif -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE) int (*test_assign_dtdevice) (const char *dtpath); int (*assign_dtdevice) (struct domain *d, const char *dtpath); int (*deassign_dtdevice) (struct domain *d, const char *dtpath); @@ -491,7 +491,7 @@ static inline int xsm_deassign_device(xsm_default_t def, struct domain *d, uint3 } #endif /* HAS_PASSTHROUGH && HAS_PCI) */ -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE) static inline int xsm_assign_dtdevice(xsm_default_t def, struct domain *d, const char *dtpath) { @@ -741,7 +741,7 @@ extern int xsm_multiboot_policy_init(unsigned long *module_map, void *(*bootstrap_map)(const module_t *)); #endif -#ifdef HAS_DEVICE_TREE +#ifdef CONFIG_HAS_DEVICE_TREE extern int xsm_dt_init(void); extern int xsm_dt_policy_init(void); #endif @@ -765,7 +765,7 @@ static inline int xsm_multiboot_init (unsigned long *module_map, } #endif -#ifdef HAS_DEVICE_TREE +#ifdef CONFIG_HAS_DEVICE_TREE static inline int xsm_dt_init(void) { return 0; diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index 036db4b1fa..a380da3b50 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -96,7 +96,7 @@ void xsm_fixup_ops (struct xsm_operations *ops) set_to_dummy_if_null(ops, deassign_device); #endif -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE) set_to_dummy_if_null(ops, test_assign_dtdevice); set_to_dummy_if_null(ops, assign_dtdevice); set_to_dummy_if_null(ops, deassign_dtdevice); diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 3f4ceea87a..2650cc88ce 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -1279,7 +1279,7 @@ static int flask_deassign_device(struct domain *d, uint32_t machine_bdf) } #endif /* HAS_PASSTHROUGH && HAS_PCI */ -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE) static int flask_test_assign_dtdevice(const char *dtpath) { u32 rsid; @@ -1732,7 +1732,7 @@ static struct xsm_operations flask_ops = { .deassign_device = flask_deassign_device, #endif -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE) .test_assign_dtdevice = flask_test_assign_dtdevice, .assign_dtdevice = flask_assign_dtdevice, .deassign_dtdevice = flask_deassign_dtdevice, diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c index 0ac6d0330d..2a74496b8e 100644 --- a/xen/xsm/xsm_core.c +++ b/xen/xsm/xsm_core.c @@ -85,7 +85,7 @@ int __init xsm_multiboot_init(unsigned long *module_map, } #endif -#ifdef HAS_DEVICE_TREE +#ifdef CONFIG_HAS_DEVICE_TREE int __init xsm_dt_init(void) { int ret = 0; diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c index 6e0bb78df4..b60d822dab 100644 --- a/xen/xsm/xsm_policy.c +++ b/xen/xsm/xsm_policy.c @@ -23,7 +23,7 @@ #include #endif #include -#ifdef HAS_DEVICE_TREE +#ifdef CONFIG_HAS_DEVICE_TREE # include # include #endif @@ -74,7 +74,7 @@ int __init xsm_multiboot_policy_init(unsigned long *module_map, } #endif -#ifdef HAS_DEVICE_TREE +#ifdef CONFIG_HAS_DEVICE_TREE int __init xsm_dt_policy_init(void) { struct bootmodule *mod = boot_module_find_by_kind(BOOTMOD_XSM);