-
Notifications
You must be signed in to change notification settings - Fork 8.2k
dts: stm32: Introduce linux like pinctrl bindings #20386
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
Conversation
c8708db to
0182252
Compare
|
It is unclear to me what the binding file shall describe:
In case of 2&3 using st,stm32-pinmux.yaml as the name for the binding file is misleading. Looking at the content of the binding file I would say it describes a pin control configuration node (aka 3). These nodes are sub-nodes of a pin-controller node. In STM32 Linux https://elixir.bootlin.com/linux/v5.2.21/source/Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt these nodes used to be called pin function nodes. Linux generically calls them pin configuration nodes (see https://www.kernel.org/doc/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt). EDTS calls them pinconf nodes. As a common denominator I would use st,stm32-pinconf.yaml. I´m not aware of that currently a binding can include another binding as a child-binding. So st,stm32-pinmux.yaml may have to become part of the pin-controller binding file as a child-binding. @ulfalizer may know better. |
Yeah, this is confusing to me too. To use the binding as it's currently written, you'd have to do this, repeating the Was it meant to be used like this? In that case, you need to use a
What about |
|
We should assume the .dts files are roughly correct and that the binding is what should be updated. |
|
So I think it should be something like: |
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.
Needs to have a title: and description: too. The contents of child-binding: is parsed like a regular binding.
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.
@ulfalizer
The usage of child-binding did not work out for me with the current edtlib.py.
In #22255 I made a RFC for a different solution using a generic binding for the pinctrl-state nodes (and some other similar node types - dts: edtlib: enable bindings for special nodes without compatibles).
|
@ulfalizer, question around dts parsing: Do you think the following pinctrl nodes descriptions would be equivalent from parsing point of view? used as follows: I don't intent to use this in zephyr, but this is the way it is done in Linux right now and it would be ideal if this would work out of the box in zephyr as well (seems equivalent to me). |
Introduce Linux like dts bindings for stm32 devices. Difference is that pinctrl subnodes describe a single pin configuration for a dedicated function (eg: usart1_tx_pa9) while linux proposes directly pins combinations aiming at configuring an IP. Reason for this choice is to be able to provide a complete description of possible configurations in a finite number of subnodes. This will prevent need to modify these files each time a user wants to use a new pins combination for his own board. Other advantage is that pin configuration will appear more clearly in board dts files. Signed-off-by: Erwan Gouriou <[email protected]>
|
@mnkp, can you provide here a sample of alternative pinmux bindings (as discussed in previous dev-meeting) ? |
Introduce Linux like dts bindings for stm32 devices.
Reason for this change is described with more detail in dedicated commit.
Ultimate goal is to generate -pinctrl.dtsi files from STM23CubeMx GPIO IP database (which is available for download to all users). Scripts could then be used for generation and correctness verification.
While the number of GPIO IPs to describe is limited (54 GPIO IPs for 988 MCUs according to latest database in CubeMx 5.4), I'd like we could re-use the current inclusion/inheritance model currently in use in
dts/arm/st/*. This means that each stm32f/l/g(/...)xxx.dtsi would include a matching stm32f/l/gxxx-pinctrl.dtsi describing the pin configuration of the peripheral described in stm32f/l/gxxx.dtsi. Aim is to minimize pinctrl file sizes (and information redundancy, potential errors, ..)Alternative option would be to provide stm32f/l/gxxx-pinctrl.dtsi de-correlated from stm32f/l/gxxx.dtsi but describing various GPIO IPs and using its own inclusion/inheritance schema. This should further reduce the number of duplicates, but would require additional verification effort (which might be feasible with appropriate tooling)
EDIT: Aim of this draft PR is to get early feedbacks on the direction