Get Tool and Firmware

tools

Writing to the board with USB

For USB to work you must get your board into ROM boot mode, either by erasing
your MMC or holding the maskrom button when you boot the board.

rk3288(upgrade_tool)

To create a suitable image and write it to the board:
default : with CONFIG_ROCKCHIP_SPL_BACK_TO_BROM

tools/mkimage -n rk3288 -T rksd -d spl/u-boot-spl-dtb.bin out
cat u-boot-dtb.bin >> out
sudo upgrade_tool db  ../rkbin/rk32/RK3288UbootLoader_V2.30.06.bin
sudo upgrade_tool wl 64 out
sudo upgrade_tool rd

others : firefly(Recommend using sd card)

rk3036

To create a suitable image and write it to the board:

tools/mkimage -n rk3036 -T rksd -d spl/u-boot-spl-dtb.bin out
cat u-boot-dtb.bin >> out
sudo upgrade_tool db  ../rkbin/rk30/RK3036MiniLoaderAll_V2.19.bin
sudo upgrade_tool wl 64 out
sudo upgrade_tool rd

rk3399

cd ..
./rkbin/tools/trust_merger ./rkbin/tools/RK3399TRUST.ini
cd uboot

../rkbin/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img

sudo upgrade_tool UL   ../rkbin/rk33/RK3399MiniLoaderAll_V1.05.bin
sudo upgrade_tool DI uboot uboot.img  ../rkbin/tools/rk3399_parameter.txt 
sudo upgrade_tool DI trust ../trust.img  ../rkbin/tools/rk3399_parameter.txt
sudo upgrade_tool rd

Flash kernel and rootfs

Enter into the uboot and issue the following command on uboot: (otg should be connected)

gpt write mmc 0 $partitions
ums 0 mmc 0

Now the board will act as an USB-drive.
In host: (assuming sdb is ur device)
sudo mkfs.fat /dev/sdb6

Copy zimage and dts file to dev/sdb6
cp arch/arm/boot/zImage /media/chen/9F35-9565/
cp arch/arm/boot/dts/rk3288-fennec.dtb /media/chen/9F35-9565/rk3288-fennec.dtb

Add extlinux/extlinux.conf to dev/sdb6
(Please notice "mmcblk2p7" and "115200n8" is decide on your chip, Please refer to config table)

label kernel-4.4
    kernel /zImage
    fdt /rk3288-fennec.dtb
    append  earlyprintk console=tty1 console=ttyS2,115200n8 rw root=/dev/mmcblk2p7 rootfstype=ext4 init=/sbin/init

Flash rootfs
sudo dd if=linaro-rootfs.img of=/dev/sdb7 conv=notrunc