Browse Source

dubhe: u-boot-starfive: Add Dubhe support
Now Dubhe 80 and Dubhe 90 supports U-Boot.
Clean up recipe.

Signed-off-by: weiheng.cheng <weiheng.cheng@starfivetech.com>

weiheng.cheng 6 months ago
parent
commit
613a767c3a
1 changed files with 40 additions and 14 deletions
  1. 40 14
      recipes-bsp/u-boot/u-boot-starfive.bb

+ 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://git@192.168.110.45/${FORK}/u-boot.git;protocol=ssh;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)"