|
| 1 | +# Copyright (c) 2025 Ambiq Micro Inc. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +description: | |
| 5 | + The Ambiq Apollo5 pin controller is a node responsible for controlling |
| 6 | + pin function selection and pin properties, such as routing a UART0 TX |
| 7 | + to pin 60 and enabling the pullup resistor on that pin. |
| 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 | + /* You can put this in places like a board-pinctrl.dtsi file in |
| 20 | + * your board directory, or a devicetree overlay in your application. |
| 21 | + */ |
| 22 | +
|
| 23 | + /* include pre-defined combinations for the SoC variant used by the board */ |
| 24 | + #include <dt-bindings/pinctrl/ambiq-apollo5-pinctrl.h> |
| 25 | +
|
| 26 | + &pinctrl { |
| 27 | + uart0_default: uart0_default { |
| 28 | + group1 { |
| 29 | + pinmux = <UART0TX_P60>; |
| 30 | + }; |
| 31 | + group2 { |
| 32 | + pinmux = <UART0RX_P47>; |
| 33 | + input-enable; |
| 34 | + }; |
| 35 | + }; |
| 36 | + }; |
| 37 | +
|
| 38 | + The 'uart0_default' child node encodes the pin configurations for a |
| 39 | + particular state of a device; in this case, the default (that is, active) |
| 40 | + state. |
| 41 | +
|
| 42 | + As shown, pin configurations are organized in groups within each child node. |
| 43 | + Each group can specify a list of pin function selections in the 'pinmux' |
| 44 | + property. |
| 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 | +compatible: "ambiq,apollo5-pinctrl" |
| 50 | + |
| 51 | +include: base.yaml |
| 52 | + |
| 53 | +child-binding: |
| 54 | + description: | |
| 55 | + Definitions for a pinctrl state. |
| 56 | + child-binding: |
| 57 | + |
| 58 | + include: |
| 59 | + - name: pincfg-node.yaml |
| 60 | + property-allowlist: |
| 61 | + - input-enable |
| 62 | + - drive-push-pull |
| 63 | + - drive-open-drain |
| 64 | + - bias-high-impedance |
| 65 | + - bias-pull-up |
| 66 | + - bias-pull-down |
| 67 | + |
| 68 | + properties: |
| 69 | + pinmux: |
| 70 | + required: true |
| 71 | + type: array |
| 72 | + description: | |
| 73 | + An array of pins sharing the same group properties. Each |
| 74 | + element of the array is an integer constructed from the |
| 75 | + pin number and the alternative function of the pin. |
| 76 | + drive-strength: |
| 77 | + type: string |
| 78 | + enum: |
| 79 | + - "0.1" |
| 80 | + - "0.5" |
| 81 | + - "0.75" |
| 82 | + - "1.0" |
| 83 | + default: "0.1" |
| 84 | + description: | |
| 85 | + The drive strength of a pin, relative to full-driver strength. |
| 86 | + The default value is 0.1, which is the reset value. |
| 87 | + ambiq,pull-up-ohms: |
| 88 | + type: int |
| 89 | + enum: |
| 90 | + - 1500 |
| 91 | + - 6000 |
| 92 | + - 12000 |
| 93 | + - 24000 |
| 94 | + - 50000 |
| 95 | + - 100000 |
| 96 | + default: 1500 |
| 97 | + description: | |
| 98 | + The pullup resistor value. The default value is 1500 ohms. |
| 99 | + ambiq,nce-src: |
| 100 | + type: int |
| 101 | + default: 0 |
| 102 | + description: | |
| 103 | + IOM0CE0 = 0x0 - IOM 0 NCE 0 module |
| 104 | + IOM0CE1 = 0x1 - IOM 0 NCE 1 module |
| 105 | + IOM0CE2 = 0x2 - IOM 0 NCE 2 module |
| 106 | + IOM0CE3 = 0x3 - IOM 0 NCE 3 module |
| 107 | + IOM1CE0 = 0x4 - IOM 1 NCE 0 module |
| 108 | + IOM1CE1 = 0x5 - IOM 1 NCE 1 module |
| 109 | + IOM1CE2 = 0x6 - IOM 1 NCE 2 module |
| 110 | + IOM1CE3 = 0x7 - IOM 1 NCE 3 module |
| 111 | + IOM2CE0 = 0x8 - IOM 2 NCE 0 module |
| 112 | + IOM2CE1 = 0x9 - IOM 2 NCE 1 module |
| 113 | + IOM2CE2 = 0xA - IOM 2 NCE 2 module |
| 114 | + IOM2CE3 = 0xB - IOM 2 NCE 3 module |
| 115 | + IOM3CE0 = 0xC - IOM 3 NCE 0 module |
| 116 | + IOM3CE1 = 0xD - IOM 3 NCE 1 module |
| 117 | + IOM3CE2 = 0xE - IOM 3 NCE 2 module |
| 118 | + IOM3CE3 = 0xF - IOM 3 NCE 3 module |
| 119 | + IOM4CE0 = 0x10 - IOM 4 NCE 0 module |
| 120 | + IOM4CE1 = 0x11 - IOM 4 NCE 1 module |
| 121 | + IOM4CE2 = 0x12 - IOM 4 NCE 2 module |
| 122 | + IOM4CE3 = 0x13 - IOM 4 NCE 3 module |
| 123 | + IOM5CE0 = 0x14 - IOM 5 NCE 0 module |
| 124 | + IOM5CE1 = 0x15 - IOM 5 NCE 1 module |
| 125 | + IOM5CE2 = 0x16 - IOM 5 NCE 2 module |
| 126 | + IOM5CE3 = 0x17 - IOM 5 NCE 3 module |
| 127 | + IOM6CE0 = 0x18 - IOM 6 NCE 0 module |
| 128 | + IOM6CE1 = 0x19 - IOM 6 NCE 1 module |
| 129 | + IOM6CE2 = 0x1A - IOM 6 NCE 2 module |
| 130 | + IOM6CE3 = 0x1B - IOM 6 NCE 3 module |
| 131 | + IOM7CE0 = 0x1C - IOM 7 NCE 0 module |
| 132 | + IOM7CE1 = 0x1D - IOM 7 NCE 1 module |
| 133 | + IOM7CE2 = 0x1E - IOM 7 NCE 2 module |
| 134 | + IOM7CE3 = 0x1F - IOM 7 NCE 3 module |
| 135 | + DC_DPI_DE = 0x30 - DC DPI DE module |
| 136 | + DISP_CONT_CSX = 0x31 - DISP CONT CSX module |
| 137 | + DC_SPI_CS_N = 0x32 - DC SPI CS_N module |
| 138 | + DC_QSPI_CS_N = 0x33 - DC QSPI CS_N module |
| 139 | + DC_RESX = 0x34 - DC module RESX |
| 140 | + ambiq,nce-pol: |
| 141 | + type: int |
| 142 | + default: 0 |
| 143 | + description: | |
| 144 | + Polarity select for NCE |
| 145 | + LOW = 0x0 - Polarity is active low |
| 146 | + HIGH = 0x1 - Polarity is active high |
| 147 | + ambiq,sdif-cdwp: |
| 148 | + type: int |
| 149 | + default: 0 |
| 150 | + description: | |
| 151 | + Configure SD Card Detection and Write Protection pin |
| 152 | + 0x0 - Not SDIF pin |
| 153 | + 0x1 - SDIF0CD |
| 154 | + 0x2 - SDIF0WP |
| 155 | + 0x3 - SDIF1CD |
| 156 | + 0x4 - SDIF1WP |
0 commit comments