From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7220354510442463232 X-Received: by 2002:a5d:448f:0:b0:2ef:b8e3:4708 with SMTP id j15-20020a5d448f000000b002efb8e34708mr961708wrq.11.1681119806795; Mon, 10 Apr 2023 02:43:26 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6000:16c3:b0:2f0:2ddf:651e with SMTP id h3-20020a05600016c300b002f02ddf651els4187607wrf.3.-pod-prod-gmail; Mon, 10 Apr 2023 02:43:25 -0700 (PDT) X-Google-Smtp-Source: AKy350Zzm7VCIOUQYVBBgQ92MVmqIUVwJpwk+JusEA9tkc0Od7KKlSrOk/xadwTMjLBxwICb5pvc X-Received: by 2002:a5d:5946:0:b0:2f0:244c:277b with SMTP id e6-20020a5d5946000000b002f0244c277bmr2524531wri.27.1681119805213; Mon, 10 Apr 2023 02:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681119805; cv=none; d=google.com; s=arc-20160816; b=vNbZF8Dsqxkc8PCv/vY5Ifz77VsA49vPl2RIxbcJNTq7s6L7s3hNNFlgJ+JP4kAxir eFgK5zj0BH0kebKG6ypUrMBiGU8hNVD2r/l00RX47ZuxYem7foCR3iE04ZaOO8iRNS7+ ZV4j6jXKpoAGiKUXACEW4M1nhj0WKt0yFUJsu4HukWYxVRjsVpYjpZiZkKfHw0EnJ8GX EGHjMfptAU0EGok/XJIGN174fw59VT4yxlcOPXqXeH5+J/O6XpPaiXnntn7+bMgO7cvR I1VeJZdTWZXuUN2cVU/3gUvdFtrTrxTPcKYFPtTnpO5Dw0VddpSOLsuJTBgkpOT6UAhn QRTg== 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=/XU/mgBaCMQhyes8TIpmVBzcdBa1I9da8HxbCwUt9ZY=; b=FnGov3zToSR8d4ccwpcZkAzAmZEdFRbQUZCx/qIHeWBXuQFcdsjlc/gQTvFf4hDXgz jr+eHao8cahquIJ5+VZyGYrwmND/heiSmESdb2zMxr9QS7K1VzNns5H7i2wlGpehThjg RKgvXZzcgmI93lyL65d+jeiLuhAioKY8sprJLopMcw5/jJvZwl5GCrNYBBlTDrYiMyno Gbg7uR/37m/gU1jsUwg18cC0Zzn1+Mh0aK5w1S9cl5IMqpm8cI1BFYoo1I5LnEy99DR9 1pyWOtQadOmN7/vaYl8spsK7LVySrJt69NNK5+PiBlFEt/GpVOOotjHxcWNoH+FH1jON U2og== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=mpGHJt+b; spf=pass (google.com: domain of fm-72506-20230410094325af094dc2045b7b47d3-fvy5lp@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-72506-20230410094325af094dc2045b7b47d3-FVy5lp@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net. [185.136.64.227]) by gmr-mx.google.com with ESMTPS id e7-20020a5d6d07000000b002ec0293a208si445796wrq.6.2023.04.10.02.43.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2023 02:43:25 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-72506-20230410094325af094dc2045b7b47d3-fvy5lp@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) client-ip=185.136.64.227; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=mpGHJt+b; spf=pass (google.com: domain of fm-72506-20230410094325af094dc2045b7b47d3-fvy5lp@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-72506-20230410094325af094dc2045b7b47d3-FVy5lp@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 20230410094325af094dc2045b7b47d3 for ; Mon, 10 Apr 2023 11:43:25 +0200 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=/XU/mgBaCMQhyes8TIpmVBzcdBa1I9da8HxbCwUt9ZY=; b=mpGHJt+bjH2LLvsiSeoj4qCdTW4nCrzbckMq6X8kL07Y/eOX0dhau4Bjx4PFkSIjkf/yuq vX3sjq0eBVlnNKMZD7zXnR+6kQWilTmr1MNMhHcmVkO6FCnt9YimMHgyzGqNeGiIIhIzWF9u JfslpfE/U6Col89L9ja8o+W5pCR2M=; 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 v4 5/6] starfive-visionfive2: create u-boot-spl FIT image Date: Mon, 10 Apr 2023 09:42:51 +0000 Message-Id: <20230410094252.1151370-6-felix.moessbauer@siemens.com> In-Reply-To: <20230410094252.1151370-1-felix.moessbauer@siemens.com> References: <20230410094252.1151370-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: 9VwipJsRNoD5 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.34.1