[U-Boot] [RFC PATCH 3/5] spl: dfu: adding dfu support functions for SPL-DFU

Heiko Schocher hs at denx.de
Mon May 30 07:27:07 CEST 2016


Hello Ravi,

Am 27.05.2016 um 15:39 schrieb Ravi Babu:
> Adding support functions to run dfu commands
> with support for eMMC/MMC/SD memory device.
>
> Signed-off-by: Ravi Babu <ravibabu at ti.com>
> ---
>   drivers/dfu/dfu.c     |   28 ++++++++++++++++++++++++++++
>   drivers/dfu/dfu_mmc.c |   28 ++++++++++++++++++++++++++++
>   include/dfu.h         |    8 ++++++++
>   3 files changed, 64 insertions(+)
>
> diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
> index 20dfcbb..1d4690b 100644
> --- a/drivers/dfu/dfu.c
> +++ b/drivers/dfu/dfu.c
> @@ -16,6 +16,7 @@
>   #include <hash.h>
>   #include <linux/list.h>
>   #include <linux/compiler.h>
> +#include <environment.h>
>
>   static LIST_HEAD(dfu_list);
>   static int dfu_alt_num;
> @@ -596,3 +597,30 @@ int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size)
>
>   	return ret;
>   }
> +
> +int dfu_run_cmd(char *dfu_alt_info, char *dfu_cmd_str)
> +{
> +	char *str_env;
> +	int ret;
> +
> +	/* set default environment */
> +	set_default_env(0);
> +	str_env = getenv(dfu_alt_info);
> +	if (!str_env) {
> +		error("\"dfu_alt_info\" env variable not defined!\n");
> +		return -EINVAL;
> +	}
> +
> +	ret = setenv("dfu_alt_info", str_env);
> +	if (ret) {
> +		error("unable to set env variable \"dfu_alt_info\"!\n");
> +		return -EINVAL;
> +	}

Why you read the Envvariable and store it again?

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list