From patchwork Tue Oct 17 04:42:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 116009 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp821094edb; Mon, 16 Oct 2017 21:47:47 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SFad35CjUdcXy8I6+Y17DaMgDNBOfKkPMAJ64SarWhbl7Ygav9Hv8Iaj7cis08hM0Jb+mk X-Received: by 10.80.218.72 with SMTP id a8mr11976749edk.221.1508215667540; Mon, 16 Oct 2017 21:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508215667; cv=none; d=google.com; s=arc-20160816; b=eCm/ARpkYhVo7aj1i247ffFB3ZBt7UpK+8HHQ/hnodpw3VEbKxuTr/tIBJyER2OYor dT4JfkommVwgfoJe4sLR9+zRygm70qYRV4QQlVOedIpJPjwT//Pt3Rj1s3t6kvrjOBiY cHdI8CTZ6wCxou+4ZtMvUeOIpaM9tLubSHH/3Fgw9Un0i+YnlzCM19rNb3Q/LQKRdI62 Y8nzGpFN46haQFJGtsGLL3UVxyXCt4nQrUGHfKUunyibYfpnGYYh9D1wgGk4vimXJX+f Jg0zJqcak5LwYGrGZaD3vJrpXgYlmpFeAJEDHMBZJvzUn5UG+ofFZPvtpMe4ZtUKvBl1 rInQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=ZF7l6CmIgAd9mSyV7bcJCwOZPzkCu0P2gy40FJ9hB54=; b=BH2+pL1q5pp1J7UzWSI+tQLMG4MPbdZlUnoZo7RUGuLEeI7mdX+NxQ/K1+NYFfexbp hTQ6PHCmJ7nCXJg8MSFzxb1LXKAXcZa8GdkE9oPKPtPr6QGytf6yoFQmAKLwO+h7REdM 1tHHV74m6lzAFjuPtQuJUEnYW4BxlNtVJrlHt3zcMs2KeHUCaLACbByX59BZwkE/ko+1 F9Vnp44RAwMQdqx7yOPLxWzTvd937pgi2q4Af0VsJ4/FVzNpIVVrpABokc/W/1db6Ovh oeiWx2vyrkoVjyiw747rpZmR4xtsYCahBhZ1GNvYMAQ13rY3PtJjiU3r/t9hznW8aRP8 bq/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=2l7GJ20g; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id 93si373231edl.507.2017.10.16.21.47.47; Mon, 16 Oct 2017 21:47:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=2l7GJ20g; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 1E80EC21D95; Tue, 17 Oct 2017 04:47:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 2643FC21C8F; Tue, 17 Oct 2017 04:43:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 567D3C21CB6; Tue, 17 Oct 2017 04:43:42 +0000 (UTC) Received: from conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) by lists.denx.de (Postfix) with ESMTPS id C0D53C21DBA for ; Tue, 17 Oct 2017 04:43:35 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id v9H4gltY026811; Tue, 17 Oct 2017 13:42:49 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v9H4gltY026811 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1508215370; bh=oFoiKqJq9iTsSx4ZLX0SyfD2vTAaqc6VGWTwVDJBJbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2l7GJ20gYEmqVrRP8N2kIAVS7osUiarMafo7iS4UP35ac7RC5FgVKZ1qEOLxZLUuo 8+pIVTmOmOUjY+Q+LveAWyBxwwaaYylZYPiewGbqoy5FXeYCuJndY1VQFDK2aRsAtv TKsXoFgSqX0l81YrOyHgD8dC3Zu7BvhfvHJSVBwzn+GAr2+KsnuQAyW7y8sGv221M2 arvaHUf9KCG9/1IQP29/63o1v6FCgg5mITtdnoxyy/YcsCiYkfUk4joiaEUYd2y6GC FL6TYg3pMCJIRu8BGZu4mg91TAES2Q8lIdXl9UxnMtzx8zj0/c7ntN37cK1ZYpopDB LiAAphEU8Jw2Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Tue, 17 Oct 2017 13:42:44 +0900 Message-Id: <1508215364-14631-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508215364-14631-1-git-send-email-yamada.masahiro@socionext.com> References: <1508215364-14631-1-git-send-email-yamada.masahiro@socionext.com> Cc: Tom Rini Subject: [U-Boot] [PATCH v2 4/4] pylibfdt: compile pylibfdt only when dtoc/binman is necessary X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Reviewed-by: Simon Glass --- Makefile | 17 ++--------------- arch/arm/Kconfig | 1 + arch/x86/Kconfig | 1 + dts/Kconfig | 13 +++++++++++++ scripts/Makefile.spl | 15 ++------------- scripts/dtc/Makefile | 2 +- 6 files changed, 20 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index 40cd61a..8f3fcfe 100644 --- a/Makefile +++ b/Makefile @@ -1135,7 +1135,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ u-boot.rom: u-boot-x86-16bit.bin u-boot.bin \ $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ - $(if $(CONFIG_HAVE_REFCODE),refcode.bin) checkbinman FORCE + $(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE $(call if_changed,binman) OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec @@ -1144,8 +1144,7 @@ u-boot-x86-16bit.bin: u-boot FORCE endif ifneq ($(CONFIG_ARCH_SUNXI),) -u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb \ - checkbinman FORCE +u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE $(call if_changed,binman) endif @@ -1379,18 +1378,6 @@ $(version_h): include/config/uboot.release FORCE $(timestamp_h): $(srctree)/Makefile FORCE $(call filechk,timestamp.h) -checkbinman: tools - @if ! ( echo 'import libfdt' | ( PYTHONPATH=scripts/dtc/pylibfdt $(PYTHON) )); then \ - echo >&2; \ - echo >&2 '*** binman needs the Python libfdt library.'; \ - echo >&2 '*** Either install it on your system, or try:'; \ - echo >&2 '***'; \ - echo >&2 '*** sudo apt-get install swig libpython-dev'; \ - echo >&2 '***'; \ - echo >&2 '*** to have U-Boot build its own version.'; \ - false; \ - fi - # --------------------------------------------------------------------------- quiet_cmd_cpp_lds = LDS $@ cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \ diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 64e0ee4..d69141a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -682,6 +682,7 @@ config ARCH_SOCFPGA config ARCH_SUNXI bool "Support sunxi (Allwinner) SoCs" + select BINMAN select CMD_GPIO select CMD_MMC if MMC select CMD_USB if DISTRO_DEFAULTS diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 38a6187..9d12a98 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -152,6 +152,7 @@ config SMM_TSEG_SIZE config X86_RESET_VECTOR bool default n + select BINMAN # The following options control where the 16-bit and 32-bit init lies # If SPL is enabled then it normally holds this init code, and U-Boot proper diff --git a/dts/Kconfig b/dts/Kconfig index daa757d..0cef225 100644 --- a/dts/Kconfig +++ b/dts/Kconfig @@ -8,6 +8,17 @@ config SUPPORT_OF_CONTROL 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 OF_SPL_REMOVE_PROPS 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 SPL_OF_PLATDATA 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 diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 065bb25..ca04476 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -276,10 +276,10 @@ PHONY += dts_dir dts_dir: $(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts) -include/generated/dt-structs-gen.h: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc +include/generated/dt-structs-gen.h: $(obj)/$(SPL_BIN).dtb dts_dir FORCE $(call if_changed,dtoch) -$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc +$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir FORCE $(call if_changed,dtocc) ifdef CONFIG_SAMSUNG @@ -380,17 +380,6 @@ ifneq ($(cmd_files),) include $(cmd_files) endif -checkdtoc: tools - @if ! ( echo 'import libfdt' | ( PYTHONPATH=scripts/dtc/pylibfdt $(PYTHON) )); then \ - echo '*** dtoc needs the Python libfdt library. Either '; \ - echo '*** install it on your system, or try:'; \ - echo '***'; \ - echo '*** sudo apt-get install swig libpython-dev'; \ - echo '***'; \ - echo '*** to have U-Boot build its own version.'; \ - false; \ - fi - PHONY += FORCE FORCE: diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile index f4a16ed..90ef2db 100644 --- a/scripts/dtc/Makefile +++ b/scripts/dtc/Makefile @@ -31,4 +31,4 @@ $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h clean-files := dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h # Added for U-Boot -subdir-y += pylibfdt +subdir-$(CONFIG_PYLIBFDT) += pylibfdt