-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
dts: Add new DTS/binding parser #17660
Conversation
ulfalizer
commented
Jul 18, 2019
•
edited
Loading
edited
Found the following issues, please fix and resubmit: License issuesIn most cases you do not need to do anything here, especially if the files
|
ca6930f
to
219ad8a
Compare
f54be4d
to
2d7ee87
Compare
scripts/dts/gen_defines.py
Outdated
|
||
out_comment("/chosen/{} ({})".format(prop_name, dev.path)) | ||
out("{}_BASE_ADDRESS".format(prefix), hex(dev.regs[0].addr)) | ||
out("SRAM_SIZE", dev.regs[0].size//1024) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this missing prefix
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops... fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't build nucleo_f401re board (sample hello_world), due to missing symbol CONFIG_RAM_SIZE
It is defined in arch/Kconfig
:
config SRAM_SIZE
int "SRAM Size in kB"
default $(dt_int_val,DT_SRAM_SIZE)
DT_SRAM_SIZE
is not defined anymore
EDIT: Seems it has been replaced by:
#define DT_SRAM_SRAM_SIZE 96
Cf fix in scripts/dts/gen_defines.py
, line 318:
- out("{}_SRAM_SIZE".format(prefix), dev.regs[0].size//1024)
+ out("{}_SIZE".format(prefix), dev.regs[0].size//1024)
Fixed by the latest force push. Thought I could make a small change without diffing |
(Slack is broken to me so pasting my point here) |
@erwango The order in the conf and header file matches the order in the .dts file now, so it should be consistent at least. Would be pretty easy to change though, if you have some case where that order is bad. |
This is not that I see, actually. For instance nucleo_f401re board, gpio nodes order: |
@erwango diff --git a/scripts/dts/gen_defines.py b/scripts/dts/gen_defines.py
index 720c297615..9d8c43a9c7 100755
--- a/scripts/dts/gen_defines.py
+++ b/scripts/dts/gen_defines.py
@@ -72,7 +72,7 @@ def main():
active_compats.update(dev.compats)
out_comment("Active compatibles (mentioned in DTS + binding found)")
- for compat in active_compats:
+ for compat in sorted(active_compats):
#define DT_COMPAT_<COMPAT> 1
out("COMPAT_{}".format(str2ident(compat)), 1)
|
@erwango |
Tried your proposal, but it didn't work (didn't help sorting devices). But as I understand, this aims at sorting compatibles and not devices, so this is logical. |
@erwango The rest of it is consistent for me, so I'm guessing it's because you have Python 3.5. Could you post a diff between runs? Would help with figuring out where it's coming from. |
--deprecate-only sounded like a command to "only deprecate (something)" to me at first. --deprecated-only might make it clearer that it's about only generating deprecated stuff. Signed-off-by: Ulf Magnusson <[email protected]>
Add a new DTS/binding parser to scripts/dts/ for generating generated_dts_board.conf and generated_dts_board_unfixed.h. The old code is kept to generate some deprecated defines, using the --deprecated-only flag. It will be removed later. The new parser is implemented in three files in scripts/dts/: dtlib.py: A low-level .dts parsing library. This is similar to devicetree.py in the old code, but is a general robust DTS parser that doesn't rely on preprocessing. edtlib.py (e for extended): A library built on top of dtlib.py that brings together data from DTS files and bindings and creates Device instances with all the data for a device. gen_defines.py: A script that uses edtlib.py to generate generated_dts_board.conf and generated_dts_board_unfixed.h. Corresponds to extract_dts_includes.py and the files in extract/ in the old code. testdtlib.py: Test suite for dtlib.py. Can be run directly as a script. testedtlib.py (uses test.dts and test-bindings/): Test suite for edtlib.py. Can be run directly as a script. The test suites will be run automatically in CI. The new code turns some things that were warnings (or not checked) in the old code into errors, like missing properties that are specified with 'category: required' in the binding for the node. The code includes lots of documentation and tries to give helpful error messages instead of Python errors. Co-authored-by: Kumar Gala <[email protected]> Signed-off-by: Ulf Magnusson <[email protected]>
Makes it easier to understand what's going on. Signed-off-by: Ulf Magnusson <[email protected]>
zephyrproject-rtos/zephyr#17660 must go in before this will work. Piggyback a clarification re. ZEPHYR_BASE being None when not running on a Zephyr tree (e.g. when running on the ci-tools repo itself). Signed-off-by: Ulf Magnusson <[email protected]>
zephyrproject-rtos#17660 must go in before this will work. Piggyback a clarification re. ZEPHYR_BASE being None when not running on a Zephyr tree (e.g. when running on the ci-tools repo itself). Signed-off-by: Ulf Magnusson <[email protected]>