To use SPL DFU, some environment variables are needed so define
CFG_EXTRA_ENV_SETTINGS for XPL builds.

Signed-off-by: Arnaud Patard <arnaud.pat...@collabora.com>
---
 include/configs/rk3399_common.h | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
index 76f40e7cd5f..e5f0206ba53 100644
--- a/include/configs/rk3399_common.h
+++ b/include/configs/rk3399_common.h
@@ -5,7 +5,7 @@
 
 #ifndef __CONFIG_RK3399_COMMON_H
 #define __CONFIG_RK3399_COMMON_H
-
+#include <linux/stringify.h>
 #include "rockchip-common.h"
 
 #define CFG_IRAM_BASE                  0xff8c0000
@@ -13,7 +13,6 @@
 #define CFG_SYS_SDRAM_BASE             0
 #define SDRAM_MAX_SIZE                 0xf8000000
 
-#ifndef CONFIG_XPL_BUILD
 
 #ifndef ROCKCHIP_DEVICE_SETTINGS
 #define ROCKCHIP_DEVICE_SETTINGS
@@ -31,6 +30,8 @@
        "ramdisk_addr_r=0x12180000\0"   \
        "kernel_comp_size=0x8000000\0"
 
+#ifndef CONFIG_XPL_BUILD
+
 #define CFG_EXTRA_ENV_SETTINGS         \
        "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
        "partitions=" PARTS_DEFAULT     \
@@ -38,6 +39,19 @@
        ROCKCHIP_DEVICE_SETTINGS        \
        "boot_targets=" BOOT_TARGETS "\0"
 
+
+#else
+
+#define CFG_EXTRA_ENV_SETTINGS         \
+       "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
+       ENV_MEM_LAYOUT_SETTINGS         \
+       ROCKCHIP_DEVICE_SETTINGS        \
+       "dfu_alt_info=ram ram0=ram ram " \
+               __stringify(CONFIG_SPL_LOAD_FIT_ADDRESS) " " \
+               __stringify(CONFIG_SYS_DFU_DATA_BUF_SIZE) "\0"  \
+       "dfu_alt_info_ram=u-boot.itb ram " \
+               __stringify(CONFIG_SPL_LOAD_FIT_ADDRESS) " " \
+               __stringify(CONFIG_SYS_DFU_DATA_BUF_SIZE)
 #endif /* CONFIG_XPL_BUILD */
 
 #endif /* __CONFIG_RK3399_COMMON_H */
-- 
2.39.5

Reply via email to