|
@@ -1,25 +1,63 @@
|
|
|
SUMMARY = "QSPI Image Creator"
|
|
|
-DESCRIPTION = "Recipe to create a QSPI Image"
|
|
|
+DESCRIPTION = "Generate QSPI boot firmware, kernel image, device tree blob, kernel bundled with initramfs, NFS and SD rootfs image"
|
|
|
LICENSE = "CLOSED"
|
|
|
|
|
|
inherit core-image
|
|
|
|
|
|
-DEPENDS = "deploy-bootfiles"
|
|
|
+DEPENDS = "deploy-bootfiles core-image-minimal"
|
|
|
|
|
|
LIC_FILES_CHKSUM = ""
|
|
|
|
|
|
-IMAGE_FSTYPES = "qspi"
|
|
|
+# Generate QSPI firmware & SD rootfs (NFS rootfs will be auto-generated by default IMAGE_FSTYPES, which is tar.gz)
|
|
|
+IMAGE_FSTYPES += " qspi qspi_sd"
|
|
|
|
|
|
-do_rootfs[depends] += "dubhe-image-initramfs:do_rootfs"
|
|
|
+# Set image naming as such: Image-<boot_mode>-<machine>
|
|
|
+# Image-initramfs-starfive-dubhe (initramfs boot)
|
|
|
+# Image-nfs-starfive-dubhe (NFS boot)
|
|
|
+# Image-sd-starfive-dubhe (SD boot)
|
|
|
+IMAGE_BASENAME = "Image-nfs"
|
|
|
+
|
|
|
+IMAGE_TYPEDEP:qspi_sd = "ext4 wic wic.gz wic.bmap"
|
|
|
+
|
|
|
+do_rootfs[depends] += " \
|
|
|
+ dubhe-image-initramfs:do_rootfs \
|
|
|
+ "
|
|
|
|
|
|
do_image[depends] += "\
|
|
|
deploy-bootfiles:do_deploy \
|
|
|
u-boot-starfive:do_deploy \
|
|
|
"
|
|
|
|
|
|
-IMAGE_CMD:qspi(){
|
|
|
- dd if=${DEPLOY_DIR_IMAGE}/bootcode.bin of=${DEPLOY_DIR_IMAGE}/starfive-dubhe-qspi-tftpboot.bin bs=32 seek=0 count=128
|
|
|
- dd if=${DEPLOY_DIR_IMAGE}/bootjump.bin of=${DEPLOY_DIR_IMAGE}/starfive-dubhe-qspi-tftpboot.bin bs=32 seek=128 count=128
|
|
|
- dd if=${DEPLOY_DIR_IMAGE}/u-boot-spl.bin of=${DEPLOY_DIR_IMAGE}/starfive-dubhe-qspi-tftpboot.bin bs=32 seek=256 count=8192
|
|
|
- dd if=${DEPLOY_DIR_IMAGE}/u-boot.itb of=${DEPLOY_DIR_IMAGE}/starfive-dubhe-qspi-tftpboot.bin bs=32 seek=8448 count=32768
|
|
|
+# Generate a boot firmware image that contains bootcode, bootjump, U-Boot SPL, U-Boot proper & OpenSBI
|
|
|
+IMAGE_CMD:qspi() {
|
|
|
+ dd if=${DEPLOY_DIR_IMAGE}/bootcode.bin of=${DEPLOY_DIR_IMAGE}/${MACHINE}-qspi-firmware.bin bs=32 seek=0 count=128
|
|
|
+ dd if=${DEPLOY_DIR_IMAGE}/bootjump.bin of=${DEPLOY_DIR_IMAGE}/${MACHINE}-qspi-firmware.bin bs=32 seek=128 count=128
|
|
|
+ dd if=${DEPLOY_DIR_IMAGE}/u-boot-spl.bin of=${DEPLOY_DIR_IMAGE}/${MACHINE}-qspi-firmware.bin bs=32 seek=256 count=8192
|
|
|
+ dd if=${DEPLOY_DIR_IMAGE}/u-boot.itb of=${DEPLOY_DIR_IMAGE}/${MACHINE}-qspi-firmware.bin bs=32 seek=8448 count=32768
|
|
|
}
|
|
|
+
|
|
|
+# Generate SD image using bmaptool
|
|
|
+IMAGE_CMD:qspi_sd() {
|
|
|
+ cd ${IMGDEPLOYDIR}
|
|
|
+ bmaptool copy ${IMAGE_BASENAME}-${MACHINE}.wic.gz ${DEPLOY_DIR_IMAGE}/Image-sd-${MACHINE}.img
|
|
|
+}
|
|
|
+
|
|
|
+# Create an output folder for all machine variations across Dubhe series
|
|
|
+do_create_output_folder() {
|
|
|
+ rm -rf ${DEPLOY_DIR_IMAGE}/Dubhe-*0
|
|
|
+
|
|
|
+ mkdir -p ${DEPLOY_DIR_IMAGE}/Dubhe-80
|
|
|
+ cp ${DEPLOY_DIR_IMAGE}/${MACHINE}-qspi-firmware.bin ${DEPLOY_DIR_IMAGE}/Dubhe-80
|
|
|
+ cp ${DEPLOY_DIR_IMAGE}/Image ${DEPLOY_DIR_IMAGE}/Dubhe-80
|
|
|
+ cp ${DEPLOY_DIR_IMAGE}/Image-initramfs-${MACHINE}.bin ${DEPLOY_DIR_IMAGE}/Dubhe-80
|
|
|
+ cp ${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.tar.gz ${DEPLOY_DIR_IMAGE}/Dubhe-80
|
|
|
+ cp ${DEPLOY_DIR_IMAGE}/Image-sd-${MACHINE}.img ${DEPLOY_DIR_IMAGE}/Dubhe-80
|
|
|
+
|
|
|
+ cp -r ${DEPLOY_DIR_IMAGE}/Dubhe-80 ${DEPLOY_DIR_IMAGE}/Dubhe-90
|
|
|
+
|
|
|
+ cp ${DEPLOY_DIR_IMAGE}/dubhe80_fpga.dtb ${DEPLOY_DIR_IMAGE}/Dubhe-80
|
|
|
+ cp ${DEPLOY_DIR_IMAGE}/dubhe90_fpga.dtb ${DEPLOY_DIR_IMAGE}/Dubhe-90
|
|
|
+}
|
|
|
+addtask do_create_output_folder before do_populate_lic_deploy after do_image_complete
|
|
|
+
|
|
|
+COMPATIBLE_MACHINE = "starfive-dubhe"
|