Commit 87180263 authored by Grant Likely's avatar Grant Likely
Browse files

rk3399: Add target to flash over USB



'make flash-usb' will download the firmware to a rk3399 in maskrom mode
via USB.
Signed-off-by: Grant Likely's avatarGrant Likely <grant.likely@arm.com>
parent 0eb1a6c1
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
# #
# Build config for RockPro64 # Build config for RockPro64
# Inspired by https://stikonas.eu/wordpress/2019/09/15/blobless-boot-with-rockpro64/ # Inspired by https://stikonas.eu/wordpress/2019/09/15/blobless-boot-with-rockpro64/
#
# Flashing via USB requires rkdeveloptool. You can find it here:
# rkdeveloptool: https://github.com/rockchip-linux/rkdeveloptool.git
FLASH_IMAGE_DEPS := u-boot/all FLASH_IMAGE_DEPS := u-boot/all
TFA_PLAT := $(CONFIG_SYS_SOC) TFA_PLAT := $(CONFIG_SYS_SOC)
...@@ -11,6 +14,8 @@ OPTEE_PLATFORM := rockchip ...@@ -11,6 +14,8 @@ OPTEE_PLATFORM := rockchip
OPTEE_EXTRA += PLATFORM_FLAVOR=rk3399 OPTEE_EXTRA += PLATFORM_FLAVOR=rk3399
FLASH_IMAGE := $(UBOOT_OUTPUT)/flash_image.bin FLASH_IMAGE := $(UBOOT_OUTPUT)/flash_image.bin
RKDEVELOPTOOL ?= rkdeveloptool
ifeq ($(CONFIG_OPTEE),y) ifeq ($(CONFIG_OPTEE),y)
UBOOT_EXTRA += TEE=$(OPTEE_OUTPUT)/arm-plat-rockchip/core/tee.elf UBOOT_EXTRA += TEE=$(OPTEE_OUTPUT)/arm-plat-rockchip/core/tee.elf
u-boot/all: optee_os/all u-boot/all: optee_os/all
...@@ -25,3 +30,9 @@ sdimage: ...@@ -25,3 +30,9 @@ sdimage:
/sbin/sgdisk -n 1:: $(SD_IMAGE) /sbin/sgdisk -n 1:: $(SD_IMAGE)
dd if=${UBOOT_OUTPUT}/idbloader.img of=$(SD_IMAGE) seek=64 dd if=${UBOOT_OUTPUT}/idbloader.img of=$(SD_IMAGE) seek=64
dd if=${UBOOT_OUTPUT}/u-boot.itb of=$(SD_IMAGE) seek=16384 dd if=${UBOOT_OUTPUT}/u-boot.itb of=$(SD_IMAGE) seek=16384
flash-usb: $(UBOOT_OUTPUT)/idbloader.img $(UBOOT_OUTPUT)/u-boot.itb
$(RKDEVELOPTOOL) db MiniLoaderAll.bin && sleep 0.25
$(RKDEVELOPTOOL) wl 0x40 $(UBOOT_OUTPUT)/idbloader.img
$(RKDEVELOPTOOL) wl 0x4000 $(UBOOT_OUTPUT)/u-boot.itb
$(RKDEVELOPTOOL) rd
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment