From patchwork Tue Oct 17 13:30:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 116109 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp4900850qgn; Tue, 17 Oct 2017 06:33:34 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBb3nVbe7kUOJv+rpjCsWNOdHGmtOx0LfEbbhNjlDubQ1y26MaWvUgmIAcKnbXHLDR4TLjY X-Received: by 10.80.169.120 with SMTP id m53mr16791944edc.249.1508247214216; Tue, 17 Oct 2017 06:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508247214; cv=none; d=google.com; s=arc-20160816; b=L+UbrwalJdum2hUMYzTjSVINbo2+y78mpzeZH6ks6tZRPkdnMr0QBjs5+S9zpEy/XN BPLTx0Zj9n047FgDdk7wngliuH0T5u3Tt55n7JclT7f3rM9miO3s9CQBRjD18uIw0xsW ANH3c1QsBMtjivBgUYa6L1WpWqsk4u074/9I2+E/mFxFdOX+FQV1Yl16tJvV4A98wmYJ mHn7l2BWYni1qUh8XqdchLXCXiBH6UquxOMZexXyRXVKRrKXQKOM9Yzx3qp3XvdZgltK LlN77QV9QE5iviS8/rK56lgGbYJt8nTrq4L3cakAXFDsnuY85f8Ne8n7H7pn7h5BOGAt 8EWA== 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=56Yi1klLlS3TLZ1ZQb64Qj7wRp396G8m6S1EIoSfdNY=; b=x1dvbo/uuWTilDF2U8vgDEiO/CfweP4fwATzKmeJG/pee39uRqcJQ1sm5dYOLVV0NT XQLpZ8nhFjSmV/H2+NO9WiVmcKNOP2oXMm+yIJo6IooMq7R6IjPkU3MZxEuoPe2sCIyK zD1M3fzgQplKFAMqWhPnksugNlVPq6XtYGr8nqBREwhGX0jt0cTOp336Vu9vtcwZ3ewk flDXumZH6ya3HJdjPpOpM4XNUXj7FiCCWQQGdqQYCyUf9rsfCvTV++l6ZiSDdX4CRrvI PWYX1x+LtxxvkbSCMusJMvZNLtfhjfUUGwbCTY0c4bhvGlRpBW0sejWOBjCqrp6sJIs1 rvKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=n673AG7E; 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 t18si2192888edi.64.2017.10.17.06.33.33; Tue, 17 Oct 2017 06:33:34 -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=n673AG7E; 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 D0F33C21E3B; Tue, 17 Oct 2017 13:33:06 +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 250CFC21E37; Tue, 17 Oct 2017 13:31:57 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 35270C21DCE; Tue, 17 Oct 2017 13:31:32 +0000 (UTC) Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by lists.denx.de (Postfix) with ESMTPS id 102E8C21DE1 for ; Tue, 17 Oct 2017 13:31:27 +0000 (UTC) Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-10.nifty.com with ESMTP id v9HDUUVP009624; Tue, 17 Oct 2017 22:30:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v9HDUUVP009624 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1508247032; bh=quQA79TRfsVoozUgotXVZX8PVD4CyzH+aWjLATDhGUg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n673AG7E9ff7Bi9Htk6MbyWX8/Q0cH+szWJSEglhFPcjYIik/8M/YKG+fXMfkxHpe 6SJjekcyfrqBydu9vTNFRTc9wvBWR37eTTa9RgmCSZVZPgDj0h/0bb7042nlZ7xl1v 4IwIRMmnHICsHArl5ZVAibs4zNE3pPPiEuknCM7ZcmaXGC47a7TbVG47SMdCE/Q2ge WUHEgvQUhSICDA27mbe6u0Eh+B56725cMFVKZX1icsAo69AoWN4oo8NyJWW5Q+URoL xpBJJ55PpoIGrc6rx59K1WdvRzkxQhbyKZE5imN6t45h//74NuwJ7x5YjaoQt9jBPC N67cChL814iOg== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Tue, 17 Oct 2017 22:30:18 +0900 Message-Id: <1508247020-28071-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508247020-28071-1-git-send-email-yamada.masahiro@socionext.com> References: <1508247020-28071-1-git-send-email-yamada.masahiro@socionext.com> Cc: Stefan Roese , Hans de Goede , "oliver@schinagl.nl" , Olliver Schinagl Subject: [U-Boot] [PATCH 3/5] tools: use files from scripts/dtc/libfdt where possible 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" Prior to this commit, tools/Makefile pulls all libfdt files from lib/libfdt. lib/libfdt/ and scripts/dtc/libfdt have the same copies for the followings 6 files: fdt.c fdt_addresses.c fdt_empty_tree.c fdt_overlay.c fdt_strerr.c fdt_sw.c This commit changes them to #include ones from scripts/dtc/libfdt. Unfortunately, U-Boot locally modified the following 3 files: fdt_ro.c fdt_wip.c fdt_rw.c I did not touch them in order to avoid unpredictable impact. The fdt_region.c is U-Boot own file. This is also borrowed from lib/libfdt/. Signed-off-by: Masahiro Yamada --- tools/Makefile | 15 ++++++++++----- tools/libfdt/fdt.c | 2 ++ tools/libfdt/fdt_addresses.c | 2 ++ tools/libfdt/fdt_empty_tree.c | 2 ++ tools/libfdt/fdt_overlay.c | 2 ++ tools/libfdt/fdt_strerror.c | 2 ++ tools/libfdt/fdt_sw.c | 2 ++ 7 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 tools/libfdt/fdt.c create mode 100644 tools/libfdt/fdt_addresses.c create mode 100644 tools/libfdt/fdt_empty_tree.c create mode 100644 tools/libfdt/fdt_overlay.c create mode 100644 tools/libfdt/fdt_strerror.c create mode 100644 tools/libfdt/fdt_sw.c diff --git a/tools/Makefile b/tools/Makefile index 2b87e18..acbcd87 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -58,12 +58,17 @@ hostprogs-y += dumpimage mkimage hostprogs-$(CONFIG_FIT_SIGNATURE) += fit_info fit_check_sign FIT_SIG_OBJS-$(CONFIG_FIT_SIGNATURE) := common/image-sig.o -# Flattened device tree objects -LIBFDT_CSRCS := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c \ - fdt_empty_tree.c fdt_addresses.c fdt_overlay.c \ - fdt_region.c -LIBFDT_OBJS := $(addprefix lib/libfdt/, $(patsubst %.c, %.o, $(LIBFDT_CSRCS))) +# The following files are synced with upstream DTC. +# Use synced versions from scripts/dtc/libfdt/. +LIBFDT_SRCS_SYNCED := fdt.c fdt_sw.c fdt_strerror.c fdt_empty_tree.c \ + fdt_addresses.c fdt_overlay.c +# The following files are locally modified for U-Boot (unfotunately). +# Use U-Boot own versions from lib/libfdt/. +LIBFDT_SRCS_UNSYNCED := fdt_ro.c fdt_wip.c fdt_rw.c fdt_region.c + +LIBFDT_OBJS := $(addprefix libfdt/, $(patsubst %.c, %.o, $(LIBFDT_SRCS_SYNCED))) \ + $(addprefix lib/libfdt/, $(patsubst %.c, %.o, $(LIBFDT_SRCS_UNSYNCED))) RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \ rsa-sign.o rsa-verify.o rsa-checksum.o \ diff --git a/tools/libfdt/fdt.c b/tools/libfdt/fdt.c new file mode 100644 index 0000000..8ba8091 --- /dev/null +++ b/tools/libfdt/fdt.c @@ -0,0 +1,2 @@ +#include "fdt_host.h" +#include "../scripts/dtc/libfdt/fdt.c" diff --git a/tools/libfdt/fdt_addresses.c b/tools/libfdt/fdt_addresses.c new file mode 100644 index 0000000..242a2c0 --- /dev/null +++ b/tools/libfdt/fdt_addresses.c @@ -0,0 +1,2 @@ +#include "fdt_host.h" +#include "../scripts/dtc/libfdt/fdt_addresses.c" diff --git a/tools/libfdt/fdt_empty_tree.c b/tools/libfdt/fdt_empty_tree.c new file mode 100644 index 0000000..9ccbb1f --- /dev/null +++ b/tools/libfdt/fdt_empty_tree.c @@ -0,0 +1,2 @@ +#include "fdt_host.h" +#include "../scripts/dtc/libfdt/fdt_empty_tree.c" diff --git a/tools/libfdt/fdt_overlay.c b/tools/libfdt/fdt_overlay.c new file mode 100644 index 0000000..801ec37 --- /dev/null +++ b/tools/libfdt/fdt_overlay.c @@ -0,0 +1,2 @@ +#include "fdt_host.h" +#include "../scripts/dtc/libfdt/fdt_overlay.c" diff --git a/tools/libfdt/fdt_strerror.c b/tools/libfdt/fdt_strerror.c new file mode 100644 index 0000000..d7ed70b --- /dev/null +++ b/tools/libfdt/fdt_strerror.c @@ -0,0 +1,2 @@ +#include "fdt_host.h" +#include "../scripts/dtc/libfdt/fdt_strerror.c" diff --git a/tools/libfdt/fdt_sw.c b/tools/libfdt/fdt_sw.c new file mode 100644 index 0000000..ed6b327 --- /dev/null +++ b/tools/libfdt/fdt_sw.c @@ -0,0 +1,2 @@ +#include "fdt_host.h" +#include "../scripts/dtc/libfdt/fdt_sw.c"