From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Mon, 30 May 2016 07:27:07 +0200 Subject: [U-Boot] [RFC PATCH 3/5] spl: dfu: adding dfu support functions for SPL-DFU In-Reply-To: <1464356373-8375-4-git-send-email-ravibabu@ti.com> References: <1464356373-8375-1-git-send-email-ravibabu@ti.com> <1464356373-8375-4-git-send-email-ravibabu@ti.com> Message-ID: <574BCF2B.605@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > 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 > #include > #include > +#include > > 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