@@ -8,18 +8,12 @@ DISTRO_ARCH = "riscv64"
KERNEL_NAME ?= "starfive"
IMAGE_FSTYPES ?= "wic"
-
WKS_FILE ?= "starfive-visionfive2.wks.in"
IMAGER_INSTALL:wic += " \
- jh7110-u-boot-spl-image \
- visionfive2-u-boot-firmware \
+ u-boot-starfive-visionfive2 \
${SYSTEMD_BOOTLOADER_INSTALL}"
-IMAGER_BUILD_DEPS += " \
- jh7110-u-boot-spl-image \
- visionfive2-u-boot-firmware"
+IMAGER_BUILD_DEPS += "u-boot-starfive-visionfive2"
-# DTB file for OpenSBI
-DTB_UBOOT_JH7110_VF2 = "starfive_visionfive2.dtb"
# DTB file for booting
DTB_VISIONFIVE2 = "jh7110-visionfive-v2.dtb"
DTB_FILES = "starfive/${DTB_VISIONFIVE2}"
new file mode 100644
@@ -0,0 +1,12 @@
+#!/usr/bin/make -f
+
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
+endif
+
+override_dh_auto_build:
+ CFLAGS= LDFLAGS= $(MAKE) $(PARALLEL_MAKE) \
+ PLATFORM=generic FW_TEXT_START=0x40000000 FW_OPTIONS=0
+
+%:
+ dh $@
deleted file mode 100644
@@ -1,17 +0,0 @@
-#!/usr/bin/make -f
-
-ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
-export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
-endif
-
-UBOOT_DTB_FILE := /usr/share/u-boot/starfive-visionfive2/${DTB_UBOOT_JH7110_VF2}
-FW_TEXT_START := 0x40000000
-
-override_dh_auto_build:
- CFLAGS= LDFLAGS= $(MAKE) $(PARALLEL_MAKE) PLATFORM=generic \
- FW_PAYLOAD_PATH=/usr/lib/u-boot/starfive-visionfive2/u-boot.bin \
- FW_FDT_PATH=$(UBOOT_DTB_FILE) \
- FW_TEXT_START=$(FW_TEXT_START)
-
-%:
- dh $@
@@ -9,25 +9,18 @@ DESCRIPTION = "OpenSBI firmware for StarFive VisionFive 2"
SRC_URI = " \
git://github.com/riscv-software-src/opensbi.git;destsuffix=opensbi-${PV};protocol=https;branch=master \
- file://starfive-visionfive2-rules.tmpl"
+ file://starfive-visionfive2-rules"
# required patches are not yet part of a release, but will be in 1.3
SRCREV = "2868f26131308ff345382084681ea89c5b0159f1"
S = "${WORKDIR}/opensbi-${PV}"
-TEMPLATE_FILES += "starfive-visionfive2-rules.tmpl"
-TEMPLATE_VARS += "DTB_UBOOT_JH7110_VF2"
-
-DEPENDS = "u-boot-starfive-visionfive2"
-DEBIAN_BUILD_DEPENDS = " \
- u-boot-starfive-visionfive2, \
- u-boot-starfive-visionfive2-dev"
do_prepare_build[cleandirs] += "${S}/debian"
do_prepare_build() {
cp ${WORKDIR}/starfive-visionfive2-rules ${WORKDIR}/rules
deb_debianize
- echo "build/platform/generic/firmware/fw_payload.bin /usr/lib/opensbi/starfive-visionfive2/" > ${S}/debian/install
+ echo "build/platform/generic/firmware/fw_dynamic.bin /usr/lib/opensbi/starfive-visionfive2/" > ${S}/debian/install
}
COMPATIBLE_MACHINE = "starfive-visionfive2"
new file mode 100755
@@ -0,0 +1,35 @@
+#!/usr/bin/make -f
+
+# Debian rules for custom U-Boot build
+#
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2018-2021
+#
+# SPDX-License-Identifier: MIT
+
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
+SET_CROSS_BUILD_TOOLS=CROSS_BUILD_TOOLS=y
+endif
+
+override_dh_auto_build:
+ $(MAKE) $(PARALLEL_MAKE) ${U_BOOT_CONFIG}
+ $(MAKE) $(PARALLEL_MAKE) flash.bin OPENSBI=/usr/lib/opensbi/starfive-visionfive2/fw_dynamic.bin
+ spl_tool -c -f spl/u-boot-spl.bin
+ $(MAKE) -n u-boot-initial-env >/dev/null 2>&1; if [ $$? -ne 2 ]; then \
+ $(MAKE) $(PARALLEL_MAKE) u-boot-initial-env; \
+ else \
+ ./scripts/get_default_envs.sh >u-boot-initial-env; \
+ fi
+ $(MAKE) $(PARALLEL_MAKE) $(SET_CROSS_BUILD_TOOLS) NO_SDL=1 tools-only envtools
+
+override_dh_auto_install:
+ mv tools/env/lib.a tools/env/libubootenv.a
+
+override_dh_auto_test:
+
+override_dh_strip:
+ dh_strip -X libubootenv.a
+
+%:
+ dh $@ --parallel
deleted file mode 100644
@@ -1,31 +0,0 @@
-#
-# Copyright (c) Siemens AG, 2023
-#
-# SPDX-License-Identifier: MIT
-
-require recipes-bsp/u-boot/u-boot-custom.inc
-
-SRC_URI += "git://github.com/starfive-tech/u-boot.git;nobranch=1;protocol=https;destsuffix=u-boot-${PV}"
-SRCREV = "b6e2b0e85c774a18ae668223a6e5f7d335895243"
-
-DEBIAN_BUILD_DEPENDS .= ", libssl-dev, libssl-dev:native"
-
-U_BOOT_CONFIG = "starfive_visionfive2_defconfig"
-U_BOOT_BIN = "u-boot.bin"
-U_BOOT_SPL_BIN = "spl/u-boot-spl.bin"
-
-S = "${WORKDIR}/u-boot-${PV}"
-
-# install dtb files for opensbi
-do_prepare_build[cleandirs] += "${S}/debian"
-do_prepare_build:append() {
- # also build and install spl component
- sed -i 's|${U_BOOT_BIN}|${U_BOOT_BIN} ${U_BOOT_SPL_BIN}|g' ${S}/debian/rules
- echo "${U_BOOT_SPL_BIN} usr/lib/u-boot/${MACHINE}/" \
- >> ${S}/debian/u-boot-${MACHINE}.install
- # install device tree
- echo "arch/riscv/dts/*.dtb usr/share/u-boot/${MACHINE}/" \
- >> ${S}/debian/u-boot-${MACHINE}-dev.install
-}
-
-COMPATIBLE_MACHINE = "starfive-visionfive2"
new file mode 100644
@@ -0,0 +1,29 @@
+#
+# Copyright (c) Siemens AG, 2023
+#
+# SPDX-License-Identifier: MIT
+
+require recipes-bsp/u-boot/u-boot-custom.inc
+
+COMPATIBLE_MACHINE = "starfive-visionfive2"
+
+SRC_URI += "https://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 \
+ file://starfive-visionfive2-rules.tmpl"
+SRC_URI[sha256sum] = "e00e6c6f014e046101739d08d06f328811cebcf5ae101348f409cbbd55ce6900"
+
+DEPENDS += "opensbi-starfive-visionfive2 jh7110-u-boot-spl-tool-native"
+DEBIAN_BUILD_DEPENDS .= ", opensbi-starfive-visionfive2, \
+ jh7110-u-boot-spl-tool:native, \
+ swig, python3-dev:native, python3-setuptools, \
+ libssl-dev:${DISTRO_ARCH}, libssl-dev:native"
+
+U_BOOT_CONFIG = "starfive_visionfive2_defconfig"
+U_BOOT_BIN = "u-boot.itb spl/u-boot-spl.bin.normal.out"
+
+TEMPLATE_FILES += "starfive-visionfive2-rules.tmpl"
+
+S = "${WORKDIR}/u-boot-${PV}"
+
+do_prepare_build:append() {
+ cp ${WORKDIR}/starfive-visionfive2-rules ${S}/debian/rules
+}
@@ -12,9 +12,9 @@
# This is required to boot efi with the correct device tree, which is included in the fit image.
# SPL
-part --source rawcopy --sourceparams "file=/usr/share/jh7110-uboot-spl-image/u-boot-spl.bin.normal.out" --ondisk mmcblk1 --fixed-size 2M --offset 2M --part-type 2E54B353-1271-4842-806F-E436D6AF6985
+part --source rawcopy --sourceparams "file=/usr/lib/u-boot/starfive-visionfive2/u-boot-spl.bin.normal.out" --fixed-size 2M --part-type 2E54B353-1271-4842-806F-E436D6AF6985
# U-Boot FIT
-part --source rawcopy --sourceparams "file=/usr/share/visionfive2-u-boot-firmware/visionfive2_fw_payload.img" --ondisk mmcblk1 --fixed-size 4M --offset 4M --part-type 5B193300-FC78-40CD-8002-E86C45580B47
+part --source rawcopy --sourceparams "file=/usr/lib/u-boot/starfive-visionfive2/u-boot.itb" --fixed-size 4M --part-type BC13C2FF-59E6-4262-A352-B275FD6F7172
# EFI
part /boot --source bootimg-efi-isar --sourceparams "loader=systemd-boot,dtb=${DTB_VISIONFIVE2}" --use-uuid --label efi --part-type EF00 --align 1024
# rootfs