From patchwork Wed Dec 18 06:17:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 302651 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id EB4AA2C0096 for ; Wed, 18 Dec 2013 17:19:33 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 908EE4AA5D; Wed, 18 Dec 2013 07:19:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zyWNbAWLxtbE; Wed, 18 Dec 2013 07:19:28 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8E4734A9B1; Wed, 18 Dec 2013 07:18:36 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EBB754A090 for ; Wed, 18 Dec 2013 07:18:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9yWAM49IvVKf for ; Wed, 18 Dec 2013 07:18:19 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=SKIP(-1.5) (only DNSBL check requested) Received: from smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by theia.denx.de (Postfix) with ESMTP id 4B0C94A098 for ; Wed, 18 Dec 2013 07:18:12 +0100 (CET) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile14) with ESMTP id rBI6I6hq002583; Wed, 18 Dec 2013 15:18:06 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili14) with ESMTP id rBI6I6L10943; Wed, 18 Dec 2013 15:18:06 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi16) id rBI6I6hJ022182; Wed, 18 Dec 2013 15:18:06 +0900 Received: from poodle by lomi16.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id rBI6I6Qn022155; Wed, 18 Dec 2013 15:18:06 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 6C7512743A5E; Wed, 18 Dec 2013 15:18:06 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 18 Dec 2013 15:17:22 +0900 Message-Id: <1387347473-29146-5-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1387347473-29146-1-git-send-email-yamada.m@jp.panasonic.com> References: <1387347473-29146-1-git-send-email-yamada.m@jp.panasonic.com> Cc: Tom Rini Subject: [U-Boot] [PATCH v2 04/35] board: samsung: refactor host programs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Some Samsung boards have their own tools under board/samsung//tools/. This commit refactor more makefiles with "hostprogs-y". Signed-off-by: Masahiro Yamada --- Note1: Samsung boards have tools under board/samsung//tools/ and have tools/mkexynosspl.c too. It is inconsistent, so we should choose the appropriate directory in which Samsung-specific tools are stored. Note2: I marded TODO item in board/samsung/origen/Makefile. Samsung engineers, I hope you will fix the root cause of the warning. # omit -O2 option to suppress # warning: dereferencing type-punned pointer will break strict-aliasing rules # # TODO: # Fix the root cause in tools/mkorigenspl.c and delete the following work-around $(obj)/tools/mkorigenspl: HOSTCFLAGS:=$(filter-out -O2,$(HOSTCFLAGS)) Changes in v2: None Makefile | 1 + board/samsung/origen/Makefile | 20 ++++++++++---------- .../origen/tools/{mkv310_image.c => mkorigenspl.c} | 0 board/samsung/smdkv310/Makefile | 15 ++++----------- .../tools/{mkv310_image.c => mksmdkv310spl.c} | 0 spl/Makefile | 4 ++-- 6 files changed, 17 insertions(+), 23 deletions(-) rename board/samsung/origen/tools/{mkv310_image.c => mkorigenspl.c} (100%) rename board/samsung/smdkv310/tools/{mkv310_image.c => mksmdkv310spl.c} (100%) diff --git a/Makefile b/Makefile index cd32ba3..2ab24bd 100644 --- a/Makefile +++ b/Makefile @@ -782,6 +782,7 @@ clean: $(obj)tools/proftool @rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image} \ $(obj)board/matrix_vision/*/bootscript.img \ + $(obj)spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl \ $(obj)u-boot.lds \ $(obj)arch/blackfin/cpu/init.{lds,elf} @rm -f $(obj)include/bmp_logo.h diff --git a/board/samsung/origen/Makefile b/board/samsung/origen/Makefile index e8818bf..31e88f4 100644 --- a/board/samsung/origen/Makefile +++ b/board/samsung/origen/Makefile @@ -4,16 +4,16 @@ # SPDX-License-Identifier: GPL-2.0+ # -ifndef CONFIG_SPL_BUILD -obj-y += origen.o -endif - ifdef CONFIG_SPL_BUILD -all: $(OBJTREE)/tools/mk$(BOARD)spl -endif +hostprogs-y := tools/mkorigenspl +always := $(hostprogs-y) -# Fix ME after we implement hostprogs-y. -ifdef CONFIG_SPL_BUILD -$(OBJTREE)/tools/mk$(BOARD)spl: tools/mkv310_image.c - $(HOSTCC) tools/mkv310_image.c -o $(OBJTREE)/tools/mk$(BOARD)spl +# omit -O2 option to suppress +# warning: dereferencing type-punned pointer will break strict-aliasing rules +# +# TODO: +# Fix the root cause in tools/mkorigenspl.c and delete the following work-around +$(obj)tools/mkorigenspl: HOSTCFLAGS:=$(filter-out -O2,$(HOSTCFLAGS)) +else +obj-y += origen.o endif diff --git a/board/samsung/origen/tools/mkv310_image.c b/board/samsung/origen/tools/mkorigenspl.c similarity index 100% rename from board/samsung/origen/tools/mkv310_image.c rename to board/samsung/origen/tools/mkorigenspl.c diff --git a/board/samsung/smdkv310/Makefile b/board/samsung/smdkv310/Makefile index dbc621b..9e37b4e 100644 --- a/board/samsung/smdkv310/Makefile +++ b/board/samsung/smdkv310/Makefile @@ -4,16 +4,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -ifndef CONFIG_SPL_BUILD -obj-y += smdkv310.o -endif - ifdef CONFIG_SPL_BUILD -all: $(OBJTREE)/tools/mk$(BOARD)spl -endif - -# Fix ME after we implement hostprogs-y. -ifdef CONFIG_SPL_BUILD -$(OBJTREE)/tools/mk$(BOARD)spl: tools/mkv310_image.c - $(HOSTCC) tools/mkv310_image.c -o $(OBJTREE)/tools/mk$(BOARD)spl +hostprogs-y := tools/mksmdkv310spl +always := $(hostprogs-y) +else +obj-y += smdkv310.o endif diff --git a/board/samsung/smdkv310/tools/mkv310_image.c b/board/samsung/smdkv310/tools/mksmdkv310spl.c similarity index 100% rename from board/samsung/smdkv310/tools/mkv310_image.c rename to board/samsung/smdkv310/tools/mksmdkv310spl.c diff --git a/spl/Makefile b/spl/Makefile index b23ade8..a3253ba 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -156,8 +156,8 @@ all: $(ALL-y) ifdef CONFIG_SAMSUNG $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin - $(if $(wildcard $(OBJTREE)/tools/mk$(BOARD)spl),\ - $(OBJTREE)/tools/mk$(BOARD)spl,\ + $(if $(wildcard $(OBJTREE)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl),\ + $(OBJTREE)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl,\ $(OBJTREE)/tools/mkexynosspl) $< $@ endif