From patchwork Tue Apr 16 16:14:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bence.balogh@arm.com X-Patchwork-Id: 42540 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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEDFDC04FF6 for ; Tue, 16 Apr 2024 16:15:04 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.25353.1713284096837072744 for ; Tue, 16 Apr 2024 09:14:56 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: bence.balogh@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A1554DA7; Tue, 16 Apr 2024 09:15:24 -0700 (PDT) Received: from e126523.budapest.arm.com (e126523.budapest.arm.com [10.45.26.201]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E617F3F792; Tue, 16 Apr 2024 09:14:55 -0700 (PDT) From: bence.balogh@arm.com To: meta-arm@lists.yoctoproject.org Cc: Bence Balogh Subject: [PATCH 1/3] arm-bsp/corstone1000-flash-firmware-image: add nopt generation Date: Tue, 16 Apr 2024 18:14:44 +0200 Message-Id: <20240416161446.217376-2-bence.balogh@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240416161446.217376-1-bence.balogh@arm.com> References: <20240416161446.217376-1-bence.balogh@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 16 Apr 2024 16:15:04 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arm/message/5551 From: Bence Balogh The .nopt image is used during the UEFI Update Capsule generation. This .nopt image was generated manually when it was needed. Signed-off-by: Bence Balogh --- .../images/corstone1000-flash-firmware-image.bb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/meta-arm-bsp/recipes-bsp/images/corstone1000-flash-firmware-image.bb b/meta-arm-bsp/recipes-bsp/images/corstone1000-flash-firmware-image.bb index 73fc1766..5238d1d3 100644 --- a/meta-arm-bsp/recipes-bsp/images/corstone1000-flash-firmware-image.bb +++ b/meta-arm-bsp/recipes-bsp/images/corstone1000-flash-firmware-image.bb @@ -38,6 +38,11 @@ RE_LAYOUT_WRAPPER_VERSION = "0.0.7" TFM_SIGN_PRIVATE_KEY = "${libdir}/tfm-scripts/root-RSA-3072_1.pem" RE_IMAGE_OFFSET = "0x1000" +# Offsets for the .nopt image generation +TFM_OFFSET = "102400" +FIP_OFFSET = "479232" +KERNEL_OFFSET = "2576384" + do_sign_images() { # Sign TF-A BL2 sign_host_image ${RECIPE_SYSROOT}/firmware/${TFA_BL2_BINARY} \ @@ -56,3 +61,15 @@ do_sign_images() { do_sign_images[depends] = "\ fiptool-native:do_populate_sysroot \ " + +# This .nopt image is not the same as the one which is generated by meta-arm/meta-arm/classes/wic_nopt.bbclass. +# The meta-arm/meta-arm/classes/wic_nopt.bbclass removes the partition table from the wic image, but keeps the +# second bank. This function creates a no-partition image with only the first bank. +create_nopt_image() { + dd conv=notrunc bs=1 if=${DEPLOY_DIR_IMAGE}/bl2_signed.bin of=${B}/${MACHINE}_image.nopt + dd conv=notrunc bs=1 if=${DEPLOY_DIR_IMAGE}/tfm_s_signed.bin of=${B}/${MACHINE}_image.nopt seek=${TFM_OFFSET} + dd conv=notrunc bs=1 if=${DEPLOY_DIR_IMAGE}/signed_fip-corstone1000.bin of=${B}/${MACHINE}_image.nopt seek=${FIP_OFFSET} + dd conv=notrunc bs=1 if=${DEPLOY_DIR_IMAGE}/Image.gz-initramfs-${MACHINE}.bin of=${B}/${MACHINE}_image.nopt seek=${KERNEL_OFFSET} +} +create_nopt_image[depends] += "mc:firmware:linux-yocto:do_deploy" +do_image_uefi_capsule[prefuncs] += "create_nopt_image"