Browse Source

dubhe: Enable ESDK build with QSPI image separated from RFS image

RFS needs to be specified as a dependency for QSPI image. QSPI image
that will be deployed to FPGA needs to be created as an image instead
of a regular bb recipe.

Rebased to Yocto Honister by Jun Yuan Tan.

Signed-off-by: Tien Hock Loh <tienhock.loh@starfivetech.com>
Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
Jun Yuan Tan 2 years ago
parent
commit
0d5d90e248

+ 5 - 0
recipes-images/images/dubhe-image-initramfs.bb

@@ -8,6 +8,7 @@ INITRAMFS_SCRIPTS ?= "\
                      "
 PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} base-passwd ${ROOTFS_BOOTSTRAP_INSTALL} helloworld coremark dhrystone"
 
+
 # Do not pollute the initrd image with rootfs features
 IMAGE_FEATURES = ""
 
@@ -26,3 +27,7 @@ EXTRA_IMAGEDEPENDS ?= ""
 
 # Use the same restriction as initramfs-module-install
 COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|riscv64.*|rv64.*)-(linux.*|freebsd.*)'
+
+# Override this as the qspi-image will populate the sdk_ext
+do_populate_sdk_ext () {
+}

+ 8 - 4
recipes-images/qspi-image/qspi-image_0.1.bb

@@ -2,13 +2,17 @@ SUMMARY = "QSPI Image Creator"
 DESCRIPTION = "Recipe to create a QSPI Image"
 LICENSE = "CLOSED"
 
+inherit image
+
+DEPENDS = "opensbi deploy-bootfiles"
+
 LIC_FILES_CHKSUM = ""
 
-do_createqspiimage[depends] += " virtual/kernel:do_deploy "
-do_createqspiimage[depends] += "opensbi:do_deploy"
-addtask do_createqspiimage after do_deploy before do_build
+IMAGE_FSTYPES = "qspi"
+
+do_rootfs[depends] += "dubhe-image-initramfs:do_rootfs"
 
-do_createqspiimage(){
+IMAGE_CMD:qspi () {
 	dd if=${DEPLOY_DIR_IMAGE}/bootcode.bin of=${DEPLOY_DIR_IMAGE}/QSPI-Image.bin bs=1 seek=0 count=4096
 	dd if=${DEPLOY_DIR_IMAGE}/bootjump.bin of=${DEPLOY_DIR_IMAGE}/QSPI-Image.bin bs=1 seek=4096 count=32
 	dd if=${DEPLOY_DIR_IMAGE}/dubhe_fpga.dtb of=${DEPLOY_DIR_IMAGE}/QSPI-Image.bin bs=1 seek=4128 count=4064