-
Notifications
You must be signed in to change notification settings - Fork 3
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
model: properties always appear to come from the top-level binding file #5
Comments
The PropertySec.path API in the python-devicetree library wrongly tells all properties originate from the top-level binding file, which causes the cat command to show misleading and confusing paths (see issue #5). We've proposed a patch upstream, but its review clearly is not a priority (the underlying issue has no consequence on Zephyr use of the library). Applying this patch here: - does actually fix the cat command, and does not otherwise break DTSh - can't break Zephyr in any way (will still use its own unpatched version of the python-devicetree library, see issue #2)
Fixed upstream, patch merged. |
All child bindings are initialized at once after included binding files have been merged, with the including binding file set as their origin. As a consequence, properties of child binding appear to all come from ("last modified" semantic) the top-level file. For example, properties of a channel child of an ADC controller with compatible "nordic,nrf-saadc" will all appear last modified by nordic,nrf-saadc.yaml instead of adc-controller.yaml. We should use the same approach we've already come to for property specifications: - #5 - zephyrproject-rtos/zephyr#65221
All child bindings are initialized at once after included binding files have been merged, with the top-level binding file set as their origin. As a consequence, properties of child bindings appear to all come from ("last modified" semantic) the top-level file. For example, properties of a channel child of an ADC controller with compatible "nordic,nrf-saadc" will all appear last modified by nordic,nrf-saadc.yaml instead of adc-controller.yaml. We should use the same approach we've already come to for property specifications: - #5 - zephyrproject-rtos/zephyr#65221
All child bindings are initialized at once after included binding files have been merged, with the top-level binding file set as their origin. As a consequence, properties of child bindings appear to all come from ("last modified" semantic) the top-level file. For example, properties of a channel child of an ADC controller with compatible "nordic,nrf-saadc" will all appear last modified by nordic,nrf-saadc.yaml instead of adc-controller.yaml. We should use the same approach we've already come to for property specifications: - #5 - zephyrproject-rtos/zephyr#65221
All child bindings are initialized at once after included binding files have been merged, with the top-level binding file set as their origin. As a consequence, properties of child bindings appear to all come from ("last modified" semantic) the top-level file. For example, properties of a channel child of an ADC controller with compatible "nordic,nrf-saadc" will all appear last modified by nordic,nrf-saadc.yaml instead of adc-controller.yaml. We should use the same approach we've already come to for property specifications: - #5 - zephyrproject-rtos/zephyr#65221
All child bindings are initialized at once after included binding files have been merged, with the top-level binding file set as their origin. As a consequence, properties of child bindings appear to all come from ("last modified" semantic) the top-level file. For example, properties of a channel child of an ADC controller with compatible "nordic,nrf-saadc" will all appear last modified by nordic,nrf-saadc.yaml instead of adc-controller.yaml. We should use the same approach we've already come to for property specifications: - #5 - zephyrproject-rtos/zephyr#65221
The patch didn't work for child-bidings, and introduced regressions. DTSh now implements a workaround, where it retrieves properties lineage a posteriori.
I'm reopening this until our workaround proves correct. |
Starting from a given "top-level" YAML file, down to the recursively included files we assume: - the first binding file that adds some definition (e.g. "required: true") to a property with the given name, is where the property was last modified - the first file (should it be the last ?) where we find a description for the property is where it's first specified This is a workaround for issue #5. The principle can be extended to the entire spcifications lineage (no only what we assume are the ends) if no issue arise.
Closing this: the workaround has been released with DTSh v0.2.4. |
When using the
cat
command to show the specifications of node properties, they all appear to be defined (actually last modified) by the node bindings itself, not the YAML file we would expect: e.g. all properties of " nordic,nrf52-flash-controller" devices appear to be defined bynordic,nrf52-flash-controller.yaml
, although we should also findflash-controller.yaml
,base.yaml
andpm.yaml
.An example is the
wakeup-source
property, which is defined inpm.yaml
:This is a known issue in Zephyr's Python devicetree library: edtlib: PropertySpec.path API might be incorrect or misleading #65135
A pull request has been submitted upstream: edtlib: fix last modified semantic in included property specs #65221
While this bug has absolutely no incidence on Zephyr's use of the library, this is an issue for DTSh which aims to help beginners understand Devicetree: a tool that says that the
wakeup-source
property is defined by the bindings for the "nordic,nrf52-flash-controller" compatible does not.Since we already have to repackage Zephyr's Python devicetree library (#2, #5e803eb), should we consider applying the above patch ?
The text was updated successfully, but these errors were encountered: