From patchwork Tue Mar 11 09:13:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 328996 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 7D7C62C00AD for ; Tue, 11 Mar 2014 20:14:14 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9E83E4B199; Tue, 11 Mar 2014 10:14:12 +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 WvUEX4+iTQQ4; Tue, 11 Mar 2014 10:14:12 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5C0D64B579; Tue, 11 Mar 2014 10:14:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7860A4B579 for ; Tue, 11 Mar 2014 10:14:03 +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 roihc-KTkIpb for ; Tue, 11 Mar 2014 10:13:56 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-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 5360C4B199 for ; Tue, 11 Mar 2014 10:13:49 +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-maile12) with ESMTP id s2B9DSv5006855; Tue, 11 Mar 2014 18:13:28 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili15) with ESMTP id s2B9DSB08546; Tue, 11 Mar 2014 18:13:28 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi16) id s2B9DSbR027438; Tue, 11 Mar 2014 18:13:28 +0900 Received: from [10.184.179.11] by lomi16.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id s2B9DRPV027406; Tue, 11 Mar 2014 18:13:28 +0900 Date: Tue, 11 Mar 2014 18:13:26 +0900 From: Masahiro Yamada To: Gerhard Sittig In-Reply-To: <20140310193624.GC3327@book.gsilab.sittig.org> References: <201403101604.58362.manningc2@actrix.gen.nz> <20140310193624.GC3327@book.gsilab.sittig.org> X-BkSecure-Plugin: BkSecure.dll Ver 1, 2, 7, 0 Message-Id: <20140311181325.6F1B.AA925319@jp.panasonic.com> MIME-Version: 1.0 X-Mailer: Becky! ver. 2.64.06 [ja] Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH v7] socfpga: Add socfpga preloader signing to mkimage 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Hello Charles, Gerhard, > > > Is there any (real, technical) reason why the bzip stuff (the > > > CRC-32 calculation that has been made available separately) > > > cannot get built and used as a library, and the tools/ > > > application just gets linked against it as one would expect? > > > > From my limited understanding, lib/ is not built for the host. It is only > > built for the target. That is why we have all these ugly C files: crc32.c, > > sha1.c,... in tools/. > > With Kbuild, is the '#include "../otherdir/source.c" trick still > needed? Would a list of object files with relative path specs > work, or can object files in one output directory result from > compile units taken out of several source directories? In this case, object files with relative path such as "../lib/foo.o" does not work. If we write ../lib/foo.o in tools/Makefile, $(HOSTCC) will compile foo.o into lib/ directory. And lator it will be overwritten with the one compiled with $(CC). I thought this is a simple way to generate two objects from one source file, one is for hostprogs in tools/ and the other for the target in lib/. BTW, I sometimes see #include for "*.c" for example, drivers/usb/host/ehci-hcd.c of Linux Kernel, although I admit it is ugly. I agree we need to do something with it, but it's beyond the scope of this patch. > diff --git a/spl/Makefile b/spl/Makefile > index 346d0aa..4e0f33f 100644 > --- a/spl/Makefile > +++ b/spl/Makefile > @@ -182,6 +182,11 @@ MLO MLO.byteswap: $(obj)/u-boot-spl.bin > > ALL-y += $(obj)/$(SPL_BIN).bin > > +$(OBJTREE)/socfpga-signed-preloader.bin: $(obj)/u-boot-spl.bin > + $(OBJTREE)/tools/mkimage -T socfpgaimage -d $< $@ > + > +ALL-$(CONFIG_SOCFPGA) += $(OBJTREE)/socfpga-signed-preloader.bin > + > ifdef CONFIG_SAMSUNG > ALL-y += $(obj)/$(BOARD)-spl.bin > endif Could you re-write this part as follows, please? Best Regards Masahiro Yamada diff --git a/spl/Makefile b/spl/Makefile index bb3d349..9f3893e 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -184,6 +184,12 @@ MLO MLO.byteswap: $(obj)/u-boot-spl.bin ALL-y += $(obj)/$(SPL_BIN).bin +MKIMAGEFLAGS_socfpga-signed-preloader.bin := -T socfpgaimage +socfpga-signed-preloader.bin: $(obj)/u-boot-spl.bin + $(call cmd,mkimage) + +ALL-$(CONFIG_SOCFPGA) += socfpga-signed-preloader.bin + ifdef CONFIG_SAMSUNG ALL-y += $(obj)/$(BOARD)-spl.bin endif