From patchwork Sat May 27 13:38:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 767720 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3wZkqb0M9fz9s7C for ; Sat, 27 May 2017 23:48:42 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="e0CG2107"; dkim-atps=neutral Received: by lists.denx.de (Postfix, from userid 105) id C58EAC21C66; Sat, 27 May 2017 13:42:31 +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=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 510A9C21C38; Sat, 27 May 2017 13:39:13 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9EB8DC21C48; Sat, 27 May 2017 13:38:59 +0000 (UTC) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com [209.85.218.42]) by lists.denx.de (Postfix) with ESMTPS id 55317C21C5C for ; Sat, 27 May 2017 13:38:53 +0000 (UTC) Received: by mail-oi0-f42.google.com with SMTP id w10so40636533oif.0 for ; Sat, 27 May 2017 06:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZGXJSf3YEkAtvYuElnOcdu1PzXA6b2e+pfe34Fp1IzI=; b=e0CG2107Z6qDlPpe14d8E3w6zbOp0Bi+iaEkwOZxIrM0hns21BfSFnp7aTnepzJl5p WDWtdRyODg2bYFPeGncZYSfHFoKd/qio6iB1sj7WNUHQeI56n+WZD1HhI3Ih0teMd+V7 RkEnoH0kywvbZgs7jtM4/m+hxcRfMICO10H4fgKZ6/tsaP/usvE7Ik0Kd68lG913geSW ADNGXts5ma2I8xufp/soazHdDXZIjnbGED34oARNbFX414TaYhj9z8p5STeF3fz0k9HX SIL2pTBI76RZ7MY3UJh0t5zr02hun9zM8BISHRbzoczv2/5kfoXFHaE2+jfDteRL5Bpx 7zcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ZGXJSf3YEkAtvYuElnOcdu1PzXA6b2e+pfe34Fp1IzI=; b=jlfYBDcfBIqHMcDYJ+I//G0rRu7JDMpXwT73Ve7wVBW7kqJTVzkHfbEdz43Vfcb25x g8E+vZXkPfm5deWjDf0LIPjsNxnOc1gh7Rlnoorc/o7mD8/JXOiwhSqYMqDRuslUSAKk ilvV32TMi3cpXzSbc0odcUjTE1V5A8QWVgEGMtuFvRGCLO2jTgqOxcP4jGaWb2NMGfd/ iDPVpYzfEiyBkWrtgWx588ggluneHoa0VzfzWiw5cMotOHnofDqrWBhtAwlFfDkJkCAR rTMt0Bnw3l7JKdCyP6UmdWe8/KoJAe1wz9zuSYVrrg/uxVGfNSb+fGB+LQ68ID4K4Lvc Kimg== X-Gm-Message-State: AODbwcCnQVBarxhed/alUTzUpZV73nrhwXuZbK5Wo6Og0NpFcWVB9E5l 1AVHxqhPVChx1dKV X-Received: by 10.157.61.180 with SMTP id l49mr3692171otc.80.1495892332094; Sat, 27 May 2017 06:38:52 -0700 (PDT) Received: from kaki.bld.corp.google.com ([2620:0:10f2:12:e8b2:5b4f:48b1:9c2c]) by smtp.gmail.com with ESMTPSA id j198sm1742284oih.3.2017.05.27.06.38.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 May 2017 06:38:51 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id C638840486; Sat, 27 May 2017 07:38:50 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 27 May 2017 07:38:23 -0600 Message-Id: <20170527133831.25882-14-sjg@chromium.org> X-Mailer: git-send-email 2.13.0.219.gdb65acc882-goog In-Reply-To: <20170527133831.25882-1-sjg@chromium.org> References: <20170527133831.25882-1-sjg@chromium.org> Cc: Tom Rini , Jerry Van Baren Subject: [U-Boot] [PATCH v3 13/20] fdt: Makefile: Build python libfdt library if needed 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" This is needed by binman and dtoc, so if those are being used, check that the library is present and complain if not. This means that the fallback library (which uses fdtget) will not be used anymore and swig will need to be installed to use binman / dtoc. This affects any board which uses binman (currently sunxi and x86) or dtoc (anything that uses CONFIG_SPL_OF_PLATDATA, currently some rockchip boards). Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: None Makefile | 16 ++++++++++++++-- scripts/Makefile.spl | 17 +++++++++++++---- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1b7cab2121..89e0451a49 100644 --- a/Makefile +++ b/Makefile @@ -1116,7 +1116,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) FORCE + $(if $(CONFIG_HAVE_REFCODE),refcode.bin) checkbinman FORCE $(call if_changed,binman) OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec @@ -1125,7 +1125,8 @@ 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 FORCE +u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb \ + checkbinman FORCE $(call if_changed,binman) endif @@ -1354,6 +1355,17 @@ $(version_h): include/config/uboot.release FORCE $(timestamp_h): $(srctree)/Makefile FORCE $(call filechk,timestamp.h) +checkbinman: tools + @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \ + echo '*** binman 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 + # --------------------------------------------------------------------------- quiet_cmd_cpp_lds = LDS $@ cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \ diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 135706f21d..ac3c2c7f13 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -257,14 +257,12 @@ PHONY += dts_dir dts_dir: $(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts) -include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir dtoc +include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc $(call if_changed,dtoch) -$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir dtoc +$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc $(call if_changed,dtocc) -dtoc: #$(objtree)/tools/_libfdt.so - ifdef CONFIG_SAMSUNG ifdef CONFIG_VAR_SIZE_SPL VAR_SIZE_PARAM = --vs @@ -357,6 +355,17 @@ ifneq ($(cmd_files),) include $(cmd_files) endif +checkdtoc: tools + @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools 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: