summaryrefslogtreecommitdiffstats
path: root/scripts/dtc/pylibfdt
Commit message (Collapse)AuthorAgeFilesLines
* pylibfdt: Rework "avoid unused variable warning" linesTom Rini2021-05-241-2/+2
| | | | | | | | | | | 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 <trini@konsulko.com>
* dtc: Update the build rule for pylibfdtSimon Glass2021-04-061-0/+1
| | | | | | | | | | | 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 <sjg@chromium.org>
* libfdt: Tidy up pylibfdt build ruleSimon Glass2021-03-261-3/+9
| | | | | | | | | | | | | | 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 <sjg@chromium.org>
* libfdt: Detected out-of-space with fdt_finish()Simon Glass2020-09-221-1/+2
| | | | | | | | | | 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 <sjg@chromium.org>
* binman: Adjust pylibfdt for incremental buildSimon Glass2020-07-241-0/+3
| | | | | | | | | | | | | | | 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 <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Revert "Merge tag 'dm-pull-20jul20' of git://git.denx.de/u-boot-dm"Tom Rini2020-07-241-3/+0
| | | | | | | | | | 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 <trini@konsulko.com>
* binman: Adjust pylibfdt for incremental buildSimon Glass2020-07-201-0/+3
| | | | | | | | | | | | | | | 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 <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* scripts: dtc: ignore files generated generated by pythonBartosz Golaszewski2019-11-231-1/+2
| | | | | | | 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 <bgolaszewski@baylibre.com>
* pylibfdt: Correct the type for fdt_property_stub()Simon Glass2019-11-041-2/+2
| | | | | | | | | | 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 <sjg@chromium.org>
* pylibfdt: Sync up with upstreamSimon Glass2019-11-041-12/+33
| | | | | | | | Sync up the libfdt Python bindings with upstream, commit: 430419c (tests: fix some python warnings) Signed-off-by: Simon Glass <sjg@chromium.org>
* pylibfdt: Convert to Python 3Simon Glass2019-11-043-3/+3
| | | | | | Build this swig module with Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
* pylibfdt: Use Python 2 in MakefileJosef Lusticky2019-01-151-1/+1
| | | | | | | | | | 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 <sjg@chromium.org>
* fdt: Add Python support for adding/removing nodesSimon Glass2018-09-281-6/+28
| | | | | | | | | 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 <sjg@chromium.org>
* libfdt: Update to latest pylibfdt implementationSimon Glass2018-08-081-225/+239
| | | | | | | | | | | | | | | | | | 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 <sjg@chromium.org>
* libfdt: Add get_property() and del_node()Simon Glass2018-07-091-0/+32
| | | | | | | Add support for these functions in the Python binding. This patch stands in for a pending upstream change. Signed-off-by: Simon Glass <sjg@chromium.org>
* libfdt: Fix the Python pack() functionSimon Glass2018-07-091-1/+5
| | | | | | | | 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 <sjg@chromium.org>
* libfdt: Bring in proposed pylibfdt changesSimon Glass2018-07-091-64/+641
| | | | | | | | | | | | | | | 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 <sjg@chromium.org>
* pylibfdt: Add missing CC and LD to MakefileMarek Vasut2018-05-231-1/+2
| | | | | | | | | | | 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 <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* SPDX: Convert all of our multiple license tags to Linux Kernel styleTom Rini2018-05-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | 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 <fabio.estevam@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* host-tools: use python2 explicitly for shebangMasahiro Yamada2018-01-281-1/+1
| | | | | | | | | | | All of these host tools are apparently written for Python2, not Python3. Use 'python2' in the shebang line according to PEP 394 (https://www.python.org/dev/peps/pep-0394/). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* pylibfdt: move pylibfdt to scripts/dtc/pylibfdt and refactor makefileMasahiro Yamada2017-11-174-0/+606
The pylibfdt is used by dtoc (and, indirectly by binman), but there is no reason why it must be generated in the tools/ directory. Recently, U-Boot switched over to the bundled DTC, and the directory structure under scripts/dtc/ now mirrors the upstream DTC project. So, scripts/dtc/pylibfdt is the best location. I also rewrote the Makefile in a cleaner Kbuild style. The scripts from the upstream have been moved as follows: lib/libfdt/pylibfdt/setup.py -> scripts/dtc/pylibfdt/setup.py lib/libfdt/pylibfdt/libfdt.i -> scripts/dtc/pylibfdt/libfdt.i_shipped The .i_shipped is coped to .i during building because the .i must be located in the objtree when we build it out of tree. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>