public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Felix Moessbauer <felix.moessbauer@siemens.com>
To: isar-users@googlegroups.com
Cc: jan.kiszka@siemens.com, daniel.bovensiepen@siemens.com,
	florian.bezdeka@siemens.com,
	Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH v3 5/7] starfive-visionfive2: create u-boot-spl firmware
Date: Fri, 17 Mar 2023 14:21:04 +0100	[thread overview]
Message-ID: <20230317132106.1111258-6-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20230317132106.1111258-1-felix.moessbauer@siemens.com>

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 .../jh7110-u-boot-spl-image/files/install     |  1 +
 .../jh7110-u-boot-spl-image/files/rules       | 13 ++++++++
 .../jh7110-u-boot-spl-image_0.1.bb            | 30 +++++++++++++++++++
 .../jh7110-u-boot-spl-tool_0.1.bb             | 23 ++++++++++++++
 4 files changed, 67 insertions(+)
 create mode 100644 meta-isar/recipes-bsp/jh7110-u-boot-spl-image/files/install
 create mode 100644 meta-isar/recipes-bsp/jh7110-u-boot-spl-image/files/rules
 create mode 100644 meta-isar/recipes-bsp/jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb
 create mode 100644 meta-isar/recipes-bsp/jh7110-u-boot-spl-tool/jh7110-u-boot-spl-tool_0.1.bb

diff --git a/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/files/install b/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/files/install
new file mode 100644
index 00000000..c300f842
--- /dev/null
+++ b/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/files/install
@@ -0,0 +1 @@
+u-boot-spl.bin.normal.out usr/share/jh7110-uboot-spl-image
diff --git a/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/files/rules b/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/files/rules
new file mode 100644
index 00000000..3c28b2c0
--- /dev/null
+++ b/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/files/rules
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+
+U_BOOT_SPL_BIN := /usr/lib/u-boot/starfive-visionfive2/u-boot-spl.bin
+# taken from https://github.com/starfive-tech/Tools
+OFFSET := 0x01010101
+
+override_dh_auto_build:
+	cp $(U_BOOT_SPL_BIN) u-boot-spl.bin
+	/usr/lib/jh7110-uboot-spl-tool/jh7110_uboot_spl u-boot-spl.bin $(OFFSET)
+	mv u-boot-spl.bin.out u-boot-spl.bin.normal.out
+
+%:
+	dh \$@
diff --git a/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb b/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb
new file mode 100644
index 00000000..08c53b51
--- /dev/null
+++ b/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb
@@ -0,0 +1,30 @@
+#
+# Copyright (c) Siemens AG, 2023
+#
+# SPDX-License-Identifier: MIT
+
+inherit dpkg
+
+SRC_URI = "file://rules file://install"
+
+DESCRIPTION = "StarFive VisionFive 2 u-boot SPL"
+DEPENDS = "jh7110-u-boot-spl-tool u-boot-starfive-visionfive2"
+DEBIAN_BUILD_DEPENDS = "jh7110-u-boot-spl-tool, u-boot-starfive-visionfive2:${DISTRO_ARCH}"
+
+# this is a host tool
+PACKAGE_ARCH = "${HOST_ARCH}"
+
+do_prepare_build[cleandirs] += "${S}/debian"
+do_prepare_build(){
+    deb_debianize
+    cp ${WORKDIR}/install ${S}/debian/
+}
+
+do_deploy() {
+    dpkg --fsys-tarfile ${WORKDIR}/jh7110-u-boot-spl-image_${PV}*.deb | \
+        tar xOf - "./usr/share/jh7110-uboot-spl-image/u-boot-spl.bin.normal.out" \
+        > "${DEPLOY_DIR_IMAGE}/u-boot-spl.bin.normal.out"
+}
+
+addtask deploy after do_dpkg_build before do_build
+do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
diff --git a/meta-isar/recipes-bsp/jh7110-u-boot-spl-tool/jh7110-u-boot-spl-tool_0.1.bb b/meta-isar/recipes-bsp/jh7110-u-boot-spl-tool/jh7110-u-boot-spl-tool_0.1.bb
new file mode 100644
index 00000000..1991e61a
--- /dev/null
+++ b/meta-isar/recipes-bsp/jh7110-u-boot-spl-tool/jh7110-u-boot-spl-tool_0.1.bb
@@ -0,0 +1,23 @@
+#
+# Copyright (c) Siemens AG, 2023
+#
+# SPDX-License-Identifier: MIT
+
+inherit dpkg
+
+DESCRIPTION = "replacement for proprietary VisionFive2 SDK spl_tool"
+LICENSE = "CPL-1"
+
+SRC_URI = "git://github.com/electrorys/jh7110_uboot_spl.git;branch=master;protocol=https;destsuffix=jh7110-uboot-spl"
+SRCREV = "e089116b902240659c1dcd6cbb6537dc4c1e316c"
+
+S = "${WORKDIR}/jh7110-uboot-spl"
+
+# This is a host tool
+PACKAGE_ARCH = "${HOST_ARCH}"
+
+do_prepare_build[cleandirs] += "${S}/debian"
+do_prepare_build(){
+    deb_debianize
+    echo "jh7110_uboot_spl usr/lib/jh7110-uboot-spl-tool" > ${S}/debian/${PN}.install
+}
-- 
2.30.2


  parent reply	other threads:[~2023-03-17 13:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 13:20 [PATCH v3 0/7] Add BSP for StarFiveTech VisionFive2 Risc-V board Felix Moessbauer
2023-03-17 13:21 ` [PATCH v3 1/7] u-boot: make KCFLAGS and HOSTCFLAGS configurable Felix Moessbauer
2023-03-17 14:42   ` Jan Kiszka
2023-03-17 13:21 ` [PATCH v3 2/7] starfive-visionfive2: package u-boot Felix Moessbauer
2023-03-17 13:21 ` [PATCH v3 3/7] starfive-visionfive2: package opensbi firmware Felix Moessbauer
2023-03-17 13:21 ` [PATCH v3 4/7] starfive-visionfive2: add BSP kernel Felix Moessbauer
2023-03-17 13:21 ` Felix Moessbauer [this message]
2023-03-17 13:21 ` [PATCH v3 6/7] starfive-visionfive2: create u-boot-spl FIT image Felix Moessbauer
2023-03-17 13:21 ` [PATCH v3 7/7] starfive-visionfive2: add machine Felix Moessbauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230317132106.1111258-6-felix.moessbauer@siemens.com \
    --to=felix.moessbauer@siemens.com \
    --cc=daniel.bovensiepen@siemens.com \
    --cc=florian.bezdeka@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox