https://github.com/BPI-SINOVOIP/BPI-R64-BSP/blob/master/scripts/dd_download.sh
image: https://github.com/BPI-SINOVOIP/BPI-R64-BSP/blob/master/scripts/bootloader.sh
With the opensource ATF we switched to full 64bit mode,fip (bl31+uboot) and fit kernel
Details on my ATF repo: https://github.com/frank-w/BPI-R64-ATF
sudo dd of=$target if=./fip_sdmmc.bin bs=512 seek=2048
PRELOADER=$TOPDIR/mt-pack/mtk/${TARGET_PRODUCT}/bin/preloader_bpi-r64_forsdcard-2k.img ATF=$TOPDIR/mt-pack/mtk/${TARGET_PRODUCT}/bin/BPI-R64-atf.img UBOOT=$TOPDIR/u-boot-mt/u-boot-mtk.bin HEAD0=$TOPDIR/mt-pack/mtk/${TARGET_PRODUCT}/bin/BPI-R2-HEAD440-0k.img HEAD1=$TOPDIR/mt-pack/mtk/${TARGET_PRODUCT}/bin/BPI-R2-HEAD1-512b.img sudo dd if=$HEAD0 of=$O bs=512 seek=0 #0 sudo dd if=$HEAD1 of=$O bs=512 seek=1 #512 = 0x200 sudo dd if=$PRELOADER of=$O bs=1k seek=2 #2k = 0x800 sudo dd if=$ATF of=$O bs=1k seek=512 #512k = 0x80000 sudo dd if=$UBOOT of=$O bs=1k seek=768 #768k = 0xC0000 # partition1 /dev/sdc1 vfat 204800~327679 # partition2 /dev/sdc2 ext4 327680~end root@x:~# sfdisk /dev/sdb < r64_parttable.dat root@x:~# mkfs.vfat /dev/sdb1 root@x:~# mkfs.ext4 /dev/sdb2 root@x:~# fatlabel /dev/sdb1 BPI-BOOT root@x:~# e2label /dev/sdb2 BPI-ROOT
https://github.com/BPI-SINOVOIP/BPI-R64-BSP/tree/master/mt-pack/mtk/bpi-r64/bin
only uboot-mtk.bin (with littlekernel=LK) works
A better ATF is mt7622_atf_push_wps_uboot_64.img (can be found on my gdrive too) supports booting 32bit uboot by default and 64bit uboot by pressing wps-button
http://forum.banana-pi.org/t/bpi-r64-current-u-boot-support/10077/79
this Preloader have to be used: preloader_evb7622_64_foremmc.bin (copy on my gdrive)
- boot from sd-card
root@bpi-r64:~# ls /dev/mmcblk* /dev/mmcblk0 /dev/mmcblk0p2 /dev/mmcblk1boot0 /dev/mmcblk1rpmb /dev/mmcblk0p1 /dev/mmcblk1 /dev/mmcblk1boot1 #configure lan-port root@bpi-r64:~# ip addr add 192.168.0.18/24 dev eth0 root@bpi-r64:~# ip route add default via 192.168.0.10 root@bpi-r64:~# echo "nameserver 192.168.0.10">/etc/resolv.conf #download preloader and flash it root@bpi-r64:~# wget https://github.com/BPI-SINOVOIP/BPI-R64-bsp-4.19/raw/master/mt-pack/mtk/bpi-r64/configs/default/linux-4.19/preloader_evb7622_64_foremmc.bin root@bpi-r64:~# echo 0 > /sys/block/mmcblk1boot0/force_ro root@bpi-r64:~# dd if=preloader_evb7622_64_foremmc.bin of=/dev/mmcblk1boot0
- boot0-block exists, but mmc-utils showing partconfig 0x0 (should be 0x48), emmc-boot hangs at bootrom:
root@bpi-r64:~# ./mmc extcsd read /dev/mmcblk1 | grep 'PARTITION_CONFIG' Boot configuration bytes [PARTITION_CONFIG: 0x00] root@bpi-r64:~# ./mmc bootpart enable 1 1 /dev/mmcblk1 root@bpi-r64:~# ./mmc extcsd read /dev/mmcblk1 | grep 'PARTITION_CONFIG' Boot configuration bytes [PARTITION_CONFIG: 0x48]
This can also be done in recent uboot
mmc partconf 0 mmc partconf 0 1 1 0
after this steps preloader gets loaded (i had only flashed preloader here and nothing alse, so error is correct…full boot needs additional headers HEAD0,HEAD1,SD-Preloader,ATF and UBOOT)…
maybe write partitiontable
boot from emmc till uboot: http://forum.banana-pi.org/t/bpi-r64-quick-start-boot-from-emmc/9809/36
i've created a small script with all headers needed for emmc-boot: https://drive.google.com/open?id=1a8yCzwiCAcqtHHXDLhRzMdItsMC7ndJr this erases content of emmc! if you do not want this, comment out lines for writing partition table and formatting