Boot the RK3308 from the USB OTG port using rkflashtool[1] or
rkusbboot[2] and dfu-util.

1a. Download the TPL and SPL using rkflashtool

$ openssl rc4 -provider legacy -K 7c4e0304550509072d2c7b38170d1711 \
        < mkimage-in-simple-bin.mkimage-rockchip-tpl | rkflashtool l
$ openssl rc4 -provider legacy -K 7c4e0304550509072d2c7b38170d1711 \
        < mkimage-in-simple-bin.mkimage-u-boot-spl | rkflashtool L

1b. Download the TPL and SPL using rkusbboot

$ rkusbboot \
        mkimage-in-simple-bin.mkimage-rockchip-tpl \
        mkimage-in-simple-bin.mkimage-u-boot-spl

2. Download the U-Boot

$ dfu-util -a 0 -D u-boot.itb

[1] https://github.com/linux-rockchip/rkflashtool
[2] https://github.com/RadxaNaoki/rkusbboot

Signed-off-by: FUKAUMI Naoki <na...@radxa.com>
---
 arch/arm/dts/rk3308-u-boot.dtsi        | 5 +++++
 arch/arm/mach-rockchip/rk3308/rk3308.c | 1 +
 include/configs/rk3308_common.h        | 7 +++++++
 3 files changed, 13 insertions(+)

diff --git a/arch/arm/dts/rk3308-u-boot.dtsi b/arch/arm/dts/rk3308-u-boot.dtsi
index b7964e2756f..cf7e41da65b 100644
--- a/arch/arm/dts/rk3308-u-boot.dtsi
+++ b/arch/arm/dts/rk3308-u-boot.dtsi
@@ -122,6 +122,11 @@
        bootph-some-ram;
 };
 
+&usb20_otg {
+       bootph-pre-ram;
+       bootph-some-ram;
+};
+
 &xin24m {
        bootph-all;
 };
diff --git a/arch/arm/mach-rockchip/rk3308/rk3308.c 
b/arch/arm/mach-rockchip/rk3308/rk3308.c
index 03d97e1d746..8b2832ef0f2 100644
--- a/arch/arm/mach-rockchip/rk3308/rk3308.c
+++ b/arch/arm/mach-rockchip/rk3308/rk3308.c
@@ -142,6 +142,7 @@ const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = 
{
        [BROM_BOOTSOURCE_EMMC] = "/mmc@ff490000",
        [BROM_BOOTSOURCE_SPINOR] = "/spi@ff4c0000/flash@0",
        [BROM_BOOTSOURCE_SD] = "/mmc@ff480000",
+       [BROM_BOOTSOURCE_USB] = "/usb@ff400000",
 };
 
 int rk_board_init(void)
diff --git a/include/configs/rk3308_common.h b/include/configs/rk3308_common.h
index 2de55538fdf..11eeef3942a 100644
--- a/include/configs/rk3308_common.h
+++ b/include/configs/rk3308_common.h
@@ -25,11 +25,18 @@
        "kernel_comp_addr_r=0x08000000\0"       \
        "kernel_comp_size=0x2000000\0"
 
+#if defined(CONFIG_SPL_DFU) && defined(CONFIG_XPL_BUILD)
+#define CFG_EXTRA_ENV_SETTINGS                         \
+       "dfu_alt_info_ram=u-boot.itb ram "              \
+       __stringify(CONFIG_SPL_LOAD_FIT_ADDRESS) " "    \
+       __stringify(CONFIG_SYS_DFU_MAX_FILE_SIZE) "\0"
+#else
 #define CFG_EXTRA_ENV_SETTINGS         \
        "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
        "partitions=" PARTS_DEFAULT     \
        ENV_MEM_LAYOUT_SETTINGS         \
        ROCKCHIP_DEVICE_SETTINGS        \
        "boot_targets=" BOOT_TARGETS "\0"
+#endif
 
 #endif /* __CONFIG_RK3308_COMMON_H */
-- 
2.43.0

Reply via email to