<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/cmd/fdt.c, branch v2017.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>fdt: fix 'prop (...) not found!' error in 'fdt set' command</title>
<updated>2017-09-04T08:10:06+00:00</updated>
<author>
<name>Hannes Schmelzer</name>
<email>oe5hpm@oevsv.at</email>
</author>
<published>2017-08-18T12:41:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=cee8c35d1b7101d09a1854a48f867deaa701f7bf'/>
<id>cee8c35d1b7101d09a1854a48f867deaa701f7bf</id>
<content type='text'>
This commit brings things back to the well known working state of the
command.
-
With commit 9620d87259572ef21f0df60988d9a932ca673779
(cmd/fdt: support single value replacement within an array)

there was an error introduced modifying (inserting) a property to a
device-tree node.
fdt_getprop(...) returnes a len with -1 for a non-existing property, but
a memcpy with len -1 isn't a good idea and things went wrong (crash).
-
Some times later Tom did repair this
with commit 99bb38e2cce9d99238458e0f6d1880c6d2e80a4d
(fdt: Check for NULL return from fdt_getprop in 'fdt set')

This repairs the crash but the behaviour of the command isn't like
before, it makes it impossible to insert a property.
-

Signed-off-by: Hannes Schmelzer &lt;oe5hpm@oevsv.at&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit brings things back to the well known working state of the
command.
-
With commit 9620d87259572ef21f0df60988d9a932ca673779
(cmd/fdt: support single value replacement within an array)

there was an error introduced modifying (inserting) a property to a
device-tree node.
fdt_getprop(...) returnes a len with -1 for a non-existing property, but
a memcpy with len -1 isn't a good idea and things went wrong (crash).
-
Some times later Tom did repair this
with commit 99bb38e2cce9d99238458e0f6d1880c6d2e80a4d
(fdt: Check for NULL return from fdt_getprop in 'fdt set')

This repairs the crash but the behaviour of the command isn't like
before, it makes it impossible to insert a property.
-

Signed-off-by: Hannes Schmelzer &lt;oe5hpm@oevsv.at&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>env: Rename getenv_hex(), getenv_yesno(), getenv_ulong()</title>
<updated>2017-08-16T12:30:32+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-08-03T18:22:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=bfebc8c965e41d62dc6355d09bdd63ca57011b99'/>
<id>bfebc8c965e41d62dc6355d09bdd63ca57011b99</id>
<content type='text'>
We are now using an env_ prefix for environment functions. Rename these
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk &lt;wd@denx.de&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We are now using an env_ prefix for environment functions. Rename these
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk &lt;wd@denx.de&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>env: Rename common functions related to setenv()</title>
<updated>2017-08-16T12:23:32+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-08-03T18:22:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=018f530323b2cc41be05be5b12375d3648f06554'/>
<id>018f530323b2cc41be05be5b12375d3648f06554</id>
<content type='text'>
We are now using an env_ prefix for environment functions. Rename these
commonly used functions, for consistency. Also add function comments in
common.h.

Suggested-by: Wolfgang Denk &lt;wd@denx.de&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We are now using an env_ prefix for environment functions. Rename these
commonly used functions, for consistency. Also add function comments in
common.h.

Suggested-by: Wolfgang Denk &lt;wd@denx.de&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>env: Rename setenv() to env_set()</title>
<updated>2017-08-16T12:22:18+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-08-03T18:22:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=382bee57f19b4454e2015bc19a010bc2d0ab9337'/>
<id>382bee57f19b4454e2015bc19a010bc2d0ab9337</id>
<content type='text'>
We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk &lt;wd@denx.de&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.

Suggested-by: Wolfgang Denk &lt;wd@denx.de&gt;
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fdt: Check for NULL return from fdt_getprop in 'fdt set'</title>
<updated>2017-07-11T16:08:20+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2017-06-13T11:10:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=99bb38e2cce9d99238458e0f6d1880c6d2e80a4d'/>
<id>99bb38e2cce9d99238458e0f6d1880c6d2e80a4d</id>
<content type='text'>
While the previous pass through fixed one place where we knew that
fdt_getprop would be given a positive len, in the case of 'fdt set' we
do not, so check that we did no get NULL from fdt_getprop().

Cc: Simon Glass &lt;sjg@chromium.org&gt;
Reported-by: Coverity (CID: 163249)
Fixes 72c98ed1ab48 ("fdt: Add a check to do_fdt() for coverity")
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While the previous pass through fixed one place where we knew that
fdt_getprop would be given a positive len, in the case of 'fdt set' we
do not, so check that we did no get NULL from fdt_getprop().

Cc: Simon Glass &lt;sjg@chromium.org&gt;
Reported-by: Coverity (CID: 163249)
Fixes 72c98ed1ab48 ("fdt: Add a check to do_fdt() for coverity")
Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fdt: Add a check to fdt_print() for coverity</title>
<updated>2017-06-12T12:38:08+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-06-07T16:28:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9f95267271c0b6cff64c5ac1b308e1e0281e9e3a'/>
<id>9f95267271c0b6cff64c5ac1b308e1e0281e9e3a</id>
<content type='text'>
We know that fdt_getprop() does not return NULL when len is &gt; 0 but
coverity does not. Add an extra check to keep it happy.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reported-by: Coverity (CID: 163248)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We know that fdt_getprop() does not return NULL when len is &gt; 0 but
coverity does not. Add an extra check to keep it happy.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reported-by: Coverity (CID: 163248)
</pre>
</div>
</content>
</entry>
<entry>
<title>fdt: Add a check to do_fdt() for coverity</title>
<updated>2017-06-12T12:38:08+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-06-07T16:28:41+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=72c98ed1ab48dbd2f3129160413dcc10565aae0c'/>
<id>72c98ed1ab48dbd2f3129160413dcc10565aae0c</id>
<content type='text'>
We know that fdt_getprop() does not return NULL when len is &gt; 0 but
coverity does not. Add an extra check to keep it happy.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reported-by: Coverity (CID: 163249)
Fixes: bc80295b (fdt: Add get commands to fdt)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We know that fdt_getprop() does not return NULL when len is &gt; 0 but
coverity does not. Add an extra check to keep it happy.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reported-by: Coverity (CID: 163249)
Fixes: bc80295b (fdt: Add get commands to fdt)
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/fdt: support single value replacement within an array</title>
<updated>2017-06-09T19:45:34+00:00</updated>
<author>
<name>Hannes Schmelzer</name>
<email>Hannes.Schmelzer@br-automation.com</email>
</author>
<published>2017-05-30T13:05:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9620d87259572ef21f0df60988d9a932ca673779'/>
<id>9620d87259572ef21f0df60988d9a932ca673779</id>
<content type='text'>
With this commit we can modify single values within an array of a dts
property.

This is useful if we have for example a pwm-backlight where we want to
modifiy the pwm frequency per u-boot script.

The pwm is described in dts like this:

backlight {
	pwms = &lt;0x0000002b 0x00000000 0x004c4b40&gt;;
};

For changing the frequency, here the 3rd parameter, we simply type:

fdt set /backlight pwms &lt;? ? 0x1E8480&gt;;

For doing all this we:
- backup the property content into our 'SCRATCHPAD'
- only modify the array-cell if the new content doesn't start with '?'

Signed-off-by: Hannes Schmelzer &lt;hannes.schmelzer@br-automation.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With this commit we can modify single values within an array of a dts
property.

This is useful if we have for example a pwm-backlight where we want to
modifiy the pwm frequency per u-boot script.

The pwm is described in dts like this:

backlight {
	pwms = &lt;0x0000002b 0x00000000 0x004c4b40&gt;;
};

For changing the frequency, here the 3rd parameter, we simply type:

fdt set /backlight pwms &lt;? ? 0x1E8480&gt;;

For doing all this we:
- backup the property content into our 'SCRATCHPAD'
- only modify the array-cell if the new content doesn't start with '?'

Signed-off-by: Hannes Schmelzer &lt;hannes.schmelzer@br-automation.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Kconfig: Drop CONFIG_CMD_FDT_MAX_DUMP</title>
<updated>2017-05-22T13:33:56+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2017-05-17T09:25:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5d927b428622800850d845b468a3165eb1c92d7b'/>
<id>5d927b428622800850d845b468a3165eb1c92d7b</id>
<content type='text'>
This option is not used by any board. Drop it.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This option is not used by any board. Drop it.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/fdt: Make fdt get value endian-safe for single-cell properties</title>
<updated>2017-01-14T17:09:46+00:00</updated>
<author>
<name>Andreas Färber</name>
<email>afaerber@suse.de</email>
</author>
<published>2017-01-09T15:08:02+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b05bf6c75d03c925737e228472b694cbeaa503c2'/>
<id>b05bf6c75d03c925737e228472b694cbeaa503c2</id>
<content type='text'>
On a Raspberry Pi 2 disagreements on cell endianness can be observed:

  U-Boot&gt; fdt print /soc/gpio@7e200000 phandle
  phandle = &lt;0x0000000d&gt;
  U-Boot&gt; fdt get value myvar /soc/gpio@7e200000 phandle; printenv myvar
  myvar=0x0D000000

Fix this by always treating the pointer as BE and converting it in
fdt_value_setenv(), like its counterpart fdt_parse_prop() already does.

Consistently use fdt32_t, fdt32_to_cpu() and cpu_to_fdt32().

Fixes: bc80295 ("fdt: Add get commands to fdt")
Cc: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
Cc: Gerald Van Baren &lt;gvb@unssw.com&gt;
Signed-off-by: Andreas Färber &lt;afaerber@suse.de&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On a Raspberry Pi 2 disagreements on cell endianness can be observed:

  U-Boot&gt; fdt print /soc/gpio@7e200000 phandle
  phandle = &lt;0x0000000d&gt;
  U-Boot&gt; fdt get value myvar /soc/gpio@7e200000 phandle; printenv myvar
  myvar=0x0D000000

Fix this by always treating the pointer as BE and converting it in
fdt_value_setenv(), like its counterpart fdt_parse_prop() already does.

Consistently use fdt32_t, fdt32_to_cpu() and cpu_to_fdt32().

Fixes: bc80295 ("fdt: Add get commands to fdt")
Cc: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
Cc: Gerald Van Baren &lt;gvb@unssw.com&gt;
Signed-off-by: Andreas Färber &lt;afaerber@suse.de&gt;
Acked-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
