]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dfu: samsung: move call to set_dfu_alt_info() to dfu common code
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Tue, 17 Feb 2015 11:24:11 +0000 (12:24 +0100)
committerMarek Vasut <marex@denx.de>
Wed, 25 Feb 2015 16:47:02 +0000 (17:47 +0100)
This common call can be used for setting proper entities based
on dfu command arguments.
The config: CONFIG_SET_DFU_ALT_INFO, was used only for few configs,
and now it is common.

The board file should implement:
- set_dfu_alt_info() function

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
[Test HW: Odroid U3 (Exynos 4412)]

board/samsung/common/board.c
board/samsung/common/misc.c
drivers/dfu/dfu.c
include/dfu.h
include/samsung/misc.h

index da2245ff9d6c21aa1a6ae05fcaa590564069acf2..6c7f59be87101c48cde630a5ca7efc87e96891ce 100644 (file)
@@ -338,9 +338,6 @@ int arch_early_init_r(void)
 #ifdef CONFIG_MISC_INIT_R
 int misc_init_r(void)
 {
-#ifdef CONFIG_SET_DFU_ALT_INFO
-       set_dfu_alt_info();
-#endif
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
        set_board_info();
 #endif
index 4538ac7f2a2fc2d2a91f840944d13ec542e35e11..1a77c820ae97f7604be995faa4a850b7943da230 100644 (file)
@@ -22,7 +22,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_SET_DFU_ALT_INFO
-void set_dfu_alt_info(void)
+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);
@@ -34,13 +34,13 @@ void set_dfu_alt_info(void)
 
        puts("DFU alt info setting: ");
 
-       alt_setting = get_dfu_alt_boot();
+       alt_setting = get_dfu_alt_boot(interface, devstr);
        if (alt_setting) {
                setenv("dfu_alt_boot", alt_setting);
                offset = snprintf(buf, buf_size, "%s", alt_setting);
        }
 
-       alt_setting = get_dfu_alt_system();
+       alt_setting = get_dfu_alt_system(interface, devstr);
        if (alt_setting) {
                if (offset)
                        alt_sep = ";";
index ad0a7e7c25f9f4cd5f6c543cdb3deab56d97ceca..0560afa9ffa500b1d49a5c911268d8c6bd1070e0 100644 (file)
@@ -55,6 +55,9 @@ int dfu_init_env_entities(char *interface, char *devstr)
        char *env_bkp;
        int ret;
 
+#ifdef CONFIG_SET_DFU_ALT_INFO
+       set_dfu_alt_info(interface, devstr);
+#endif
        str_env = getenv("dfu_alt_info");
        if (!str_env) {
                error("\"dfu_alt_info\" env variable not defined!\n");
index c27856cb729a3bb4832831b477a03d61c0875bcf..7d31abdf337dfc3c6ae2c8e3eaa7024dd9e61e14 100644 (file)
@@ -140,6 +140,9 @@ struct dfu_entity {
        unsigned int inited:1;
 };
 
+#ifdef CONFIG_SET_DFU_ALT_INFO
+void set_dfu_alt_info(char *interface, char *devstr);
+#endif
 int dfu_config_entities(char *s, char *interface, char *devstr);
 void dfu_free_entities(void);
 void dfu_show_entities(void);
index 607e8d49223b909f549ed5e3c8fc5083126280bb..0f957dc36750aa6a9a2411f750a3430d3ba0adbe 100644 (file)
@@ -29,9 +29,8 @@ void draw_logo(void);
 #endif
 
 #ifdef CONFIG_SET_DFU_ALT_INFO
-char *get_dfu_alt_system(void);
-char *get_dfu_alt_boot(void);
-void set_dfu_alt_info(void);
+char *get_dfu_alt_system(char *interface, char *devstr);
+char *get_dfu_alt_boot(char *interface, char *devstr);
 #endif
 #ifdef CONFIG_BOARD_TYPES
 void set_board_type(void);