-
Notifications
You must be signed in to change notification settings - Fork 8.2k
devicetree: Update generation/API #24769
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
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
846e661
edtlib: populate standard properties for nodes without bindings
galak 0e6621a
devicetree: gen_defines: Don't require matching compat to gen defines
galak ac2c66e
edtlib: change semantics of node.enabled
galak f594580
devicetree.h: Add DT_NODE_HAS_STATUS()
galak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -200,6 +200,27 @@ static void test_has_compat(void) | |
| zassert_equal(compats, 0x3, "as bit array"); | ||
| } | ||
|
|
||
| static void test_has_status(void) | ||
| { | ||
| zassert_equal(DT_NODE_HAS_STATUS(DT_NODELABEL(test_gpio_1), okay), | ||
| 1, "vnd,gpio okay"); | ||
| zassert_equal(DT_NODE_HAS_STATUS(DT_NODELABEL(test_gpio_1), disabled), | ||
| 0, "vnd,gpio not disabled"); | ||
|
|
||
| zassert_equal(DT_NODE_HAS_STATUS(DT_NODELABEL(test_no_status), okay), | ||
| 1, "vnd,gpio okay"); | ||
| zassert_equal(DT_NODE_HAS_STATUS(DT_NODELABEL(test_no_status), disabled), | ||
| 0, "vnd,gpio not disabled"); | ||
|
|
||
| /* Disabled for now until we generate something for non-"enabled" nodes */ | ||
| #if 0 | ||
|
||
| zassert_equal(DT_NODE_HAS_STATUS(DT_NODELABEL(disabled_gpio), disabled), | ||
| 1, "vnd,disabled-compat disabled"); | ||
| zassert_equal(DT_NODE_HAS_STATUS(DT_NODELABEL(disabled_gpio), okay), | ||
| 0, "vnd,disabled-compat not okay"); | ||
| #endif | ||
| } | ||
|
|
||
| #define TEST_I2C_DEV DT_PATH(test, i2c_11112222, test_i2c_dev_10) | ||
| #define TEST_I2C_BUS DT_BUS(TEST_I2C_DEV) | ||
|
|
||
|
|
@@ -1381,6 +1402,7 @@ void test_main(void) | |
| ztest_unit_test(test_inst_checks), | ||
| ztest_unit_test(test_has_nodelabel), | ||
| ztest_unit_test(test_has_compat), | ||
| ztest_unit_test(test_has_status), | ||
| ztest_unit_test(test_bus), | ||
| ztest_unit_test(test_reg), | ||
| ztest_unit_test(test_irq), | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
So if we're moving to #25002, I think this should be removed too, right? We had discussed being able to read any property we have semantics for (at least 'reg' and 'interrupts') regardless of status.
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.
I also think things like
compat2enabledin the EDT object may need changes, since we're changing the semantics of "enabled" in C to bestatus == "okay"instead ofstatus != "disabled"and adding macros like DT_HAS_COMPAT_STATUS_OKAY in #25002. So it seems like we should be doingcompat2statusokayor something instead.In general I'm having trouble keeping all the pull requests together and I don't see enough Python changes to accompany all the C changes. What am I missing?
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.
I reworked how enabled was defined. If we want to leave that alone we can create a new 'available' which would be similar to the linux concept https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/of/base.c#n581