|
| 1 | +# Copyright 2025 Arm Limited and/or its affiliates <[email protected]> |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +description: | |
| 5 | + The Arm Mps4 pin controller is a node responsible for controlling |
| 6 | + pin function selection and pin properties, such as routing a UART3 TX |
| 7 | + to pin 1. |
| 8 | +
|
| 9 | + The node has the 'pinctrl' node label set in your SoC's devicetree, |
| 10 | + so you can modify it like this: |
| 11 | +
|
| 12 | + &pinctrl { |
| 13 | + /* your modifications go here */ |
| 14 | + }; |
| 15 | +
|
| 16 | + All device pin configurations should be placed in child nodes of the |
| 17 | + 'pinctrl' node, as shown in this example: |
| 18 | +
|
| 19 | + &pinctrl { |
| 20 | + /* configuration for the usart0 "default" state */ |
| 21 | + uart3_default: uart3_default { |
| 22 | + /* group 1 */ |
| 23 | + group1 { |
| 24 | + /* configure P1 as UART3 TX */ |
| 25 | + pinmux = <UART3_TXD_EXP>; |
| 26 | + }; |
| 27 | + /* group 2 */ |
| 28 | + group2 { |
| 29 | + /* configure P0 as UART3 RX */ |
| 30 | + pinmux = <UART3_TXD_EXP>; |
| 31 | + /* enable input on pin 1 */ |
| 32 | + input-enable; |
| 33 | + }; |
| 34 | + }; |
| 35 | + }; |
| 36 | +
|
| 37 | + The 'uart3_default' child node encodes the pin configurations for a |
| 38 | + particular state of a device; in this case, the default (that is, active) |
| 39 | + state. |
| 40 | +
|
| 41 | + As shown, pin configurations are organized in groups within each child node. |
| 42 | + Each group can specify a list of pin function selections in the 'pinmux' |
| 43 | + property. Here is a list of supported standard pin properties: |
| 44 | + - input-enable |
| 45 | +
|
| 46 | + A group can also specify shared pin properties common to all the specified |
| 47 | + pins, such as the 'input-enable' property in group 2. |
| 48 | +
|
| 49 | + To link pin configurations with a device, use a pinctrl-N property for some |
| 50 | + number N, like this example you could place in your board's DTS file: |
| 51 | +
|
| 52 | + #include "board-pinctrl.dtsi" |
| 53 | +
|
| 54 | + &uart3 { |
| 55 | + pinctrl-0 = <&uart3_default>; |
| 56 | + pinctrl-1 = <&uart3_sleep>; |
| 57 | + pinctrl-names = "default", "sleep"; |
| 58 | + }; |
| 59 | +
|
| 60 | +
|
| 61 | +compatible: "arm,mps4-pinctrl" |
| 62 | + |
| 63 | +include: base.yaml |
| 64 | + |
| 65 | +child-binding: |
| 66 | + description: | |
| 67 | + Definitions for a pinctrl state. |
| 68 | + child-binding: |
| 69 | + |
| 70 | + include: |
| 71 | + - name: pincfg-node.yaml |
| 72 | + property-allowlist: |
| 73 | + - input-enable |
| 74 | + |
| 75 | + properties: |
| 76 | + pinmux: |
| 77 | + required: true |
| 78 | + type: array |
| 79 | + description: | |
| 80 | + An array of pins sharing the same group properties. Each |
| 81 | + element of the array is an integer constructed from the |
| 82 | + pin number and the alternative function of the pin. |
0 commit comments