[U-Boot] [PATCH v2 4/4] env_sf: use DIV_ROUND_UP to calculate number of sectors to erase

2017-04-08 Thread Andreas Fenkart
simpler to read Signed-off-by: Andreas Fenkart --- common/env_sf.c | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/common/env_sf.c b/common/env_sf.c index 6a1583ebec..9944602367 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -80,7 +80,7 @@ int

[U-Boot] [PATCH v2 0/4] env_sf: minor refactorings

2017-04-08 Thread Andreas Fenkart
rebased patches on master fixed compiled error in 1st patch (missing variable declaration) compile tested all patches with travis Andreas Fenkart (4): env_sf: factor out prepare_flash_device enf_sf: reuse setup_flash_device instead of open coding it env_sf: re-order error handling in single

[U-Boot] [PATCH v2 3/4] env_sf: re-order error handling in single-buffer env_relocate_spec

2017-04-08 Thread Andreas Fenkart
this makes it easier comparable to the double-buffered version Signed-off-by: Andreas Fenkart Reviewed-by: Simon Glass --- common/env_sf.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/common/env_sf.c b/common/env_sf.c index a52fb734c8..6a1583ebec

[U-Boot] [PATCH v2 2/4] enf_sf: reuse setup_flash_device instead of open coding it

2017-04-08 Thread Andreas Fenkart
s not yet usable when relocating. Signed-off-by: Andreas Fenkart --- common/env_sf.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/common/env_sf.c b/common/env_sf.c index 8af590a3d9..a52fb734c8 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -176,12 +

[U-Boot] [PATCH v2 1/4] env_sf: factor out prepare_flash_device

2017-04-08 Thread Andreas Fenkart
copy&paste code found in single/double buffered code path Signed-off-by: Andreas Fenkart Reviewed-by: Simon Glass --- common/env_sf.c | 48 +++- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/common/env_sf.c b/common/env_sf.c i

Re: [U-Boot] [PATCH v2] tools/env: fix environment alignment tests for block devices

2016-11-28 Thread Andreas Fenkart
Hi Max, LGTM, see one nit below, can fixed later On 11/19/2016 01:58 PM, Max Krummenacher wrote: commit 183923d3e412500bdc597d1745e2fb6f7f679ec7 enforces that the environment must start at an erase block boundary. For block devices the sample fw_env.config does not mandate a erase block size f

[U-Boot] [PATCH 4/4] env_sf: use DIV_ROUND_UP to calculate number of sectors to erase

2016-11-28 Thread Andreas Fenkart
simpler, needs less thinking when reading the code Signed-off-by: Andreas Fenkart --- common/env_sf.c | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/common/env_sf.c b/common/env_sf.c index 8a3de63..0434bb8 100644 --- a/common/env_sf.c +++ b/common

[U-Boot] [PATCH 2/4] enf_sf: reuse setup_flash_device instead of open coding it

2016-11-28 Thread Andreas Fenkart
s not yet usable when relocating. Signed-off-by: Andreas Fenkart --- common/env_sf.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/common/env_sf.c b/common/env_sf.c index 5126762..ba9ac8a 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -175,12 +175,9 @@

[U-Boot] [PATCH 3/4] env_sf: re-order error handling in single-buffer env_relocate_spec

2016-11-28 Thread Andreas Fenkart
this makes it easier comparable to the double-buffered version Signed-off-by: Andreas Fenkart --- common/env_sf.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/common/env_sf.c b/common/env_sf.c index ba9ac8a..8a3de63 100644 --- a/common/env_sf.c +++ b

[U-Boot] [PATCH 1/4] env_sf: factor out prepare_flash_device

2016-11-28 Thread Andreas Fenkart
copy&paste code found in single/double buffered code path Signed-off-by: Andreas Fenkart --- common/env_sf.c | 47 ++- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/common/env_sf.c b/common/env_sf.c index c53200f..5126762 10

[U-Boot] [PATCH 0/4] env_sf: minor cleanup

2016-11-28 Thread Andreas Fenkart
Andreas Fenkart (4): env_sf: factor out prepare_flash_device enf_sf: reuse setup_flash_device instead of open coding it env_sf: re-order error handling in single-buffer env_relocate_spec env_sf: use DIV_ROUND_UP to calculate number of sectors to erase common/env_sf.c | 91

Re: [U-Boot] [PATCH] tools/env: fix environment alignment tests for block devices

2016-11-18 Thread Andreas Fenkart
2016-11-18 11:38 GMT+01:00 Max Krummenacher : > commit 183923d3e412500bdc597d1745e2fb6f7f679ec7 enforces that the > environment must start at an erase block boundary. > > For block devices the sample fw_env.config does not mandate a erase block size > for block devices. A missing setting defaults t

[U-Boot] Suspected Spam: Do not open attachements![PATCH 4/6] tools/env: flash_write_buf: enforce offset to be start of environment

2016-08-29 Thread Andreas Fenkart
This allows to take advantage of the environment being block aligned. This is not a new constraint. Writes always start at the begin of the environment, since the header with CRC/length as there. Every environment modification requires updating the header Signed-off-by: Andreas Fenkart

[U-Boot] [PATCH 3/6] tools/env: lookup dev_type directly from flash_read_buf/flash_write_buf

2016-08-29 Thread Andreas Fenkart
flash_write_buf already looks up size/offset/#sector from struct envdev_s. It can look up mtd_type as well. Same applies to flash_read_buf. Makes the interface simpler Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 28 +--- 1 file changed, 13 insertions(+), 15

[U-Boot] [PATCH 2/6] tools/env: pass bad block offset by value

2016-08-29 Thread Andreas Fenkart
the offset is not modified by linux ioctl call see mtd_ioctl{drivers/mtd/mtdchar.c} Makes the interface less ambiguous, since the caller can now exclude a modification of blockstart Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 10 +- 1 file changed, 5 insertions(+), 5

[U-Boot] [PATCH 1/6] tools/env: factor out environment_end function

2016-08-29 Thread Andreas Fenkart
instead of adhoc computation of the environment end, use a function with a proper name Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index

[U-Boot] [PATCH 0/6] tools/env: refactor flash read/write function

2016-08-29 Thread Andreas Fenkart
Take advantage of the environment being block aligned block alignment is enforced since 183923d3e4 Andreas Fenkart (6): tools/env: factor out environment_end function tools/env: pass bad block offset by value tools/env: lookup dev_type directly from flash_read_buf/flash_write_buf

[U-Boot] [PATCH 1/2] tools/env: return with error if redundant environments have unequal size

2016-08-17 Thread Andreas Fenkart
: Andreas Fenkart --- tools/env/fw_env.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index d2b167d..7cc7488 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -1423,10 +1423,9 @@ static int parse_config(struct env_opts *opts

[U-Boot] [PATCH 2/2] tools/env: soften warning about erase block alignment

2016-08-17 Thread Andreas Fenkart
addon 183923d3e MMC/SATA have no erase blocks, only blocks. Hence the warning about erase block alignment might be confusing in such environment. Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/env/fw_env.c b/tools

[U-Boot] [PATCH 0/2] tools/env: minor fixes plus resend

2016-08-17 Thread Andreas Fenkart
The redundant environment patch was already submitted once, but not applied due to a merge conflict. The second patch is an addon to 183923d3e as suggested by Stefan Agner Andreas Fenkart (2): tools/env: return with error if redundant environments have unequal size tools/env: soften

[U-Boot] [PATCH] tools/env: ensure environment starts at erase block boundary

2016-08-11 Thread Andreas Fenkart
it wasn't supported and due to reasons above I guess it was never introduced. I prefer to remove that (unused) feature in favor of simplicity Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 12 1 file changed, 12 insertions(+) diff --git a/tools/env/fw_env.c b/tool

[U-Boot] [RFC: v2] tools/env: ensure environment starts at erase block boundary

2016-08-11 Thread Andreas Fenkart
it wasn't supported and due to reasons above I guess it was never introduced. I prefer to remove that (unused) feature in favor of simplicity Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 12 1 file changed, 12 insertions(+) diff --git a/tools/env/fw_env.c b/tool

Re: [U-Boot] [PATCH 2/2] tools/env: allow negative offsets

2016-07-17 Thread Andreas Fenkart
Hi, 2016-07-14 2:14 GMT+02:00 Stefan Agner : > From: Stefan Agner > > A negative value for the offset is treated as a backwards offset for > from the end of the device/partition for block devices. This aligns > the behavior of the config file with the syntax of CONFIG_ENV_OFFSET > where the funct

Re: [U-Boot] [PATCH 1/2] tools/env: complete environment device config early

2016-07-17 Thread Andreas Fenkart
es the code for further extension. > > Signed-off-by: Stefan Agner Reviewed-by: Andreas Fenkart > --- > > tools/env/fw_env.c | 110 > + > 1 file changed, 60 insertions(+), 50 deletions(-) > > diff --git a/tools/env/f

Re: [U-Boot] [PATCH 2/4] tools/env: javadoc for fw_printenv, fw_getenv and fw_parse_script

2016-07-17 Thread Andreas Fenkart
Hi Simon, I sent out a v2 of this series, you should have received by now. Some comments in the context: 2016-07-09 16:39 GMT+02:00 Simon Glass : > On 27 June 2016 at 16:06, Andreas Fenkart > wrote: [snip] >> +/** >> + * fw_printenv - print one or several environment variabl

[U-Boot] [PATCH v2 4/4] tools/env: reuse fw_getenv in fw_printenv function

2016-07-16 Thread Andreas Fenkart
Try to avoid adhoc iteration of the environment. Reuse fw_getenv to find the variables that should be printed. Only use open-coded iteration when printing all variables. For backwards compatibility, keep emitting a newline when printing with value_only. Signed-off-by: Andreas Fenkart --- tools

[U-Boot] [PATCH v2 3/4] tools/env: move envmatch further up in file to avoid forward declarations

2016-07-16 Thread Andreas Fenkart
forward declaration not needed when re-ordered Reviewed-by: Simon Glass Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 38 ++ 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index fe479e9

[U-Boot] [PATCH v2 0/4] tools/env: minor refactorings

2016-07-16 Thread Andreas Fenkart
various patches, see individual patch descriptions Andreas Fenkart (4): tools/env: return with error if redundant environments have unequal size tools/env: kernel-doc for fw_printenv, fw_getenv and fw_parse_script tools/env: move envmatch further up in file to avoid forward

[U-Boot] [PATCH v2 1/4] tools/env: return with error if redundant environments have unequal size

2016-07-16 Thread Andreas Fenkart
: Andreas Fenkart --- tools/env/fw_env.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 692abda..b1c8217 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -1382,18 +1382,19 @@ static int parse_config

[U-Boot] [PATCH v2 2/4] tools/env: kernel-doc for fw_printenv, fw_getenv and fw_parse_script

2016-07-16 Thread Andreas Fenkart
those to modify several variables without creating a temporary batch script file tested with "./scripts/kernel-doc -html -v tools/env/fw_env.h" Reviewed-by: Simon Glass Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 2 +- tools/env/fw_e

[U-Boot] [PATCH 2/4] tools/env: javadoc for fw_printenv, fw_getenv and fw_parse_script

2016-06-27 Thread Andreas Fenkart
those to modify several variables without creating a temporary batch script file Signed-off-by: Andreas Fenkart --- tools/env/fw_env.h | 75 +- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h

[U-Boot] [PATCH 1/4] tools/env: return with error if redundant environments have unequal size

2016-06-27 Thread Andreas Fenkart
From: Andreas Fenkart For double buffering to work, the target buffer must always be big enough to hold all data. This can only be ensured if buffers are of equal size, otherwise one must be smaller and we risk data loss when copying from the bigger to the smaller buffer. Signed-off-by: Andreas

[U-Boot] [PATCH 4/4] tools/env: reuse fw_getenv in fw_printenv function

2016-06-27 Thread Andreas Fenkart
Try to avoid adhoc iteration of the environment. Reuse fw_getenv to find the variables that should be printed. Only use open-coded iteration when printing all variables. For backwards compatibility, keep emitting a newline when printing with noheader. Signed-off-by: Andreas Fenkart --- tools

[U-Boot] [PATCH 3/4] tools/env: move envmatch further up in file to avoid forward declarations

2016-06-27 Thread Andreas Fenkart
From: Andreas Fenkart forward declaration not needed when re-ordered Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 38 ++ 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index b1c8217

[U-Boot] [PATCH 0/4] tools/env: minor refactorings

2016-06-27 Thread Andreas Fenkart
various patches, see individual patch descriptions Andreas Fenkart (4): tools/env: return with error if redundant environments have unequal size tools/env: javadoc for fw_printenv, fw_getenv and fw_parse_script tools/env: move envmatch further up in file to avoid forward

Re: [U-Boot] [PATCH] fw_env: Make env flash lock optional

2016-06-02 Thread Andreas Fenkart
Hi, I faced the same problem a while back, thanks for taking a look at this. Does it have to be compiled in? Why not make it a command line option, evtl. making the default a compile time option. /Andi 2016-06-02 10:27 GMT+02:00 Dirk Eibach : > Hi Anatolij, > > 2016-06-02 10:14 GMT+02:00 Anatoli

Re: [U-Boot] tools/env: check that redundant environments have equal size

2016-05-31 Thread Andreas Fenkart
2016 at 12:43:51PM +0200, Andreas Fenkart wrote: >> >> > For double buffering to work, the target buffer must always be big >> > enough to hold all data. This can only be ensured if buffers are of >> > equal size, otherwise one must be smaller and we risk data loss &

[U-Boot] [PATCH] tools/env: allow to pass NULL for environment options

2016-05-31 Thread Andreas Fenkart
If users of the library are happy with the default, e.g. config file name. They can pass NULL as the opts pointer. This simplifies the transition of existing library users. FIXES a compile error. since common_args has been removed by a previous patch Signed-off-by: Andreas Fenkart --- tools/env

[U-Boot] [PATCH] tools/env: check that redundant environments have equal size

2016-05-19 Thread Andreas Fenkart
For double buffering to work, the target buffer must always be big enough to hold all data. This can only be ensured if buffers are of equal size, otherwise one must be smaller and we risk data loss when copying from the bigger to the smaller. Signed-off-by: Andreas Fenkart --- tools/env

[U-Boot] [PATCH v2 4/5] tools/env: compute size of usable area only once

2016-04-19 Thread Andreas Fenkart
for double buffering to work, redundant buffers must have equal size Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 1420855..15df5ad 100644

[U-Boot] [PATCH v2 3/5] tools/env: fw_printenv pass value_only as argument

2016-04-19 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 6 +++--- tools/env/fw_env.h | 4 ++-- tools/env/fw_env_main.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index e5b2e8f..1420855 100644 --- a/tools/env/fw_env.c

[U-Boot] [PATCH v2 0/5] tools/env: pass arguments as parameters not global structure

2016-04-19 Thread Andreas Fenkart
u-boot tools can be built as a library (libubootenv.a). Passing arguments to the library using global structures is a bad interface. v2: - fix env_aes_cbc_crypt prototype - check opts pointer for not NULL Andreas Fenkart (5): tools/env: pass key as argument to env_aes_cbc_crypt tools/env

[U-Boot] [PATCH v2 1/5] tools/env: pass key as argument to env_aes_cbc_crypt

2016-04-19 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 1420ac5..e5b2e8f 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -106,7 +106,7 @@ static struct

[U-Boot] [PATCH v2 2/5] tools/env: remove 'extern' from function prototype in fw_env.h

2016-04-19 Thread Andreas Fenkart
checkpatch complains about in succeding patch. Prefer to fix all declarations in a dedicated patch. Signed-off-by: Andreas Fenkart --- tools/env/fw_env.h | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h index 57149e7

[U-Boot] [PATCH 2/5] tools/env: remove 'extern' from function prototype in fw_env.h

2016-04-05 Thread Andreas Fenkart
checkpatch complains about in succeding patch. Prefer to fix all declarations in a dedicated patch. Signed-off-by: Andreas Fenkart --- tools/env/fw_env.h | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h index 57149e7

[U-Boot] [PATCH 3/5] tools/env: fw_printenv pass value_only as argument

2016-04-05 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 6 +++--- tools/env/fw_env.h | 4 ++-- tools/env/fw_env_main.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index c362a41..bd218cb 100644 --- a/tools/env/fw_env.c

[U-Boot] [PATCH 5/5] tools/env: no global variable sharing between application and library

2016-04-05 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 50 +++-- tools/env/fw_env.h | 25 +++-- tools/env/fw_env_main.c | 28 +-- 3 files changed, 48 insertions(+), 55 deletions(-) diff --git a

[U-Boot] [PATCH 4/5] tools/env: compute size of usable area only once

2016-04-05 Thread Andreas Fenkart
for double buffering to work, redundant buffers must have equal size Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index bd218cb..3525563 100644

[U-Boot] [PATCH 1/5] tools/env: make env_aes_cbc_crypt re-entrant

2016-04-05 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 1420ac5..c362a41 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -106,7 +106,8 @@ static struct

[U-Boot] [PATCH 0/5] tools/env: pass arguments as parameters not global structure

2016-04-05 Thread Andreas Fenkart
u-boot tools can be built as a library (ibubootenv.a). Passing arguments to the library using global structures is not a good interface. Andreas Fenkart (5): tools/env: make env_aes_cbc_crypt re-entrant tools/env: remove 'extern' from function prototype in fw_env.h tools/env: f

Re: [U-Boot] ENV library broken with setenv/printenv argument structs

2016-03-25 Thread Andreas Fenkart
HI Stefano, I was not aware of the use case. I have sent out a simple patch that moves the definition of the structs from fw_main_env.c to fw_env.c, which should avoid the linking problem. Do you have test application you could send me. I without doing the option parsing as done in fw_env_main, yo

[U-Boot] [PATCH] tools: env: bug: config structs must be defined in tools library

2016-03-25 Thread Andreas Fenkart
fw_senten/fw_printenv can be compiled as a tools library, excluding the fw_env_main object. Reported-by: Stefano Babic Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 4 tools/env/fw_env_main.c | 4 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/env

[U-Boot] [PATCH 4/6] tools: env: fw_parse_script: simplify removal of newline/carriage return

2016-03-11 Thread Andreas Fenkart
fgets returns when the first '\n' is found Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 60574f2..5c7505c 100644 --- a/tools/env/fw_env.c +++ b/tools/en

[U-Boot] [PATCH 3/6] tools: env: split fw_string_blank into skip_chars / skip_blanks

2016-03-11 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 0a438a3..60574f2 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -133,14 +133,19 @@ static

[U-Boot] [PATCH 2/6] tools: env: fw_string_blank: return from loop when item found

2016-03-11 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index bded9f6..0a438a3 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -141,12 +141,9 @@ static char

[U-Boot] [PATCH 1/6] tools: env: replace WHITESPACE macro by isblank

2016-03-11 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index ee17a69..bded9f6 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -15,6 +15,7 @@ #include #include

[U-Boot] [PATCH 0/6] tools: env: trivial cleanups in script parsing

2016-03-11 Thread Andreas Fenkart
Andreas Fenkart (6): tools: env: replace WHITESPACE macro by isblank tools: env: fw_string_blank: return from loop when item found tools: env: split fw_string_blank into skip_chars / skip_blanks tools: env: fw_parse_script: simplify removal of newline/carriage return tools: env

[U-Boot] [PATCH v3 7/7] tools: env: update usage strings

2015-12-09 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env_main.c | 117 +++- 1 file changed, 75 insertions(+), 42 deletions(-) diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c index 39c8771..4bd4216 100644 --- a/tools/env/fw_env_main.c +++ b

[U-Boot] [PATCH v3 3/7] tools: env: introduce setenv/printenv argument structs

2015-12-09 Thread Andreas Fenkart
goal is to use getopt for all argument parsing instead of adhoc parsing in fw_getenv/fw_setenv functions Signed-off-by: Andreas Fenkart --- tools/env/fw_env.h | 9 tools/env/fw_env_main.c | 113 2 files changed, 84 insertions(+), 38

[U-Boot] [PATCH v3 4/7] tools: env: parse aes key / suppress flag into argument struct

2015-12-09 Thread Andreas Fenkart
disabled original parsing, but not yet removed since the argument indexing needs to be fixed Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 64 ++--- tools/env/fw_env.h | 15 tools/env/fw_env_main.c | 31

[U-Boot] [PATCH v3 5/7] tools: env: shift optind arguments and fix argument indices

2015-12-09 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 54 ++--- tools/env/fw_env_main.c | 4 2 files changed, 15 insertions(+), 43 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 2cfff02..b1cf9ae 100644 --- a/tools

[U-Boot] [PATCH v3 6/7] tools: env: factor out parse_common_args

2015-12-09 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env_main.c | 62 + 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c index daf4688..39c8771 100644 --- a/tools/env/fw_env_main.c +++ b

[U-Boot] [PATCH v3 2/7] tools: env: make parse_aes_key stateless

2015-12-09 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 22507f6..5b76b74 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -207,7 +207,7 @@ char *fw_getdefenv

[U-Boot] [PATCH v3 0/7] tools: env: simplify argument parsing

2015-12-09 Thread Andreas Fenkart
place using getopt and store the parsed flags in a global struct. v3: - rebased on top of master/8555dd8 - made emails in From:/Signed-off header match Andreas Fenkart (7): tools: env validate: pass values as 0-based array tools: env: make parse_aes_key stateless tools: env: introduce setenv

[U-Boot] [PATCH v3 1/7] tools: env validate: pass values as 0-based array

2015-12-09 Thread Andreas Fenkart
passing argv/argc can produce off-by-one errors Signed-off-by: Andreas Fenkart --- common/env_flags.c | 14 +++--- include/env_flags.h | 2 +- tools/env/fw_env.c | 11 +++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/common/env_flags.c b/common/env_flags.c

[U-Boot] [PATCH v2 7/7] tools: env: update usage strings

2015-11-26 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env_main.c | 117 +++- 1 file changed, 75 insertions(+), 42 deletions(-) diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c index e7ba95e..79273ce 100644 --- a/tools/env/fw_env_main.c +++ b

[U-Boot] [PATCH v2 6/7] tools: env: factor out parse_common_args

2015-11-26 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env_main.c | 63 + 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c index daf4688..e7ba95e 100644 --- a/tools/env/fw_env_main.c +++ b

[U-Boot] [PATCH v2 5/7] tools: env: shift optind arguments and fix argument indices

2015-11-26 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 54 ++--- tools/env/fw_env_main.c | 4 2 files changed, 15 insertions(+), 43 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 2cfff02..b1cf9ae 100644 --- a/tools

[U-Boot] [PATCH v2 4/7] tools: env: parse aes key / suppress flag into argument struct

2015-11-26 Thread Andreas Fenkart
disabled original parsing, but not yet removed since the argument indexing needs to be fixed Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 64 ++--- tools/env/fw_env.h | 13 ++ tools/env/fw_env_main.c | 31

[U-Boot] [PATCH v2 2/7] tools: env: make parse_aes_key stateless

2015-11-26 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 22507f6..5b76b74 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -207,7 +207,7 @@ char *fw_getdefenv

[U-Boot] [PATCH v2 3/7] tools: env: introduce setenv/printenv argument structs

2015-11-26 Thread Andreas Fenkart
goal is to use getopt for all argument parsing instead of adhoc parsing in fw_getenv/fw_setenv functions Signed-off-by: Andreas Fenkart --- tools/env/fw_env.h | 9 tools/env/fw_env_main.c | 113 2 files changed, 84 insertions(+), 38

[U-Boot] [PATCH v2 1/7] tools: env validate: pass values as 0-based array

2015-11-26 Thread Andreas Fenkart
passing argv/argc can produce off-by-one errors Signed-off-by: Andreas Fenkart --- common/env_flags.c | 14 +++--- include/env_flags.h | 2 +- tools/env/fw_env.c | 11 +++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/common/env_flags.c b/common/env_flags.c

[U-Boot] [PATCH v2 0/7] tools: env: simplify argument parsing

2015-11-26 Thread Andreas Fenkart
store the parsed flags in a global struct. v2: - rebased on top of current master Andreas Fenkart (7): tools: env validate: pass values as 0-based array tools: env: make parse_aes_key stateless tools: env: introduce setenv/printenv argument structs tools: env: parse aes key / suppress flag

[U-Boot] [PATCH 5/5] tools: env: shift optind arguments and fix argument indices

2015-11-24 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 40 +++- tools/env/fw_env_main.c | 4 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 32bb3aa..a89bde5 100644 --- a/tools/env

[U-Boot] [PATCH 3/5] tools: env: introduce setenv/printenv argument structs

2015-11-24 Thread Andreas Fenkart
goal is to use getopt for all argument parsing instead of adhoc parsing in fw_getenv/fw_setenv functions Signed-off-by: Andreas Fenkart --- tools/env/fw_env.h | 9 tools/env/fw_env_main.c | 111 +++- 2 files changed, 81 insertions(+), 39

[U-Boot] [PATCH 4/5] tools: env: parse aes key / suppress flag into argument struct

2015-11-24 Thread Andreas Fenkart
disabled original parsing, but not yet removed since the argument indexing needs to be fixed Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 45 + tools/env/fw_env.h | 12 tools/env/fw_env_main.c | 15 --- 3

[U-Boot] [PATCH 2/5] tools: env: make parse_aes_key stateless

2015-11-24 Thread Andreas Fenkart
Signed-off-by: Andreas Fenkart --- tools/env/fw_env.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index bcf3756..f1dea8b 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -204,7 +204,7 @@ char *fw_getdefenv

[U-Boot] [PATCH 0/5] tools: env: simplify argument parsing

2015-11-24 Thread Andreas Fenkart
nd is using adhoc parsing where the order of arguments is important. This patch will parse arguments only in one place using getopt and store the parsed flags in a global struct. Andreas Fenkart (5): tools: env validate: pass values as 0-based array tools: env: make parse_aes_key stateless

[U-Boot] [PATCH 1/5] tools: env validate: pass values as 0-based array

2015-11-24 Thread Andreas Fenkart
passing argv/argc can produce off-by-one errors Signed-off-by: Andreas Fenkart --- common/env_flags.c | 14 +++--- include/env_flags.h | 2 +- tools/env/fw_env.c | 11 +++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/common/env_flags.c b/common/env_flags.c