rk2aw installation instructions =============================== rk2aw must be installed to the first boot block of the highest priority storage device that BROM tries to boot from on a particular Rockchip based board. Installation to SPI NOR flash ----------------------------- ** WARNING ** Beware that on RK3399, rk2aw fixes the silicon bug present in Rockchip boot ROM that prevents you from using normal SPL+TPL images in SPI NOR flash. If you use rk2aw on RK3399, specially crafted idbloader.img images meant to work around the BROM bug, will not work with rk2aw. You should use the regular idbloader.img meant for SD card or eMMC. The only exception is the rk2aw image itself, which still needs a special handling to be readable by BROM from SPI NOR flash. rk2aw distribution for RK3399 includes two bootable images of rk2aw meant for SPI NOR flash: normal.img.spi and debug.img.spi. Other two are meant for SD card and eMMC: normal.img and debug.img. Other SoCs have the BROM bug fixed, and thus if your board uses newer SoC, you should flash normal.img and debug.img to SPI NOR flash. rk2aw distribution includes a rk2aw-spi-flasher SPI flashing tool meant to handle the installation of rk2aw to SPI NOR flash. This tool automatically adjusts the bootloader layout based on erase block size of the particular flash chip. Installation steps are: 1) Erase the SPI NOR flash compeltely and install rk2aw # for RK3399: ./rk2aw-spi-flasher --erase-all --rk2aw rk2aw/debug.img.spi # for other SoCs: ./rk2aw-spi-flasher --erase-all --rk2aw rk2aw/debug.img 2) Install U-Boot or other bootloader a) U-Boot ./rk2aw-spi-flasher \ --uboot-spl u-boot-spl.bin \ --uboot-tpl u-boot-tpl.bin \ --uboot-itb u-boot.itb (The above 3 files are normal build artifacts of U-Boot. You get them from a regular defconfig U-Boot build for your board.) b) Other bootloaders ./rk2aw-spi-flasher \ --spl levinboot-emmc.img If flashing fallback bootloader add --replace-fallback to the above commands. You should never need to update rk2aw itself, but if you'll want to, you would do: # for RK3399: ./rk2aw-spi-flasher --rk2aw rk2aw/debug.img.spi # for other SoCs: ./rk2aw-spi-flasher --rk2aw rk2aw/debug.img Installation to eMMC -------------------- This is only recommended if your board doesn't have a SPI NOR flash. Installation steps are: 0) Identify your eMMC block device path and save it to DEV variable: # eg.: DEV=/dev/mmcblk0 1) Install rk2aw to the first boot block: dd if=debug.img of=$DEV seek=64 oflag=direct bs=64k 2) Install bootloader to the second boot block: a) U-Boot: dd if=idbloader.img of=$DEV seek=1088 oflag=direct bs=256k dd if=u-boot.itb of=$DEV seek=16384 oflag=direct bs=256k b) Levinboot: dd if=levinboot-emmc.img of=$DEV seek=1088 oflag=direct bs=256k Installation to SD card ----------------------- This is identical to eMMC installation method, and useful only for rk2aw testing and development. rk2aw will not be able to affect boot order when installed this way.