forked from Mirrors/opensbi
		
	lib: utils/fdt: Use kconfig for enabling/disabling
We update FDT support makefile to use kconfig for enabling/disabling. To avoid compilation errors, we also enable FDT for each platform. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Tested-by: Andrew Jones <ajones@ventanamicro.com> Acked-by: Atish Patra <atishp@rivosinc.com> Tested-by: Atish Patra <atishp@rivosinc.com>
This commit is contained in:
		@@ -2,6 +2,8 @@
 | 
			
		||||
 | 
			
		||||
menu "Utils and Drivers Support"
 | 
			
		||||
 | 
			
		||||
source "$(OPENSBI_SRC_DIR)/lib/utils/fdt/Kconfig"
 | 
			
		||||
 | 
			
		||||
source "$(OPENSBI_SRC_DIR)/lib/utils/gpio/Kconfig"
 | 
			
		||||
 | 
			
		||||
source "$(OPENSBI_SRC_DIR)/lib/utils/i2c/Kconfig"
 | 
			
		||||
@@ -10,6 +12,8 @@ source "$(OPENSBI_SRC_DIR)/lib/utils/ipi/Kconfig"
 | 
			
		||||
 | 
			
		||||
source "$(OPENSBI_SRC_DIR)/lib/utils/irqchip/Kconfig"
 | 
			
		||||
 | 
			
		||||
source "$(OPENSBI_SRC_DIR)/lib/utils/libfdt/Kconfig"
 | 
			
		||||
 | 
			
		||||
source "$(OPENSBI_SRC_DIR)/lib/utils/reset/Kconfig"
 | 
			
		||||
 | 
			
		||||
source "$(OPENSBI_SRC_DIR)/lib/utils/serial/Kconfig"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								lib/utils/fdt/Kconfig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								lib/utils/fdt/Kconfig
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
# SPDX-License-Identifier: BSD-2-Clause
 | 
			
		||||
 | 
			
		||||
menuconfig FDT
 | 
			
		||||
	bool "Flattened Device Tree (FDT) support"
 | 
			
		||||
	select LIBFDT
 | 
			
		||||
	default n
 | 
			
		||||
 | 
			
		||||
if FDT
 | 
			
		||||
 | 
			
		||||
config FDT_DOMAIN
 | 
			
		||||
	bool "FDT domain support"
 | 
			
		||||
	default n
 | 
			
		||||
 | 
			
		||||
config FDT_PMU
 | 
			
		||||
	bool "FDT performance monitoring unit (PMU) support"
 | 
			
		||||
	default n
 | 
			
		||||
 | 
			
		||||
endif
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
# Copyright (C) 2020 Bin Meng <bmeng.cn@gmail.com>
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
libsbiutils-objs-y += fdt/fdt_domain.o
 | 
			
		||||
libsbiutils-objs-y += fdt/fdt_pmu.o
 | 
			
		||||
libsbiutils-objs-y += fdt/fdt_helper.o
 | 
			
		||||
libsbiutils-objs-y += fdt/fdt_fixup.o
 | 
			
		||||
libsbiutils-objs-$(CONFIG_FDT_DOMAIN) += fdt/fdt_domain.o
 | 
			
		||||
libsbiutils-objs-$(CONFIG_FDT_PMU) += fdt/fdt_pmu.o
 | 
			
		||||
libsbiutils-objs-$(CONFIG_FDT) += fdt/fdt_helper.o
 | 
			
		||||
libsbiutils-objs-$(CONFIG_FDT) += fdt/fdt_fixup.o
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,7 @@ menu "GPIO Support"
 | 
			
		||||
 | 
			
		||||
config FDT_GPIO
 | 
			
		||||
	bool "FDT based GPIO drivers"
 | 
			
		||||
	depends on FDT
 | 
			
		||||
	select GPIO
 | 
			
		||||
	default n
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,7 @@ menu "I2C Support"
 | 
			
		||||
 | 
			
		||||
config FDT_I2C
 | 
			
		||||
	bool "FDT based I2C drivers"
 | 
			
		||||
	depends on FDT
 | 
			
		||||
	select I2C
 | 
			
		||||
	default n
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,7 @@ menu "IPI Device Support"
 | 
			
		||||
 | 
			
		||||
config FDT_IPI
 | 
			
		||||
	bool "FDT based ipi drivers"
 | 
			
		||||
	depends on FDT
 | 
			
		||||
	default n
 | 
			
		||||
 | 
			
		||||
if FDT_IPI
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,7 @@ menu "Interrupt Controller Support"
 | 
			
		||||
 | 
			
		||||
config FDT_IRQCHIP
 | 
			
		||||
	bool "FDT based interrupt controller drivers"
 | 
			
		||||
	depends on FDT
 | 
			
		||||
	default n
 | 
			
		||||
 | 
			
		||||
if FDT_IRQCHIP
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								lib/utils/libfdt/Kconfig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								lib/utils/libfdt/Kconfig
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
# SPDX-License-Identifier: BSD-2-Clause
 | 
			
		||||
 | 
			
		||||
config LIBFDT
 | 
			
		||||
	bool
 | 
			
		||||
	default n
 | 
			
		||||
@@ -12,5 +12,5 @@ libfdt_files = fdt.o fdt_addresses.o fdt_check.o fdt_empty_tree.o fdt_ro.o fdt_r
 | 
			
		||||
$(foreach file, $(libfdt_files), \
 | 
			
		||||
        $(eval CFLAGS_$(file) = -I$(src)/../../utils/libfdt))
 | 
			
		||||
 | 
			
		||||
libsbiutils-objs-y += $(addprefix libfdt/,$(libfdt_files))
 | 
			
		||||
libsbiutils-objs-$(CONFIG_LIBFDT) += $(addprefix libfdt/,$(libfdt_files))
 | 
			
		||||
libsbiutils-genflags-y  += -I$(libsbiutils_dir)/libfdt/
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,7 @@ menu "System Reset Support"
 | 
			
		||||
 | 
			
		||||
config FDT_RESET
 | 
			
		||||
	bool "FDT based reset drivers"
 | 
			
		||||
	depends on FDT
 | 
			
		||||
	default n
 | 
			
		||||
 | 
			
		||||
if FDT_RESET
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,7 @@ menu "Serial Device Support"
 | 
			
		||||
 | 
			
		||||
config FDT_SERIAL
 | 
			
		||||
	bool "FDT based serial drivers"
 | 
			
		||||
	depends on FDT
 | 
			
		||||
	default n
 | 
			
		||||
 | 
			
		||||
if FDT_SERIAL
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,7 @@ menu "Timer Device Support"
 | 
			
		||||
 | 
			
		||||
config FDT_TIMER
 | 
			
		||||
	bool "FDT based timer drivers"
 | 
			
		||||
	depends on FDT
 | 
			
		||||
	default n
 | 
			
		||||
 | 
			
		||||
if FDT_TIMER
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user