aboutsummaryrefslogtreecommitdiff
path: root/tools/dtoc
AgeCommit message (Collapse)Author
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-07common.h: Remove this file and all referencesTom Rini
With all files that had included this file directly having been updated, we can now remove this file. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-03-01dtoc: avoid invalid escape sequence '\s'Heinrich Schuchardt
\s is not a valid escape sequence in strings. Mark regular expressions with r''. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-01-04dtoc: Change dst to self in debug messageManorit Chawdhry
Fix the error message to not use dst and use self as it is copying the properties to self. While using templating if there are no subnodes defined, we end up in this situation where "dst" isn't defined and it tries to print the error message and fails. 'UnboundLocalError: local variable 'dst' referenced before assignment' Fixes: 55e1278d5eca ("dtoc: Allow inserting a list of nodes into another") Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-12-13tools: Move python tools to version 0.0.6Simon Glass
A new release has been done with this version, so update it. Use the version numbers in dependencies also. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-12-13doc: Update documentation URLSimon Glass
Update to use the new docs.u-boot.org URL for documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-28Revert "binman: Add a temporary hack for duplicate phandles"Simon Glass
The affected boards have been fixed, so drop this hack. This reverts commit 288ae53cb73605500b7fc01e5919753c878466be. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Tim Harvey <tharvey@gateworks.com>
2023-08-02binman: Add a temporary hack for duplicate phandlesSimon Glass
Three boards use a phandle in a FIT generator and the maintainer is away. For now, add a hack to allow this. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-02fdt: Allow copying phandles into templatesSimon Glass
Allow phandles to be copied over from a template. This can potentially cause duplicate phandles, so detect this and report an error. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-02dtoc: Add some debugging when copying nodesSimon Glass
Show the operations being performed, when debugging is enabled. Convert a mistaken 'print' in test_copy_subnodes_from_phandles() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-02dtoc: Make properties dirty when purging themSimon Glass
Without the 'dirty' flag properties are not written back to the devicetree when synced. This means that new properties copied over to a node are not always written out. Fix this and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20dtoc: Allow inserting a list of nodes into anotherSimon Glass
Provide a way to specify a phandle list of nodes which are to be inserted into an existing node. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20dtoc: Support copying the contents of a node into anotherSimon Glass
This permits implementation of a simple templating system, where a node can be reused as a base for others. For now this adds new subnodes after any existing ones. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-05-04tools: fix TestFdtUtil()Heinrich Schuchardt
Variable old_outdir cannot be used before assignment. The assignment must occur before the try block. tools/dtoc/test_fdt.py:796:26: E0601: Using variable 'old_outdir' before assignment (used-before-assignment) Add missing space in assignment. Fixes: a004f29464d1 ("binman: Tidy up _SetupDtb() to use its own temporary file") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08dtoc: Add support for building a dtoc PyPi packageSimon Glass
Create the necessary files to build this new package. This is needed for binman. Move the main program into a function so that it can easily be called by the PyPi-created script. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08dtoc: Use pathlib to find the test directorySimon Glass
Update this so that the directory being used is declared at the top of the file. Use pathlib as it seems to be more modern. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08dtoc: Move the main code into a functionSimon Glass
Put this code into a function so it is easy for it be run when packaged. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08dtoc: Hide the test options unless test code is availableSimon Glass
It doesn't make much sense to expose tests when dtoc is running outside of the U-Boot git checkout. Hide the option in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08patman: Move library functions into a library directorySimon Glass
The patman directory has a number of modules which are used by other tools in U-Boot. This makes it hard to package the tools using pypi since the common files must be copied along with the tool that uses them. To address this, move these files into a new u_boot_pylib library. This can be packaged separately and listed as a dependency of each tool. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-14dm: doc: Move to new driver model schemaSimon Glass
Now that Linux has accepted these tags, update the dtoc tool to use them. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-14dm: treewide: Complete migration to new driver model schemaSimon Glass
Update various build and test components to use the new schema. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18dtoc: Add a way to read a phandle with paramsSimon Glass
Add a function to read a phandle and associated name and offset. This is useful for binman. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-12dtoc: Drop sys.exit() in test_fdtSimon Glass
This breaks using pytest to run the tests. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-09dtoc: Correct remaining pylint problems in test_fdtSimon Glass
Fix various camel-case and other naming problems. Update the pylint base file to avoid regressions. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-09test_fdt: Convert to use argparseSimon Glass
Drop the deprecated OptionParser. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-09dtoc: Move main program into its own functionSimon Glass
Use a function for the main program so everything there doesn't look like a global variable to pylint. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-09dtoc: Fix fdt test coverageSimon Glass
Fix a bug that the --processes option was ignored, thus resulting in no test coverage information being generated. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 42ae363ddd9 ("dtoc: Update fdt tests to use test_util")
2022-08-09dtoc: Tidy up fdt_tests RunTests()Simon Glass
Pass the options args in rather than using the global variables. Use snake case, fix up comments and use a ternary operator to make pylint happy. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-09dtoc: Tidy up fdt_tests RunTestCoverage() argsSimon Glass
Pass the options args in rather than using the global various. Use snake case and fix up comments to make pylint happy. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-06-28dm: core: Support accessing core tagsSimon Glass
At present tag numbers are only allocated for non-core data, meaning that the 'core' data, like priv and plat, are accessed through dedicated functions. For debugging and consistency it is convenient to use tags for this 'core' data too. Add support for this, with new tag numbers and functions to access the pointer and size for each. Update one of the test drivers so that the uclass-private data can be tested here. There is some code duplication with functions like device_alloc_priv() but this is not addressed for now. At some point, some rationalisation may help to reduce code size, but more thought it needed on that. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-06-28dm: core: Switch the testbus driver to use a new structSimon Glass
At present this driver uses 'priv' struct to hold 'plat' data, which is confusing. The contents of the strct don't matter, since only dtoc is using it. Create a new struct with the correct name. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-06-28patman: test_util: Use unittest text runner to print test resultsAlper Nebi Yasak
The python tools' test utilities handle printing test results, but the output is quite bare compared to an ordinary unittest run. Delegate printing the results to a unittest text runner, which gives us niceties like clear separation between each test's result and how long it took to run the test suite. Unfortunately it does not print info for skipped tests by default, but this can be handled later by a custom test result subclass. It also does not print the tool name; manually print a heading that includes the toolname so that the outputs of each tool's tests are distinguishable in the CI output. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-28dtoc: Update fdt tests to use test_utilSimon Glass
Use the common functions to run tests and report results. Ensure that the result code indicates success or failure. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-06-14dtoc: Update test_src_scan.py for new tegra compatiblesTom Rini
This test was written to match up with the list of compatibles in drivers/i2c/tegra_i2c.c so adding another one requires the test to be updated to match. Fixes: 0d2105ae5e32 ("arm: tegra: Update some DT compatibles") Signed-off-by: Tom Rini <trini@konsulko.com>
2022-03-18dtoc: Tidy up implementation of AddStringList()Simon Glass
Refactor this to avoid a loop. Also add a test for an empty string. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-03-18dtoc: Make GetArgs() more flexibleSimon Glass
At present it is not possible to have arguments which include spaces. Update the function to only split the args if the property is a single string. This is a bit inconsistent, but might still be useful. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-03-02dtoc: Correct pylint errorsSimon Glass
Fix pylint errors in this directory. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-22dtoc: Support reading a list of argumentsSimon Glass
It is helpful to support a string or stringlist containing a list of space-separated arguments, for example: args = "-n fred", "-a", "123"; This resolves to the list: -n fred -a 123 which can be passed to a program as arguments. Add a helper to do the required processing. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-22dtoc: Allow deleting nodes and adding them in the same syncSimon Glass
This does not work at present, since the current algorithm assumes that either there are no nodes or all nodes have an offset. If a node is new, but an old node is still in the tree, then syncing fails due to this assumption. Fix it and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-22dtoc: Support deleting a nodeSimon Glass
Add a function to delete a node. This is synced to the tree when requested. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-22dtoc: Support adding a string list to a device treeSimon Glass
Add a new function to add a string list. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in test_util.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in command.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-09patman: Convert camel case in tools.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-08patman: Update test_util to run doc testsSimon Glass
At present this function does not run the doctests. Allow the caller to pass these modules in as strings. Update patman to use this. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-24tools: Add init files for Python toolsSimon Glass
Add some empty __init__ files for binman, buildman and dtoc so that pylint is able to recognise these as Python modules and produce more useful pylint output. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-24dtoc: Fix up a code comment that confuses pylintSimon Glass
This produces a pylint error at present. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-05dtoc: Add support for reading string-list propertiesSimon Glass
Add a function to read a list of strings from the devicetree. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-02dtoc: Add support for reading fixed-length bytes propertiesSimon Glass
Add functions to read a sequence of bytes from the devicetree. Signed-off-by: Simon Glass <sjg@chromium.org>