From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7198826225008115712 X-Received: by 2002:a17:906:4744:b0:8b1:780d:e43d with SMTP id j4-20020a170906474400b008b1780de43dmr7075469ejs.13.1679059327639; Fri, 17 Mar 2023 06:22:07 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6402:2908:b0:4ac:b59b:6e28 with SMTP id ee8-20020a056402290800b004acb59b6e28ls5512682edb.2.-pod-prod-gmail; Fri, 17 Mar 2023 06:22:05 -0700 (PDT) X-Google-Smtp-Source: AK7set/H7eM9Rtab+7u+/YEgxqg+XGei2PK0CB6J/xUj/tIVLUN8cZAQ00rP/gGw9Kh7lmi2ekGc X-Received: by 2002:a50:fe99:0:b0:4fb:395a:6aa5 with SMTP id d25-20020a50fe99000000b004fb395a6aa5mr2851657edt.9.1679059325923; Fri, 17 Mar 2023 06:22:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679059325; cv=none; d=google.com; s=arc-20160816; b=WfWXuNVISltI+/xuGa69v+q/0aFAG3d6h/QryD2TQrPbQleeSvyZAnlKKi1QL1egwc PZdi2NpfXkQEoURk3Jm6LwtC8Pp+XsffR+WjlUedK0PmdmHZ4uwAdtrU2VocwzaiSTnd Hhp1CjyNwaRRJ8LY3eXIYyMAgdj9sKTlh/rjNmmEFFXkFhOPPkyoLggFSbJCxdK4xPuZ SQmopjLbO+G81Srl3NMNdeV8Qj+E0/pYxzVpGeU6+1gKWGwgmbU0NXx6aCnB+weKBjWm 7WVYLx6LEv/6vkojotNLOkW7CTU2Xk7cHoS05lPjVbGuLuG80rkmOSHMnVl7Jx0uwMOE +b5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=15nwzJYNf+cSQEA+wQQO5OguwAz1AL3lN0Rkg1QXQRw=; b=lS48Da+KNXROtl1V8KWG6ad4lr4Wp0FqiaE0Ay2qrKmrzei3aBBCq/SQagyfW1xElo rcFCfVGaI/rjR1kx1Y/zv2ncPnOYiz8BivTfEDdqCv1ZW+0+03jpHPeMzwWgOOKuFwaM zLu5FZzROuqKCpubpyfBTH5IpSOPkHrYWsOoSiw79cs5SITxEb2CAQAiVAfphKD5wwhf JL4OPAz+1e3UDI6jIbiufwchq1btvZL8gusSXUcw9Xh8Ejm5dVHXlsorKxVlLda/Bbbo T6+qsLjSwIxNVLGDgWfWxvga72Z1sCcbR8ysdij52HpVcKqh66AA+ELs2NxYFjHoRWs+ PZcA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=hnxFVAbT; spf=pass (google.com: domain of fm-72506-20230317132205abf0d3b65e34a09a46-httcwa@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-72506-20230317132205abf0d3b65e34a09a46-httcwa@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net. [185.136.65.226]) by gmr-mx.google.com with ESMTPS id d16-20020a056402401000b0046c3ce626bdsi112833eda.2.2023.03.17.06.22.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2023 06:22:05 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-72506-20230317132205abf0d3b65e34a09a46-httcwa@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) client-ip=185.136.65.226; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=hnxFVAbT; spf=pass (google.com: domain of fm-72506-20230317132205abf0d3b65e34a09a46-httcwa@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-72506-20230317132205abf0d3b65e34a09a46-httcwa@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 20230317132205abf0d3b65e34a09a46 for ; Fri, 17 Mar 2023 14:22:05 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=felix.moessbauer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=15nwzJYNf+cSQEA+wQQO5OguwAz1AL3lN0Rkg1QXQRw=; b=hnxFVAbTsyjXf/gLH/TSJu0NEKlo7VkUbBPPbakC+QlrKyIjOZMn05Gc1E15lrsApHetIg viYlu8jRRAi1fkXXCD6gFeUudZqVHbr6HGCKKc0VnLZdSGjOKTwyWG6AH2oz39BOTPcnPGuP OmEPXEnrUwgeECpdLuuYIYD5/mriI=; From: Felix Moessbauer To: isar-users@googlegroups.com Cc: jan.kiszka@siemens.com, daniel.bovensiepen@siemens.com, florian.bezdeka@siemens.com, Felix Moessbauer Subject: [PATCH v3 6/7] starfive-visionfive2: create u-boot-spl FIT image Date: Fri, 17 Mar 2023 14:21:05 +0100 Message-Id: <20230317132106.1111258-7-felix.moessbauer@siemens.com> In-Reply-To: <20230317132106.1111258-1-felix.moessbauer@siemens.com> References: <20230317132106.1111258-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-72506:519-21489:flowmailer X-TUID: 44zhimrHcg1G Signed-off-by: Felix Moessbauer --- .../files/rules.tmpl | 12 ++++++ .../files/visionfive2-u-boot-firmware.install | 1 + .../visionfive2-uboot-fit-image.its.tmpl | 41 +++++++++++++++++++ .../visionfive2-u-boot-firmware.bb | 36 ++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 meta-isar/recipes-bsp/visionfive2-u-boot-firmware/files/rules.tmpl create mode 100644 meta-isar/recipes-bsp/visionfive2-u-boot-firmware/files/visionfive2-u-boot-firmware.install create mode 100644 meta-isar/recipes-bsp/visionfive2-u-boot-firmware/files/visionfive2-uboot-fit-image.its.tmpl create mode 100644 meta-isar/recipes-bsp/visionfive2-u-boot-firmware/visionfive2-u-boot-firmware.bb diff --git a/meta-isar/recipes-bsp/visionfive2-u-boot-firmware/files/rules.tmpl b/meta-isar/recipes-bsp/visionfive2-u-boot-firmware/files/rules.tmpl new file mode 100644 index 00000000..4826f7d6 --- /dev/null +++ b/meta-isar/recipes-bsp/visionfive2-u-boot-firmware/files/rules.tmpl @@ -0,0 +1,12 @@ +#!/usr/bin/make -f + +KERNEL_VERSION=$(shell find /usr/lib/ -maxdepth 1 -type d -name 'linux-image-*' | head -1 | sed 's/.*linux-image-//g') + +override_dh_auto_configure: + sed -i 's||$(KERNEL_VERSION)|g' visionfive2-uboot-fit-image.its + +override_dh_auto_build: + mkimage -A riscv -O u-boot -f ${IMAGE_ITS_FILE} visionfive2_fw_payload.img + +%: + dh $@ diff --git a/meta-isar/recipes-bsp/visionfive2-u-boot-firmware/files/visionfive2-u-boot-firmware.install b/meta-isar/recipes-bsp/visionfive2-u-boot-firmware/files/visionfive2-u-boot-firmware.install new file mode 100644 index 00000000..d1bdf6d6 --- /dev/null +++ b/meta-isar/recipes-bsp/visionfive2-u-boot-firmware/files/visionfive2-u-boot-firmware.install @@ -0,0 +1 @@ +visionfive2_fw_payload.img usr/share/visionfive2-u-boot-firmware diff --git a/meta-isar/recipes-bsp/visionfive2-u-boot-firmware/files/visionfive2-uboot-fit-image.its.tmpl b/meta-isar/recipes-bsp/visionfive2-u-boot-firmware/files/visionfive2-uboot-fit-image.its.tmpl new file mode 100644 index 00000000..4cbe9318 --- /dev/null +++ b/meta-isar/recipes-bsp/visionfive2-u-boot-firmware/files/visionfive2-uboot-fit-image.its.tmpl @@ -0,0 +1,41 @@ +/dts-v1/; + +/ { + description = "U-boot-spl FIT image for JH7110 VisionFive2"; + #address-cells = <2>; + + images { + firmware { + description = "u-boot"; + data = /incbin/("/usr/lib/opensbi/starfive-visionfive2/fw_payload.bin"); + type = "firmware"; + arch = "riscv"; + os = "u-boot"; + load = <0x0 0x40000000>; + entry = <0x0 0x40000000>; + compression = "none"; + }; + fdt { + description = "DTB"; + data = /incbin/("/usr/lib/linux-image-/${DTB_FILES}"); + type = "flat_dt"; + arch = "riscv"; + compression = "none"; + load = <0x46000000>; + entry = <0x46000000>; + hash { + algo = "sha1"; + }; + }; + }; + + configurations { + default = "config-1"; + + config-1 { + description = "U-boot-spl FIT config for JH7110 VisionFive2"; + firmware = "firmware"; + fdt = "fdt"; + }; + }; +}; diff --git a/meta-isar/recipes-bsp/visionfive2-u-boot-firmware/visionfive2-u-boot-firmware.bb b/meta-isar/recipes-bsp/visionfive2-u-boot-firmware/visionfive2-u-boot-firmware.bb new file mode 100644 index 00000000..b2303968 --- /dev/null +++ b/meta-isar/recipes-bsp/visionfive2-u-boot-firmware/visionfive2-u-boot-firmware.bb @@ -0,0 +1,36 @@ +# +# Copyright (c) Siemens AG, 2023 +# +# SPDX-License-Identifier: MIT + +inherit dpkg + +DESCRIPTION = "StarFive VisionFive 2 u-boot firmware" + +IMAGE_ITS_FILE = "visionfive2-uboot-fit-image.its" +SRC_URI = " \ + file://${IMAGE_ITS_FILE}.tmpl \ + file://rules.tmpl \ + file://visionfive2-u-boot-firmware.install" + +DEPENDS += "opensbi-starfive-visionfive2 linux-image-${KERNEL_NAME}" +DEBIAN_BUILD_DEPENDS += "opensbi-starfive-visionfive2, u-boot-tools, device-tree-compiler, linux-image-${KERNEL_NAME}" + +TEMPLATE_FILES = "${IMAGE_ITS_FILE}.tmpl rules.tmpl" +TEMPLATE_VARS = "IMAGE_ITS_FILE DTB_FILES" + +do_prepare_build[cleandirs] += "${S}/debian" +do_prepare_build(){ + cp ${WORKDIR}/${IMAGE_ITS_FILE} ${S}/ + cp ${WORKDIR}/visionfive2-u-boot-firmware.install ${S}/debian/ + deb_debianize +} + +do_deploy() { + dpkg --fsys-tarfile ${WORKDIR}/visionfive2-u-boot-firmware_${PV}*.deb | \ + tar xOf - "./usr/share/visionfive2-u-boot-firmware/visionfive2_fw_payload.img" \ + > "${DEPLOY_DIR_IMAGE}/visionfive2_fw_payload.img" +} + +addtask deploy after do_dpkg_build before do_build +do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}" -- 2.30.2