1# Copyright (c) 2023 Antmicro <www.antmicro.com>
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5    The Ambiq Apollo4 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-apollo4-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
49compatible: "ambiq,apollo4-pinctrl"
50
51include: base.yaml
52
53child-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      slew-rate:
88        type: string
89        enum:
90          - "slow"
91          - "fast"
92        default: "slow"
93        description: |
94          Select slew rate for a pin. The default is slow, which is the reset value.
95      ambiq,pull-up-ohms:
96        type: int
97        enum:
98          - 1500
99          - 6000
100          - 12000
101          - 24000
102          - 50000
103          - 100000
104        default: 1500
105        description: |
106          The pullup resistor value. The default value is 1500 ohms.
107      ambiq,iom-nce-module:
108        type: int
109        default: 0
110        description: |
111          IOM nCE module select. The default value is reset value.
112