mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-16 09:54:35 +00:00
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)]
This commit is contained in:
parent
372d7decfe
commit
899a528215
5 changed files with 11 additions and 9 deletions
|
@ -338,9 +338,6 @@ int arch_early_init_r(void)
|
||||||
#ifdef CONFIG_MISC_INIT_R
|
#ifdef CONFIG_MISC_INIT_R
|
||||||
int misc_init_r(void)
|
int misc_init_r(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SET_DFU_ALT_INFO
|
|
||||||
set_dfu_alt_info();
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
|
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
|
||||||
set_board_info();
|
set_board_info();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
#ifdef CONFIG_SET_DFU_ALT_INFO
|
#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;
|
size_t buf_size = CONFIG_SET_DFU_ALT_BUF_LEN;
|
||||||
ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
|
ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
|
||||||
|
@ -34,13 +34,13 @@ void set_dfu_alt_info(void)
|
||||||
|
|
||||||
puts("DFU alt info setting: ");
|
puts("DFU alt info setting: ");
|
||||||
|
|
||||||
alt_setting = get_dfu_alt_boot();
|
alt_setting = get_dfu_alt_boot(interface, devstr);
|
||||||
if (alt_setting) {
|
if (alt_setting) {
|
||||||
setenv("dfu_alt_boot", alt_setting);
|
setenv("dfu_alt_boot", alt_setting);
|
||||||
offset = snprintf(buf, buf_size, "%s", 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 (alt_setting) {
|
||||||
if (offset)
|
if (offset)
|
||||||
alt_sep = ";";
|
alt_sep = ";";
|
||||||
|
|
|
@ -55,6 +55,9 @@ int dfu_init_env_entities(char *interface, char *devstr)
|
||||||
char *env_bkp;
|
char *env_bkp;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
#ifdef CONFIG_SET_DFU_ALT_INFO
|
||||||
|
set_dfu_alt_info(interface, devstr);
|
||||||
|
#endif
|
||||||
str_env = getenv("dfu_alt_info");
|
str_env = getenv("dfu_alt_info");
|
||||||
if (!str_env) {
|
if (!str_env) {
|
||||||
error("\"dfu_alt_info\" env variable not defined!\n");
|
error("\"dfu_alt_info\" env variable not defined!\n");
|
||||||
|
|
|
@ -140,6 +140,9 @@ struct dfu_entity {
|
||||||
unsigned int inited:1;
|
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);
|
int dfu_config_entities(char *s, char *interface, char *devstr);
|
||||||
void dfu_free_entities(void);
|
void dfu_free_entities(void);
|
||||||
void dfu_show_entities(void);
|
void dfu_show_entities(void);
|
||||||
|
|
|
@ -29,9 +29,8 @@ void draw_logo(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SET_DFU_ALT_INFO
|
#ifdef CONFIG_SET_DFU_ALT_INFO
|
||||||
char *get_dfu_alt_system(void);
|
char *get_dfu_alt_system(char *interface, char *devstr);
|
||||||
char *get_dfu_alt_boot(void);
|
char *get_dfu_alt_boot(char *interface, char *devstr);
|
||||||
void set_dfu_alt_info(void);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_BOARD_TYPES
|
#ifdef CONFIG_BOARD_TYPES
|
||||||
void set_board_type(void);
|
void set_board_type(void);
|
||||||
|
|
Loading…
Add table
Reference in a new issue