Browse Source

Merge branch 'starfive-kirkstone-dubhe-uboot' into 'starfive-kirkstone'

Dubhe Q3 U-Boot Release

See merge request starfive-tech/meta-starfive!39
tienhock.loh 6 months ago
parent
commit
e003b1104c
40 changed files with 468 additions and 227 deletions
  1. 1 1
      README.md
  2. 8 9
      conf/machine/starfive-dubhe.conf
  3. 9 11
      recipes-bsp/deploy-bootfiles/deploy-bootfiles_0.1.bb
  4. BIN
      recipes-bsp/deploy-bootfiles/files/bootcode.bin
  5. BIN
      recipes-bsp/deploy-bootfiles/files/bootcode_dual.bin
  6. BIN
      recipes-bsp/deploy-bootfiles/files/bootcode_min_dual.bin
  7. BIN
      recipes-bsp/deploy-bootfiles/files/bootjump.bin
  8. 0 25
      recipes-bsp/opensbi/opensbi_%.bbappend
  9. 18 0
      recipes-bsp/opensbi/opensbi_1.0.bbappend
  10. 21 8
      recipes-bsp/opensbi/opensbi_1.2.bb
  11. 40 14
      recipes-bsp/u-boot/u-boot-starfive.bb
  12. 4 11
      recipes-core/images/core-image-minimal.bbappend
  13. 20 24
      recipes-core/images/core-image-starfive-extra.bb
  14. 12 1
      recipes-core/images/dubhe-image-essential.inc
  15. 14 4
      recipes-core/images/dubhe-image-initramfs.bb
  16. 1 1
      recipes-core/images/dubhe-image-minimal_0.1.bb
  17. 10 13
      recipes-core/images/qspi-image_0.1.bb
  18. 7 1
      recipes-core/images/qspi-nfs-essential.inc
  19. 1 1
      recipes-core/images/qspi-nfs-image_0.1.bb
  20. 7 2
      recipes-core/images/qspi-ubifs-image_0.1.bb
  21. 13 0
      recipes-core/packagegroups/packagegroup-starfive-dubhe-essentials.bb
  22. 18 0
      recipes-core/packagegroups/packagegroup-starfive-essentials.bb
  23. 14 0
      recipes-core/packagegroups/packagegroup-starfive-toolchain.bb
  24. 5 5
      recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
  25. 2 0
      recipes-graphics/xorg-xserver/xserver-xorg_1.20.13.bb
  26. 0 0
      recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/0001-Avoid-duplicate-definitions-of-IOPortBase.patch
  27. 0 0
      recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch
  28. 0 0
      recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/0001-drmmode_display.c-add-missing-mi.h-include.patch
  29. 0 0
      recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/0001-test-xtest-Initialize-array-with-braces.patch
  30. 0 0
      recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch
  31. 0 0
      recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/pkgconfig.patch
  32. 0 0
      recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/sdksyms-no-build-path.patch
  33. 2 0
      recipes-graphics/xorg-xserver/xserver-xorg_21.1.4.bb
  34. 29 0
      recipes-graphics/xorg-xserver/xserver-xorg_21.1.4/0001-Avoid-duplicate-definitions-of-IOPortBase.patch
  35. 53 0
      recipes-graphics/xorg-xserver/xserver-xorg_21.1.4/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch
  36. 63 0
      recipes-graphics/xorg-xserver/xserver-xorg_21.1.4/0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch
  37. 38 0
      recipes-graphics/xorg-xserver/xserver-xorg_21.1.4/0001-xkb-proof-GetCountedString-against-request-length-at.patch
  38. 0 9
      recipes-kernel/linux/files/add-dubhe-additional-dtb.patch
  39. 5 33
      recipes-kernel/linux/linux-starfive-dev_6.1.20.bb
  40. 53 54
      setup.sh

+ 1 - 1
README.md

@@ -34,7 +34,7 @@ Now, we will be creating a workspace and retrieve the latest layers needed for o
 
 ```
 $ mkdir starfive-yocto && cd starfive-yocto
-$ repo init -u https://github.com/starfive-tech/meta-starfive -b starfive-honister -m tools/manifests/starfive.xml
+$ repo init -u https://github.com/starfive-tech/meta-starfive -b starfive-kirkstone -m tools/manifests/starfive.xml
 $ repo sync
 $ repo start work --all
 ```

+ 8 - 9
conf/machine/starfive-dubhe.conf

@@ -5,7 +5,7 @@
 
 LLVMVERSION = "16.0.5"
 CLANGSDK = "1"
-EXTRA_IMAGEDEPENDS:append = " llvm file-native rpm-native popt-native openocd-native"
+EXTRA_IMAGEDEPENDS:append = " llvm file-native rpm-native popt-native openocd-native u-boot-starfive"
 EXTRA_IMAGE_FEATURES:append = " dbg-pkgs tools-profile"
 
 PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'
@@ -31,14 +31,7 @@ MACHINE_FEATURES = "screen keyboard ext2 ext3 serial"
 
 KERNEL_DEVICETREE ?= " \
 	starfive/dubhe80_fpga.dtb \
-	starfive/dubhe80_fpga_ext4.dtb \
-        starfive/dubhe80_fpga_ubi.dtb \
-        starfive/dubhe80_fpga_nfs.dtb \
 	starfive/dubhe90_fpga.dtb \
-	starfive/dubhe90_fpga_dual.dtb \
-	starfive/dubhe90_fpga_ext4.dtb \
-	starfive/dubhe90_fpga_ubi.dtb \
-	starfive/dubhe90_fpga_nfs.dtb \
 "
 KERNEL_IMAGETYPE = "Image"
 
@@ -48,8 +41,8 @@ INITRAMFS_MAXSIZE = "524288"
 
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-starfive-dev"
 PREFERRED_VERSION_linux-starfive-dev = "6.1%"
+PREFERRED_PROVIDER_virtual/bootloader = "u-boot-starfive"
 RISCV_SBI_PLAT = "generic"
-RISCV_SBI_PAYLOAD = "Image-starfive-dubhe.bin"
 
 QEMU_EXTRAOPTIONS:riscv64 = " -cpu rv64,x-b=true,x-v=true"
 
@@ -63,6 +56,12 @@ PREFERRED_VERSION_opensbi = "1.2"
 
 #UBOOT_CONFIG = "defconfig"
 
+UBOOT_MACHINE = "starfive_dubhe_fpga_defconfig"
+UBOOT_DTB_BINARY = "dubhe_fpga.dtb"
+
+SPL_BINARY = "spl/u-boot-spl.bin"
+SPL_NORMAL_BINARY = "u-boot-spl.bin.normal.out"
+
 ## Do not update fstab file when using wic images
 ###WIC_CREATE_EXTRA_ARGS ?= "--no-fstab-update"
 

+ 9 - 11
recipes-bsp/deploy-bootfiles/deploy-bootfiles_0.1.bb

@@ -4,22 +4,20 @@ LICENSE = "CLOSED"
 
 LIC_FILES_CHKSUM = ""
 
-SRC_URI = "file://bootcode.bin \
-           file://bootcode_dual.bin \
-	   file://bootcode_min.bin \
-	   file://bootcode_min_dual.bin \
-           file://bootjump.bin \
-          "
+SRC_URI = "\
+	file://bootcode.bin \
+	file://bootcode_min.bin \
+	file://bootjump.bin \
+	"
           
 S = "${WORKDIR}"
 
 inherit deploy
+
 do_deploy(){
-	install -m 755 ${WORKDIR}/bootcode.bin ${DEPLOYDIR}/
-	install -m 755 ${WORKDIR}/bootcode_dual.bin ${DEPLOYDIR}/
-	install -m 755 ${WORKDIR}/bootcode_min.bin ${DEPLOYDIR}/
-	install -m 755 ${WORKDIR}/bootcode_min_dual.bin ${DEPLOYDIR}/
-	install -m 755 ${WORKDIR}/bootjump.bin ${DEPLOYDIR}/
+	install -m 755 ${WORKDIR}/bootcode.bin ${DEPLOYDIR}
+	install -m 755 ${WORKDIR}/bootcode_min.bin ${DEPLOYDIR}
+	install -m 755 ${WORKDIR}/bootjump.bin ${DEPLOYDIR}
 }
 
 addtask deploy before do_build after do_install

BIN
recipes-bsp/deploy-bootfiles/files/bootcode.bin


BIN
recipes-bsp/deploy-bootfiles/files/bootcode_dual.bin


BIN
recipes-bsp/deploy-bootfiles/files/bootcode_min_dual.bin


BIN
recipes-bsp/deploy-bootfiles/files/bootjump.bin


+ 0 - 25
recipes-bsp/opensbi/opensbi_%.bbappend

@@ -1,25 +0,0 @@
-SRCREV:starfive-visionfive2 = "c6a092cd80112529cb2e92e180767ff5341b22a3"
-SRC_URI:starfive-visionfive2 = "git://github.com/starfive-tech/opensbi.git;protocol=https \
-                                file://visionfive2-uboot-fit-image.its \
-                               "
-
-SRCREV:starfive-jh8100 = "06c3d05b7f5f1e0aa24141e4de487313b620cea9"
-SRC_URI:starfive-jh8100 = "git://git@192.168.110.45/starfive-tech/opensbi.git;protocol=ssh;branch=fpga-starfive-v1.2-jh8100"
-
-EXTRA_OEMAKE:starfive-visionfive2 += "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= FW_TEXT_START=0x40000000"
-EXTRA_OEMAKE:starfive-jh8100 += "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= FW_OPTIONS=0 FW_TEXT_START=0x40000000 PLATFORM_DEFCONFIG=starfive_defconfig"
-
-DEPENDS:starfive-visionfive2:append = " u-boot-tools-native dtc-native"
-
-do_deploy:append:starfive-visionfive2() {
-        install -m 0644 ${WORKDIR}/visionfive2-uboot-fit-image.its ${DEPLOYDIR}/visionfive2-uboot-fit-image.its
-        cd ${DEPLOYDIR}
-        mkimage -f visionfive2-uboot-fit-image.its -A riscv -O u-boot -T firmware visionfive2_fw_payload.img
-}
-
-do_deploy:append:starfive-dubhe(){
-	oe_runmake clean
-	oe_runmake PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= PLATFORM_DEFCONFIG=starfive_defconfig FW_PAYLOAD_PATH=${DEPLOY_DIR_IMAGE}/Image-initramfs-starfive-dubhe.bin
-	install -m 755 ${B}/build/platform/generic/firmware/fw_payload.bin ${DEPLOYDIR}/fw_payload_initramfs.bin
-	install -m 755 ${B}/build/platform/generic/firmware/fw_payload.elf ${DEPLOYDIR}/fw_payload_initramfs.elf
-}

+ 18 - 0
recipes-bsp/opensbi/opensbi_1.0.bbappend

@@ -0,0 +1,18 @@
+FORK:starfive-visionfive2 = "starfive-tech"
+BRANCH:starfive-visionfive2 = "master"
+SRCREV:starfive-visionfive2 = "c6a092cd80112529cb2e92e180767ff5341b22a3"
+
+SRC_URI:starfive-visionfive2 = "\
+	git://github.com/${FORK}/opensbi.git;protocol=https;branch=${BRANCH} \
+	file://visionfive2-uboot-fit-image.its \
+	"
+
+EXTRA_OEMAKE:starfive-visionfive2 += "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= FW_TEXT_START=0x40000000"
+
+DEPENDS:starfive-visionfive2 += "u-boot-tools-native dtc-native"
+
+do_deploy:append:starfive-visionfive2() {
+	install -m 0644 ${WORKDIR}/visionfive2-uboot-fit-image.its ${DEPLOYDIR}/visionfive2-uboot-fit-image.its
+	cd ${DEPLOYDIR}
+	mkimage -f visionfive2-uboot-fit-image.its -A riscv -O u-boot -T firmware visionfive2_fw_payload.img
+}

+ 21 - 8
recipes-bsp/opensbi/opensbi_1.2.bb

@@ -8,18 +8,31 @@ require opensbi-payloads.inc
 
 inherit autotools-brokensep deploy
 
-SRCREV:starfive-dubhe = "3b7a16171029ca0a185789ca7cba583a5bf31b19"
-SRC_URI:starfive-dubhe = "git://git@192.168.110.45/starfive-tech/opensbi.git;protocol=ssh;branch=starfive-v1.2-dubhe"
+FORK:starfive-dubhe = "starfive-tech"
+BRANCH:starfive-dubhe = "starfive-v1.2-dubhe"
+SRCREV:starfive-dubhe = "a10e0837f215fb4ed25f195f2c511a41deb9c324"
 
-SRC_URI:remove:nezha = " \
-    file://0001-lib-utils-fdt-Require-match-data-to-be-const.patch \
-    file://0002-lib-utils-timer-Add-a-separate-compatible-for-the-D1.patch \
-"
+FORK:starfive-jh8100 = "starfive-tech"
+BRANCH:starfive-jh8100 = "fpga-starfive-v1.2-jh8100"
+SRCREV:starfive-jh8100 = "06c3d05b7f5f1e0aa24141e4de487313b620cea9"
+
+SRC_URI:starfive-dubhe = "\
+	git://github.com/${FORK}/opensbi.git;protocol=https;branch=${BRANCH} \
+	"
+
+SRC_URI:starfive-jh8100 = "\
+	git://git@192.168.110.45/${FORK}/opensbi.git;protocol=ssh;branch=${BRANCH} \
+	"
+
+SRC_URI:remove:nezha = "\
+	file://0001-lib-utils-fdt-Require-match-data-to-be-const.patch \
+	file://0002-lib-utils-timer-Add-a-separate-compatible-for-the-D1.patch \
+	"
 
 S = "${WORKDIR}/git"
 
-EXTRA_OEMAKE += "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= "
-EXTRA_OEMAKE:starfive-dubhe += "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= PLATFORM_DEFCONFIG=starfive_defconfig "
+EXTRA_OEMAKE:starfive-dubhe = "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= FW_OPTIONS=0 FW_TEXT_START=0x80100000 PLATFORM_DEFCONFIG=starfive_defconfig"
+EXTRA_OEMAKE:starfive-jh8100 = "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= FW_OPTIONS=0 FW_TEXT_START=0x40000000 PLATFORM_DEFCONFIG=starfive_defconfig"
 
 # If RISCV_SBI_PAYLOAD is set then include it as a payload
 EXTRA_OEMAKE:append = " ${@riscv_get_extra_oemake_image(d)}"

+ 40 - 14
recipes-bsp/u-boot/u-boot-starfive.bb

@@ -3,44 +3,66 @@ require recipes-bsp/u-boot/u-boot.inc
 
 inherit uboot-extlinux-config
 
+LIC_FILES_CHKSUM:starfive-dubhe = "file://Licenses/README;md5=2ca5f2c35c8cc335f0a19756634782f1"
 LIC_FILES_CHKSUM:starfive-visionfive2 = "file://Licenses/README;md5=5a7450c57ffe5ae63fd732446b988025"
 LIC_FILES_CHKSUM:starfive-jh8100 = "file://Licenses/README;md5=2ca5f2c35c8cc335f0a19756634782f1"
 
 FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
 
+FORK:starfive-dubhe = "starfive-tech"
+BRANCH:starfive-dubhe = "dubhe_fpga_dev_v2023.10"
+SRCREV:starfive-dubhe = "85c7554283547d5ab9dca94427a74a691132cebf"
+
 FORK:starfive-visionfive2 = "starfive-tech"
 BRANCH:starfive-visionfive2 = "JH7110_VisionFive2_devel"
+SRCREV:starfive-visionfive2 = "b6e2b0e85c774a18ae668223a6e5f7d335895243"
 
 FORK:starfive-jh8100 = "starfive-tech"
 BRANCH:starfive-jh8100 = "jh8100_fpga_dev_v2023.01_bmc"
+SRCREV:starfive-jh8100 = "163e8d28c905711d76cbd5d78dafbd6e24b3f21d"
 
-SRC_URI:starfive-visionfive2 = "git://github.com/${FORK}/u-boot.git;protocol=ssh;branch=${BRANCH} \
-           file://vf2_uEnv.txt \
-	   file://vf2_nvme_uEnv.txt \
-	   file://tftp-mmc-boot.txt \
-	   file://visionfive2-fit-image.its \
-	   file://uboot_disable_logo.patch \
-          "
+SRC_URI:starfive-dubhe = "\
+	git://github.com/${FORK}/u-boot.git;protocol=https;branch=${BRANCH} \
+	"
 
-SRC_URI:starfive-jh8100 = "git://git@192.168.110.45/${FORK}/u-boot.git;protocol=ssh;branch=${BRANCH} \
-	 file://tftp-mmc-boot.txt \
+SRC_URI:starfive-visionfive2 = "\
+	git://github.com/${FORK}/u-boot.git;protocol=ssh;branch=${BRANCH} \
+	file://vf2_uEnv.txt \
+	file://vf2_nvme_uEnv.txt \
+	file://tftp-mmc-boot.txt \
+	file://visionfive2-fit-image.its \
+	file://uboot_disable_logo.patch \
 	"
 
-SRCREV:starfive-visionfive2 = "b6e2b0e85c774a18ae668223a6e5f7d335895243"
-SRCREV:starfive-jh8100 = "163e8d28c905711d76cbd5d78dafbd6e24b3f21d"
+SRC_URI:starfive-jh8100 = "\
+	git://git@192.168.110.45/${FORK}/u-boot.git;protocol=ssh;branch=${BRANCH} \
+	file://tftp-mmc-boot.txt \
+	"
 
+DEPENDS:append:starfive-dubhe = " u-boot-tools-native bmap-tools-native opensbi"
 DEPENDS:append:starfive-visionfive2 = " u-boot-tools-native starfive-tool-native"
 DEPENDS:append:starfive-jh8100 = " u-boot-tools-native bmap-tools-native opensbi"
 
 # Overwrite this for your server
 TFTP_SERVER_IP ?= "127.0.0.1"
 
-do_configure:prepend() {
+do_configure:prepend:starfive-visionfive2() {
     sed -i -e 's,@SERVERIP@,${TFTP_SERVER_IP},g' ${WORKDIR}/tftp-mmc-boot.txt
     mkimage -O linux -T script -C none -n "U-Boot boot script" \
 	-d ${WORKDIR}/tftp-mmc-boot.txt ${WORKDIR}/${UBOOT_ENV_BINARY}
 }
 
+do_configure:prepend:starfive-jh8100() {
+    sed -i -e 's,@SERVERIP@,${TFTP_SERVER_IP},g' ${WORKDIR}/tftp-mmc-boot.txt
+    mkimage -O linux -T script -C none -n "U-Boot boot script" \
+        -d ${WORKDIR}/tftp-mmc-boot.txt ${WORKDIR}/${UBOOT_ENV_BINARY}
+}
+
+do_configure:prepend:starfive-dubhe() {
+    cp ${DEPLOY_DIR_IMAGE}/fw_dynamic.bin ${WORKDIR}/build/fw_dynamic.bin
+    export OPENSBI=${WORKDIR}/build/fw_dynamic.bin
+}
+
 do_configure:prepend:starfive-jh8100() {
     cp ${DEPLOY_DIR_IMAGE}/fw_dynamic.bin ${WORKDIR}/build/fw_dynamic.bin
     export OPENSBI=${WORKDIR}/build/fw_dynamic.bin
@@ -55,6 +77,11 @@ do_deploy:append:starfive-visionfive2() {
     ln -sf ${SPL_IMAGE}.normal.out ${DEPLOYDIR}/${SPL_SYMLINK}.normal.out
 }
 
+do_deploy:append:starfive-dubhe() {
+    install -m 644 ${WORKDIR}/build/u-boot.itb ${DEPLOYDIR}/u-boot.itb
+    rm ${WORKDIR}/build/fw_dynamic.bin
+}
+
 do_deploy:append:starfive-jh8100() {
     install -m 644 ${WORKDIR}/build/u-boot.itb ${DEPLOYDIR}/u-boot.itb
     rm ${WORKDIR}/build/fw_dynamic.bin
@@ -62,5 +89,4 @@ do_deploy:append:starfive-jh8100() {
 
 TOOLCHAIN = "gcc"
 
-COMPATIBLE_MACHINE = "(starfive-visionfive2|starfive-jh8100)"
-
+COMPATIBLE_MACHINE = "(starfive-dubhe|starfive-visionfive2|starfive-jh8100)"

+ 4 - 11
recipes-core/images/core-image-minimal.bbappend

@@ -5,18 +5,11 @@ DEPENDS:starfive-visionfive2 += " opensbi starfive-tool-native"
 IMAGE_FEATURES += " allow-empty-password empty-root-password"
 
 IMAGE_INSTALL += " \
-	helloworld \
-	coremark \
-	dhrystone \
-	perf \
-	gdb \
-	gdbserver \
-	util-linux \
-	ethtool \
+	packagegroup-starfive-essentials \
 	bmap-tools \
 	systemd-analyze \
-	openssh \
 	e2fsprogs-resize2fs \
-	"
+	parted \
+        "
 
-EXTRA_IMAGEDEPENDS:starfive-visionfive2 += " alsa-lib libgpiod i2c-tools"
+TOOLCHAIN_TARGET_TASK += "packagegroup-starfive-toolchain"

+ 20 - 24
recipes-core/images/core-image-starfive-extra.bb

@@ -4,30 +4,26 @@ require sd-image.inc
 
 DEPENDS += " opensbi u-boot-tools-native dtc-native"
 
-IMAGE_INSTALL = "packagegroup-core-boot \
-		${CORE_IMAGE_EXTRA_INSTALL} \
-		helloworld \
-        	coremark \
-        	dhrystone \
-        	perf \
-        	gdb \
-        	gdbserver \
-        	util-linux \
-        	ethtool \
-        	bmap-tools \
-        	systemd-analyze \
-        	openssh \
-        	e2fsprogs-resize2fs \
-		ldd \
-		file \
-		git \
-		texinfo \
-		libcheck \
-		packagegroup-core-buildessential \
-		packagegroup-starfive-c \
-		nodejs \
-        	nodejs-npm \
-		"
+IMAGE_INSTALL = "\
+	packagegroup-core-boot \
+	${CORE_IMAGE_EXTRA_INSTALL} \
+	bmap-tools \
+	systemd-analyze \
+	e2fsprogs-resize2fs \
+	parted \
+	ldd \
+	file \
+	git \
+	texinfo \
+	libcheck \
+	packagegroup-core-buildessential \
+	packagegroup-starfive-c \
+	packagegroup-starfive-essentials \
+	nodejs \
+	nodejs-npm \
+	"
+
+TOOLCHAIN_TARGET_TASK += "packagegroup-starfive-toolchain"
 
 IMAGE_LINGUAS = " "
 

+ 12 - 1
recipes-core/images/dubhe-image-essential.inc

@@ -8,4 +8,15 @@ IMAGE_ROOTFS_SIZE ?= "8192"
 IMAGE_FEATURES += "allow-empty-password empty-root-password"
 IMAGE_FEATURES:remove = "dbg-pkgs"
 
-IMAGE_INSTALL += "mtd-utils helloworld coremark dhrystone perf util-linux btrfs-tools parted lrzsz devmem2 iperf3 e2fsprogs ethtool"
+IMAGE_INSTALL += "\
+	packagegroup-starfive-essentials \
+	packagegroup-starfive-dubhe-essentials \
+	mtd-utils \
+	btrfs-tools \
+	parted \
+	lrzsz \
+	devmem2 \
+	e2fsprogs \
+	"
+
+TOOLCHAIN_TARGET_TASK += "packagegroup-starfive-toolchain"

+ 14 - 4
recipes-core/images/dubhe-image-initramfs.bb

@@ -4,10 +4,20 @@ the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
 first 'init' program more efficiently."
 
 INITRAMFS_SCRIPTS ?= "\
-                      initramfs-boot packagegroup-core-boot \
-                     "
-PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} base-passwd ${ROOTFS_BOOTSTRAP_INSTALL} helloworld coremark dhrystone perf gdb gdbserver util-linux ethtool atftp iperf3 openssh dhcpcd kvmtool tmux"
-
+	initramfs-boot \
+	packagegroup-core-boot \
+	"
+
+PACKAGE_INSTALL = "\
+	${INITRAMFS_SCRIPTS} \
+	${VIRTUAL-RUNTIME_base-utils} \
+	base-passwd \
+	${ROOTFS_BOOTSTRAP_INSTALL} \
+	packagegroup-starfive-essentials \
+	packagegroup-starfive-dubhe-essentials \
+	"
+
+TOOLCHAIN_TARGET_TASK += "packagegroup-starfive-toolchain"
 
 # Do not pollute the initrd image with rootfs features
 IMAGE_FEATURES = ""

+ 1 - 1
recipes-core/images/dubhe-image-minimal_0.1.bb

@@ -14,7 +14,7 @@ require dubhe-image-essential.inc
 
 export IMAGE_BASENAME = "console-image-minimal"
 
-do_image_qspi_ext4[depends] += " \
+do_image_qspi_ext4[depends] += "\
 	deploy-bootfiles:do_deploy \
 	opensbi:do_deploy \
 	virtual/kernel:do_deploy \

+ 10 - 13
recipes-core/images/qspi-image_0.1.bb

@@ -4,25 +4,22 @@ LICENSE = "CLOSED"
 
 inherit core-image
 
-DEPENDS = "opensbi deploy-bootfiles"
+DEPENDS = "deploy-bootfiles"
 
 LIC_FILES_CHKSUM = ""
 
 IMAGE_FSTYPES = "qspi"
 
 do_rootfs[depends] += "dubhe-image-initramfs:do_rootfs"
-do_image[depends] += " deploy-bootfiles:do_deploy"
-do_image[depends] += " opensbi:do_deploy"
-do_image[depends] += " virtual/kernel:do_deploy"
 
-IMAGE_CMD:qspi () {
-	dd if=${DEPLOY_DIR_IMAGE}/bootcode.bin of=${DEPLOY_DIR_IMAGE}/starfive-dubhe-90-qspi-initramfs-image.bin bs=32 seek=0 count=128
-	dd if=${DEPLOY_DIR_IMAGE}/bootjump.bin of=${DEPLOY_DIR_IMAGE}/starfive-dubhe-90-qspi-initramfs-image.bin bs=32 seek=128 count=1
-	dd if=${DEPLOY_DIR_IMAGE}/dubhe90_fpga.dtb of=${DEPLOY_DIR_IMAGE}/starfive-dubhe-90-qspi-initramfs-image.bin bs=32 seek=129 count=255
-	dd if=${DEPLOY_DIR_IMAGE}/fw_payload_initramfs.bin of=${DEPLOY_DIR_IMAGE}/starfive-dubhe-90-qspi-initramfs-image.bin bs=32 seek=384
+do_image[depends] += "\
+	deploy-bootfiles:do_deploy \
+	u-boot-starfive:do_deploy \
+	"
 
-	dd if=${DEPLOY_DIR_IMAGE}/bootcode.bin of=${DEPLOY_DIR_IMAGE}/starfive-dubhe-80-qspi-initramfs-image.bin bs=32 seek=0 count=128
-        dd if=${DEPLOY_DIR_IMAGE}/bootjump.bin of=${DEPLOY_DIR_IMAGE}/starfive-dubhe-80-qspi-initramfs-image.bin bs=32 seek=128 count=1
-        dd if=${DEPLOY_DIR_IMAGE}/dubhe80_fpga.dtb of=${DEPLOY_DIR_IMAGE}/starfive-dubhe-80-qspi-initramfs-image.bin bs=32 seek=129 count=255
-        dd if=${DEPLOY_DIR_IMAGE}/fw_payload_initramfs.bin of=${DEPLOY_DIR_IMAGE}/starfive-dubhe-80-qspi-initramfs-image.bin bs=32 seek=384
+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
 }

+ 7 - 1
recipes-core/images/qspi-nfs-essential.inc

@@ -8,4 +8,10 @@ IMAGE_ROOTFS_SIZE ?= "8192"
 IMAGE_FEATURES += "allow-empty-password empty-root-password"
 IMAGE_FEATURES:remove = "dbg-pkgs"
 
-IMAGE_INSTALL += "mtd-utils helloworld coremark dhrystone perf util-linux"
+IMAGE_INSTALL += "\
+	packagegroup-starfive-essentials \
+	packagegroup-starfive-dubhe-essentials \
+	mtd-utils \
+	"
+
+TOOLCHAIN_TARGET_TASK += "packagegroup-starfive-toolchain"

+ 1 - 1
recipes-core/images/qspi-nfs-image_0.1.bb

@@ -24,7 +24,7 @@ export IMAGE_BASENAME = "nfs-rootfs"
 #	rm ${IMAGE_ROOTFS}/var/log; mkdir -p ${IMAGE_ROOTFS}/var/log; touch ${IMAGE_ROOTFS}/var/log/lighttpd
 #}
 
-do_image_qspi_nfs[depends] += " \
+do_image_qspi_nfs[depends] += "\
 	deploy-bootfiles:do_deploy \
 	opensbi:do_deploy \
 	virtual/kernel:do_deploy \

+ 7 - 2
recipes-core/images/qspi-ubifs-image_0.1.bb

@@ -17,12 +17,17 @@ IMAGE_ROOTFS_SIZE ?= "8192"
 IMAGE_FEATURES += "allow-empty-password empty-root-password"
 
 #IMAGE_INSTALL += "mtd-utils mtd-utils-ubifs kernel-modules"
-IMAGE_INSTALL += "helloworld"
+IMAGE_INSTALL += "\
+	packagegroup-starfive-essentials \
+	packagegroup-starfive-dubhe-essentials \
+	"
+
+TOOLCHAIN_TARGET_TASK += "packagegroup-starfive-toolchain"
 
 IMAGE_FEATURES:remove = "dbg-pkgs"
 
 export IMAGE_BASENAME = "qspi-ubifs"
-do_image_qspi_ubifs[depends] += " \
+do_image_qspi_ubifs[depends] += "\
 	deploy-bootfiles:do_deploy \
 	opensbi:do_deploy \
 	virtual/kernel:do_deploy \

+ 13 - 0
recipes-core/packagegroups/packagegroup-starfive-dubhe-essentials.bb

@@ -0,0 +1,13 @@
+SUMMARY = "Packages required by StarFive Dubhe"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+RDEPENDS:${PN} = "\
+	atftp \
+	iperf3 \
+	dhcpcd \
+	kvmtool \
+	tmux \
+	"

+ 18 - 0
recipes-core/packagegroups/packagegroup-starfive-essentials.bb

@@ -0,0 +1,18 @@
+SUMMARY = "Essential Packages for StarFive Images."
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+RDEPENDS:${PN} = "\
+	helloworld \
+	coremark \
+	dhrystone \
+	perf \
+	gdb \
+	gdbserver \
+	util-linux \
+	ethtool \
+	openssh \
+	"
+

+ 14 - 0
recipes-core/packagegroups/packagegroup-starfive-toolchain.bb

@@ -0,0 +1,14 @@
+SUMMARY = "Packages required for StarFive toolchain"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+RDEPENDS:${PN} = "\
+	glibc glibc-dev glibc-staticdev \
+	libgomp libgomp-dev libgomp-staticdev \
+	alsa-lib alsa-lib-dev \
+	libgpiod libgpiod-dev \
+	i2c-tools i2c-tools-dev i2c-tools-staticdev \
+	libatomic-ops libatomic-ops-dev libatomic-ops-staticdev \
+	"

+ 5 - 5
recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend

@@ -1,5 +1,5 @@
-RDEPENDS:${PN}:append:starfive-visionfive2 = " \
-    xf86-video-modesetting \
-    ${PN}-extension-glx \
-    xserver-xf86-config \
-"
+RDEPENDS:${PN}:append:starfive-visionfive2 = "\
+	xf86-video-modesetting \
+	${PN}-extension-glx \
+	xserver-xf86-config \
+	"

+ 2 - 0
recipes-graphics/xorg-xserver/xserver-xorg_1.20.13.bb

@@ -1,5 +1,7 @@
 require xserver-xorg.inc
 
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}_${PV}:"
+
 SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch \
            file://pkgconfig.patch \
            file://0001-test-xtest-Initialize-array-with-braces.patch \

+ 0 - 0
recipes-graphics/xorg-xserver/xserver-xorg/0001-Avoid-duplicate-definitions-of-IOPortBase.patch → recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/0001-Avoid-duplicate-definitions-of-IOPortBase.patch


+ 0 - 0
recipes-graphics/xorg-xserver/xserver-xorg/0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch → recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/0001-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch


+ 0 - 0
recipes-graphics/xorg-xserver/xserver-xorg/0001-drmmode_display.c-add-missing-mi.h-include.patch → recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/0001-drmmode_display.c-add-missing-mi.h-include.patch


+ 0 - 0
recipes-graphics/xorg-xserver/xserver-xorg/0001-test-xtest-Initialize-array-with-braces.patch → recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/0001-test-xtest-Initialize-array-with-braces.patch


+ 0 - 0
recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch → recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch


+ 0 - 0
recipes-graphics/xorg-xserver/xserver-xorg/pkgconfig.patch → recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/pkgconfig.patch


+ 0 - 0
recipes-graphics/xorg-xserver/xserver-xorg/sdksyms-no-build-path.patch → recipes-graphics/xorg-xserver/xserver-xorg_1.20.13/sdksyms-no-build-path.patch


+ 2 - 0
recipes-graphics/xorg-xserver/xserver-xorg_21.1.4.bb

@@ -1,5 +1,7 @@
 require xserver-xorg.inc
 
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}_${PV}:"
+
 SRC_URI += "file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch \
            file://0001-Avoid-duplicate-definitions-of-IOPortBase.patch \
            file://0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch \

+ 29 - 0
recipes-graphics/xorg-xserver/xserver-xorg_21.1.4/0001-Avoid-duplicate-definitions-of-IOPortBase.patch

@@ -0,0 +1,29 @@
+From ce3b8a230a3805c9b557c1f106795675bd034860 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 17 Aug 2020 10:50:51 -0700
+Subject: [PATCH] Avoid duplicate definitions of IOPortBase
+
+This fixed build with gcc10/-fno-common
+
+Fixes
+compiler.h:528: multiple definition of `IOPortBase';
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ hw/xfree86/os-support/linux/lnx_video.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
+index fd83022..1d0d96e 100644
+--- a/hw/xfree86/os-support/linux/lnx_video.c
++++ b/hw/xfree86/os-support/linux/lnx_video.c
+@@ -78,6 +78,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
+ /***************************************************************************/
+ /* I/O Permissions section                                                 */
+ /***************************************************************************/
++_X_EXPORT unsigned int IOPortBase;      /* Memory mapped I/O port area */
+ 
+ #if defined(__powerpc__)
+ volatile unsigned char *ioBase = NULL;

+ 53 - 0
recipes-graphics/xorg-xserver/xserver-xorg_21.1.4/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch

@@ -0,0 +1,53 @@
+From d77cdc5e1eee26821ab98c947abea53fb7b18fe5 Mon Sep 17 00:00:00 2001
+From: California Sullivan <california.l.sullivan@intel.com>
+Date: Fri, 16 Mar 2018 17:23:11 -0700
+Subject: [PATCH] xf86pciBus.c: use Intel ddx only for pre-gen4 hardware
+
+Use intel ddx only on pre-gen4 hw, newer ones will fall back to modesetting
+Author: Timo Aaltonen <tjaalton@debian.org>
+
+Instead of defaulting to the Intel driver for all Intel hardware, only
+default it for older hardware for which it has shown to be better for.
+
+Others fall through to the -modesetting default.
+
+Upstream-Status: Pending [Debian/Fedora patch
+https://src.fedoraproject.org/rpms/xorg-x11-server/c/ee515e44b07e37689abf48cf2fffb41578f3bc1d]
+
+Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
+---
+ hw/xfree86/common/xf86pciBus.c | 18 +++++++++++++++++-
+ 1 file changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
+index e61ae0cd4..d70c99197 100644
+--- a/hw/xfree86/common/xf86pciBus.c
++++ b/hw/xfree86/common/xf86pciBus.c
+@@ -1173,7 +1173,23 @@ xf86VideoPtrToDriverList(struct pci_device *dev,
+ 		case 0x0bef:
+ 			/* Use fbdev/vesa driver on Oaktrail, Medfield, CDV */
+ 			break;
+-		default:
++		/* Default to intel only on pre-gen4 chips */
++		case 0x3577:
++		case 0x2562:
++		case 0x3582:
++		case 0x358e:
++		case 0x2572:
++		case 0x2582:
++		case 0x258a:
++		case 0x2592:
++		case 0x2772:
++		case 0x27a2:
++		case 0x27ae:
++		case 0x29b2:
++		case 0x29c2:
++		case 0x29d2:
++		case 0xa001:
++		case 0xa011:
+ 			driverList[0] = "intel";
+ 			break;
+         }
+-- 
+2.14.3
+

+ 63 - 0
recipes-graphics/xorg-xserver/xserver-xorg_21.1.4/0001-xkb-fix-some-possible-memleaks-in-XkbGetKbdByName.patch

@@ -0,0 +1,63 @@
+CVE: CVE-2022-3551
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+From 18f91b950e22c2a342a4fbc55e9ddf7534a707d2 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Wed, 13 Jul 2022 11:23:09 +1000
+Subject: [PATCH] xkb: fix some possible memleaks in XkbGetKbdByName
+
+GetComponentByName returns an allocated string, so let's free that if we
+fail somewhere.
+
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+---
+ xkb/xkb.c | 26 ++++++++++++++++++++------
+ 1 file changed, 20 insertions(+), 6 deletions(-)
+
+diff --git a/xkb/xkb.c b/xkb/xkb.c
+index 4692895db..b79a269e3 100644
+--- a/xkb/xkb.c
++++ b/xkb/xkb.c
+@@ -5935,18 +5935,32 @@ ProcXkbGetKbdByName(ClientPtr client)
+     xkb = dev->key->xkbInfo->desc;
+     status = Success;
+     str = (unsigned char *) &stuff[1];
+-    if (GetComponentSpec(&str, TRUE, &status))  /* keymap, unsupported */
+-        return BadMatch;
++    {
++        char *keymap = GetComponentSpec(&str, TRUE, &status);  /* keymap, unsupported */
++        if (keymap) {
++            free(keymap);
++            return BadMatch;
++        }
++    }
+     names.keycodes = GetComponentSpec(&str, TRUE, &status);
+     names.types = GetComponentSpec(&str, TRUE, &status);
+     names.compat = GetComponentSpec(&str, TRUE, &status);
+     names.symbols = GetComponentSpec(&str, TRUE, &status);
+     names.geometry = GetComponentSpec(&str, TRUE, &status);
+-    if (status != Success)
++    if (status == Success) {
++        len = str - ((unsigned char *) stuff);
++        if ((XkbPaddedSize(len) / 4) != stuff->length)
++            status = BadLength;
++    }
++
++    if (status != Success) {
++        free(names.keycodes);
++        free(names.types);
++        free(names.compat);
++        free(names.symbols);
++        free(names.geometry);
+         return status;
+-    len = str - ((unsigned char *) stuff);
+-    if ((XkbPaddedSize(len) / 4) != stuff->length)
+-        return BadLength;
++    }
+ 
+     CHK_MASK_LEGAL(0x01, stuff->want, XkbGBN_AllComponentsMask);
+     CHK_MASK_LEGAL(0x02, stuff->need, XkbGBN_AllComponentsMask);
+-- 
+2.34.1
+

+ 38 - 0
recipes-graphics/xorg-xserver/xserver-xorg_21.1.4/0001-xkb-proof-GetCountedString-against-request-length-at.patch

@@ -0,0 +1,38 @@
+CVE: CVE-2022-3550
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+From 11beef0b7f1ed290348e45618e5fa0d2bffcb72e Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue, 5 Jul 2022 12:06:20 +1000
+Subject: [PATCH] xkb: proof GetCountedString against request length attacks
+
+GetCountedString did a check for the whole string to be within the
+request buffer but not for the initial 2 bytes that contain the length
+field. A swapped client could send a malformed request to trigger a
+swaps() on those bytes, writing into random memory.
+
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+---
+ xkb/xkb.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/xkb/xkb.c b/xkb/xkb.c
+index f42f59ef3..1841cff26 100644
+--- a/xkb/xkb.c
++++ b/xkb/xkb.c
+@@ -5137,6 +5137,11 @@ _GetCountedString(char **wire_inout, ClientPtr client, char **str)
+     CARD16 len;
+ 
+     wire = *wire_inout;
++
++    if (client->req_len <
++        bytes_to_int32(wire + 2 - (char *) client->requestBuffer))
++        return BadValue;
++
+     len = *(CARD16 *) wire;
+     if (client->swapped) {
+         swaps(&len);
+-- 
+2.34.1
+

+ 0 - 9
recipes-kernel/linux/files/add-dubhe-additional-dtb.patch

@@ -1,9 +0,0 @@
-diff --git a/arch/riscv/boot/dts/starfive/Makefile b/arch/riscv/boot/dts/starfive/Makefile
-index afd54ff97bd3..19cec25ad47b 100644
---- a/arch/riscv/boot/dts/starfive/Makefile
-+++ b/arch/riscv/boot/dts/starfive/Makefile
-@@ -1,3 +1,4 @@
- # SPDX-License-Identifier: GPL-2.0
- dtb-$(CONFIG_SOC_STARFIVE) += jh7100-beaglev-starlight-a1.dtb jh7100-beaglev-starlight.dtb jh7100-starfive-visionfive-v1.dtb
- dtb-$(CONFIG_SOC_STARFIVE_DUBHE) += dubhe80_fpga.dtb dubhe90_fpga.dtb dubhe90_fpga_dual.dtb
-+dtb-$(CONFIG_SOC_STARFIVE_DUBHE) += dubhe90_fpga_ext4.dtb dubhe90_fpga_ubi.dtb dubhe90_fpga_nfs.dtb dubhe80_fpga_ext4.dtb dubhe80_fpga_ubi.dtb dubhe80_fpga_nfs.dtb

+ 5 - 33
recipes-kernel/linux/linux-starfive-dev_6.1.20.bb

@@ -10,7 +10,7 @@ BRANCH = "master"
 
 FORK:starfive-dubhe = "starfive-tech"
 BRANCH:starfive-dubhe = "starfive-6.1-dubhe"
-SRCREV:starfive-dubhe = "1e3b15b8f416e8d26af7bff467d8debc3f1f5fd9"
+SRCREV:starfive-dubhe = "c888e193d4662be1943b79172f0f5780dab87b72"
 
 FORK:starfive-jh8100 = "starfive-tech"
 BRANCH:starfive-jh8100 = "starfive-6.1-dev-jh8100-bmc"
@@ -25,12 +25,13 @@ LINUX_VERSION_EXTENSTION:append:starfive-dubhe = "-starlight"
 FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
 
 SRC_URI:starfive-dubhe = " \
-        git://git@192.168.110.45/${FORK}/linux.git;protocol=ssh;branch=${BRANCH} \
+        git://github.com/${FORK}/linux.git;protocol=https;branch=${BRANCH} \
         file://cpio.cfg \
-	file://add-dubhe-additional-dtb.patch \
         "
-SRC_URI:starfive-jh8100 = "git://git@192.168.110.45/${FORK}/linux.git;protocol=ssh;branch=${BRANCH}"
 
+SRC_URI:starfive-jh8100 = "\
+	git://git@192.168.110.45/${FORK}/linux.git;protocol=ssh;branch=${BRANCH} \
+	"
 
 INITRAMFS_IMAGE_BUNDLE:starfive-dubhe = "1"
 INITRAMFS_IMAGE:starfive-dubhe = "dubhe-image-initramfs"
@@ -41,32 +42,3 @@ KBUILD_DEFCONFIG:starfive-jh8100 = "jh8100_defconfig"
 COMPATIBLE_MACHINE = "(starfive-dubhe|starfive-jh8100)"
 
 FILES:${KERNEL_PACKAGE_NAME}-base += "/usr/*"
-
-BOOTARGS_EXT4 = "console=ttySIF0,115200 earlycon=sbi root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait ip=:::255.255.255.0::eth0:dhcp"
-BOOTARGS_UBI = "console=ttySIF0,115200 earlycon=sbi ip=:::255.255.255.0::eth0:dhcp root=ubi0:starfive-dubhe-rootfs ubi.mtd=1 rw rootfstype=ubifs rootwait"
-BOOTARGS_NFS = "console=ttySIF0,115200 earlycon=sbi root=/dev/nfs rw nfsroot=192.168.1.1:/filepath,rw,tcp,vers=3 ip=:::255.255.255.0::eth0:dhcp rootfstype=ext4 rootwait"
-
-do_configure:append:starfive-dubhe() {
-	cp ${S}/arch/riscv/boot/dts/starfive/dubhe80_fpga.dts ${S}/arch/riscv/boot/dts/starfive/dubhe80_fpga_ext4.dts
-        cp ${S}/arch/riscv/boot/dts/starfive/dubhe80_fpga.dts ${S}/arch/riscv/boot/dts/starfive/dubhe80_fpga_ubi.dts
-        cp ${S}/arch/riscv/boot/dts/starfive/dubhe80_fpga.dts ${S}/arch/riscv/boot/dts/starfive/dubhe80_fpga_nfs.dts
-
-	cp ${S}/arch/riscv/boot/dts/starfive/dubhe90_fpga.dts ${S}/arch/riscv/boot/dts/starfive/dubhe90_fpga_ext4.dts
-	cp ${S}/arch/riscv/boot/dts/starfive/dubhe90_fpga.dts ${S}/arch/riscv/boot/dts/starfive/dubhe90_fpga_ubi.dts
-	cp ${S}/arch/riscv/boot/dts/starfive/dubhe90_fpga.dts ${S}/arch/riscv/boot/dts/starfive/dubhe90_fpga_nfs.dts
-
-	for dts_file in ${S}/arch/riscv/boot/dts/starfive/dubhe*0_fpga_*.dts; do
-		if [ "$dts_file" = "${S}/arch/riscv/boot/dts/starfive/dubhe90_fpga_dual.dts" ]; then
-			continue
-		fi
-		echo "/ {" >> "$dts_file"
-		echo "    chosen {" >> "$dts_file"
-		echo "        bootargs" >> "$dts_file"
-		echo "    };" >> "$dts_file"
-		echo "};" >> "$dts_file"
-	done
-
-	sed -i "s+bootargs+bootargs = \"${BOOTARGS_EXT4}\";+g" ${S}/arch/riscv/boot/dts/starfive/dubhe*0_fpga_ext4.dts
-	sed -i "s+bootargs+bootargs = \"${BOOTARGS_UBI}\";+g" ${S}/arch/riscv/boot/dts/starfive/dubhe*0_fpga_ubi.dts
-	sed -i "s+bootargs+bootargs = \"${BOOTARGS_NFS}\";+g" ${S}/arch/riscv/boot/dts/starfive/dubhe*0_fpga_nfs.dts
-}

+ 53 - 54
setup.sh

@@ -158,32 +158,34 @@ echo "";
 echo "This build script can build three types of image.";
 echo "";
 echo "1) QSPI-Image";
-echo "   - Initramfs has been bundled into qspi-image.";
+echo "   - QSPI image that boots image via TFTP";
 echo "   - Generated output : ";
-echo "     QSPI-Image.bin";
-echo "2) Dubhe-Image-Minimal";
-echo "   - Minimal image with ext4 support.";
-echo "   - Generated output : ";
-echo "     QSPI-EXT4-Image.bin";
-echo "     SD-Image.img";
-echo "3) QSPI-Ubifs-Image";
-echo "   - Minimal image with ubifs support.";
-echo "   - Generated output : ";
-echo -e "     QSPI-Ubifs-Image.bin";
-echo "4) QSPI-NFS-Image";
-echo "   - NFS config has been enabled.";
-echo "   - Generated output : ";
-echo -e "     QSPI-NFS-Image.bin${NC}";
+echo "     starfive-dubhe-qspi-tftpboot.bin";
+echo "     Image-initramfs-starfive-dubhe.bin";
+echo "     dubhe80_fpga.dtb"
+echo -e "     dubhe90_fpga.dtb${NC}";
+#echo "2) Dubhe-Image-Minimal";
+#echo "   - Minimal image with ext4 support.";
+#echo "   - Generated output : ";
+#echo "     QSPI-EXT4-Image.bin";
+#echo "     SD-Image.img";
+#echo "3) QSPI-Ubifs-Image";
+#echo "   - Minimal image with ubifs support.";
+#echo "   - Generated output : ";
+#echo -e "     QSPI-Ubifs-Image.bin";
+#echo "4) QSPI-NFS-Image";
+#echo "   - NFS config has been enabled.";
+#echo "   - Generated output : ";
+#echo -e "     QSPI-NFS-Image.bin${NC}";
 echo "";
 
 PS3="Select your action : "
-options=("Build qspi-image" "Build dubhe-image-minimal" "Build qspi-ubifs-image" "Build qspi-nfs-image" "Quit")
+options=("Build qspi-image" "Quit")
 
 select opt in "${options[@]}"
 do
     case $opt in
         "Build qspi-image")
-#            cd ../build || { echo "Run setup.sh before building images."; cd meta-starfive; break; };
 	    updatecfg ENABLE_INIT;
             cur_ter=$(tty);
             output=$(MACHINE=starfive-dubhe bitbake qspi-image | tee $cur_ter);
@@ -192,43 +194,40 @@ do
                 runprog dubhe-image-initramfs;
             else echo -e "\U000274C ${RED}Build Failed${NC}"
             fi;;
-	"Build dubhe-image-minimal")
-#           cd ../build || { echo "Run setup.sh before building images."; cd meta-starfive; break; };
-	    updatecfg ENABLE_EXT4
-            cur_ter=$(tty);
-            output_min=$(MACHINE=starfive-dubhe bitbake dubhe-image-minimal | tee $cur_ter);
-            if [[ $output_min != *"ERROR"* ]]; then
-                echo -e "\U0002705 ${GREEN}Build Complete${NC}"
-                runprog console-image-minimal;
-            else echo -e "\U000274C ${RED}Build Failed${NC}"
-            fi;;
-	"Build qspi-ubifs-image")
-#            cd ../build || { echo "Run setup.sh before building images."; cd meta-starfive; break; };
-	    updatecfg ENABLE_UBI
-            cur_ter=$(tty);
-            output=$(MACHINE=starfive-dubhe bitbake qspi-ubifs-image | tee $cur_ter);
-            if [[ $output != *"ERROR"* ]]; then
-                echo -e "\U0002705 ${GREEN}Build Complete${NC}"
-            else echo -e "\U000274C ${RED}Build Failed${NC}"
-            fi;;
-        "Build qspi-nfs-image")
-#           cd ../build || { echo "Run setup.sh before building images."; cd meta-starfive; break; };
-	    sed -n 47p ../meta-starfive/recipes-kernel/linux/linux-starfive-dev_6.1.20.bb;
-	    read -p "Kindly confirm boot argument such as nfs path and ip address before build (/meta-starfive/recipes-kernel/linux/files/nfs.patch). Proceed to build?[Y/n]:" RES;
-	    case $RES in
-		[Yy])
-			updatecfg ENABLE_NFS
-			cur_ter=$(tty);
-			output_min=$(MACHINE=starfive-dubhe bitbake qspi-nfs-image | tee $cur_ter);
-			if [[ $output_min != *"ERROR"* ]]; then
-				echo -e "\U0002705 ${GREEN}Build Complete${NC}"
-			else echo -e "\U000274C ${RED}Build Failed${NC}"
-			fi;;
-		 [Nn])
-			return;;
-		 *)
-			echo "Invalid option $RES , [Y/n] only.";
-			esac;;
+#	"Build dubhe-image-minimal")
+#	    updatecfg ENABLE_EXT4
+#            cur_ter=$(tty);
+#            output_min=$(MACHINE=starfive-dubhe bitbake dubhe-image-minimal | tee $cur_ter);
+#            if [[ $output_min != *"ERROR"* ]]; then
+#                echo -e "\U0002705 ${GREEN}Build Complete${NC}"
+#                runprog console-image-minimal;
+#            else echo -e "\U000274C ${RED}Build Failed${NC}"
+#            fi;;
+#	"Build qs#pi-ubifs-image")
+#	    updatecfg ENABLE_UBI
+#            cur_ter=$(tty);
+#            output=$(MACHINE=starfive-dubhe bitbake qspi-ubifs-image | tee $cur_ter);
+#            if [[ $output != *"ERROR"* ]]; then
+#                echo -e "\U0002705 ${GREEN}Build Complete${NC}"
+#            else echo -e "\U000274C ${RED}Build Failed${NC}"
+#            fi;;
+#        "Build qspi-nfs-image")
+#	    sed -n 47p ../meta-starfive/recipes-kernel/linux/linux-starfive-dev_6.1.20.bb;
+#	    read -p "Kindly confirm boot argument such as nfs path and ip address before build (/meta-starfive/recipes-kernel/linux/linux-starfive-dev_6.1.20). Proceed to build?[Y/n]:" RES;
+#	    case $RES in
+#		[Yy])
+#			updatecfg ENABLE_NFS
+#			cur_ter=$(tty);
+#			output_min=$(MACHINE=starfive-dubhe bitbake qspi-nfs-image | tee $cur_ter);
+#			if [[ $output_min != *"ERROR"* ]]; then
+#				echo -e "\U0002705 ${GREEN}Build Complete${NC}"
+#			else echo -e "\U000274C ${RED}Build Failed${NC}"
+#			fi;;
+#		 [Nn])
+#			return;;
+#		 *)
+#			echo "Invalid option $RES , [Y/n] only.";
+#			esac;;
 	"Quit")
             break;;
         *)