26 Apr, 2018
1 commit
-
Fix below build warning and errors:
env/sata.c: In function ‘env_sata_save’:
env/sata.c:59:9: warning: implicit declaration of function ‘sata_get_dev’ [-Wimplicit-function-declaration]
sata = sata_get_dev(env_sata);
^~~~~~~~~~~~
env/sata.c:59:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
sata = sata_get_dev(env_sata);
^
env/sata.c: In function ‘env_sata_load’:
env/sata.c:101:10: warning: ‘return’ with a value, in function returning void
return -EIO;
^
env/sata.c:94:13: note: declared here
static void env_sata_load(void)
^~~~~~~~~~~~~
env/sata.c:105:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
sata = sata_get_dev(env_sata);
^
env/sata.c:108:10: warning: ‘return’ with a value, in function returning void
return -EIO;
^
env/sata.c:94:13: note: declared here
static void env_sata_load(void)
^~~~~~~~~~~~~
env/sata.c:113:10: warning: ‘return’ with a value, in function returning void
return -EIO;
^
env/sata.c:94:13: note: declared here
static void env_sata_load(void)
^~~~~~~~~~~~~
env/sata.c:116:9: warning: ‘return’ with a value, in function returning void
return env_import(buf, 1);
^~~~~~~~~~~~~~~~~~
env/sata.c:94:13: note: declared here
static void env_sata_load(void)
^~~~~~~~~~~~~
env/sata.c: At top level:
env/sata.c:120:14: error: ‘ENVL_ESATA’ undeclared here (not in a function)
.location = ENVL_ESATA,
^~~~~~~~~~
env/sata.c:122:11: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.load = env_sata_load,Signed-off-by: Ye Li
17 Feb, 2018
2 commits
-
With multiple environments, the 'get_char' callback for env
drivers does not really make sense any more because it is
only supported by two drivers (eeprom and nvram).To restore single character loading for these drivers,
override 'env_get_char_spec'.Signed-off-by: Simon Goldschmidt
Acked-by: Maxime Ripard -
Commit 7d714a24d725 ("env: Support multiple environments") added
static variable env_load_location. When saving environmental
variables, this variable is presumed to have the value set before.
In case the value was set before relocation and U-Boot runs from a
NOR flash, this variable wasn't writable. This causes failure when
saving the environment. To save this location, global data must be
used instead.Signed-off-by: York Sun
CC: Maxime Ripard
01 Feb, 2018
1 commit
-
There is more common code in mmc, nand and ubi env drivers that
can be shared by moving to env_import_redund.For this, a status/error value whether the buffers were loaded
are passed as additional parameters to env_import_redund.
Ideally, these are already returned to the env driver by the
storage driver. This is the case for mmc, nand and ubi, so for
this change, code deduplicated.Signed-off-by: Simon Goldschmidt
Acked-by: Maxime Ripard
27 Jan, 2018
2 commits
-
In preparation for the multiple environment support, let's introduce two
new parameters to the environment driver lookup function: the priority and
operation.The operation parameter is meant to identify, obviously, the operation you
might want to perform on the environment.The priority is a number passed to identify the environment priority you
want to retrieve. The lowest priority parameter (0) will be the primary
source.Combining the two parameters allow you to support multiple environments
through different priorities, and to change those priorities between read
and writes operations.This is especially useful to implement migration mechanisms where you want
to always use the same environment first, be it to read or write, while the
common case is more likely to use the same environment it has read from to
write it to.Signed-off-by: Maxime Ripard
-
The nvedit command is the only user of env_driver_lookup_default outside of
the environment code itself, and it uses it only to print the environment
it's about to save to during env save.As we're about to rework the environment to be able to handle multiple
environment sources, we might not have an idea of what environment backend
is going to be used before trying (and possibly failing for some).Therefore, it makes sense to remove that message and move it to the
env_save function itself. As a side effect, we also can get rid of the call
to env_driver_lookup_default that is also about to get refactored.Reviewed-by: Andre Przywara
Reviewed-by: Lukasz Majewski
Reviewed-by: Simon Glass
Signed-off-by: Maxime Ripard
21 Nov, 2017
1 commit
-
This support has been deprecated since v2017.09 due to security issues.
We now remove this support.Signed-off-by: Tom Rini
16 Oct, 2017
1 commit
-
Last user of this option went away in commit:
fdc7718999 ("board: usb_a9263: Update to support DT and DM")
Signed-off-by: Tuomas Tynkkynen
16 Aug, 2017
8 commits
-
The load() methods have inconsistent behaviour on error. Some of them load
an empty default environment. Some load an environment containing an error
message. Others do nothing.As a step in the right direction, have the method return an error code.
Then the caller could handle this itself in a consistent way.Signed-off-by: Simon Glass
-
In principle this can fail, e.g. if the index is out of range. Adjust the
driver signature to allow returning an error code.Signed-off-by: Simon Glass
Reviewed-by: Tom Rini -
We are now using an env_ prefix for environment functions. Rename these
other functions as well, for consistency:getenv_vlan()
getenv_bootm_size()
getenv_bootm_low()
getenv_bootm_mapsize()
env_get_default()Suggested-by: Wolfgang Denk
Signed-off-by: Simon Glass -
Use the env_save() function directly now that there is only one
implementation of saveenv().Signed-off-by: Simon Glass
Reviewed-by: Wolfgang Denk
Reviewed-by: Tom Rini -
This is a strange name for a function that loads the environment. There is
now only one implementation of this function, so use the new env_load()
function directly instead.Signed-off-by: Simon Glass
Reviewed-by: Tom Rini -
We only have a single implementation of this function now and it is called
env_get_char(). Drop the old function and the weak version.Reviewed-by: Tom Rini
Signed-off-by: Simon Glass -
Add a name to the driver and use that instead of the global variable
declared by each driver.Signed-off-by: Simon Glass
Reviewed-by: Tom Rini -
Most of the init() implementations just use the default environment.
Adjust env_init_new() to do this automatically, and drop the redundant
code.Signed-off-by: Simon Glass
Reviewed-by: Tom Rini
15 Aug, 2017
3 commits
-
Set up a location driver for each supported environment location. At
present this just points to the global functions and is not used. A
later patch will switch this over to use private functions in each driver.There are several special cases here in various drivers to handle
peculiarities of certain boards:1. Some boards define CONFIG_ENV_IS_IN_FAT and CONFIG_SPL_ENV_SUPPORT but
do not actually load the environment in SPL. The env load code was
optimised out before but with the driver, it is not. Therefore a special
case is added to env/fat.c. The correct fix (depending on board testing
might be to disable CONFIG_SPL_ENV_SUPPORT.2. A similar situations happens with CONFIG_ENV_IS_IN_FLASH. Some boards
do not actually load the environment in SPL, so to reduce code size we
need to drop that code. A similar fix may be possible with these boards,
or it may be possible to adjust the environment CONFIG settings.Added to the above is that the CONFIG_SPL_ENV_SUPPORT option does not
apply when the environment is in flash.Obviously the above has been discovered through painful and time-consuming
trial and error. Hopefully board maintainers can take a look and figure
out what is actually needed.Signed-off-by: Simon Glass
-
At present we have three states for the environment, numbered 0, 1 and 2.
Add an enum to record this to avoid open-coded values.Signed-off-by: Simon Glass
Reviewed-by: Tom Rini -
These functions are not used outside this file. Make them static and order
them to avoid forward declarations.Signed-off-by: Simon Glass
Reviewed-by: Tom Rini
23 Jul, 2017
1 commit
-
All current environments that implement redundancy use almost
identical implementations. This patch implements the env_nand
implementation as a function in env_common, and updates the
env_export function to export an env_nand-style 'flags' field by
default.Signed-off-by: Fiach Antaw
Reviewed-by: Tom Rini
07 Apr, 2017
1 commit
-
The environment location is something that might change per board
(depending on what storage options are availaible there) or depending on
the user choice (when we have several options).Instead of hardcoding it in our configuration header, create a Kconfig
choice with the options we use for now, and the symbols that depend on it.Once done, also remove the irrelevant sunxi defines.
Signed-off-by: Maxime Ripard
Reviewed-by: Tom Rini
Reviewed-by: Jagan Teki
07 Oct, 2016
1 commit
-
Fix various misspellings of:
* deprecated
* partition
* preceding,preceded
* preparation
* its versus it's
* export
* existing
* scenario
* redundant
* remaining
* value
* architectureSigned-off-by: Robert P. J. Day
Reviewed-by: Jagan Teki
Reviewed-by: Stefan Roese
02 Aug, 2014
2 commits
-
Add callback with __weak annotation to allow setup of environment
partition number in runtime from a board file.Propagate mmc_switch_part() return value into init_mmc_for_env() instead
of -1 in case of failure.Signed-off-by: Dmitry Lifshitz
Signed-off-by: Igor Grinberg
Acked-by: Pantelis Antoniou -
Add missing mmc_get_env_addr() prototype in environment.h
Signed-off-by: Dmitry Lifshitz
Acked-by: Pantelis Antoniou
22 Mar, 2014
2 commits
-
Add function which allows encrypting the whole environment block with
AES-128-CBC. The key for the environment is retrieved by
env_aes_cbc_get_key() function, which must be implemented on a per-board
basis.Signed-off-by: Marek Vasut
-
Implement env_export() wrapper, so that all implementers of saveenv() don't
have to call hexport_r(), crc32() etc. sequence . This trims down a bit of
code duplication.Signed-off-by: Marek Vasut
24 Jul, 2013
1 commit
-
Signed-off-by: Wolfgang Denk
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini
14 Jun, 2013
1 commit
-
The commit d196bd8 (env_mmc: add support for redundant environment)
introduce the following compile error when enable redundant
environment support with MMC
---88---Add this patch to fix it
Signed-off-by: Bo Shen
Reviewed-by: Michael Heimpold
Signed-off-by: Andy Fleming
12 Apr, 2013
2 commits
-
Allow the user to specify two UBI volumes to use for the environment
Signed-off-by: Joe Hershberger
-
UBI is a better place for the environment on NAND devices because it
handles wear-leveling and bad blocks.Gluebi is needed in Linux to access the env as an MTD partition.
Signed-off-by: Joe Hershberger
14 Dec, 2012
4 commits
-
Add support for read-only, write-once, and change-default.
Signed-off-by: Joe Hershberger
-
Currently just validates variable types as decimal, hexidecimal,
boolean, ip address, and mac address.If the entry is not found in the env ".flags", then look in the static
one. This allows the env to override the static definitions, but prevents
the need to have every definition in the environment distracting you.Signed-off-by: Joe Hershberger
-
Add support for per-variable callbacks to the "hashtable" functions.
Signed-off-by: Joe Hershberger
!!!fix comment in callback
-
Move the read of the old value to inside the check function. In some
cases it can be avoided all together and at the least the code is only
called from one place.Also name the function and the callback to more clearly describe what
it does.Pass the ENTRY instead of just the name for direct access to the whole
data structure.Pass an enum to the callback that specifies the operation being approved.
Signed-off-by: Joe Hershberger
19 Sep, 2012
2 commits
-
Change the syntax (user API) for "env default":
-f: override write-once variables
var... : accept individual variable(s)
-a: all (resetting the whole env is NOT the default behavior)Enable variable checking and make changes effective by
enabling do_apply argument to himport_r().Signed-off-by: Gerlando Falauto
-
Change hashtable so that a callback function will decide whether a
variable can be overwritten, and possibly apply the changes.So add a new field to struct hsearch_data:
o "apply" callback function to check whether a variable can be
overwritten, and possibly immediately apply the changes;
when NULL, no check is performed.And a new argument to himport_r():
o "do_apply": whether to call the apply callback functionNOTE: This patch does not change the current behavior.
Signed-off-by: Gerlando Falauto
Reviewed-by: Marek Vasut
22 Jun, 2012
1 commit
-
This driver is unused and obsolete.
Signed-off-by: Marek Vasut
Cc: Wolfgang Denk
Cc: unsik Kim
05 Jan, 2012
1 commit
-
Several boolean defines have a value assigned.
Remove the value as defining the symbol is enough.Signed-off-by: Igor Grinberg
Acked-by: Marek Vasut
Acked-by: Mike Frysinger
22 Nov, 2011
2 commits
-
Cleanup the env_common.c checkpatch warnings, errors and coding style.
Signed-off-by: Igor Grinberg
-
Cleanup the cmd_nvedit.c checkpatch warnings, errors and coding style.
There are 10 wanrings left about the simple_strtoul() function:
WARNING: simple_strtoul is obsolete, use kstrtoul instead
#359: FILE: cmd_nvedit.c:359:
+ load_addr = simple_strtoul(argv[2], NULL, 16);...
total: 0 errors, 10 warnings, 1043 lines checked
Signed-off-by: Igor Grinberg