Commit Graph

13 Commits

Author SHA1 Message Date
Igor Grinberg bf95df44ff env: factor out the env_get_char_spec() function
env_get_char_spec() function is duplicated across multiple environment
files.
Remove the duplication by providing a default implementation.
Add "weak" declaration, so the default implementation can be overridden.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2012-01-05 16:34:10 +01:00
Igor Grinberg e8db8f71c9 env: clean env_mmc.c checkpatch and code style
Cleanup the env_mmc.c checkpatch warnings, errors and coding style.
Simplify env_relocate_spec() function implementation.
Also mark internal functions as static.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:26 +01:00
Igor Grinberg 994bc671cf env: move extern environment[] to environment.h
Extract all extern declarations for environment out of c files
into the environment.h header.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:25 +01:00
Igor Grinberg d1459f0fab env: move extern default_environment[] to environment.h
Extract all extern declarations for default_environment[] out of c files
into the environment.h header.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
2011-11-22 08:39:25 +01:00
Wolfgang Denk 37f2fe7472 env: allow to export only selected variables
New syntax:
	env export [-t | -b | -c] [-s size] addr [var ...]

With this change it is possible to provide a list of variables names
that shall be exported.  Whenno arguments are given, the whole
environment gets exported.

NOTE: The new handling of the "size" argument means a change to the
user API.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-11-08 13:20:42 +01:00
Mingkai Hu 97039ab98c env_mmc: Allow board code to override the environment address
On some boards the environment may not be located at a fixed address in
the MMC/SDHC card.  This allows those boards to implement their own
means to report what address the environment is located at.

Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Signed-off-by: Zhao Chenhui <b35336@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-04-04 22:26:16 -05:00
Mike Frysinger 2eb1573f01 hashtable: drop all non-reentrant versions
The non-reentrant versions of the hashtable functions operate on a single
shared hashtable.  So if two different people try using these funcs for
two different purposes, they'll cause problems for the other.

Avoid this by converting all existing hashtable consumers over to the
reentrant versions and then punting the non-reentrant ones.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-12-17 21:07:14 +01:00
Lei Wen 6d1d51b32b env_mmc: fix compile warning
hexport would complain implicit declaration, if we don't add the
include file.

env_mmc.c: In function 'saveenv':
env_mmc.c:109: warning: implicit declaration of function 'hexport'

Signed-off-by: Lei Wen <leiwen@marvell.com>
2010-11-14 23:28:21 +01:00
Wolfgang Denk cacc342d5a Merge branch 'master' of git://git.denx.de/u-boot-arm 2010-10-17 20:25:05 +02:00
Lei Wen e79f48393d env_mmc: fix cannot save env issue
The env change its implementation after this log, while env mmc
didn't change it immediately, which cause issue. Follow to the
new style to fix it.

commit ea882baf9c
Author: Wolfgang Denk <wd@denx.de>
Date:   Sun Jun 20 23:33:59 2010 +0200

    New implementation for internal handling of environment variables.

Signed-off-by: Lei Wen <leiwen@marvell.com>
2010-10-13 22:02:32 +02:00
Steve Sakoman d470a6f60a env_mmc: Fix crashing bug encountered after enabling ARM relocation
The crash was occuring in env_relocate because it was being called prior
to mmc_initialize.  This patch moves the MMC initialization earlier in
the init process.

This patch also cleans up the env_relocate_spec code in env_mmc.c

Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org>
Acked-by: Stefano Babic <sbabic@denx.de>
2010-10-13 21:52:13 +02:00
Steve Sakoman a2f69d35f9 env_mmc: Fix broken build due to set_default_env() change
Previously the function was set_default_env(void), it is now
set_default_env(const char *s). This patch adds the required
parameter. This fixes a broken build on OMAP4430 SDP.

Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org>
2010-10-06 22:23:30 +02:00
Terry Lv a80603598c Save environment data to mmc.
This patch is to save environment data to mmc card.
It uses interfaces defined in generic mmc.

Signed-off-by: Terry Lv <r65388@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>
2010-09-19 17:47:29 +02:00