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: 857342 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="zPNS4+Dq"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zG6ZX18y9z9s75 for ; Tue, 9 Jan 2018 20:40:36 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 99FACC220B7; 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 \