!15 rockchip: 移动u-boot配置到版型文件中
From: @chainsx Reviewed-by: @jianminw Signed-off-by: @jianminw
This commit is contained in:
commit
5024ef5ca2
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
- RK35xx
|
- 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 文件
|
## 准备 firmware 文件
|
||||||
|
|
||||||
@ -72,6 +72,12 @@ POST_BOARD_OVERLAY() {
|
|||||||
1. ubootconfig=UBOOT_DEFCONFIG
|
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`。
|
开发板对应的 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
|
2. dtb_name=DTB_NAME
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
ubootconfig=none
|
ubootconfig=none
|
||||||
|
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3588
|
||||||
dtb_name=rk3588-firefly-itx-3588j
|
dtb_name=rk3588-firefly-itx-3588j
|
||||||
platform=rockchip
|
platform=rockchip
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
ubootconfig=none
|
ubootconfig=none
|
||||||
|
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3566
|
||||||
dtb_name=rk3566-roc-pc
|
dtb_name=rk3566-roc-pc
|
||||||
platform=rockchip
|
platform=rockchip
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
ubootconfig=none
|
ubootconfig=none
|
||||||
|
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3568
|
||||||
dtb_name=rk3568-roc-pc-se
|
dtb_name=rk3568-roc-pc-se
|
||||||
platform=rockchip
|
platform=rockchip
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
ubootconfig=none
|
ubootconfig=none
|
||||||
|
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3588
|
||||||
dtb_name=rk3588s-roc-pc
|
dtb_name=rk3588s-roc-pc
|
||||||
platform=rockchip
|
platform=rockchip
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
ubootconfig=none
|
ubootconfig=none
|
||||||
|
local_uboot_dir=${nonfree_bin_dir}/u-boot/phytiumpi
|
||||||
dtb_name=phytiumpi_firefly
|
dtb_name=phytiumpi_firefly
|
||||||
platform=phytium
|
platform=phytium
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
ubootconfig=none
|
ubootconfig=none
|
||||||
|
local_uboot_dir=${nonfree_bin_dir}/u-boot/radxa-rock5b
|
||||||
dtb_name=rk3588-rock-5b
|
dtb_name=rk3588-rock-5b
|
||||||
platform=rockchip
|
platform=rockchip
|
||||||
|
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
__usage="
|
__usage="
|
||||||
Usage: build_u-boot [OPTIONS]
|
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.
|
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:
|
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.
|
--cores N The number of cpu cores to be used during making.
|
||||||
-h, --help Show command help.
|
-h, --help Show command help.
|
||||||
"
|
"
|
||||||
@ -18,7 +18,7 @@ help()
|
|||||||
}
|
}
|
||||||
|
|
||||||
default_param() {
|
default_param() {
|
||||||
ubootconfig="firefly-rk3399_defconfig"
|
board=firefly-rk3399
|
||||||
workdir=$(pwd)/build
|
workdir=$(pwd)/build
|
||||||
u_boot_url="https://gitlab.arm.com/systemready/firmware-build/u-boot.git"
|
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"
|
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(){
|
local_param(){
|
||||||
if [ -f $workdir/.param ]; then
|
if [ -f $workdir/.param ]; then
|
||||||
ubootconfig=$(cat $workdir/.param | grep ubootconfig)
|
board=$(cat $workdir/.param | grep board)
|
||||||
ubootconfig=${ubootconfig:12}
|
board=${board:6}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,8 +46,8 @@ parseargs()
|
|||||||
return 1
|
return 1
|
||||||
elif [ "x$1" == "x" ]; then
|
elif [ "x$1" == "x" ]; then
|
||||||
shift
|
shift
|
||||||
elif [ "x$1" == "x-u" -o "x$1" == "x--ubootconfig" ]; then
|
elif [ "x$1" == "x--board" ]; then
|
||||||
ubootconfig=`echo $2`
|
board=`echo $2`
|
||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
elif [ "x$1" == "x--cores" ]; then
|
elif [ "x$1" == "x--cores" ]; then
|
||||||
@ -119,26 +119,17 @@ use_prebuild_u-boot() {
|
|||||||
if [ -d $workdir/u-boot ]; then
|
if [ -d $workdir/u-boot ]; then
|
||||||
rm -rf $workdir/u-boot
|
rm -rf $workdir/u-boot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir $workdir/u-boot
|
mkdir $workdir/u-boot
|
||||||
if [ -f $workdir/.param ]; then
|
if [[ "x${platform}" == "xrockchip" ]]; then
|
||||||
dtb_name=$(cat $workdir/.param | grep dtb_name)
|
cp ${local_uboot_dir}/* $workdir/u-boot
|
||||||
dtb_name=${dtb_name:9}
|
elif [[ "x${platform}" == "xphytium" ]]; then
|
||||||
if [[ "x$dtb_name" == "xrk3588s-roc-pc" || "x$dtb_name" == "xrk3588-firefly-itx-3588j" ]]; then
|
cp ${local_uboot_dir}/fip-all-sd-boot.bin $workdir/u-boot
|
||||||
cp $nonfree_bin_dir/u-boot/firefly-rk3588/* $workdir/u-boot
|
mkenvimage -s 0x1000 -o $workdir/u-boot/env.bin ${local_uboot_dir}/env.txt
|
||||||
elif [[ "x$dtb_name" == "xrk3588-rock-5b" ]]; then
|
dd if=$workdir/u-boot/env.bin of=$workdir/u-boot/fip-all-sd-boot.bin bs=1k seek=1472 conv=notrunc
|
||||||
cp $nonfree_bin_dir/u-boot/radxa-rock5b/* $workdir/u-boot
|
else
|
||||||
elif [[ "x$dtb_name" == "xrk3566-roc-pc" ]]; then
|
echo "target u-boot can not found!"
|
||||||
cp $nonfree_bin_dir/u-boot/firefly-rk3566/* $workdir/u-boot
|
exit 2
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,6 +139,8 @@ default_param
|
|||||||
local_param
|
local_param
|
||||||
parseargs "$@" || help $?
|
parseargs "$@" || help $?
|
||||||
|
|
||||||
|
source $workdir/../boards/${board}.conf
|
||||||
|
|
||||||
if [ ! -d $workdir ]; then
|
if [ ! -d $workdir ]; then
|
||||||
mkdir $workdir
|
mkdir $workdir
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user