From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7198826225008115712 X-Received: by 2002:ac2:46d8:0:b0:4b5:1545:2229 with SMTP id p24-20020ac246d8000000b004b515452229mr2615599lfo.113.1676107378083; Sat, 11 Feb 2023 01:22:58 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:bd01:0:b0:293:ed1:1aaa with SMTP id n1-20020a2ebd01000000b002930ed11aaals1161622ljq.9.-pod-prod-gmail; Sat, 11 Feb 2023 01:22:56 -0800 (PST) X-Google-Smtp-Source: AK7set83JbQh4wRW0btnmiUfNXqTyu8Myg8vnB7px40rX9ua2D2i0cPOD2GbgbclrTTbCDahRvZJ X-Received: by 2002:a05:651c:2050:b0:28f:61f9:c51e with SMTP id t16-20020a05651c205000b0028f61f9c51emr4694803ljo.44.1676107375999; Sat, 11 Feb 2023 01:22:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676107375; cv=none; d=google.com; s=arc-20160816; b=0F5Sk6d6NdFn1P5SonCkoqwyoNaWLeXpwOSeniWPErvK5edkn9hNs1KEFvAAA+v2fe eIql0xlNMITps5+vxSFllKEVUKokyG3uoDR8Jioey0K4j+ke3UJIML9S+K7MwjnMaKmA mpYuKgymD5s138lqUMG+c4jirkJIHcpGsJveLkxGQFFqpVyogwD4kvM566yZtjvFDbGJ +lI7Zvn2oGl2QxFKzFkjYyNZ2Rw2LQbMqVqpd4aPJLSqCdN1wtI1PfMRgYkHVMaCnVwx cLUPUPz+rn32T6DMDrMi6Jb2d/WYHhpxzjSOZRS8lsL8AyFjFAk3AU/nGezn11iX0sMD vl9w== 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=wWJEBQTbOjl9/ws+HJMBcTXuMAp7zvADl6gH1C08s0CuwZKAwuffFFnmZxIAnN/AuG 7xDbAALPazgNb6jPkJuGw3x0UqEn0cPooXWTN/AbuOwJfePRl7xWShwQfwNSI6Vxc1TV Wenyha2XHPjOAG2ug5gQzenAkPuau8sPcF7wpSQLtpMCxXQ3RUTxn4+6kV76FLE99+XN w+vs6IgylV8QgowRboi8p++pXLmNktF/o6ZR0C01CTkETCZf0sn0ILW+rb+kCXXHTbZh lVV2f9RUpLTRVaEpbT673HkaWqttQ+NhNj0jyBS8nqZK5kBNh9gLpuyv4MjpqDFR4GhZ 6ibw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=HZbScjm2; spf=pass (google.com: domain of fm-72506-20230211092254968a5eacc754390811-jvwqoi@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-72506-20230211092254968a5eacc754390811-JvwQOi@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net. [185.136.64.226]) by gmr-mx.google.com with ESMTPS id f23-20020a05651c161700b0028b731e8e20si321643ljq.1.2023.02.11.01.22.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Feb 2023 01:22:55 -0800 (PST) Received-SPF: pass (google.com: domain of fm-72506-20230211092254968a5eacc754390811-jvwqoi@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) client-ip=185.136.64.226; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=HZbScjm2; spf=pass (google.com: domain of fm-72506-20230211092254968a5eacc754390811-jvwqoi@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-72506-20230211092254968a5eacc754390811-JvwQOi@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 20230211092254968a5eacc754390811 for ; Sat, 11 Feb 2023 10:22:55 +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=/XU/mgBaCMQhyes8TIpmVBzcdBa1I9da8HxbCwUt9ZY=; b=HZbScjm2trIn7MrySzTkr+9KPJIfueesKqqEl6GwPOBo2VTO6yjCAYRiljIYQxIf4rlpOw Ro9WKFfc++xY1Ii5E/+INHuDpYY/ZQD03d7z0fGb29XKF7SCje86iTEn0zRd0/QxYgqzcvRG FEmMoWcGdX44MfpkCbbsF3Rlc+6ZA=; From: Felix Moessbauer To: isar-users@googlegroups.com Cc: jan.kiszka@siemens.com, daniel.bovensiepen@siemens.com, florian.bezdeka@siemens.com, jay.zhou@starfivetech.com, Felix Moessbauer Subject: [PATCH v2 6/7] starfive-visionfive2: create u-boot-spl FIT image Date: Sat, 11 Feb 2023 09:21:51 +0000 Message-Id: <20230211092152.949442-7-felix.moessbauer@siemens.com> In-Reply-To: <20230211092152.949442-1-felix.moessbauer@siemens.com> References: <20230211092152.949442-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: 4/UcSn5MhTLt 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