pylibfdt: compile pylibfdt only when dtoc/binman is necessary
Currently, pylibfdt is always compiled if swig is installed on your
machine. It is really annoying because most of targets (excepts
x86, sunxi, rockchip) do not use dtoc or binman.
"checkbinman" and "checkdtoc" are wrong. It is odd that the final
build stage checks if we have built necessary tools. If your platform
depends on dtoc/binman, you must be able to build pylibfdt. If swig
is not installed, it should fail immediately.
I added PYLIBFDT, DTOC, BINMAN entries to Kconfig. They should be
property select:ed by platforms that need them. Kbuild will descend
into scripts/dtc/pylibfdt/ only when CONFIG_PYLIBFDT is enabled.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/dts/Kconfig b/dts/Kconfig
index daa757d..0cef225 100644
--- a/dts/Kconfig
+++ b/dts/Kconfig
@@ -8,6 +8,17 @@
config DTC
bool
+config PYLIBFDT
+ bool
+
+config DTOC
+ bool
+ select PYLIBFDT
+
+config BINMAN
+ bool
+ select DTOC
+
menu "Device Tree Control"
depends on SUPPORT_OF_CONTROL
@@ -231,6 +242,7 @@
config SPL_OF_PLATDATA
bool "Generate platform data for use in SPL"
depends on SPL_OF_CONTROL
+ select DTOC
help
For very constrained SPL environments the overhead of decoding
device tree nodes and converting their contents into platform data
@@ -252,6 +264,7 @@
config TPL_OF_PLATDATA
bool "Generate platform data for use in TPL"
depends on TPL_OF_CONTROL
+ select DTOC
help
For very constrained SPL environments the overhead of decoding
device tree nodes and converting their contents into platform data