Commit 899a52821515d79f9e4e525fd3098bdb574062ed

Authored by Przemyslaw Marczak
Committed by Marek Vasut
1 parent 372d7decfe

dfu: samsung: move call to set_dfu_alt_info() to dfu common code

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)]

Showing 5 changed files with 11 additions and 9 deletions Side-by-side Diff

board/samsung/common/board.c
... ... @@ -338,9 +338,6 @@
338 338 #ifdef CONFIG_MISC_INIT_R
339 339 int misc_init_r(void)
340 340 {
341   -#ifdef CONFIG_SET_DFU_ALT_INFO
342   - set_dfu_alt_info();
343   -#endif
344 341 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
345 342 set_board_info();
346 343 #endif
board/samsung/common/misc.c
... ... @@ -22,7 +22,7 @@
22 22 DECLARE_GLOBAL_DATA_PTR;
23 23  
24 24 #ifdef CONFIG_SET_DFU_ALT_INFO
25   -void set_dfu_alt_info(void)
  25 +void set_dfu_alt_info(char *interface, char *devstr)
26 26 {
27 27 size_t buf_size = CONFIG_SET_DFU_ALT_BUF_LEN;
28 28 ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
29 29  
... ... @@ -34,13 +34,13 @@
34 34  
35 35 puts("DFU alt info setting: ");
36 36  
37   - alt_setting = get_dfu_alt_boot();
  37 + alt_setting = get_dfu_alt_boot(interface, devstr);
38 38 if (alt_setting) {
39 39 setenv("dfu_alt_boot", alt_setting);
40 40 offset = snprintf(buf, buf_size, "%s", alt_setting);
41 41 }
42 42  
43   - alt_setting = get_dfu_alt_system();
  43 + alt_setting = get_dfu_alt_system(interface, devstr);
44 44 if (alt_setting) {
45 45 if (offset)
46 46 alt_sep = ";";
... ... @@ -55,6 +55,9 @@
55 55 char *env_bkp;
56 56 int ret;
57 57  
  58 +#ifdef CONFIG_SET_DFU_ALT_INFO
  59 + set_dfu_alt_info(interface, devstr);
  60 +#endif
58 61 str_env = getenv("dfu_alt_info");
59 62 if (!str_env) {
60 63 error("\"dfu_alt_info\" env variable not defined!\n");
... ... @@ -140,6 +140,9 @@
140 140 unsigned int inited:1;
141 141 };
142 142  
  143 +#ifdef CONFIG_SET_DFU_ALT_INFO
  144 +void set_dfu_alt_info(char *interface, char *devstr);
  145 +#endif
143 146 int dfu_config_entities(char *s, char *interface, char *devstr);
144 147 void dfu_free_entities(void);
145 148 void dfu_show_entities(void);
include/samsung/misc.h
... ... @@ -29,9 +29,8 @@
29 29 #endif
30 30  
31 31 #ifdef CONFIG_SET_DFU_ALT_INFO
32   -char *get_dfu_alt_system(void);
33   -char *get_dfu_alt_boot(void);
34   -void set_dfu_alt_info(void);
  32 +char *get_dfu_alt_system(char *interface, char *devstr);
  33 +char *get_dfu_alt_boot(char *interface, char *devstr);
35 34 #endif
36 35 #ifdef CONFIG_BOARD_TYPES
37 36 void set_board_type(void);