4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-03-01 13:45:25 +08:00
Chen Wang 7e0acaa254 bsp: cvitek: use rttpkgtool to replace cvitek_bootloader
Originally, for riscv big and little cores under bsp/cvitek,
after generating rtthread.bin, the cvitek_bootloader tool
would be used to package it and generate fip.bin and boot.sd
files that can be burned into sdcard. However, the
cvitek_bootloader tool repository is relatively large, and
it compiles and generates firmware such as fsbl, opensbi and
uboot from the source code level. And when using it, it
needs to be downloaded to the bsp/cvitek directory, which
will introduce pollution to source files in the RTT repository
under the original working path.

The new solution uses rttpkgtool, which is similar to
cvitek_bootloader, but it uses prebuilt firmware, so it is
very small and does not introduce pollution to the source file.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-26 10:55:44 +08:00

69 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
source ./tools.sh
function usage() {
echo "Usage:"
echo " ./build.sh [-h|-l|-b]"
echo " -h: display usage"
echo " -l: build c906L"
echo " -b: build c906B"
}
function build_c906b() {
echo "build_c906b"
BOARD_TYPE=`get_board_type $BSP_PATH/cv18xx_risc-v`
echo "BOARD_TYPE: $BOARD_TYPE"
DPT_PATH_KERNEL=$BSP_PATH/../../ DPT_BOARD_TYPE=$BOARD_TYPE DPT_PATH_OUTPUT=$BSP_PATH/output ./rttpkgtool/script/mkpkg.sh -b
}
function build_c906l() {
echo "build_c906l"
BOARD_TYPE=`get_board_type $BSP_PATH/c906_little`
echo "BOARD_TYPE: $BOARD_TYPE"
DPT_PATH_KERNEL=$BSP_PATH/../../ DPT_BOARD_TYPE=$BOARD_TYPE DPT_PATH_OUTPUT=$BSP_PATH/output ./rttpkgtool/script/mkpkg.sh -l
}
while getopts ":hbl" opt
do
case $opt in
h)
O_HELP=y
;;
b)
O_MAKE_BIG=y
;;
l)
O_MAKE_LITTLE=y
;;
?)
echo "Unrecognized parameter."
usage
exit 1
;;
esac
done
if [ "$O_HELP" = "y" ]; then
usage
exit 0
fi
BSP_PATH=$(realpath $(dirname $0))
echo "BSP_PATH: $BSP_PATH"
download_rttpkgtool $BSP_PATH
if [ "$O_MAKE_BIG" = "y" ]; then
build_c906b
fi
if [ "$O_MAKE_LITTLE" = "y" ]; then
build_c906l
fi