board: artik530_raptor: override set_dfu_alt_info
authorChanho Park <chanho61.park@samsung.com>
Mon, 24 Apr 2017 13:37:31 +0000 (22:37 +0900)
committerChanho Park <chanho61.park@samsung.com>
Mon, 24 Apr 2017 13:37:31 +0000 (22:37 +0900)
Thie patch defines set_dfu_alt_info to evaluate the environment
variables on runtime. Typically, the dfu_alt_info can be determined
statically on compile time. To convert the values on runtime, the
setenv command can evaluate the variables.

Change-Id: Icad4d64c7250f748a99b6a8d296a557ab27e4bbb
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
board/s5p4418/artik530_raptor/board.c

index 033e68f0054a8d7e60afcffbaead7c7577138c88..c61fab190329b0fdd1bb37bbc5e84296b0a5c537 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <asm/arch/nexell.h>
 #include <asm/arch/nx_gpio.h>
+#include <memalign.h>
 
 #ifdef CONFIG_DM_PMIC_NXE2000
 #include <dm.h>
@@ -142,6 +143,17 @@ static void get_sensorid(u32 revision)
 }
 #endif
 
+#ifdef CONFIG_SET_DFU_ALT_INFO
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+       size_t buf_size = CONFIG_SET_DFU_ALT_BUF_LEN;
+       ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
+
+       snprintf(buf, buf_size, "setenv dfu_alt_info \"%s\"", CONFIG_DFU_ALT);
+       run_command(buf, 0);
+}
+#endif
+
 /*------------------------------------------------------------------------------
  * intialize nexell soc and board status.
  */