Skip to content

Python replacement for DTC [DNM/WIP] #5615

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

Closed
wants to merge 14 commits into from

Conversation

nashif
Copy link
Member

@nashif nashif commented Jan 9, 2018

just for sharing here, still need to resolve some of the issues with a few boards and fix the last commit to be less hackish

@codecov-io
Copy link

codecov-io commented Jan 9, 2018

Codecov Report

Merging #5615 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5615   +/-   ##
=======================================
  Coverage   51.29%   51.29%           
=======================================
  Files         440      440           
  Lines       42232    42232           
  Branches     8055     8055           
=======================================
  Hits        21665    21665           
  Misses      20048    20048           
  Partials      519      519

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d32b5c...54c4e9b. Read the comment docs.

@carlescufi
Copy link
Member

Please add:

if (NOT WIN32)
endif()

around the find_program call in cmake/host-tools.cmake

lpereira and others added 14 commits January 15, 2018 11:46
When parsing pre-processed .dts files, some nodes appear twice in the
file, causing some nodes to not appear in the parsed data.  Update the
nodes recursively.

Signed-off-by: Leandro Pereira <[email protected]>
It was not being used by any script, and parse_node() was setting it
to the `type` variable, which contains the type `type` from Python.

Signed-off-by: Leandro Pereira <[email protected]>
DTS files may be preprocessed by the C preprocessor in order to build
nodes selectively based on configuration.  When CPP touches a file,
it leaves some directives that may be used by a compiler for errors
and such; just ignore these lines as we're not going to need them.

Signed-off-by: Leandro Pereira <[email protected]>
Some files contain lines such as "chosen { };", which were not being
correctly parsed.

Signed-off-by: Leandro Pereira <[email protected]>
DTS syntax allows for the following:

	some-node {
		property-name;
	}

And the devicetree.py was converting property-name to a boolean
property with value 1.  In order to dump the DTS file, store
`{empty: True}` instead.

Signed-off-by: Leandro Pereira <[email protected]>
This script parses a .dts file preprocessed by a C preprocessor and
dumps it as a .dts.  It's simlar to what the dtc compiler does, but
without requiring a host dtc binary (which might not be available on
all platforms Zephyr supports).

Signed-off-by: Leandro Pereira <[email protected]>
With 96b_nitrogen on hello world I was observing a key error. This
patch resolves the key error.

With DTC interrupt-parent would always be set to a phandle, but with
flatten.py it is set to the name of the peripheral instead.

e.g.

        interrupt-parent = "/soc/interrupt-controller@e000e100";

vs

        interrupt-parent = <0x1>;

I don't know how all this works, so they may very well be a cleaner
solution here.

Signed-off-by: Sebastian Boe <[email protected]>
With DTC now being handled with Python, there's no need to look for it
on Windows at all. Later we might even remove the requirement on UNIX
platforms.

Signed-off-by: Carles Cufi <[email protected]>
@nashif nashif requested a review from SebastianBoe as a code owner January 15, 2018 10:48
@nashif nashif added the DNM This PR should not be merged (Do Not Merge) label Jan 17, 2018
@SebastianBoe SebastianBoe removed their request for review January 19, 2018 07:23
@carlescufi
Copy link
Member

This is not required for v1.11 since we have all pieces we need now to build natively on Windows, including dtc.

@nashif
Copy link
Member Author

nashif commented Jan 30, 2018

not needed anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DNM This PR should not be merged (Do Not Merge)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants