-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
devicetree: bus:
does not work in child-binding
#32071
Comments
@kurddt Thank you for the detailed report. This is an interesting case; I've never run into the TCA9546A. Let me confirm the problem. In debug_sep.h, I see the following bus macros generated for /* Bus info (controller: '/soc/i2c@40004000/tca9546a@3B/mux_i2c@0', type: 'i2c') */
#define DT_N_S_soc_S_i2c_40004000_S_tca9546a_3b_S_mux_i2c_0_S_tmp116_49_BUS_i2c 1
#define DT_N_S_soc_S_i2c_40004000_S_tca9546a_3b_S_mux_i2c_0_S_tmp116_49_BUS DT_N_S_soc_S_i2c_40004000_S_tca9546a_3b_S_mux_i2c_0 This is what you want. The In debug_child.h, I see these instead: /* Bus info (controller: '/soc/i2c@40004000', type: 'i2c') */
#define DT_N_S_soc_S_i2c_40004000_S_tca9546a_3b_S_mux_i2c_0_S_tmp116_49_BUS_i2c 1
#define DT_N_S_soc_S_i2c_40004000_S_tca9546a_3b_S_mux_i2c_0_S_tmp116_49_BUS DT_N_S_soc_S_i2c_40004000 This is not what you want. This binding results in the bus pointing at the twim device, which is the wrong bus. I don't see anything wrong with bindings_2/i2c-tca9546a.yaml and I agree this looks like a bug at this point. I'm investigating. |
@mbolivar-nordic I looked and tested your fix. Would it be possible to have the same behavior when the child node does not have any compatible? In my use case this binding will not be used anywhere in the driver code, the parent device will create the child devices.
|
Thanks for testing!
Not easily with the current tooling, I'm afraid. |
Ok, I think we can close this ticket when your fix is merged then, thank you for working on it. I will create a new enhancement request for the child compatible unless @mbolivar-nordic you prefer to do so yourself ? |
Please go ahead, thanks. |
Whenever a child-binding: dict has a compatible, we ought to make that available in EDT._compat2binding. If we don't, we can't look it up later. This has adverse effects like missing child bindings which describe buses. Fixes: zephyrproject-rtos#32071 Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Whenever a child-binding: dict has a compatible, we ought to make that available in EDT._compat2binding. If we don't, we can't look it up later. This has adverse effects like missing child bindings which describe buses. Fixes: #32071 Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Describe the bug
I'm trying to have a child binding declare a new bus controller. That does not seems to work as expected, the childs of this new controller does not refers to it in the generated defines.
It also seems that even when using a separate binding file for the controller, it must be on a bus (binding must contains
on-bus
) otherwise the childs also don't use it as the controllerTo Reproduce
dts_debug.zip
Steps to reproduce the behavior:
Run gen_defines with provided dts and .yaml files
The joined archive contains:
child-bindings
bindings
folderbindings_2
folderExpected behavior
Childs of the controller should refers to it in their
*_BUS
defineEnvironment (please complete the following information):
The text was updated successfully, but these errors were encountered: