Skip to content
This repository was archived by the owner on May 12, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added h5/Image
Binary file not shown.
Binary file added h5/bl31.bin
Binary file not shown.
Binary file added h5/boot.scr
Binary file not shown.
Binary file added h5/dtb/sun50i-h5-opi-zero-plus2.dtb
Binary file not shown.
Binary file added h5/sunxi-spl.bin
Binary file not shown.
Binary file added h5/u-boot.bin
Binary file not shown.
Binary file added h5/uInitrd
Binary file not shown.
39 changes: 36 additions & 3 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,40 @@
echo "Connect device in FEL mode and press <Enter>"
read

BOARD=h3
FEL=sunxi-fel
BOARD=$1

sunxi-fel -p uboot $BOARD/u-boot-sunxi-with-spl.bin write 0x42000000 $BOARD/zImage write 0x43000000 $BOARD/script.bin write 0x43300000 $BOARD/uInitrd write 0x43100000 $BOARD/boot.scr
read

function exec-fel-command () {
$FEL $@
if [[ $? -ne 0 ]];then
echo "Failed to exec: $FEL $@"
exit 1
fi
}

function boot-h3 () {
exec-fel-command -p uboot h3/u-boot-sunxi-with-spl.bin write 0x42000000 h3/zImage write 0x43000000 h3/script.bin write 0x43300000 h3/uInitrd write 0x43100000 h3/boot.scr
}

function boot-h5 () {
DTB_FILE="sun50i-h5-opi-zero-plus2.dtb"

exec-fel-command -v -p spl h5/sunxi-spl.bin
exec-fel-command -v -p write 0x44000 h5/bl31.bin
exec-fel-command -v -p write 0x4a000000 h5/u-boot.bin
exec-fel-command -v -p write 0x50000000 h5/Image
exec-fel-command -v -p write 0x52000000 h5/dtb/$DTB_FILE
exec-fel-command -v -p write 0x53000000 h5/uInitrd
exec-fel-command -v -p write 0x43100000 h5/boot.scr
exec-fel-command -v -p reset64 0x44000
}

if [[ $BOARD == "h3" ]];then
boot-h3
elif [[ $BOARD == "h5" ]];then
boot-h5
else
echo "$0 board[h3|h5]"
exit 1
fi