!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
|
||||
|
||||
需要将编译好的 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 文件
|
||||
|
||||
@ -73,6 +73,12 @@ POST_BOARD_OVERLAY() {
|
||||
|
||||
开发板对应的 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
|
||||
|
||||
内核设备树中的设备名称,和开发板名称有一点区别,对应 [kernel/arch/arm64/boot/dts/rockchip](https://gitee.com/openeuler/rockchip-kernel/tree/openEuler-22.03-LTS-SP3/arch/arm64/boot/dts/rockchip) 下的 `DTB_NAME.dts` 文件。
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
ubootconfig=none
|
||||
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3588
|
||||
dtb_name=rk3588-firefly-itx-3588j
|
||||
platform=rockchip
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
ubootconfig=none
|
||||
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3566
|
||||
dtb_name=rk3566-roc-pc
|
||||
platform=rockchip
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
ubootconfig=none
|
||||
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3568
|
||||
dtb_name=rk3568-roc-pc-se
|
||||
platform=rockchip
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
ubootconfig=none
|
||||
local_uboot_dir=${nonfree_bin_dir}/u-boot/firefly-rk3588
|
||||
dtb_name=rk3588s-roc-pc
|
||||
platform=rockchip
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
ubootconfig=none
|
||||
local_uboot_dir=${nonfree_bin_dir}/u-boot/phytiumpi
|
||||
dtb_name=phytiumpi_firefly
|
||||
platform=phytium
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
ubootconfig=none
|
||||
local_uboot_dir=${nonfree_bin_dir}/u-boot/radxa-rock5b
|
||||
dtb_name=rk3588-rock-5b
|
||||
platform=rockchip
|
||||
|
||||
|
||||
@ -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,27 +119,18 @@ 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
|
||||
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
|
||||
fi
|
||||
}
|
||||
|
||||
set -e
|
||||
@ -148,6 +139,8 @@ default_param
|
||||
local_param
|
||||
parseargs "$@" || help $?
|
||||
|
||||
source $workdir/../boards/${board}.conf
|
||||
|
||||
if [ ! -d $workdir ]; then
|
||||
mkdir $workdir
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user