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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B8703C433FE for ; Sun, 13 Nov 2022 13:55:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2342285160; Sun, 13 Nov 2022 14:55:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="WdBOA6dZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8406D84D45; Sun, 13 Nov 2022 14:55:52 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 824B584B0C for ; Sun, 13 Nov 2022 14:55:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=jitloonl@ecsmtp.png.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668347748; x=1699883748; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=91CHGLNsZls4c8SS3sFVZ53x9VSyf/l1mBdGOn+Z8zg=; b=WdBOA6dZkiBlwQkqdR76peHE9oEIZaU1mdULiLUslGkqhXXKmkwcfoZd sWfzGS+2tZLWNCuaDTzj8qDSpsrSTRC9gD80hYFzO06XBiX0DI3EJNVxu GNkItay4QW96X8vpOO/+Kr0qR57i34S+WYDvbYu+LuABm+l7XUSX8k7XZ WwvzYcSQPitGtOWSqXjIMsL4PjgKGYVmnbuJHYvqYBsk+zMeYhi9wehKD bcIPnr8yFCp4FQd9LUt1BAbbsl6MZPOQcqDU0UehCiQb5C5r0jMrLGBux 6LPquyahTAklZClS2pqkWU3ekJw/3C/LH2J/9MRLkLKzgc/3dFVN0OH2D g==; X-IronPort-AV: E=McAfee;i="6500,9779,10529"; a="292211347" X-IronPort-AV: E=Sophos;i="5.96,161,1665471600"; d="scan'208";a="292211347" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2022 05:55:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10529"; a="763166441" X-IronPort-AV: E=Sophos;i="5.96,161,1665471600"; d="scan'208";a="763166441" Received: from pglmail07.png.intel.com ([10.221.193.207]) by orsmga004.jf.intel.com with ESMTP; 13 Nov 2022 05:55:41 -0800 Received: from localhost (pgli0028.png.intel.com [10.221.84.177]) by pglmail07.png.intel.com (Postfix) with ESMTP id 4428D4837; Sun, 13 Nov 2022 21:55:41 +0800 (+08) Received: by localhost (Postfix, from userid 12048045) id 2FBB8E0094D; Sun, 13 Nov 2022 21:55:41 +0800 (+08) From: Jit Loon Lim To: u-boot@lists.denx.de Cc: Jagan Teki , Vignesh R , Marek , Simon , Tien Fong , Kok Kiang , Siew Chin , Sin Hui , Raaj , Dinesh , Boon Khai , Alif , Teik Heng , Hazim , Jit Loon Lim , Sieu Mun Tang , Ley Foon Tan Subject: [PATCH 1/4] makefile: tools: socfpgaimage: update padding flow Date: Sun, 13 Nov 2022 21:55:33 +0800 Message-Id: <20221113135536.9920-1-jit.loon.lim@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean From: Ley Foon Tan HSD #1508690657-2: The existing socfpgaimage always pads the image to the maximum size of OCRAM size. This will break in the encryption flow where it expects the image to be un-padded. The encryption tool will do the encryption for the whole image and append the signature key at end of the image. The signature key will append to beyond the size of OCRAM if the image is padded with the maximum size before encryption. Move the padding step from socfpgaimage to Makefile and pads with objcopy command. socfpgaimage will pad the image with 16 bytes aligned (including CRC word), this is a requirement in encryption flow. Signed-off-by: Ley Foon Tan Signed-off-by: Jit Loon Lim --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ff25f92974..04914a8bec 100644 --- a/Makefile +++ b/Makefile @@ -1606,8 +1606,14 @@ spl/u-boot-splx4.sfp: spl/u-boot-spl.sfp FORCE $(call if_changed,gensplx4) quiet_cmd_socboot = SOCBOOT $@ -cmd_socboot = cat spl/u-boot-splx4.sfp u-boot.img > $@ || { rm -f $@; false; } -u-boot-with-spl.sfp: spl/u-boot-splx4.sfp u-boot.img FORCE +cmd_socboot = $(OBJCOPY) -I binary -O binary --gap-fill=0x0 \ + --pad-to=$(CONFIG_SPL_PAD_TO) \ + spl/u-boot-spl.sfp spl/u-boot-spl.sfp && \ + cat spl/u-boot-spl.sfp spl/u-boot-spl.sfp \ + spl/u-boot-spl.sfp \ + spl/u-boot-spl.sfp > spl/u-boot-splx4.sfp ; \ + cat spl/u-boot-splx4.sfp u-boot.img > $@ || rm -f $@ +u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE $(call if_changed,socboot) quiet_cmd_gensplpadx4 = GENSPLPADX4 $@ -- 2.26.2