diff --git "a/documents/rockchip/openEuler\351\200\202\351\205\215\346\214\207\345\215\227.md" "b/documents/rockchip/openEuler\351\200\202\351\205\215\346\214\207\345\215\227.md" index d5de2d13735313145c0295c2e20d4ad13b143140..30dbb479e4f8977322556416440f84490e12af10 100644 --- "a/documents/rockchip/openEuler\351\200\202\351\205\215\346\214\207\345\215\227.md" +++ "b/documents/rockchip/openEuler\351\200\202\351\205\215\346\214\207\345\215\227.md" @@ -40,7 +40,7 @@ - RK35xx - 需要将编译好的 u-boot 二进制文件放到 [u-boot 目录](../../scripts/rockchip/bin/u-boot/)下,并在 [build_boot.sh](../../scripts/rockchip/build_u-boot.sh#L126) 中增加相应操作。 + 需要将编译好的 u-boot 二进制文件放到 [u-boot 目录](../../scripts/rockchip/bin/u-boot/)下,并在版型文件中增加文件路径。 ## 准备 firmware 文件 @@ -72,6 +72,12 @@ POST_BOARD_OVERLAY() { 1. ubootconfig=UBOOT_DEFCONFIG 开发板对应的 defconfig 的文件名称,对应 [u-boot/configs](https://github.com/u-boot/u-boot/tree/master/configs) 下 `UBOOT_DEFCONFIG` 文件,默认为 `firefly-rk3399_defconfig`;如需在 RK3568/RK3588 开发板上使用预编译的 u-boot,可以将此项设置为 `none`。 + + 如果设置为 `none`,则还需添加以下附属配置参数: + + - local_uboot_dir + + 开发板 u-boot 配置设置为 `none` 时,本地预编译的 u-boot 二进制文件的位置。 2. dtb_name=DTB_NAME diff --git a/scripts/rockchip/boards/firefly-itx-3588j.conf b/scripts/rockchip/boards/firefly-itx-3588j.conf index bae98c260bac4d9231416cf239399741908c0ee6..341fc5608d3355a74c9a0337de8632bcfe751c99 100644 --- a/scripts/rockchip/boards/firefly-itx-3588j.conf +++ b/scripts/rockchip/boards/firefly-itx-3588j.conf @@ -1,4 +1,5 @@ ubootconfig=none +local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3588 dtb_name=rk3588-firefly-itx-3588j platform=rockchip diff --git a/scripts/rockchip/boards/firefly-roc-rk3566-pc.conf b/scripts/rockchip/boards/firefly-roc-rk3566-pc.conf index a26fbb29c8c2b7e2e933ddd8e62d31b6c69af800..57fe2f495d8682a2812b1cd4ffd1caa51b0bd29f 100644 --- a/scripts/rockchip/boards/firefly-roc-rk3566-pc.conf +++ b/scripts/rockchip/boards/firefly-roc-rk3566-pc.conf @@ -1,4 +1,5 @@ ubootconfig=none +local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3566 dtb_name=rk3566-roc-pc platform=rockchip diff --git a/scripts/rockchip/boards/firefly-roc-rk3568-pc-se.conf b/scripts/rockchip/boards/firefly-roc-rk3568-pc-se.conf index e8520a304714dbf7c55cfac720e39de92b87e8d0..1b4e5aba89763e5c759577006e79c91b9b708b79 100644 --- a/scripts/rockchip/boards/firefly-roc-rk3568-pc-se.conf +++ b/scripts/rockchip/boards/firefly-roc-rk3568-pc-se.conf @@ -1,4 +1,5 @@ ubootconfig=none +local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3568 dtb_name=rk3568-roc-pc-se platform=rockchip diff --git a/scripts/rockchip/boards/firefly-roc-rk3588s-pc.conf b/scripts/rockchip/boards/firefly-roc-rk3588s-pc.conf index 9df022027cc1f60de89c85dd723b5f630e802b4a..ee7d8c13ba4417b282c8f0f3bdc9e345a412c03d 100644 --- a/scripts/rockchip/boards/firefly-roc-rk3588s-pc.conf +++ b/scripts/rockchip/boards/firefly-roc-rk3588s-pc.conf @@ -1,4 +1,5 @@ ubootconfig=none +local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3588 dtb_name=rk3588s-roc-pc platform=rockchip diff --git a/scripts/rockchip/boards/phytiumpi-4gb.conf b/scripts/rockchip/boards/phytiumpi-4gb.conf index 842fa25a9c4623256dc7f5705cae7d054fca99d7..ff1330f056376fec7a431ee92be2c1417af78705 100644 --- a/scripts/rockchip/boards/phytiumpi-4gb.conf +++ b/scripts/rockchip/boards/phytiumpi-4gb.conf @@ -1,4 +1,5 @@ ubootconfig=none +local_uboot_dir=${nonfree_bin_dir}/u-boot/phytiumpi dtb_name=phytiumpi_firefly platform=phytium diff --git a/scripts/rockchip/boards/radxa-rock5b.conf b/scripts/rockchip/boards/radxa-rock5b.conf index 0bf5341b6e903351bc302d71aeb375816ad66d6e..4dd6a3c79f7f9bb3b8fb6d58524a1ab9d7ea3626 100644 --- a/scripts/rockchip/boards/radxa-rock5b.conf +++ b/scripts/rockchip/boards/radxa-rock5b.conf @@ -1,4 +1,5 @@ ubootconfig=none +local_uboot_dir=${nonfree_bin_dir}/u-boot/radxa-rock5b dtb_name=rk3588-rock-5b platform=rockchip diff --git a/scripts/rockchip/build_u-boot.sh b/scripts/rockchip/build_u-boot.sh index 58120a4d187e2f208a453458766790da9cc5c2c4..ef75ae6909b36c6e4ee5f36f65546e1e08f6e64e 100755 --- a/scripts/rockchip/build_u-boot.sh +++ b/scripts/rockchip/build_u-boot.sh @@ -2,11 +2,11 @@ __usage=" Usage: build_u-boot [OPTIONS] -Build Rockchip u-boot image. +Build openEuler SBCs u-boot image. The target files idbloader.img and u-boot.itb will be generated in the build/u-boot folder of the directory where the build_u-boot.sh script is located. Options: - -u, --ubootconfig UBOOT_DEFCONFIG Required! The name of defconfig file when compiling u-boot, which defaults to firefly-rk3399_defconfig, set none to use prebuild u-boot image. + --board, BOARD Required! The config of target board in the boards folder, which defaults to firefly-rk3399. --cores N The number of cpu cores to be used during making. -h, --help Show command help. " @@ -18,7 +18,7 @@ help() } default_param() { - ubootconfig="firefly-rk3399_defconfig" + board=firefly-rk3399 workdir=$(pwd)/build u_boot_url="https://gitlab.arm.com/systemready/firmware-build/u-boot.git" rk3399_bl31_url="https://github.com/rockchip-linux/rkbin/raw/master/bin/rk33/rk3399_bl31_v1.36.elf" @@ -29,8 +29,8 @@ default_param() { local_param(){ if [ -f $workdir/.param ]; then - ubootconfig=$(cat $workdir/.param | grep ubootconfig) - ubootconfig=${ubootconfig:12} + board=$(cat $workdir/.param | grep board) + board=${board:6} fi } @@ -46,8 +46,8 @@ parseargs() return 1 elif [ "x$1" == "x" ]; then shift - elif [ "x$1" == "x-u" -o "x$1" == "x--ubootconfig" ]; then - ubootconfig=`echo $2` + elif [ "x$1" == "x--board" ]; then + board=`echo $2` shift shift elif [ "x$1" == "x--cores" ]; then @@ -119,26 +119,17 @@ use_prebuild_u-boot() { if [ -d $workdir/u-boot ]; then rm -rf $workdir/u-boot fi + mkdir $workdir/u-boot - if [ -f $workdir/.param ]; then - dtb_name=$(cat $workdir/.param | grep dtb_name) - dtb_name=${dtb_name:9} - if [[ "x$dtb_name" == "xrk3588s-roc-pc" || "x$dtb_name" == "xrk3588-firefly-itx-3588j" ]]; then - cp $nonfree_bin_dir/u-boot/firefly-rk3588/* $workdir/u-boot - elif [[ "x$dtb_name" == "xrk3588-rock-5b" ]]; then - cp $nonfree_bin_dir/u-boot/radxa-rock5b/* $workdir/u-boot - elif [[ "x$dtb_name" == "xrk3566-roc-pc" ]]; then - cp $nonfree_bin_dir/u-boot/firefly-rk3566/* $workdir/u-boot - elif [[ "x$dtb_name" == "xrk3568-roc-pc-se" ]]; then - cp $nonfree_bin_dir/u-boot/firefly-rk3568/* $workdir/u-boot - elif [[ "x$dtb_name" == "xphytiumpi_firefly" ]]; then - cp $nonfree_bin_dir/u-boot/phytiumpi/fip-all-sd-boot.bin $workdir/u-boot - mkenvimage -s 0x1000 -o $workdir/u-boot/env.bin $nonfree_bin_dir/u-boot/phytiumpi/env.txt - dd if=$workdir/u-boot/env.bin of=$workdir/u-boot/fip-all-sd-boot.bin bs=1k seek=1472 conv=notrunc - else - echo "target u-boot can not found!" - exit 2 - fi + if [[ "x${platform}" == "xrockchip" ]]; then + cp ${local_uboot_dir}/* $workdir/u-boot + elif [[ "x${platform}" == "xphytium" ]]; then + cp ${local_uboot_dir}/fip-all-sd-boot.bin $workdir/u-boot + mkenvimage -s 0x1000 -o $workdir/u-boot/env.bin ${local_uboot_dir}/env.txt + dd if=$workdir/u-boot/env.bin of=$workdir/u-boot/fip-all-sd-boot.bin bs=1k seek=1472 conv=notrunc + else + echo "target u-boot can not found!" + exit 2 fi } @@ -148,6 +139,8 @@ default_param local_param parseargs "$@" || help $? +source $workdir/../boards/${board}.conf + if [ ! -d $workdir ]; then mkdir $workdir fi