summaryrefslogtreecommitdiff
path: root/scripts/dtc/pylibfdt
AgeCommit message (Collapse)Author
3 dayspylibfdt: Document that FdtSw.property() takes bytesSimon Glass
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 <[email protected]> Signed-off-by: David Gibson <[email protected]> [rewrite commit message for U-Boot] Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Add add_mem_rsv() and del_mem_rsv()Alexey Charkov
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 <[email protected]> Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Add address_cells() and size_cells()Alexey Charkov
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 <[email protected]> Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Grow the FdtSw buffer geometricallyAlexey Charkov
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 <[email protected]> Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Fix a typo in the next_node() docstringThomas Huth
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 <[email protected]> Signed-off-by: David Gibson <[email protected]> [adapt to U-Boot, rewrite commit message accordingly] Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Fix backwards compatibility of return valuesBrandon Maier
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 <[email protected]> Signed-off-by: David Gibson <[email protected]> [adapt to U-Boot] Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Fix get_mem_rsv for newer Python versionsBrandon Maier
The test for get_mem_rsv fails on newer versions of Python with the following error. > AssertionError: Lists differ: > [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 <[email protected]> Signed-off-by: David Gibson <[email protected]> [adapt to U-Boot] Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Support boolean propertiesSimon Glass
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 <[email protected]> Signed-off-by: David Gibson <[email protected]> [adapt to U-Boot] Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Add size_hint parameter for get_pathLuca Weiss
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 <[email protected]> Signed-off-by: David Gibson <[email protected]> [adapt to U-Boot] Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Work-around SWIG limitations with flexible arraysRob Herring
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]> Tested-by: Simon Glass <[email protected]> Signed-off-by: David Gibson <[email protected]> [adapted to U-Boot] Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Add FdtRo.get_path()Luca Weiss
Add a new Python method wrapping fdt_get_path() from the C API. This is a backport of dtc commit ed310803ea89 ("pylibfdt: add FdtRo.get_path()"), without the dtc-side test, which has no counterpart in U-Boot's test suite. Signed-off-by: Luca Weiss <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: David Gibson <[email protected]> [adapted to U-Boot] Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Add Property.as_*int*_array()Luca Weiss
Add new methods to handle decoding of int32, uint32, int64 and uint64 arrays. This is a backport of dtc commit a04f69025003 ("pylibfdt: add Property.as_*int*_array()"), without the dtc-side tests, which have no counterpart in U-Boot's test suite. Signed-off-by: Luca Weiss <[email protected]> Signed-off-by: David Gibson <[email protected]> [adapted to U-Boot] Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Add Property.as_stringlist()Luca Weiss
Add a new method for decoding a string list property, useful for e.g. the "reg-names" property. This is a backport of dtc commit 83102717d7c4 ("pylibfdt: add Property.as_stringlist()"), without the dtc-side test, which has no counterpart in U-Boot's test suite. Signed-off-by: Luca Weiss <[email protected]> Signed-off-by: David Gibson <[email protected]> [adapted to U-Boot] Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Fix Python crash on getprop deallocationLuca Weiss
Fatal Python error: none_dealloc: deallocating None Python runtime state: finalizing (tstate=0x000055c9bac70920) Current thread 0x00007fbe34e47740 (most recent call first): <no Python frame> Aborted (core dumped) This is caused by a missing Py_INCREF on the returned Py_None, as demonstrated e.g. in https://github.com/mythosil/swig-python-incref or described at https://edcjones.tripod.com/refcount.html ("Remember to INCREF Py_None!") A PoC for triggering this crash is uploaded to https://github.com/z3ntu/pylibfdt-crash . With this patch applied to pylibfdt the crash does not happen. This is a backport of dtc commit d152126bb029 ("Fix Python crash on getprop deallocation"). Signed-off-by: Luca Weiss <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: David Gibson <[email protected]> [adapted to U-Boot] Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Restore the upstream bytearray() in getprop()Alexey Charkov
Commit 903fe17aa8c8 ("pylibfdt: Sync up with upstream") replaced the bytearray() that dtc uses here with bytes(), without saying why. The result is the same either way, since Property derives from bytearray and copies whatever it is handed, so restore the upstream spelling to keep the shipped file mechanically comparable with dtc. Signed-off-by: Alexey Charkov <[email protected]>
3 dayspylibfdt: Cast property length to Py_ssize_tAlexey Charkov
Commit 7d01bb1c5a1d ("libfdt: Fix build with python 3.10") took only half of the upstream fix, dtc commit 383e148b70a4 ("pylibfdt: fix with Python 3.10"): it defines PY_SSIZE_T_CLEAN but leaves the length argument passed to Py_BuildValue() as a plain int. With PY_SSIZE_T_CLEAN in effect the "y#" and "s#" converters read a Py_ssize_t, so passing an int is undefined behaviour that happens to work only where the two share a representation. Take the remaining hunk so the typemap matches upstream and the subsequent upstream imports apply verbatim. Signed-off-by: Alexey Charkov <[email protected]>
2026-08-13pylibfdt: Replace removed SWIG Python 2 compatibility macrosJaipaul Cheernam
SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*) from its runtime header pyhead.swg (see commit 79f7a2b7cb7d). Replace them with their Python 3 C API equivalents: - PyString_FromString -> PyUnicode_FromString - PyString_AsString -> PyBytes_AsString - PyInt_AsLong -> PyLong_AsLong The replacements are safe since the macros were already aliased to these exact functions in SWIG's Python 3 code path. This is a backport of dtc commit 5008d1d6a356 ("pylibfdt: Replace removed SWIG Python 2 compatibility macros"). Signed-off-by: Jaipaul Cheernam <[email protected]> Reviewed-by: Jérémie Dautheribes <[email protected]> Tested-by: Jérémie Dautheribes <[email protected]> Signed-off-by: Peter Robinson <[email protected]> Reviewed-by: Peter Robinson <[email protected]>
2026-01-12Merge patch series "a few test.py improvements"Tom Rini
David Lechner <[email protected]> says: While trying to run the test suite for the first time, I encountered a few minor issues. Here are a few patches to address them. Link: https://lore.kernel.org/r/20260105-a-few-test-py-improvements-v3-0-fea38243ca5b@baylibre.com
2026-01-12pylibfdt: add requirements.txt for setuptoolsDavid Lechner
Add a requirements.txt file to the pylibfdt script directory to specify setuptools as a dependency. This follows the pattern of each tool in U-Boot having its own requirements.txt file. The version is set to 78.1.1 to avoid conflict with the same in tools/patman/requirements.txt. Reviewed-by: Simon Glass <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]> # sandbox Reviewed-by: Mattijs Korpershoek <[email protected]> Signed-off-by: David Lechner <[email protected]>
2026-01-02kbuild: Bump the build system to 6.1Sughosh Ganu
Our last sync with the kernel was 5.1. We are so out of sync now, that tracking the patches and backporting them one by one makes little sense and it's going to take ages. This is an attempt to sync up Makefiles to 6.1. Unfortunately due to sheer amount of patches this is not easy to review, but that's what we decided during a community call for the bump to 5.1, so we are following the same guidelines here. Signed-off-by: Sughosh Ganu <[email protected]> Signed-off-by: Ilias Apalodimas <[email protected]>a #rebased on -next
2025-08-07pylibfdt: setup.py: Drop license_filesTom Rini
On more recent versions of setuptools the warning about not being able to find the files specified in license_files has re-appeared. This is because as best I can tell, it can't and won't look in $(srctree) but rather only subdirectories of scripts/dtc/pylibfdt. Since we already provide both SPDX tags and a license field with the SPDX contents, let us just drop license_files as it's not mandatory. Signed-off-by: Tom Rini <[email protected]>
2025-06-26pylibfdt: correct license information (further)Quentin Schulz
Since commit 51ec8db23280 ("pylibfdt: correct license information"), the License classifiers are gone so I assume setuptools now extract the license from the license argument to setuptools.setup() function. It's always been incorrect as far as I could tell, so let's fix this with the appropriate info from the SPDX License identifier at the top of the file. It was missing GPL-2.0-or-later and we disambiguate by using BSD-2-Clause instead of simply BSD. Fixes: 6b08fb5cc44f ("fdt: Move to setuptools") Signed-off-by: Quentin Schulz <[email protected]>
2025-06-09pylibfdt: correct license informationHeinrich Schuchardt
Setuptools 78.1.1 shows warnings: * Pattern 'GPL' did not match any files. * Pattern 'BSD-2-Clause' did not match any files. * SetuptoolsDeprecationWarning: License classifiers are deprecated. Cf. https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Bryan Brattlof <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2024-10-30scripts/dtc/pylibfdt/libfdt.i_shipped: Use SWIG_AppendOutputMarkus Volk
Swig has changed language specific AppendOutput functions. The helper macro SWIG_AppendOutput remains unchanged. Use that instead of SWIG_Python_AppendOutput, which would require an extra parameter since swig 4.3.0. /home/flk/poky/build-test/tmp/work/qemux86_64-poky-linux/u-boot/2024.10/git/arch/x86/cpu/u-boot-64.lds | scripts/dtc/pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_next_node’: | scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’ | 5581 | resultobj = SWIG_Python_AppendOutput(resultobj, val); | | ^~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Markus Volk <[email protected]> Reported-by: Rudi Heitbaum <[email protected]> Link: https://github.com/dgibson/dtc/pull/154
2024-03-01pylibfdt: Fix "invalid escape sequence '\w'" in setup.pyFlorian Schmaus
Once u-boot's build system invokes python3 scripts/dtc/pylibfdt/setup.py --quiet build_ext --inplace it may fail with scripts/dtc/pylibfdt/setup.py:40: SyntaxWarning: invalid escape sequence '\w' RE_KEY_VALUE = re.compile('(?P<key>\w+) *(?P<plus>[+])?= *(?P<value>.*)$') depending on the used Python version. Explicitly mark the regex string as raw string to avoid the warning. Signed-off-by: Florian Schmaus <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2023-01-07pylibfdt: Allow version normalization to failTom Rini
In some cases, we might not have the sic portion of setuputils available. Make our import and use of this be done in try/except blocks as this is done to suppress a run-time warning that is otherwise non-fatal. Reported-by: Pali Rohár <[email protected]> Fixes: 141659187667 ("pylibfdt: Fix disable version normalization") Signed-off-by: Tom Rini <[email protected]>
2023-01-06pylibfdt: Fix disable version normalizationPhilippe Schenker
On Arch Linux based systems python setuptools does not contain "setuptools.extern" hence it is failing with the following error-message: " ModuleNotFoundError: No module named 'setuptools.extern' " According to a eschwartz `setuptools.extern` is not a public API and shall not be assumed to be present in the setuptools package. He mentions that the setuptools project anyway wants to drop this. [1] Use the correct solution introduced by python setuptools developers to disable normalization. [2] [1] https://bbs.archlinux.org/viewtopic.php?id=259608 [2] https://github.com/pypa/setuptools/pull/2026 Fixes: 440098c42e73 ("pylibfdt: Fix version normalization warning") Signed-off-by: Philippe Schenker <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-12-22pylibfdt: Fix version normalization warningMarek Vasut
Fix the following version normalization warning: " /usr/lib/python3/dist-packages/setuptools/dist.py:530: UserWarning: Normalizing '2023.01' to '2023.1' " Using suggestion from Richard Jones: https://github.com/pypa/setuptools/issues/308#issuecomment-405817468 Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-10-29fdt: Move to setuptoolsSimon Glass
The distutils package is deprecated. The upstream libfdt repo uses setuptools for building the pylibfdt module, so bring in that code, suitably modified for U-Boot. Also bring in the README. The modifications include setting the version correctly, making use of the environment variables provided by the Makefile and various tweaks to the directories. Note that the version omits the minus character at the start of EXTRAVERSION, since this creates a warning. The build is really just used within U-Boot itself, so it doesn't matter too much if the version matches upstream, or exactly matches U-Boot. Signed-off-by: Simon Glass <[email protected]>
2022-10-29libfdt: Fix build with python 3.10Michal Suchanek
Python 3.10 requires defining PY_SSIZE_T_CLEAN. This will be fixed in swig 4.10 but it is not clear when it will be released. There was a warning since python 3.8. Link: https://github.com/swig/swig/pull/2277 Signed-off-by: Michal Suchanek <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-10-29libfdt: Fix invalid version warningMichal Suchanek
python does not like the u-boot- prefix in the version, drop it. /usr/lib/python3.10/site-packages/setuptools/dist.py:544: UserWarning: The version specified ('u-boot-2022.10') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details. Signed-off-by: Michal Suchanek <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2021-05-24pylibfdt: Rework "avoid unused variable warning" linesTom Rini
Clang has -Wself-assign enabled by default under -Wall and so when building with -Werror we would get an error here. Inspired by Linux kernel git commit a21151b9d81a ("tools/build: tweak unused value workaround") make use of the fact that both Clang and GCC support casting to `void` as the method to note that something is intentionally unused. Signed-off-by: Tom Rini <[email protected]>
2021-04-06dtc: Update the build rule for pylibfdtSimon Glass
Some versions of make complain about using a grouped target without a recipe: .../pylibfdt/Makefile:36: *** grouped targets must provide a recipe. Stop. Fix this by adding a dummy recipe. Signed-off-by: Simon Glass <[email protected]>
2021-03-26libfdt: Tidy up pylibfdt build ruleSimon Glass
At present the build rule for pylibfdt depends on _libfdt.so but modern Python versions add a different suffix to the output file, resulting in something like _libfdt.cpython-38-x86_64-linux-gnu.so The result is that pylibfdt is rebuilt every time. Rename the file the standard name so that the rule works correctly. Also add libfdt.py to the dependencies, so that file is always created if missing. Signed-off-by: Simon Glass <[email protected]>
2020-09-22libfdt: Detected out-of-space with fdt_finish()Simon Glass
At present the Python sequential-write interface can produce an error when it calls fdt_finish(), since this needs to add a terminating tag to the end of the struct section. Fix this by automatically expanding the buffer if needed. Signed-off-by: Simon Glass <[email protected]>
2020-07-24binman: Adjust pylibfdt for incremental buildSimon Glass
If the pylibfdt shared-object file is detected, then Python assumes that the libfdt.py file exists also. Sometimes when an incremental build aborts, the shared-object file is built but the libfdt.py is not. The only way out at this point is to use 'make mkproper', or similar. Fix this by removing the .so file before it is built. This seems to make Python rebuild everything. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2020-07-24Revert "Merge tag 'dm-pull-20jul20' of git://git.denx.de/u-boot-dm"Tom Rini
This reverts commit 5d3a21df6694ebd66d5c34c9d62a26edc7456fc7, reversing changes made to 56d37f1c564107e27d873181d838571b7d7860e7. Unfortunately this is causing CI failures: https://travis-ci.org/github/trini/u-boot/jobs/711313649 Signed-off-by: Tom Rini <[email protected]>
2020-07-20binman: Adjust pylibfdt for incremental buildSimon Glass
If the pylibfdt shared-object file is detected, then Python assumes that the libfdt.py file exists also. Sometimes when an incremental build aborts, the shared-object file is built but the libfdt.py is not. The only way out at this point is to use 'make mkproper', or similar. Fix this by removing the .so file before it is built. This seems to make Python rebuild everything. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2019-11-23scripts: dtc: ignore files generated generated by pythonBartosz Golaszewski
Add __pycache__ to ignored files and extend the rule for _libfdt to also include generated shared objects (e.g. _libfdt.cpython-37m-x86_64-linux-gnu.so). Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-11-04pylibfdt: Correct the type for fdt_property_stub()Simon Glass
This function should use a void * type, not char *. This causes an error: TypeError: in method 'fdt_property_stub', argument 3 of type 'char const *' Fix it. Signed-off-by: Simon Glass <[email protected]>
2019-11-04pylibfdt: Sync up with upstreamSimon Glass
Sync up the libfdt Python bindings with upstream, commit: 430419c (tests: fix some python warnings) Signed-off-by: Simon Glass <[email protected]>
2019-11-04pylibfdt: Convert to Python 3Simon Glass
Build this swig module with Python 3. Signed-off-by: Simon Glass <[email protected]>
2019-01-15pylibfdt: Use Python 2 in MakefileJosef Lusticky
pylibfdt needs Python 2 to build. Replace $(PYTHON) with $(PYTHON2) in pylibfdt Makefile to ensure Python 2 is used to build it. This fixes build on systems where Python 3 is the default version of the "python" interpreter. Reviewed-by: Simon Glass <[email protected]>
2018-09-28fdt: Add Python support for adding/removing nodesSimon Glass
Pull this support from these upstream commits: bfbfab0 pylibfdt: Add a means to add and delete notes 9005f41 pylibfdt: Allow delprop() to return errors Signed-off-by: Simon Glass <[email protected]>
2018-08-08libfdt: Update to latest pylibfdt implementationSimon Glass
The enhanced pylibfdt support in U-Boot needed for binman was a placeholder while upstreaming of this work continued. This is now complete, so bring in the changes and update the tools as needed. There are quite a few changes since we decided to split the implementation into three fdt classes instead of two. The Fdt.del_node() method was unfortunately missed in this process and will be dealt with later. It exists in U-Boot but not upstream. Further syncing of libfdt probably needs to wait until we assess the code-size impact of all the new checking code on SPL and possibly provide a way to disable it. Signed-off-by: Simon Glass <[email protected]>
2018-07-09libfdt: Add get_property() and del_node()Simon Glass
Add support for these functions in the Python binding. This patch stands in for a pending upstream change. Signed-off-by: Simon Glass <[email protected]>
2018-07-09libfdt: Fix the Python pack() functionSimon Glass
This currently fails to reduce the device-tree bytearray size. Fix this. This stands in for a pending upstream change. Signed-off-by: Simon Glass <[email protected]>
2018-07-09libfdt: Bring in proposed pylibfdt changesSimon Glass
This provides various patches sent to the devicetree-compiler mailing list to enhance the Python bindings. A final version of this patch may be created once upstreaming is complete, but if it takes too long, this can act as a placeholder. New pylibfdt features: - Support for most remaining, relevant libfdt functions - Support for sequential-write functions Changes are applied to existing U-Boot tools as needed. Signed-off-by: Simon Glass <[email protected]>
2018-05-23pylibfdt: Add missing CC and LD to MakefileMarek Vasut
Add missing CC and LDSHARED variables to the Makefile to pass the correct C compiler and linker path to the build of _libfdt.so . Signed-off-by: Marek Vasut <[email protected]> Cc: Tom Rini <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Simon Glass <[email protected]> Reviewed-by: Masahiro Yamada <[email protected]>
2018-05-07SPDX: Convert all of our multiple license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have multiple licenses (in these cases, dual license) declared in the SPDX-License-Identifier tag. In this case we change from listing "LICENSE-A LICENSE-B" or "LICENSE-A or LICENSE-B" or "(LICENSE-A OR LICENSE-B)" to "LICENSE-A OR LICENSE-B" as per the Linux Kernel style document. Note that parenthesis are allowed so when they were used before we continue to use them. Reviewed-by: Fabio Estevam <[email protected]> Signed-off-by: Tom Rini <[email protected]>