<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/scripts/dtc/pylibfdt/libfdt.i_shipped, branch next</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/scripts/dtc/pylibfdt/libfdt.i_shipped?h=next</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/scripts/dtc/pylibfdt/libfdt.i_shipped?h=next'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2026-08-31T23:06:21Z</updated>
<entry>
<title>pylibfdt: Document that FdtSw.property() takes bytes</title>
<updated>2026-08-31T23:06:21Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2026-08-24T13:13:13Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=44a2a718fbe62d703a8ce2ff576d2252c7444087'/>
<id>urn:sha1:44a2a718fbe62d703a8ce2ff576d2252c7444087</id>
<content type='text'>
Commit 97de532e59be ("pylibfdt: Correct the type for fdt_property_stub()")
took two of the three hunks of the upstream change and left the docstring
saying only "Value of property", which is what prompted the type fix in
the first place.

Take the remaining hunk of dtc commit fdf3f6d897ab ("pylibfdt: Correct
the type for fdt_property_stub()").

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
[rewrite commit message for U-Boot]
Signed-off-by: Alexey Charkov &lt;alchark@flipper.net&gt;
</content>
</entry>
<entry>
<title>pylibfdt: Add add_mem_rsv() and del_mem_rsv()</title>
<updated>2026-08-31T23:06:21Z</updated>
<author>
<name>Alexey Charkov</name>
<email>alchark@flipper.net</email>
</author>
<published>2026-08-24T13:13:12Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=388137abfd0442c1bbe3df92277823d9070a2747'/>
<id>urn:sha1:388137abfd0442c1bbe3df92277823d9070a2747</id>
<content type='text'>
The memory reserve map can be read through num_mem_rsv() and
get_mem_rsv(), but changing it requires calling the raw fdt_* wrappers
with the private Fdt._fdt buffer, as the class exposes no methods for
the write side.

Add them next to the existing accessors.

This is a backport of dtc commit 89c99ce78ac8 ("pylibfdt: Add
add_mem_rsv() and del_mem_rsv()").

Link: https://github.com/dgibson/dtc/pull/190
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Alexey Charkov &lt;alchark@flipper.net&gt;
</content>
</entry>
<entry>
<title>pylibfdt: Add address_cells() and size_cells()</title>
<updated>2026-08-31T23:06:21Z</updated>
<author>
<name>Alexey Charkov</name>
<email>alchark@flipper.net</email>
</author>
<published>2026-08-24T13:13:11Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=34fddfa16d47bd97f5b11d6b36dcbda91037e02f'/>
<id>urn:sha1:34fddfa16d47bd97f5b11d6b36dcbda91037e02f</id>
<content type='text'>
Finding out how many cells a node's children use for addresses and sizes
currently requires calling the raw fdt_address_cells()/fdt_size_cells()
wrappers with the private FdtRo._fdt buffer, as the class exposes no
methods for them.

Add them to FdtRo alongside the other node accessors.

This is a backport of dtc commit 3750493c8b0f ("pylibfdt: Add
address_cells() and size_cells()").

Link: https://github.com/dgibson/dtc/pull/190
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Alexey Charkov &lt;alchark@flipper.net&gt;
</content>
</entry>
<entry>
<title>pylibfdt: Grow the FdtSw buffer geometrically</title>
<updated>2026-08-31T23:06:20Z</updated>
<author>
<name>Alexey Charkov</name>
<email>alchark@flipper.net</email>
</author>
<published>2026-08-24T13:13:10Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f3e00d4b7f365929e18395194049d569d2288f31'/>
<id>urn:sha1:f3e00d4b7f365929e18395194049d569d2288f31</id>
<content type='text'>
Every expansion copies the whole tree into a freshly allocated buffer, so
growing by a fixed amount makes building a tree cost time quadratic in
its size. This is especially painful when assembling larger FIT images with
binman, as it assembles the image with the data inline.

Grow by at least as much as the tree already holds, which is what variable
sized arrays usually do specifically to avoid such excessive copying.

With this change, building a Rockchip TF-A+Falcon image whose FIT carries
a 31 MiB kernel takes 33.1 s rather than 44.4 s, with binman itself down
from 25.3 s to 14.0 s, as 7139 reallocations become 187. The images
produced are byte-identical and the binman and dtoc test results are
unaffected.

This is a backport of dtc commit 0748c384fde6 ("pylibfdt: Grow the FdtSw
buffer geometrically").

Link: https://github.com/dgibson/dtc/pull/189
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: Alexey Charkov &lt;alchark@flipper.net&gt;
</content>
</entry>
<entry>
<title>pylibfdt: Fix a typo in the next_node() docstring</title>
<updated>2026-08-31T23:06:20Z</updated>
<author>
<name>Thomas Huth</name>
<email>thuth@redhat.com</email>
</author>
<published>2026-08-24T13:13:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=dfba3eff563cc0bb779791b10e8f78a124f4182e'/>
<id>urn:sha1:dfba3eff563cc0bb779791b10e8f78a124f4182e</id>
<content type='text'>
Spell "Tuple" correctly.

This is the pylibfdt part of dtc commit 205fbef17b7b ("Fix some typos");
the other files that commit touches carry no such typos in tree.

Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
[adapt to U-Boot, rewrite commit message accordingly]
Signed-off-by: Alexey Charkov &lt;alchark@flipper.net&gt;
</content>
</entry>
<entry>
<title>pylibfdt: Fix backwards compatibility of return values</title>
<updated>2026-08-31T23:06:20Z</updated>
<author>
<name>Brandon Maier</name>
<email>brandon.maier@gmail.com</email>
</author>
<published>2026-08-24T13:13:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0e9f9fda2e4568aae651147c1e59a0b4c394df55'/>
<id>urn:sha1:0e9f9fda2e4568aae651147c1e59a0b4c394df55</id>
<content type='text'>
When our Python functions wrap `fdt_getprop()` they return a list
containing `[*data, length]`.

In SWIG v4.2 and earlier SWIG would discard `*data` if it is NULL/None.
Causing the return value to just be `length`.

But starting in SWIG v4.3 it no longer discards `*data`. So the return
value is now `[None, length]`.

Handle this compatibility issue in libfdt.i by checking if the return
value looks like the older 4.2 return value, and casting it to the newer
style.

See https://github.com/swig/swig/pull/2907

This is a backport of dtc commit 9a969f3b70b0 ("pylibfdt/libfdt.i: fix
backwards compatibility of return values"). Its prerequisite is already
in tree as commit a63456b9191f ("scripts/dtc/pylibfdt/libfdt.i_shipped:
Use SWIG_AppendOutput").

Signed-off-by: Brandon Maier &lt;brandon.maier@gmail.com&gt;
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
[adapt to U-Boot]
Signed-off-by: Alexey Charkov &lt;alchark@flipper.net&gt;
</content>
</entry>
<entry>
<title>pylibfdt: Fix get_mem_rsv for newer Python versions</title>
<updated>2026-08-31T23:06:20Z</updated>
<author>
<name>Brandon Maier</name>
<email>brandon.maier@collins.com</email>
</author>
<published>2026-08-24T13:13:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=5b7d682e1d28383318c6d649d11aef45ed604ce8'/>
<id>urn:sha1:5b7d682e1d28383318c6d649d11aef45ed604ce8</id>
<content type='text'>
The test for get_mem_rsv fails on newer versions of Python with the
following error.

&gt; AssertionError: Lists differ:
&gt; [16045690981097406464, 1048576] != [0, 16045690981097406464, 1048576]

It appears this is because the PyTuple_GET_SIZE() function that was used
to build the fdt_get_mem_rsv() return value has changed. It now is
returning a non-zero value when it's passed an integer, which causes the
SWIG wrapper to append the returned arguments to the return error rather
then ignore them.

This is valid behaviour per Python's documentation, which says it will
"Return the size of the tuple p, which must be non-NULL and point to a
tuple; no error checking is performed"[1]. As passing an integer is not
a tuple, its return value is undefined.

Fix this issue on older and newer versions by avoiding
PyTuple_GET_SIZE() entirely. Always append the arguments to the list,
and instead use the wrapper python function to check the first argument
and then splice the last two arguments as the return value.

[1] https://docs.python.org/3/c-api/tuple.html#c.PyTuple_GET_SIZE

This is a backport of dtc commit 822123856980 ("pylibfdt: fix get_mem_rsv
for newer Python versions"), keeping the SWIG_AppendOutput() spelling
introduced by commit a63456b9191f ("scripts/dtc/pylibfdt/libfdt.i_shipped:
Use SWIG_AppendOutput").

Signed-off-by: Brandon Maier &lt;brandon.maier@collins.com&gt;
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
[adapt to U-Boot]
Signed-off-by: Alexey Charkov &lt;alchark@flipper.net&gt;
</content>
</entry>
<entry>
<title>pylibfdt: Support boolean properties</title>
<updated>2026-08-31T23:06:20Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2026-08-24T13:13:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3bf9e7e72ab545d08d9ae30bcb45027ad24609bb'/>
<id>urn:sha1:3bf9e7e72ab545d08d9ae30bcb45027ad24609bb</id>
<content type='text'>
Boolean properties are unusual in that their presense or absence
indicates the value of the property. This makes them a little painful to
support using the existing getprop() support.

Add new methods to deal with booleans specifically.

This is a backport of dtc commit 52157f13ef3d ("pylibfdt: Support boolean
properties"), without the dtc-side tests, which have no counterpart in
U-Boot's test suite.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
[adapt to U-Boot]
Signed-off-by: Alexey Charkov &lt;alchark@flipper.net&gt;
</content>
</entry>
<entry>
<title>pylibfdt: Add size_hint parameter for get_path</title>
<updated>2026-08-31T23:06:20Z</updated>
<author>
<name>Luca Weiss</name>
<email>luca@z3ntu.xyz</email>
</author>
<published>2026-08-24T13:13:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=69c95e9e4f576b811e640d1bf0ee95cf070dd542'/>
<id>urn:sha1:69c95e9e4f576b811e640d1bf0ee95cf070dd542</id>
<content type='text'>
Let the caller pick the initial buffer size, which also makes the
-NOSPACE retry path reachable from a test by passing a tiny hint.

This is a backport of dtc commit 3f29d6d85c24 ("pylibfdt: add size_hint
parameter for get_path").

Signed-off-by: Luca Weiss &lt;luca@z3ntu.xyz&gt;
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
[adapt to U-Boot]
Signed-off-by: Alexey Charkov &lt;alchark@flipper.net&gt;
</content>
</entry>
<entry>
<title>pylibfdt: Work-around SWIG limitations with flexible arrays</title>
<updated>2026-08-31T23:06:20Z</updated>
<author>
<name>Rob Herring</name>
<email>robh@kernel.org</email>
</author>
<published>2026-08-24T13:13:04Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ba6d20256305ecff8c879e2acb169aa5b0fba933'/>
<id>urn:sha1:ba6d20256305ecff8c879e2acb169aa5b0fba933</id>
<content type='text'>
SWIG cannot generate setters for a struct's flexible array member and
emits C that does not compile:

./pylibfdt/libfdt_wrap.c: In function '_wrap_fdt_node_header_name_set':
./pylibfdt/libfdt_wrap.c:4350:18: error: cast specifies array type
./pylibfdt/libfdt_wrap.c:4350:16: error: invalid use of flexible array member
./pylibfdt/libfdt_wrap.c:4613:18: error: cast specifies array type
./pylibfdt/libfdt_wrap.c:4613:16: error: invalid use of flexible array member

Turns out this is a known issue with SWIG:
https://github.com/swig/swig/issues/1699

Implement the work-around to ignore the flexible array member. U-Boot's
copy of fdt.h still declares those members as zero-length arrays, so
nothing breaks today, but carrying the work-around now keeps the shipped
file in step with upstream and avoids the failure when the C libfdt is
next resynced.

This is a backport of dtc commit abbd523bae6e ("pylibfdt: Work-around
SWIG limitations with flexible arrays").

Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Tested-by: Simon Glass &lt;sjg@chromium.org&gt;
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
[adapted to U-Boot]
Signed-off-by: Alexey Charkov &lt;alchark@flipper.net&gt;
</content>
</entry>
</feed>
