diff --git a/h5/Image b/h5/Image new file mode 100644 index 0000000..2e6d59a Binary files /dev/null and b/h5/Image differ diff --git a/h5/bl31.bin b/h5/bl31.bin new file mode 100644 index 0000000..8f2f69f Binary files /dev/null and b/h5/bl31.bin differ diff --git a/h5/boot.scr b/h5/boot.scr new file mode 100644 index 0000000..a5adcf9 Binary files /dev/null and b/h5/boot.scr differ diff --git a/h5/dtb/sun50i-h5-opi-zero-plus2.dtb b/h5/dtb/sun50i-h5-opi-zero-plus2.dtb new file mode 100644 index 0000000..c428891 Binary files /dev/null and b/h5/dtb/sun50i-h5-opi-zero-plus2.dtb differ diff --git a/h5/sunxi-spl.bin b/h5/sunxi-spl.bin new file mode 100644 index 0000000..d508b9d Binary files /dev/null and b/h5/sunxi-spl.bin differ diff --git a/h5/u-boot.bin b/h5/u-boot.bin new file mode 100644 index 0000000..a5a5f66 Binary files /dev/null and b/h5/u-boot.bin differ diff --git a/h5/uInitrd b/h5/uInitrd new file mode 100644 index 0000000..fbb0b27 Binary files /dev/null and b/h5/uInitrd differ diff --git a/start.sh b/start.sh index 72f101b..2d56c8f 100644 --- a/start.sh +++ b/start.sh @@ -3,7 +3,40 @@ echo "Connect device in FEL mode and press " 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