<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/tools/env, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ausil/public_git/u-boot.git/'/>
<entry>
<title>tools: env: return error if ubi_update_start() fails</title>
<updated>2021-01-22T21:58:55+00:00</updated>
<author>
<name>Martin Hundebøll</name>
<email>martin@geanix.com</email>
</author>
<published>2020-11-30T11:11:32+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ausil/public_git/u-boot.git/commit/?id=09779488a924dbc4eb3b4ae145632f22b7f5a36c'/>
<id>09779488a924dbc4eb3b4ae145632f22b7f5a36c</id>
<content type='text'>
The UBI_IOCVOLUP ioctl can fail if exclusive access to the volume isn't
obtained. If this happens, the flush operation doesn't return error,
leaving the caller without knowledge of missing flush.

Fix this by forwarding the error (-1) from ubi_update_start().

Fixes: 34255b92e6e ("tools: env: Add support for direct read/write UBI volumes")
Signed-off-by: Martin Hundebøll &lt;martin@geanix.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The UBI_IOCVOLUP ioctl can fail if exclusive access to the volume isn't
obtained. If this happens, the flush operation doesn't return error,
leaving the caller without knowledge of missing flush.

Fix this by forwarding the error (-1) from ubi_update_start().

Fixes: 34255b92e6e ("tools: env: Add support for direct read/write UBI volumes")
Signed-off-by: Martin Hundebøll &lt;martin@geanix.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: env: Avoid an uninited warning with was_locked</title>
<updated>2020-08-05T12:18:34+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-08-01T16:30:39+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ausil/public_git/u-boot.git/commit/?id=7b27e0fe13d8d44da6cd357a69668a726b852502'/>
<id>7b27e0fe13d8d44da6cd357a69668a726b852502</id>
<content type='text'>
Set this variable to 0 to avoid a warning about an unused variable. This
happens on gcc 7.5.0 for me.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Set this variable to 0 to avoid a warning about an unused variable. This
happens on gcc 7.5.0 for me.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: env: Fix printf() warning in fw_env</title>
<updated>2020-08-05T12:18:34+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2020-08-01T16:30:38+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ausil/public_git/u-boot.git/commit/?id=d9cd4d2a8d429068a6a5061a33459ae3ae113ef8'/>
<id>d9cd4d2a8d429068a6a5061a33459ae3ae113ef8</id>
<content type='text'>
The printf() string produces a warning about %d not matching size_t. Fix
it and put the format string on one line to avoid a checkpatch warning.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The printf() string produces a warning about %d not matching size_t. Fix
it and put the format string on one line to avoid a checkpatch warning.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fw_setenv: lock the flash only if it was locked before</title>
<updated>2020-07-31T14:13:00+00:00</updated>
<author>
<name>Ivan Mikhaylov</name>
<email>fr0st61te@gmail.com</email>
</author>
<published>2020-07-10T16:54:18+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ausil/public_git/u-boot.git/commit/?id=db82015929aeff6b58982a22d61ab8c5b87752f3'/>
<id>db82015929aeff6b58982a22d61ab8c5b87752f3</id>
<content type='text'>
With current implementation of fw_setenv, it is always locks u-boot-env
region if lock interface is implemented for such mtd device. You can
not control lock of this region with fw_setenv, there is no option for
it in config or in application itself. Because of this situation may
happen problems like in this thread on xilinx forum:
https://forums.xilinx.com/t5/Embedded-Linux/Flash-be-locked-after-use-fw-setenv-from-user-space
/td-p/1027851

A short summary of that link is: some person has issue with some spi
chip which has lock interface but doesn't locks properly which leads to
lock of whole flash memory on lock of u-boot-env region. As resulted
solution hack was added into spi-nor.c driver for this chip with lock
disablement.

Instead fix this problem by adding logic to fw_setenv only lock the
flash if it was already locked when we attempted to use it.

Signed-off-by: Ivan Mikhaylov &lt;fr0st61te@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With current implementation of fw_setenv, it is always locks u-boot-env
region if lock interface is implemented for such mtd device. You can
not control lock of this region with fw_setenv, there is no option for
it in config or in application itself. Because of this situation may
happen problems like in this thread on xilinx forum:
https://forums.xilinx.com/t5/Embedded-Linux/Flash-be-locked-after-use-fw-setenv-from-user-space
/td-p/1027851

A short summary of that link is: some person has issue with some spi
chip which has lock interface but doesn't locks properly which leads to
lock of whole flash memory on lock of u-boot-env region. As resulted
solution hack was added into spi-nor.c driver for this chip with lock
disablement.

Instead fix this problem by adding logic to fw_setenv only lock the
flash if it was already locked when we attempted to use it.

Signed-off-by: Ivan Mikhaylov &lt;fr0st61te@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: fw_env: Fix warning when reading too little</title>
<updated>2020-06-02T17:06:14+00:00</updated>
<author>
<name>Harald Seiler</name>
<email>hws@denx.de</email>
</author>
<published>2020-05-28T15:54:45+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ausil/public_git/u-boot.git/commit/?id=50bb682c5cc52769e7cbd835a00dbcbc75a4f0e7'/>
<id>50bb682c5cc52769e7cbd835a00dbcbc75a4f0e7</id>
<content type='text'>
When using CONFIG_ENV_IS_IN_FAT and the config-file specifies a size
larger than what U-Boot wrote into the env-file, a confusing error
message is shown:

    $ fw_printenv
    Read error on /boot/uboot.env: Success

Fix this by showing a different error message when read returns too
little data.

Signed-off-by: Harald Seiler &lt;hws@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When using CONFIG_ENV_IS_IN_FAT and the config-file specifies a size
larger than what U-Boot wrote into the env-file, a confusing error
message is shown:

    $ fw_printenv
    Read error on /boot/uboot.env: Success

Fix this by showing a different error message when read returns too
little data.

Signed-off-by: Harald Seiler &lt;hws@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools/env/fw_env.h: remove env.h</title>
<updated>2020-05-25T15:54:53+00:00</updated>
<author>
<name>Romain Naour</name>
<email>romain.naour@gmail.com</email>
</author>
<published>2020-05-21T21:22:06+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ausil/public_git/u-boot.git/commit/?id=2aca8804d8d5f84d2d661e76e8d232c5c12445b5'/>
<id>2aca8804d8d5f84d2d661e76e8d232c5c12445b5</id>
<content type='text'>
As reported by Nicolas Carrier on the Buildroot mailing list [1],
there is a new build issue while building a program which interacts with
the u-boot environment. This program uses the headers of the ubootenv
library provided by uboot-tools.

This is a recent change from uboot [2] adding "#include &lt;env.h&gt;" to
fw_env.h. Adding env.h require a board configuration to build since
it also include compiler.h (and others uboot internal includes).

env.h include seems not needed since env_set() is not used in fw_env tool.

Nicolas removed env.h from fw_env tool and fixed it's build issue.

This problem is present since uboot v2019.10.

[1] http://lists.busybox.net/pipermail/buildroot/2020-April/280307.html
[2] https://gitlab.denx.de/u-boot/u-boot/-/commit/9fb625ce05539fe6876a59ce1dcadb76b33c6f6e

Reported-by: Nicolas Carrier &lt;nicolas.carrier@orolia.com&gt;
Signed-off-by: Romain Naour &lt;romain.naour@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As reported by Nicolas Carrier on the Buildroot mailing list [1],
there is a new build issue while building a program which interacts with
the u-boot environment. This program uses the headers of the ubootenv
library provided by uboot-tools.

This is a recent change from uboot [2] adding "#include &lt;env.h&gt;" to
fw_env.h. Adding env.h require a board configuration to build since
it also include compiler.h (and others uboot internal includes).

env.h include seems not needed since env_set() is not used in fw_env tool.

Nicolas removed env.h from fw_env tool and fixed it's build issue.

This problem is present since uboot v2019.10.

[1] http://lists.busybox.net/pipermail/buildroot/2020-April/280307.html
[2] https://gitlab.denx.de/u-boot/u-boot/-/commit/9fb625ce05539fe6876a59ce1dcadb76b33c6f6e

Reported-by: Nicolas Carrier &lt;nicolas.carrier@orolia.com&gt;
Signed-off-by: Romain Naour &lt;romain.naour@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools: fw_env: use erasesize from MEMGETINFO ioctl</title>
<updated>2020-04-27T18:55:29+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>rasmus.villemoes@prevas.dk</email>
</author>
<published>2020-03-24T12:57:40+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ausil/public_git/u-boot.git/commit/?id=e282c422e0b9a64dc53f7f1e55309639bc645f38'/>
<id>e282c422e0b9a64dc53f7f1e55309639bc645f38</id>
<content type='text'>
We have a board with several revisions. The older ones use a nor flash
with 64k erase size, while the newer have a flash with 4k sectors. The
environment size is 8k.

Currently, we have to put a column containing 0x10000 (64k) in
fw_env.config in order for it to work on the older boards. But that
ends up wasting quite a lot of time on the newer boards that could
just erase the 8k occupied by the environment - strace says the 64k
erase takes 0.405 seconds. With this patch, as expected, that's about
an 8-fold better, at 0.043 seconds.

Having different fw_env.config files for the different revisions is
highly impractical, and the correct information is already available
right at our fingertips. So use the erasesize returned by the
MEMGETINFO ioctl when the fourth and fifth columns (sector size and
#sectors, respectively) are absent or contain 0, a case where the
logic previously used to use the environment size as erase size (and
consequently computed ENVSECTORS(dev) as 1).

As I'm only testing this on a NOR flash, I'm only changing the logic
for that case, though I think it should be possible for the other
types as well.

Signed-off-by: Rasmus Villemoes &lt;rasmus.villemoes@prevas.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have a board with several revisions. The older ones use a nor flash
with 64k erase size, while the newer have a flash with 4k sectors. The
environment size is 8k.

Currently, we have to put a column containing 0x10000 (64k) in
fw_env.config in order for it to work on the older boards. But that
ends up wasting quite a lot of time on the newer boards that could
just erase the 8k occupied by the environment - strace says the 64k
erase takes 0.405 seconds. With this patch, as expected, that's about
an 8-fold better, at 0.043 seconds.

Having different fw_env.config files for the different revisions is
highly impractical, and the correct information is already available
right at our fingertips. So use the erasesize returned by the
MEMGETINFO ioctl when the fourth and fifth columns (sector size and
#sectors, respectively) are absent or contain 0, a case where the
logic previously used to use the environment size as erase size (and
consequently computed ENVSECTORS(dev) as 1).

As I'm only testing this on a NOR flash, I'm only changing the logic
for that case, though I think it should be possible for the other
types as well.

Signed-off-by: Rasmus Villemoes &lt;rasmus.villemoes@prevas.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fw_setenv: avoid writing environment when nothing has changed</title>
<updated>2019-12-20T16:02:24+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>rasmus.villemoes@prevas.dk</email>
</author>
<published>2018-09-27T20:45:26+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ausil/public_git/u-boot.git/commit/?id=c62e6142b95045621fc229d34f40bd8d0e41160a'/>
<id>c62e6142b95045621fc229d34f40bd8d0e41160a</id>
<content type='text'>
In the case where one deletes an already-non-existing variable, or sets
a variable to the value it already has, there is no point in writing the
environment back, thus reducing wear on the underlying storage
device.

In the case of redundant environments, if the two environments
differ (e.g. because one is corrupt), make sure that any call of
fw_setenv causes the two to become synchronized, even if the fw_setenv
call does not change anything in the good copy.

Signed-off-by: Rasmus Villemoes &lt;rasmus.villemoes@prevas.dk&gt;
Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the case where one deletes an already-non-existing variable, or sets
a variable to the value it already has, there is no point in writing the
environment back, thus reducing wear on the underlying storage
device.

In the case of redundant environments, if the two environments
differ (e.g. because one is corrupt), make sure that any call of
fw_setenv causes the two to become synchronized, even if the fw_setenv
call does not change anything in the good copy.

Signed-off-by: Rasmus Villemoes &lt;rasmus.villemoes@prevas.dk&gt;
Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>crc32: Use the crc.h header for crc functions</title>
<updated>2019-12-02T23:23:08+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2019-11-14T19:57:16+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ausil/public_git/u-boot.git/commit/?id=3db7110857524cf1b7d0a374c1ebcde8a2680de0'/>
<id>3db7110857524cf1b7d0a374c1ebcde8a2680de0</id>
<content type='text'>
Drop inclusion of crc.h in common.h and use the correct header directly
instead.

With this we can drop the conflicting definition in fw_env.h and rely on
the crc.h header, which is already included.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Drop inclusion of crc.h in common.h and use the correct header directly
instead.

With this we can drop the conflicting definition in fw_env.h and rely on
the crc.h header, which is already included.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fw_env: fix build error</title>
<updated>2019-09-24T21:46:13+00:00</updated>
<author>
<name>Pierre-Jean Texier</name>
<email>pjtexier@koncepto.io</email>
</author>
<published>2019-08-26T11:06:16+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/ausil/public_git/u-boot.git/commit/?id=7ce01c78dcd34b49c779467c33953c931bf7bf06'/>
<id>7ce01c78dcd34b49c779467c33953c931bf7bf06</id>
<content type='text'>
The following error appears:

tools/env/fw_env.c:1149:25: error: lvalue required as unary ‘&amp;’ operand
  rc = write(fd, &amp;ENV_REDUND_OBSOLETE, sizeof(ENV_REDUND_OBSOLETE));

Fixes: d3716dd ("env: Rename the redundancy flags")

Signed-off-by: Pierre-Jean Texier &lt;pjtexier@koncepto.io&gt;
Tested-by: Joris Offouga &lt;offougajoris@gmail.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
Suggested-by: Heiko Schocher &lt;hs@denx.de&gt;
Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following error appears:

tools/env/fw_env.c:1149:25: error: lvalue required as unary ‘&amp;’ operand
  rc = write(fd, &amp;ENV_REDUND_OBSOLETE, sizeof(ENV_REDUND_OBSOLETE));

Fixes: d3716dd ("env: Rename the redundancy flags")

Signed-off-by: Pierre-Jean Texier &lt;pjtexier@koncepto.io&gt;
Tested-by: Joris Offouga &lt;offougajoris@gmail.com&gt;
Tested-by: Heiko Schocher &lt;hs@denx.de&gt;
Suggested-by: Heiko Schocher &lt;hs@denx.de&gt;
Acked-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
