From 66d87abc45d5fcbe210bfe816847e7db861a2043 Mon Sep 17 00:00:00 2001 From: Hal Feng Date: Fri, 23 Feb 2024 15:50:17 +0800 Subject: Support specifying dtb in ${boot_syslinux_conf} With this patch, you can specify dtb to bootup kernel, using fdtdir in ${boot_syslinux_conf}. Generally boot_syslinux_conf=extlinux/extlinux.conf Signed-off-by: Yingpeng Liu Signed-off-by: Hal Feng --- cmd/pxe_utils.c | 6 ++++++ configs/starfive_devkits_defconfig | 2 +- configs/starfive_evb_defconfig | 2 +- configs/starfive_visionfive2_defconfig | 2 +- include/configs/starfive-devkits.h | 10 +--------- include/configs/starfive-evb.h | 10 +--------- include/configs/starfive-visionfive2.h | 10 +--------- 7 files changed, 12 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 " \ -- cgit v1.2.3