From patchwork Sun Jan 21 10:19:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 125270 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp632542ljf; Sun, 21 Jan 2018 02:23:51 -0800 (PST) X-Google-Smtp-Source: AH8x224U9gL3xgH4mclpMMwi5VYaet71Ic659rr6Yvj6/tQVRwg9irelPk5FlfXVYVX8tOEtBRmR X-Received: by 10.80.142.15 with SMTP id 15mr7749451edw.127.1516530231433; Sun, 21 Jan 2018 02:23:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516530231; cv=none; d=google.com; s=arc-20160816; b=SjrSg3+whujcg4UylXImYyChiVHuNKeiDlQI18b5tteoJovTnbUoPtg8tUj8zLbVDp XoXzXcxLi/GN9HIS76x4ySKe3nPDKaAyQ3vyN3QBZlcD/INtl21dmlyApxgVUlCjxdrH Tbc1prDfX+1z/yEDXepMRyWfH5WSOEyNmfQni15DF6omyosHG8ftCr+TqD/gizldoiPy yNqi4WaQOaafmcvj4E9m76x80EFjhwuxQZjTgxZK0FG+7ucRNd9K+D8x2PAIxuclSEBW PuTc+NNnSyHKBuw9kaJrILxOaDRgIiBvcr0zFBYn/PRMPKKd77wpJ/qZ+OAI0y3Xs6ir brcQ== 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=k8jmEx5X3eiBEgIZ4n54z6Zow1uBM4K7yG3HUhT6B2c=; b=zq6A4dVNvBo0yTDV28SDEHkZP4RZ4sIXsAaQmspThT3Ar8ZzBErhKKRW6XMW80b7L9 gbQqEykmhCWXyzkeRn/8238CPgeizy+rhH61hUcQYP9srYnVl1oYSQaZkk1f7fdTDiJi RAfWbsOJAumGt5KWs6Eck2cTdGoFxWGYxBgic4jvkEs7CKyhe9MxKKB74B8N7ryfi2IK Nhl0pxe01qYkTC+ZPV49Acm92j1IU0BOS0PyHOPgBSWUuFyqXlq2Ep5XqqaWAOrlIqPx 32cEtrlJN8YJXUUUJbw9CRSKMtkXhNiaVQ5ZkqwhH7avIsBaHKpKSBYrTxDBmb4CublN uzpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=GQBinX2S; 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 n39si2098829edd.202.2018.01.21.02.23.51; Sun, 21 Jan 2018 02:23:51 -0800 (PST) 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=GQBinX2S; 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 07CAFC21F6D; Sun, 21 Jan 2018 10:23:47 +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_BLOCKED, 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 D7D1EC2202E; Sun, 21 Jan 2018 10:20:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D293AC22007; Sun, 21 Jan 2018 10:20:30 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 5F25FC2201C for ; Sun, 21 Jan 2018 10:20:26 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id w0LAJUZj005764; Sun, 21 Jan 2018 19:19:34 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w0LAJUZj005764 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1516529974; bh=IqNZQghHBEvqRyGgVbNj2waYoLvitRYBP8s5sRwRn7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GQBinX2SVaqzkayVKennCK581fsjrNSOUVNcuttYsGTOSmnngVTmWiDsQqK/gsL7e DS1UZ1L5Y5l77FY1FZ/Ujtkmyj7tKBXuUlVWT4vkfbN1BTdPzdB+pUFycq0YS0G7Bh Q2b+OcVJnsqjWyFHu1QRmYQW/q3jMazUjkSDZIK6MvBfPw+Mh3o2WaTBHJ5CdFuQSX jTfki7wrOpKAQL6+45+GOPdpmCcbaLzzzFzdbnm8p+u0N0biqwSBIIQh7SpAFwaMDX 6p4TusYrJCVXVjZlHqsaNjLPxMvDTfd14HXAP99FW8GnN0TJPJZYWcYM/vXtH9ZUdn FCY8HbP8JiGuw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sun, 21 Jan 2018 19:19:18 +0900 Message-Id: <1516529958-16441-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516529958-16441-1-git-send-email-yamada.masahiro@socionext.com> References: <1516529958-16441-1-git-send-email-yamada.masahiro@socionext.com> Cc: Joe Hershberger , "oliver@schinagl.nl" , Olliver Schinagl Subject: [U-Boot] [PATCH v3 6/6] libfdt: migrate include/libfdt_env.h to a wrapper 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" libfdt_env.h is supposed to provide system-dependent defines. scripts/dtc/libfdt/libfdt_env.h from upstream DTC is suitable for user-space, so we should use this for USE_HOSTCC case. For compiling U-Boot, we need to override such system-dependent defines, so use imported from Linux. selects a proper one. Maybe, we should split header inclusion completely, but I do not want too many patches at one. I can rip off the include/libfdt_env.h from HOST_EXTRACFLAGS. Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass --- Changes in v3: None include/libfdt_env.h | 29 +++++------------------------ tools/Makefile | 2 +- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/include/libfdt_env.h b/include/libfdt_env.h index ea26979..d7e9d32 100644 --- a/include/libfdt_env.h +++ b/include/libfdt_env.h @@ -1,24 +1,5 @@ -/* - * libfdt - Flat Device Tree manipulation (build/run environment adaptation) - * Copyright (C) 2007 Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com - * Original version written by David Gibson, IBM Corporation. - * - * SPDX-License-Identifier: LGPL-2.1+ - */ - -#ifndef _LIBFDT_ENV_H -#define _LIBFDT_ENV_H - -#include "compiler.h" -#include "linux/types.h" - -typedef __be16 fdt16_t; -typedef __be32 fdt32_t; -typedef __be64 fdt64_t; - -#define fdt32_to_cpu(x) be32_to_cpu(x) -#define cpu_to_fdt32(x) cpu_to_be32(x) -#define fdt64_to_cpu(x) be64_to_cpu(x) -#define cpu_to_fdt64(x) cpu_to_be64(x) - -#endif /* _LIBFDT_ENV_H */ +#ifdef USE_HOSTCC +#include "../scripts/dtc/libfdt/libfdt_env.h" +#else +#include +#endif diff --git a/tools/Makefile b/tools/Makefile index 1bfa6fa..9da1428 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -239,7 +239,7 @@ endif # !LOGO_BMP # Define __KERNEL_STRICT_NAMES to prevent typedef overlaps # Define _GNU_SOURCE to obtain the getline prototype from stdio.h # -HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \ +HOST_EXTRACFLAGS += -include $(srctree)/include/compiler.h \ $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \ -I$(srctree)/lib/libfdt \ -I$(srctree)/tools \