From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 841AFC6377D for ; Thu, 22 Jul 2021 08:53:02 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A19116135D for ; Thu, 22 Jul 2021 08:53:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A19116135D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 142E0829FC; Thu, 22 Jul 2021 10:53:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1626943980; bh=SwedeXakcEoSY2PRvLN8Cxp/QHi8NExGIQAKvdp/aAQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=g22jPSVaKSJno/VyyhRHyoMPYthb7PosXni7UBJ7vZzLHVbJg2Gc8cXSCzN5CrGOE 6ZkTmmZC1dT4hnzQycaTvsWtMYPgc9ITnO1yQxS/pTjj9KfA9adVkNh48jokJe9BFF NRuy7l2QZFF9mtjue39dnP9FceDZ9fMZkvPeGkwTSXCutaf6hsh2T792m6fv94IxdE 5WUZMgwJAX3A3biBZCJIdEVYiI8JGLPPZPiLQ9NZHnLisXTMvbVHLKdI5krR+CbZTX nNnxnRpN0ZxwpDreEnYyehjzt1UtpRbKGMJEaxC0JzQJfM/bdfOSrfzPWtq0KPKCxv SSAslK3IsVysw== Received: by phobos.denx.de (Postfix, from userid 109) id 5339282C19; Thu, 22 Jul 2021 10:52:58 +0200 (CEST) Received: from mout-u-205.mailbox.org (mout-u-205.mailbox.org [91.198.250.254]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 667BB82991 for ; Thu, 22 Jul 2021 10:52:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-205.mailbox.org (Postfix) with ESMTPS id 4GVmS72RCpzQkGR; Thu, 22 Jul 2021 10:52:55 +0200 (CEST) Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id AS04lJMdQvGO; Thu, 22 Jul 2021 10:52:52 +0200 (CEST) Subject: Re: [PATCH u-boot-mvebu v2 37/41] tools: kwbimage: Remove v1 kwbimage SPL padding to CONFIG_SYS_U_BOOT_OFFS bytes To: =?UTF-8?Q?Marek_Beh=c3=ban?= , u-boot@lists.denx.de, Chris Packham , Baruch Siach , Dirk Eibach , Chris Packham Cc: Dennis Gilmore , Mario Six , Jon Nettleton , =?UTF-8?Q?Pali_Roh=c3=a1r?= References: <20210719122104.29698-1-marek.behun@nic.cz> <20210719122104.29698-38-marek.behun@nic.cz> From: Stefan Roese Message-ID: Date: Thu, 22 Jul 2021 10:52:50 +0200 MIME-Version: 1.0 In-Reply-To: <20210719122104.29698-38-marek.behun@nic.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F0FD185A X-Rspamd-UID: a7358a X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 19.07.21 14:21, Marek Behún wrote: > From: Pali Rohár > > This padding depends on board config file and therefore it makes the > mkimage binary tool board specific, which is not correct. One cannot use > mkimage tool built as a result for board A to generate images for board > B, even if both A and B are on the same platform. > > This CONFIG_SYS_U_BOOT_OFFS padding was needed when kwbimage v1 contained > SPL code which loaded main U-Boot binary based on CONFIG_SYS_U_BOOT_OFFS, > instead of reading correct offset from kwbimage header. > > Now that SPL code parses kwbimage header and deterinate correct offset, > there is no need for this CONFIG_SYS_U_BOOT_OFFS padding anymore. > > By removing it we also reduce the size of SPL code and therefore also > decrease the final size of v1 kwbimage. This means there is more space > for main U-Boot binary. > > Signed-off-by: Pali Rohár > Reviewed-by: Marek Behún > Reviewed-by: Chris Packham Reviewed-by: Stefan Roese Thanks, Stefan > --- > tools/Makefile | 4 ---- > tools/kwbimage.c | 13 ------------- > 2 files changed, 17 deletions(-) > > diff --git a/tools/Makefile b/tools/Makefile > index 7c27069c86..11a5a15bc2 100644 > --- a/tools/Makefile > +++ b/tools/Makefile > @@ -155,10 +155,6 @@ ifdef CONFIG_FIT_CIPHER > HOST_EXTRACFLAGS += -DCONFIG_FIT_CIPHER > endif > > -ifneq ($(CONFIG_SYS_U_BOOT_OFFS),) > -HOSTCFLAGS_kwbimage.o += -DCONFIG_SYS_U_BOOT_OFFS=$(CONFIG_SYS_U_BOOT_OFFS) > -endif > - > # MXSImage needs LibSSL > ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_FIT_SIGNATURE)$(CONFIG_FIT_CIPHER),) > HOSTCFLAGS_kwbimage.o += \ > diff --git a/tools/kwbimage.c b/tools/kwbimage.c > index 9ecda861e4..ccb0b92266 100644 > --- a/tools/kwbimage.c > +++ b/tools/kwbimage.c > @@ -979,19 +979,6 @@ static size_t image_headersz_v1(int *hasext) > *hasext = 1; > } > > -#if defined(CONFIG_SYS_U_BOOT_OFFS) > - if (headersz > CONFIG_SYS_U_BOOT_OFFS) { > - fprintf(stderr, > - "Error: Image header (incl. SPL image) too big!\n"); > - fprintf(stderr, "header=0x%x CONFIG_SYS_U_BOOT_OFFS=0x%x!\n", > - (int)headersz, CONFIG_SYS_U_BOOT_OFFS); > - fprintf(stderr, "Increase CONFIG_SYS_U_BOOT_OFFS!\n"); > - return 0; > - } > - > - headersz = CONFIG_SYS_U_BOOT_OFFS; > -#endif > - > /* > * The payload should be aligned on some reasonable > * boundary > Viele Grüße, Stefan -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de