From patchwork Tue Jan 9 09:34:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 123836 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3807147qgn; Tue, 9 Jan 2018 01:40:58 -0800 (PST) X-Google-Smtp-Source: ACJfBottL8ARLFdyV8J3Y3Xf3UtlcmFg5JpiwrNCxa1dufIcA+pU6eacxl1acn7d2weJn8hbZenH X-Received: by 10.80.184.25 with SMTP id j25mr20505627ede.5.1515490858665; Tue, 09 Jan 2018 01:40:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515490858; cv=none; d=google.com; s=arc-20160816; b=D/Sxq00dxZLFyOsVE2V/jR668gduzMQHX2f9FE6y73EV2nJOFP/wR9MDCVkMajInKv vY0Tky+PIyhjTTN97a0uhdeBJRlWQJjP1km7kBFdl2MGSWyo+Etk7abZDrw1Di9KN88U s4ocLPcqm4zksQxsp09X2Q6cgbCDbZ9T+UPtRaa/MR1KhSVIet85Irt0c5pCknoZ5hg/ XmI9sxfLf4rxwG/WFpnLa2aEWiGjGVcfWrhM2L4OV8HtH1+nPLl0Tx4lWGopk+zsO/Ne DA8kX5w8EsjpF6xHM9fqq1S4qKGf55LtbN/3L+6qRCz+KAaYBHgSlMjIdwl1nHdm+wqk xC3w== 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=C5qR25aOfbsj6oJk5DI+lsbIJZPVQf1+gz5OMSwqgUg=; b=b5VE6RJvTdji97+jj3bQhA159LWNhEFGOLPnGsQZEauwe8A7hNKlTzk6UXF7Q4cj/H CdKlLF+OXfhPK7XeqcFjAWvb1fCH0buofLuARDOMwzKr8BF/SHMjfFa7jVw0roiXBMMC QIa9sITXVdoiy+dPeHn0aFyaZApSYyAkI9+LIgJLr4bdmkohfEGObA1+7hSDks7GSWfm 6MuNw5mBeQ5bEwRjvNvYCPo1LAbUjBGbcuwPt4Llmd1VniayijL6KUBFoJb9iAYU2vNz Kh3VnKig71y1rN629iN4YXStdj4ACILvTxRfdArDIdLrVLe080ZNy1eiwCNoRsUQr+yU SOHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=zPNS4+Dq; 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 z48si276100edd.259.2018.01.09.01.40.58; Tue, 09 Jan 2018 01:40:58 -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=zPNS4+Dq; 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 42F43C220F9; Tue, 9 Jan 2018 09:40:02 +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 882ECC220F9; Tue, 9 Jan 2018 09:36:14 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id ADF09C220DC; Tue, 9 Jan 2018 09:35:50 +0000 (UTC) Received: from conuserg-12.nifty.com (conuserg-12.nifty.com [210.131.2.79]) by lists.denx.de (Postfix) with ESMTPS id B0585C220DA for ; Tue, 9 Jan 2018 09:35:45 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id w099YtdK013772; Tue, 9 Jan 2018 18:35:00 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com w099YtdK013772 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1515490500; bh=g8Zn+T+PiLA/ml2AYX1hbUPHP2MfRJWOZPHOxZ8niqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zPNS4+DqS/m+fIxLY6nBm6lnu/Co4Taooaa9XplqNKywHmW648SfyRmEqsoaoQCSW M3EKSTuihmaCK9YGlth+pWLh54w6/0Ymx3u8o+RBqM6zTiTp7mA5dkLNQrrzNSAqMf LbrDxarVSdQUo8NRjslwvW1FzCKfZYTgQMKAR4ib3F9VLI4tayyyKN382nJ6DmAPEt aeahLGC7Q8ziXpzsg0XJM0IGWU0BV+0ye/7owx84ORuYGcKuyhZu3+0jd4UC2CqfGJ sGWqbD+B6450M6UxDQS8o/MBKjF2Am98wRTJ1b84sLwizWvac7+6xQRGPAoT3QAeWn g3in+gGMI0sHw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Tue, 9 Jan 2018 18:34:52 +0900 Message-Id: <1515490492-29434-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515490492-29434-1-git-send-email-yamada.masahiro@socionext.com> References: <1515490492-29434-1-git-send-email-yamada.masahiro@socionext.com> Cc: Tom Rini , Stefan Roese , Emmanuel Vadot , "oliver@schinagl.nl" , Olliver Schinagl Subject: [U-Boot] [PATCH 7/7] 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. I can rip off the include/libfdt_env.h from HOST_EXTRACFLAGS. Adding all sort of stuff to the include path just for suppressing errors is a crazy idea. Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass --- 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 3274487..2333646 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -238,7 +238,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 \