<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/tools/env, branch v2016.09</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>tools/env: soften warning about erase block alignment</title>
<updated>2016-08-20T18:03:27+00:00</updated>
<author>
<name>Andreas Fenkart</name>
<email>andreas.fenkart@digitalstrom.com</email>
</author>
<published>2016-08-17T21:41:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4ed6f4318be9fff2df344ba7ac678736c4b6f3d6'/>
<id>4ed6f4318be9fff2df344ba7ac678736c4b6f3d6</id>
<content type='text'>
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 &lt;andreas.fenkart@digitalstrom.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;andreas.fenkart@digitalstrom.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools/env: return with error if redundant environments have unequal size</title>
<updated>2016-08-20T18:03:26+00:00</updated>
<author>
<name>Andreas Fenkart</name>
<email>andreas.fenkart@digitalstrom.com</email>
</author>
<published>2016-08-17T21:41:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=490365c38f869ecebda701df2c060ba3a9e628d3'/>
<id>490365c38f869ecebda701df2c060ba3a9e628d3</id>
<content type='text'>
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.

Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Andreas Fenkart &lt;andreas.fenkart@digitalstrom.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.

Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Andreas Fenkart &lt;andreas.fenkart@digitalstrom.com&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools/env: ensure environment starts at erase block boundary</title>
<updated>2016-08-15T22:46:40+00:00</updated>
<author>
<name>Andreas Fenkart</name>
<email>andreas.fenkart@digitalstrom.com</email>
</author>
<published>2016-08-11T19:39:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=183923d3e412500bdc597d1745e2fb6f7f679ec7'/>
<id>183923d3e412500bdc597d1745e2fb6f7f679ec7</id>
<content type='text'>
56086921 added support for unaligned environments access.
U-boot itself does not support this:
- env_nand.c fails when using an unaligned offset. It produces an
  error in nand_erase_opts{drivers/mtd/nand/nand_util.c}
- in env_sf/env_flash the unused space at the end is preserved, but
  not in the beginning. block alignment is assumed
- env_sata/env_mmc aligns offset/length to the block size of the
  underlying device. data is silently redirected to the beginning of
  a block

There is seems no use case for unaligned environment. If there is
some useful data at the beginning of the the block (e.g. end of u-boot)
that would be very unsafe. If the redundant environments are hosted by
the same erase block then that invalidates the idea of double buffering.
It might be that unaligned access was allowed in the past, and that
people with legacy u-boot are trapped. But at the time of 56086921
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 &lt;andreas.fenkart@digitalstrom.com&gt;
Acked-by: Stefan Agner &lt;stefan.agner@toradex.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
56086921 added support for unaligned environments access.
U-boot itself does not support this:
- env_nand.c fails when using an unaligned offset. It produces an
  error in nand_erase_opts{drivers/mtd/nand/nand_util.c}
- in env_sf/env_flash the unused space at the end is preserved, but
  not in the beginning. block alignment is assumed
- env_sata/env_mmc aligns offset/length to the block size of the
  underlying device. data is silently redirected to the beginning of
  a block

There is seems no use case for unaligned environment. If there is
some useful data at the beginning of the the block (e.g. end of u-boot)
that would be very unsafe. If the redundant environments are hosted by
the same erase block then that invalidates the idea of double buffering.
It might be that unaligned access was allowed in the past, and that
people with legacy u-boot are trapped. But at the time of 56086921
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 &lt;andreas.fenkart@digitalstrom.com&gt;
Acked-by: Stefan Agner &lt;stefan.agner@toradex.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: env: Fix format warnings in debug</title>
<updated>2016-07-26T06:28:39+00:00</updated>
<author>
<name>Marcin Niestroj</name>
<email>m.niestroj@grinn-global.com</email>
</author>
<published>2016-05-06T12:58:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=81c878dd3c75c9056e4755ece89f45d056735d75'/>
<id>81c878dd3c75c9056e4755ece89f45d056735d75</id>
<content type='text'>
Format warnings (-Wformat) were shown in printf() calls after defining
DEBUG macro.

Update format string and explicitly cast variables to suppress all
warnings.

Signed-off-by: Marcin Niestroj &lt;m.niestroj@grinn-global.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Format warnings (-Wformat) were shown in printf() calls after defining
DEBUG macro.

Update format string and explicitly cast variables to suppress all
warnings.

Signed-off-by: Marcin Niestroj &lt;m.niestroj@grinn-global.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools/env: reuse fw_getenv in fw_printenv function</title>
<updated>2016-07-22T18:46:22+00:00</updated>
<author>
<name>Andreas Fenkart</name>
<email>andreas.fenkart@digitalstrom.com</email>
</author>
<published>2016-07-16T15:06:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c5c41c45b1025aa951c794bb8add9c7c806496ee'/>
<id>c5c41c45b1025aa951c794bb8add9c7c806496ee</id>
<content type='text'>
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 &lt;andreas.fenkart@digitalstrom.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;andreas.fenkart@digitalstrom.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools/env: move envmatch further up in file to avoid forward declarations</title>
<updated>2016-07-22T18:46:22+00:00</updated>
<author>
<name>Andreas Fenkart</name>
<email>andreas.fenkart@digitalstrom.com</email>
</author>
<published>2016-07-16T15:06:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1b7427cd2ab6aae150559ee2edc8965fda113fdf'/>
<id>1b7427cd2ab6aae150559ee2edc8965fda113fdf</id>
<content type='text'>
forward declaration not needed when re-ordered

Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Andreas Fenkart &lt;andreas.fenkart@digitalstrom.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
forward declaration not needed when re-ordered

Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Andreas Fenkart &lt;andreas.fenkart@digitalstrom.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools/env: kernel-doc for fw_printenv, fw_getenv and fw_parse_script</title>
<updated>2016-07-22T18:46:21+00:00</updated>
<author>
<name>Andreas Fenkart</name>
<email>andreas.fenkart@digitalstrom.com</email>
</author>
<published>2016-07-16T15:06:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fd4e3280e50983aa4d646f2c8fc93b38cc1dddf9'/>
<id>fd4e3280e50983aa4d646f2c8fc93b38cc1dddf9</id>
<content type='text'>
there are two groups of functions:
- application ready tools: fw_setenv/fw_getenv/fw_parse_script
these are used, when creating a single binary containing multiple
tools (busybox like)
- file access like: open/read/write/close
above functions are implemented on top of these. applications
can use 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 &lt;sjg@chromium.org&gt;
Signed-off-by: Andreas Fenkart &lt;andreas.fenkart@digitalstrom.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
there are two groups of functions:
- application ready tools: fw_setenv/fw_getenv/fw_parse_script
these are used, when creating a single binary containing multiple
tools (busybox like)
- file access like: open/read/write/close
above functions are implemented on top of these. applications
can use 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 &lt;sjg@chromium.org&gt;
Signed-off-by: Andreas Fenkart &lt;andreas.fenkart@digitalstrom.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools/env: allow negative offsets</title>
<updated>2016-07-22T18:46:20+00:00</updated>
<author>
<name>Stefan Agner</name>
<email>stefan.agner@toradex.com</email>
</author>
<published>2016-07-14T00:14:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f4742ca0fb94e531b8dcddd1ac0799ee4c9c2605'/>
<id>f4742ca0fb94e531b8dcddd1ac0799ee4c9c2605</id>
<content type='text'>
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 functionality has been introduced with
commit 5c088ee841f9 ("env_mmc: allow negative CONFIG_ENV_OFFSET").

Signed-off-by: Stefan Agner &lt;stefan.agner@toradex.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 functionality has been introduced with
commit 5c088ee841f9 ("env_mmc: allow negative CONFIG_ENV_OFFSET").

Signed-off-by: Stefan Agner &lt;stefan.agner@toradex.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools/env: complete environment device config early</title>
<updated>2016-07-22T18:46:20+00:00</updated>
<author>
<name>Stefan Agner</name>
<email>stefan.agner@toradex.com</email>
</author>
<published>2016-07-14T00:14:37+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=14fb5b252ac21c81e24fa734c3f66e9d6c3a0932'/>
<id>14fb5b252ac21c81e24fa734c3f66e9d6c3a0932</id>
<content type='text'>
Currently flash_read completes a crucial part of the environment
device configuration, the device type (mtd_type). This is rather
confusing as flash_io calls flash_read conditionally, and one might
think flash_write, which also makes use of mtd_type, gets called
before flash_read. But since flash_io is always called with O_RDONLY
first, this is not actually the case in reality.

However, it is much cleaner to complete and verify the config early
in parse_config. This also prepares the code for further extension.

Signed-off-by: Stefan Agner &lt;stefan.agner@toradex.com&gt;
Reviewed-by: Andreas Fenkart
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently flash_read completes a crucial part of the environment
device configuration, the device type (mtd_type). This is rather
confusing as flash_io calls flash_read conditionally, and one might
think flash_write, which also makes use of mtd_type, gets called
before flash_read. But since flash_io is always called with O_RDONLY
first, this is not actually the case in reality.

However, it is much cleaner to complete and verify the config early
in parse_config. This also prepares the code for further extension.

Signed-off-by: Stefan Agner &lt;stefan.agner@toradex.com&gt;
Reviewed-by: Andreas Fenkart
</pre>
</div>
</content>
</entry>
<entry>
<title>Various, unrelated tree-wide typo fixes.</title>
<updated>2016-07-16T13:43:12+00:00</updated>
<author>
<name>Robert P. J. Day</name>
<email>rpjday@crashcourse.ca</email>
</author>
<published>2016-07-15T17:44:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=62a3b7dd086ef8ceba91e99cceb19704efc1b482'/>
<id>62a3b7dd086ef8ceba91e99cceb19704efc1b482</id>
<content type='text'>
    Fix a number of typos, including:

     * "compatble" -&gt; "compatible"
     * "eanbeld" -&gt; "enabled"
     * "envrionment" -&gt; "environment"
     * "FTD" -&gt; "FDT" (for "flattened device tree")
     * "ommitted" -&gt; "omitted"
     * "overriden" -&gt; "overridden"
     * "partiton" -&gt; "partition"
     * "propogate" -&gt; "propagate"
     * "resourse" -&gt; "resource"
     * "rest in piece" -&gt; "rest in peace"
     * "suport" -&gt; "support"
     * "varible" -&gt; "variable"

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    Fix a number of typos, including:

     * "compatble" -&gt; "compatible"
     * "eanbeld" -&gt; "enabled"
     * "envrionment" -&gt; "environment"
     * "FTD" -&gt; "FDT" (for "flattened device tree")
     * "ommitted" -&gt; "omitted"
     * "overriden" -&gt; "overridden"
     * "partiton" -&gt; "partition"
     * "propogate" -&gt; "propagate"
     * "resourse" -&gt; "resource"
     * "rest in piece" -&gt; "rest in peace"
     * "suport" -&gt; "support"
     * "varible" -&gt; "variable"

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
</pre>
</div>
</content>
</entry>
</feed>
