Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous devicetree improvements and cleanups #55105

Merged

Conversation

mbolivar-nordic
Copy link
Contributor

This is a subset of the patches in #52272 that are standalone improvements and can IMO be merged now.

Copy link
Collaborator

@galak galak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you pull the cmake change into its own PR. Thus @tejlmand can review that separately from the python lib changes.

Copy link
Collaborator

@galak galak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also split out the 'python-devicetree: re-work reg and ranges handling ' commit into its own PR. All the other cleanup commits look good and will +1 (after the minor fix that was already mentioned).

Adding 'reg' and 'ranges' to dtlib.py concerns me as dtlib doesn't generally have much understanding of the contents of the tree. I think it best to try and maintain that abstraction/separation. I'd rather see 'reg' and 'ranges' add to edtlib.py.

@mbolivar-nordic
Copy link
Contributor Author

I'd rather see 'reg' and 'ranges' add to edtlib.py.

That would defeat the purpose of being able to use them in sysdtlib, though, where we aren't using edtlib (because we don't need any bindings), but we still need to understand the DTSpec portions of the tree (to rewrite registers).

The standard way we write this in the library is 'documentation
string', not 'docstring'.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
@mbolivar-nordic mbolivar-nordic force-pushed the devicetree-prep-for-sysdt branch from 59cd151 to 407c402 Compare February 23, 2023 19:26
Introduce a context manager that will save some typing
when dealing with expected exceptions.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Using dtlib_raises() throughout the test cases saves some typing.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This helper lets you place a node (really the entire subtree rooted at
that node) elsewhere in the devicetree. This will be useful when
adding system devicetree support, when we'll want to be able to, for
example, move the CPU cluster node selected by the current execution
domain to /cpus.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
There's no need for _parse_node() to return the Node instance that is
its sole argument. The only user of the return value is a dead store.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The following section of code has nothing public inside.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This allows mypy to check the internal variable type annotations
within the function.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
We need to have an _include_path attribute to pretty-print
this object from within pdb, for some reason. Add it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Trivial fix.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
galak
galak previously approved these changes Feb 23, 2023
This will make it more convenient to use it from multiple different
places, which we will have a need for in the future.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
@mbolivar-nordic
Copy link
Contributor Author

@galak sorry, I caught an issue and pushed another change

@galak
Copy link
Collaborator

galak commented Feb 23, 2023

@galak sorry, I caught an issue and pushed another change

Hmm, what's up with the scancode license?

@mbolivar-nordic
Copy link
Contributor Author

Hmm, what's up with the scancode license?

I asked about this in #ci yesterday but got no response

@stephanosio
Copy link
Member

@galak sorry, I caught an issue and pushed another change

Hmm, what's up with the scancode license?

Nothing. License check failure on any non-Apache 2.0 files being added to the tree is normal. If sanctioned, the check failure can be overridden.

@mbolivar-nordic
Copy link
Contributor Author

mbolivar-nordic commented Feb 24, 2023 via email

@carlescufi carlescufi merged commit 513e03a into zephyrproject-rtos:main Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants