VisionFive2 U-Boot

StarFive Tech U-Boot for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   15 Branches   44 Tags
author: andy.hu <andy.hu@starfivetech.com> 2024-02-23 11:39:44 +0000 committer: andy.hu <andy.hu@starfivetech.com> 2024-02-23 11:39:44 +0000 commit: 223ac8b1e907924d3891b3be1b2f6620b56bff31 parent: f1b1c9ad3e64a9ac868042e898153b11828a5ea9
Commit Summary:
Merge branch 'CR_9215_debian_support_specifying_dtb_hal.feng' into 'jh7110-master'
Diffstat:
7 files changed, 11 insertions, 30 deletions
diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c
index 067c24e5ff..4096399c10 100644
--- a/cmd/pxe_utils.c
+++ b/cmd/pxe_utils.c
@@ -654,6 +654,12 @@ static int label_boot(struct cmd_tbl *cmdtp, struct pxe_label *label)
 
 	kernel_addr = genimg_get_kernel_addr(bootm_argv[1]);
 	buf = map_sysmem(kernel_addr, 0);
+
+#if IS_ENABLED(CONFIG_STARFIVE_JH7110)
+	run_command("run chipa_set_linux", 0);
+	run_command("run cpu_vol_set", 0);
+#endif
+
 	/* Try bootm for legacy and FIT format image */
 	if (genimg_get_format(buf) != IMAGE_FORMAT_INVALID)
 		do_bootm(cmdtp, 0, bootm_argc, bootm_argv);
diff --git a/configs/starfive_devkits_defconfig b/configs/starfive_devkits_defconfig
index 3774c07cdf..5105b62263 100644
--- a/configs/starfive_devkits_defconfig
+++ b/configs/starfive_devkits_defconfig
@@ -33,7 +33,7 @@ CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run sdk_boot_env; run distro_boot_env;"
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="run chipa_set_uboot"
-CONFIG_DEFAULT_FDT_FILE="starfive/jh7110-devkits.dtb"
+CONFIG_DEFAULT_FDT_FILE="jh7110-devkits-v2.dtb"
 CONFIG_LOG_MAX_LEVEL=4
 CONFIG_SPL_LOG=y
 CONFIG_DISPLAY_CPUINFO=y
diff --git a/configs/starfive_evb_defconfig b/configs/starfive_evb_defconfig
index 1f2b15ef5f..718480795a 100644
--- a/configs/starfive_evb_defconfig
+++ b/configs/starfive_evb_defconfig
@@ -32,7 +32,7 @@ CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run sdk_boot_env; run distro_boot_env;"
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="run chipa_set_uboot"
-CONFIG_DEFAULT_FDT_FILE="starfive/jh7110-evb.dtb"
+CONFIG_DEFAULT_FDT_FILE="jh7110-evb.dtb"
 CONFIG_LOG_MAX_LEVEL=4
 CONFIG_SPL_LOG=y
 CONFIG_DISPLAY_CPUINFO=y
diff --git a/configs/starfive_visionfive2_defconfig b/configs/starfive_visionfive2_defconfig
index 05b072db34..cc892d486f 100644
--- a/configs/starfive_visionfive2_defconfig
+++ b/configs/starfive_visionfive2_defconfig
@@ -33,7 +33,7 @@ CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run sdk_boot_env; run distro_boot_env"
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="run chipa_set_uboot;"
-CONFIG_DEFAULT_FDT_FILE="starfive/jh7110-visionfive-v2.dtb"
+CONFIG_DEFAULT_FDT_FILE="jh7110-visionfive-v2.dtb"
 CONFIG_LOG_MAX_LEVEL=4
 CONFIG_SPL_LOG=y
 CONFIG_DISPLAY_CPUINFO=y
diff --git a/include/configs/starfive-devkits.h b/include/configs/starfive-devkits.h
index 9ff0ef99f7..5a86c6f59d 100644
--- a/include/configs/starfive-devkits.h
+++ b/include/configs/starfive-devkits.h
@@ -256,17 +256,9 @@
 	"rootpart=4\0"		\
 	"load_distro_uenv="						\
 		"fatload ${bootdev} ${devnum}:${bootpart} ${loadaddr} /${bootenv}; " \
-		"env import ${loadaddr} ${filesize}; \0" \
-	"fdt_loaddtb="		\
-		"fatload ${bootdev} ${devnum}:${bootpart} ${fdt_addr_r} /dtbs/${fdtfile}; fdt addr ${fdt_addr_r}; \0" \
-	"fdt_sizecheck="	\
-		"fatsize ${bootdev} ${devnum}:${bootpart} /dtbs/${fdtfile}; \0" \
-	"set_fdt_distro="	\
-		"run chipa_set_linux; run cpu_vol_set;" \
-		"fatwrite ${bootdev} ${devnum}:${bootpart} ${fdt_addr_r} /dtbs/${fdtfile} ${filesize}; \0" \
+		"env import -t ${loadaddr} ${filesize}; \0" \
 	"bootcmd_distro="	\
 		"run load_distro_uenv; " \
-		"run fdt_loaddtb; run fdt_sizecheck; run set_fdt_distro; "	\
 		"sysboot ${bootdev} ${devnum}:${bootpart} fat ${scriptaddr} /${boot_syslinux_conf}; \0" \
 	"distro_mmc_test_and_boot="					\
 		"if mmc dev ${devnum}; then "				\
diff --git a/include/configs/starfive-evb.h b/include/configs/starfive-evb.h
index 9a64635f6d..a9ff995cb4 100644
--- a/include/configs/starfive-evb.h
+++ b/include/configs/starfive-evb.h
@@ -258,17 +258,9 @@
 	"rootpart=4\0"		\
 	"load_distro_uenv="						\
 		"fatload ${bootdev} ${devnum}:${bootpart} ${loadaddr} /${bootenv}; " \
-		"env import ${loadaddr} ${filesize}; \0" \
-	"fdt_loaddtb="		\
-		"fatload ${bootdev} ${devnum}:${bootpart} ${fdt_addr_r} /dtbs/${fdtfile}; fdt addr ${fdt_addr_r}; \0" \
-	"fdt_sizecheck="	\
-		"fatsize ${bootdev} ${devnum}:${bootpart} /dtbs/${fdtfile}; \0" \
-	"set_fdt_distro="	\
-		"run chipa_set_linux; run cpu_vol_set;" \
-		"fatwrite ${bootdev} ${devnum}:${bootpart} ${fdt_addr_r} /dtbs/${fdtfile} ${filesize}; \0" \
+		"env import -t ${loadaddr} ${filesize}; \0" \
 	"bootcmd_distro="	\
 		"run load_distro_uenv; " \
-		"run fdt_loaddtb; run fdt_sizecheck; run set_fdt_distro; "	\
 		"sysboot ${bootdev} ${devnum}:${bootpart} fat ${scriptaddr} /${boot_syslinux_conf}; \0" \
 	"distro_mmc_test_and_boot="					\
 		"if mmc dev ${devnum}; then "				\
diff --git a/include/configs/starfive-visionfive2.h b/include/configs/starfive-visionfive2.h
index 37a51004ca..30b60e85b0 100644
--- a/include/configs/starfive-visionfive2.h
+++ b/include/configs/starfive-visionfive2.h
@@ -263,17 +263,9 @@
 	"rootpart=4\0"		\
 	"load_distro_uenv="						\
 		"fatload ${bootdev} ${devnum}:${bootpart} ${loadaddr} /${bootenv}; " \
-		"env import ${loadaddr} ${filesize}; \0" \
-	"fdt_loaddtb="		\
-		"fatload ${bootdev} ${devnum}:${bootpart} ${fdt_addr_r} /dtbs/${fdtfile}; fdt addr ${fdt_addr_r}; \0" \
-	"fdt_sizecheck="	\
-		"fatsize ${bootdev} ${devnum}:${bootpart} /dtbs/${fdtfile}; \0" \
-	"set_fdt_distro="	\
-		"run chipa_set_linux; run cpu_vol_set;" \
-		"fatwrite ${bootdev} ${devnum}:${bootpart} ${fdt_addr_r} /dtbs/${fdtfile} ${filesize}; \0" \
+		"env import -t ${loadaddr} ${filesize}; \0" \
 	"bootcmd_distro="	\
 		"run load_distro_uenv; " \
-		"run fdt_loaddtb; run fdt_sizecheck; run set_fdt_distro; "	\
 		"sysboot ${bootdev} ${devnum}:${bootpart} fat ${scriptaddr} /${boot_syslinux_conf}; \0" \
 	"distro_mmc_test_and_boot="					\
 		"if mmc dev ${devnum}; then "				\