summaryrefslogtreecommitdiffstats
path: root/tools/dtoc/test
Commit message (Collapse)AuthorAgeFilesLines
* dtoc: Improve handling of reg propertiesSimon Glass2021-04-062-0/+51
| | | | | | | | | | | | | This existing code assumes that a reg property is larger than one cell, but this is not always the case. Fix this assumption. Also if a node's parent is missing the #address-cells and #size-cells properties we use 2 as a default for each. But this should not happen in practice. More likely the properties were removed for SPL due to there being no 'u-boot,dm-pre-reloc' property, or similar. Add a warning for this as the failure can be very confusing. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Add a subnode test for multiple nodesSimon Glass2021-03-271-0/+4
| | | | | | | | | | | | Add a new test that adds a subnode alongside an existing one, as well as adding properties to a subnode. This will expand to adding multiple subnodes in future patches. Put a node after the one we are adding to so we can check that things sync correctly. The testAddNode() test should be in the TestNode class since it is a node test, so move it. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Read aliases for uclassesSimon Glass2021-03-224-0/+232
| | | | | | | Scan the aliases in the device tree to establish the number of devices within each uclass, and the sequence number of each. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Process driver aliases along with driversSimon Glass2021-03-221-0/+4
| | | | | | | | | | | | | | Instead of using a separate step for this processing, handle it while scanning its associated driver. This allows us to drop the code coverage exception in this case. Note that only files containing drivers are scanned by dtoc, so aliases declared in a file that doesn't hold a driver will not be noticed. It would be confusing to put them anywhere other than in the driver that they relate to, but update the documentation to say this explicitly, just in case. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Rename sandbox_i2c_test and sandbox_pmic_testSimon Glass2021-03-221-2/+2
| | | | | | | These have '_test' suffixes which are not present on the drivers in the source code. Drop the suffixes to avoid a mismatch when scanning. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Move test files into a test/ directorySimon Glass2021-03-2220-0/+487
It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass <sjg@chromium.org>