<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/scripts, 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?h=next</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/scripts?h=next'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2026-08-31T23:09:55Z</updated>
<entry>
<title>Merge patch series "pylibfdt: Update the U-Boot version with changes from upstream dtc"</title>
<updated>2026-08-31T23:09:55Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2026-08-31T23:09:55Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=cd5bd0cb98ececd1e2eb69d0093e4940b25c9941'/>
<id>urn:sha1:cd5bd0cb98ececd1e2eb69d0093e4940b25c9941</id>
<content type='text'>
Alexey Charkov &lt;alchark@flipper.net&gt; says:

U-Boot's copy of the libfdt Python bindings in
scripts/dtc/pylibfdt/libfdt.i_shipped was last synced wholesale in 2019,
by commit 903fe17aa8c8 ("pylibfdt: Sync up with upstream"), against dtc
commit 430419c28100. Since then it has only picked up individual fixes,
so it has drifted a long way behind dtc, which is now at v1.8.1-19.

Tom asked for an audit of the divergence when reviewing the FdtSw growth
patch [1]; this is the result. Bring in every missing change from upstream
as an individual commit, referencing its upstream sibling.

This adds: hasprop() and setprop_bool(), get_path(),
Property.as_stringlist() and the as_*int*_list() accessors,
address_cells()/size_cells(), add_mem_rsv()/del_mem_rsv(), geometric FdtSw
buffer growth, a missing Py_INCREF on the Py_None returned by the
fdt_getprop() typemap, correct get_mem_rsv() results on current Python,
and the SWIG 4.3+ return-value compatibility shim.

Not included is dtc commit 5008d1d6a356 ("pylibfdt: Replace removed SWIG
Python 2 compatibility macros"), which already landed independently as
commit 527115ef6783 ("pylibfdt: Replace removed SWIG Python 2
compatibility macros").

The first two patches are preparatory: they take the parts of two upstream
commits that earlier partial imports left behind, so the rest apply
verbatim. The last patch adds test coverage, since none of these bindings
have an in-tree caller yet and dtc's own tests for them live in
tests/pylibfdt_tests.py, which U-Boot does not carry.

Residual differences from upstream left untouched:
 - the SPDX comment style;
 - the %begin block defining PY_SSIZE_T_CLEAN, which is U-Boot's variant
   of a fix dtc applies from its build system;
 - the two %include paths, which follow U-Boot's directory layout;
 - the retry loop in FdtSw.as_fdt(), from commit 211cfa503f6c ("libfdt:
   Detected out-of-space with fdt_finish()") - U-Boot only change

CI passes all green [2]

[1] https://lore.kernel.org/u-boot/20260805-pylibfdt-geo-growth-v1-1-dabe082367e5@flipper.net/
[2] https://git.u-boot-project.org/u-boot/contributors/alchark/u-boot/-/pipelines/1047

Link: https://lore.kernel.org/r/20260824-pylibfdt-sync-v1-0-a42be6fa4872@flipper.net
</content>
</entry>
<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>
</feed>
