1 * STM32 GPIO and Pin Mux/Config controller
3 STMicroelectronics's STM32 MCUs intregrate a GPIO and Pin mux/config hardware
4 controller. It controls the input/output settings on the available pins and
5 also provides ability to multiplex and configure the output of various on-chip
6 controllers onto these pads.
10 - compatible: value should be one of the following:
11 "st,stm32f429-pinctrl"
12 "st,stm32f469-pinctrl"
13 "st,stm32f746-pinctrl"
14 "st,stm32h743-pinctrl"
15 - #address-cells: The value of this property must be 1
16 - #size-cells : The value of this property must be 1
17 - ranges : defines mapping between pin controller node (parent) to
18 gpio-bank node (children).
19 - pins-are-numbered: Specify the subnodes are using numbered pinmux to
22 GPIO controller/bank node:
24 - gpio-controller : Indicates this device is a GPIO controller
25 - #gpio-cells : Should be two.
26 The first cell is the pin number
27 The second one is the polarity:
30 - reg : The gpio address range, relative to the pinctrl range
31 - clocks : clock that drives this bank
32 - st,bank-name : Should be a name string for this bank as specified in
36 - reset: : Reference to the reset controller
37 - interrupt-parent: phandle of the interrupt parent to which the external
38 GPIO interrupts are forwarded to.
39 - st,syscfg: Should be phandle/offset pair. The phandle to the syscon node
40 which includes IRQ mux selection register, and the offset of the IRQ mux
42 - gpio-ranges: Define a dedicated mapping between a pin-controller and
43 a gpio controller. Format is <&phandle a b c> with:
44 -(phandle): phandle of pin-controller.
45 -(a): gpio base offset in range.
46 -(b): pin base offset in range.
47 -(c): gpio count in range
48 This entry has to be used either if there are holes inside a bank:
49 GPIOB0/B1/B2/B14/B15 (see example 2)
50 or if banks are not contiguous:
52 NOTE: If "gpio-ranges" is used for a gpio controller, all gpio-controller
53 have to use a "gpio-ranges" entry.
54 More details in Documentation/devicetree/bindings/gpio/gpio.txt.
57 #include <dt-bindings/pinctrl/stm32f429-pinfunc.h>
63 compatible = "st,stm32f429-pinctrl";
64 ranges = <0 0x40020000 0x3000>;
67 gpioa: gpio@40020000 {
71 resets = <&reset_ahb1 0>;
72 st,bank-name = "GPIOA";
75 pin-functions nodes follow...
79 #include <dt-bindings/pinctrl/stm32f429-pinfunc.h>
82 pinctrl: pin-controller {
85 compatible = "st,stm32f429-pinctrl";
86 ranges = <0 0x40020000 0x3000>;
89 gpioa: gpio@40020000 {
93 resets = <&reset_ahb1 0>;
94 st,bank-name = "GPIOA";
95 gpio-ranges = <&pinctrl 0 0 16>;
98 gpiob: gpio@40020400 {
102 resets = <&reset_ahb1 0>;
103 st,bank-name = "GPIOB";
105 gpio-ranges = <&pinctrl 0 16 3>,
111 pin-functions nodes follow...
115 Contents of function subnode node:
116 ----------------------------------
118 A pinctrl node should contain at least one subnode representing the
119 pinctrl group available on the machine. Each subnode will list the
120 pins it needs, and how they should be configured, with regard to muxer
121 configuration, pullups, drive, output high/low and output speed.
124 pinmux = <PIN_NUMBER_PINMUX>;
129 - pinmux: integer array, represents gpio pin number and mux setting.
130 Supported pin number and mux varies for different SoCs, and are defined in
131 dt-bindings/pinctrl/<soc>-pinfunc.h directly.
132 These defines are calculated as:
133 ((port * 16 + line) << 8) | function
135 - port: The gpio port index (PA = 0, PB = 1, ..., PK = 11)
136 - line: The line offset within the port (PA0 = 0, PA1 = 1, ..., PA15 = 15)
137 - function: The function number, can be:
139 * 1 : Alternate Function 0
140 * 2 : Alternate Function 1
141 * 3 : Alternate Function 2
143 * 16 : Alternate Function 15
147 - GENERIC_PINCONFIG: is the generic pinconfig options to use.
148 Available options are:
156 - slew-rate = <x>, with x being:
166 usart1_pins_a: usart1@0 {
168 pinmux = <STM32F429_PA9_FUNC_USART1_TX>;
174 pinmux = <STM32F429_PA10_FUNC_USART1_RX>;
181 pinctrl-0 = <&usart1_pins_a>;
182 pinctrl-names = "default";