xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/fsl,imx27-pinctrl.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot* Freescale IMX27 IOMUX Controller
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotRequired properties:
4*c66ec88fSEmmanuel Vadot- compatible: "fsl,imx27-iomuxc"
5*c66ec88fSEmmanuel Vadot
6*c66ec88fSEmmanuel VadotThe iomuxc driver node should define subnodes containing of pinctrl configuration subnodes.
7*c66ec88fSEmmanuel Vadot
8*c66ec88fSEmmanuel VadotRequired properties for pin configuration node:
9*c66ec88fSEmmanuel Vadot- fsl,pins: three integers array, represents a group of pins mux and config
10*c66ec88fSEmmanuel Vadot  setting. The format is fsl,pins = <PIN MUX_ID CONFIG>.
11*c66ec88fSEmmanuel Vadot
12*c66ec88fSEmmanuel Vadot  PIN is an integer between 0 and 0xbf. imx27 has 6 ports with 32 configurable
13*c66ec88fSEmmanuel Vadot  configurable pins each. PIN is PORT * 32 + PORT_PIN, PORT_PIN is the pin
14*c66ec88fSEmmanuel Vadot  number on the specific port (between 0 and 31).
15*c66ec88fSEmmanuel Vadot
16*c66ec88fSEmmanuel Vadot  MUX_ID is
17*c66ec88fSEmmanuel Vadot    function + (direction << 2) + (gpio_oconf << 4) + (gpio_iconfa << 8) + (gpio_iconfb << 10)
18*c66ec88fSEmmanuel Vadot
19*c66ec88fSEmmanuel Vadot      function value is used to select the pin function.
20*c66ec88fSEmmanuel Vadot      Possible values:
21*c66ec88fSEmmanuel Vadot          0 - Primary function
22*c66ec88fSEmmanuel Vadot          1 - Alternate function
23*c66ec88fSEmmanuel Vadot          2 - GPIO
24*c66ec88fSEmmanuel Vadot      Registers: GIUS (GPIO In Use), GPR (General Purpose Register)
25*c66ec88fSEmmanuel Vadot
26*c66ec88fSEmmanuel Vadot      direction defines the data direction of the pin.
27*c66ec88fSEmmanuel Vadot      Possible values:
28*c66ec88fSEmmanuel Vadot          0 - Input
29*c66ec88fSEmmanuel Vadot          1 - Output
30*c66ec88fSEmmanuel Vadot      Register: DDIR
31*c66ec88fSEmmanuel Vadot
32*c66ec88fSEmmanuel Vadot      gpio_oconf configures the gpio submodule output signal. This does not
33*c66ec88fSEmmanuel Vadot      have any effect unless GPIO function is selected. A/B/C_IN are output
34*c66ec88fSEmmanuel Vadot      signals of function blocks A,B and C. Specific function blocks are
35*c66ec88fSEmmanuel Vadot      described in the reference manual.
36*c66ec88fSEmmanuel Vadot      Possible values:
37*c66ec88fSEmmanuel Vadot          0 - A_IN
38*c66ec88fSEmmanuel Vadot          1 - B_IN
39*c66ec88fSEmmanuel Vadot          2 - C_IN
40*c66ec88fSEmmanuel Vadot          3 - Data Register
41*c66ec88fSEmmanuel Vadot      Registers: OCR1, OCR2
42*c66ec88fSEmmanuel Vadot
43*c66ec88fSEmmanuel Vadot      gpio_iconfa/b configures the gpio submodule input to functionblocks A and
44*c66ec88fSEmmanuel Vadot      B. GPIO function should be selected if this is configured.
45*c66ec88fSEmmanuel Vadot      Possible values:
46*c66ec88fSEmmanuel Vadot          0 - GPIO_IN
47*c66ec88fSEmmanuel Vadot          1 - Interrupt Status Register
48*c66ec88fSEmmanuel Vadot          2 - Pulldown
49*c66ec88fSEmmanuel Vadot          3 - Pullup
50*c66ec88fSEmmanuel Vadot      Registers ICONFA1, ICONFA2, ICONFB1 and ICONFB2
51*c66ec88fSEmmanuel Vadot
52*c66ec88fSEmmanuel Vadot  CONFIG can be 0 or 1, meaning Pullup disable/enable.
53*c66ec88fSEmmanuel Vadot
54*c66ec88fSEmmanuel Vadot
55*c66ec88fSEmmanuel VadotThe iomux controller has gpio child nodes which are embedded in the iomux
56*c66ec88fSEmmanuel Vadotcontrol registers. They have to be defined as child nodes of the iomux device
57*c66ec88fSEmmanuel Vadotnode. If gpio subnodes are defined "#address-cells", "#size-cells" and "ranges"
58*c66ec88fSEmmanuel Vadotproperties for the iomux device node are required.
59*c66ec88fSEmmanuel Vadot
60*c66ec88fSEmmanuel VadotExample:
61*c66ec88fSEmmanuel Vadot
62*c66ec88fSEmmanuel Vadotiomuxc: iomuxc@10015000 {
63*c66ec88fSEmmanuel Vadot	compatible = "fsl,imx27-iomuxc";
64*c66ec88fSEmmanuel Vadot	reg = <0x10015000 0x600>;
65*c66ec88fSEmmanuel Vadot	#address-cells = <1>;
66*c66ec88fSEmmanuel Vadot	#size-cells = <1>;
67*c66ec88fSEmmanuel Vadot	ranges;
68*c66ec88fSEmmanuel Vadot
69*c66ec88fSEmmanuel Vadot	gpio1: gpio@10015000 {
70*c66ec88fSEmmanuel Vadot		...
71*c66ec88fSEmmanuel Vadot	};
72*c66ec88fSEmmanuel Vadot
73*c66ec88fSEmmanuel Vadot	...
74*c66ec88fSEmmanuel Vadot
75*c66ec88fSEmmanuel Vadot	uart {
76*c66ec88fSEmmanuel Vadot		pinctrl_uart1: uart-1 {
77*c66ec88fSEmmanuel Vadot			fsl,pins = <
78*c66ec88fSEmmanuel Vadot				0x8c 0x004 0x0 /* UART1_TXD__UART1_TXD */
79*c66ec88fSEmmanuel Vadot				0x8d 0x000 0x0 /* UART1_RXD__UART1_RXD */
80*c66ec88fSEmmanuel Vadot				0x8e 0x004 0x0 /* UART1_CTS__UART1_CTS */
81*c66ec88fSEmmanuel Vadot				0x8f 0x000 0x0 /* UART1_RTS__UART1_RTS */
82*c66ec88fSEmmanuel Vadot			>;
83*c66ec88fSEmmanuel Vadot		};
84*c66ec88fSEmmanuel Vadot
85*c66ec88fSEmmanuel Vadot		...
86*c66ec88fSEmmanuel Vadot	};
87*c66ec88fSEmmanuel Vadot};
88*c66ec88fSEmmanuel Vadot
89*c66ec88fSEmmanuel Vadot
90*c66ec88fSEmmanuel VadotFor convenience there are macros defined in imx27-pinfunc.h which provide PIN
91*c66ec88fSEmmanuel Vadotand MUX_ID. They are structured as MX27_PAD_<Pad name>__<Signal name>. The names
92*c66ec88fSEmmanuel Vadotare defined in the i.MX27 reference manual.
93*c66ec88fSEmmanuel Vadot
94*c66ec88fSEmmanuel VadotThe above example using macros:
95*c66ec88fSEmmanuel Vadot
96*c66ec88fSEmmanuel Vadotiomuxc: iomuxc@10015000 {
97*c66ec88fSEmmanuel Vadot	compatible = "fsl,imx27-iomuxc";
98*c66ec88fSEmmanuel Vadot	reg = <0x10015000 0x600>;
99*c66ec88fSEmmanuel Vadot	#address-cells = <1>;
100*c66ec88fSEmmanuel Vadot	#size-cells = <1>;
101*c66ec88fSEmmanuel Vadot	ranges;
102*c66ec88fSEmmanuel Vadot
103*c66ec88fSEmmanuel Vadot	gpio1: gpio@10015000 {
104*c66ec88fSEmmanuel Vadot		...
105*c66ec88fSEmmanuel Vadot	};
106*c66ec88fSEmmanuel Vadot
107*c66ec88fSEmmanuel Vadot	...
108*c66ec88fSEmmanuel Vadot
109*c66ec88fSEmmanuel Vadot	uart {
110*c66ec88fSEmmanuel Vadot		pinctrl_uart1: uart-1 {
111*c66ec88fSEmmanuel Vadot			fsl,pins = <
112*c66ec88fSEmmanuel Vadot				MX27_PAD_UART1_TXD__UART1_TXD 0x0
113*c66ec88fSEmmanuel Vadot				MX27_PAD_UART1_RXD__UART1_RXD 0x0
114*c66ec88fSEmmanuel Vadot				MX27_PAD_UART1_CTS__UART1_CTS 0x0
115*c66ec88fSEmmanuel Vadot				MX27_PAD_UART1_RTS__UART1_RTS 0x0
116*c66ec88fSEmmanuel Vadot			>;
117*c66ec88fSEmmanuel Vadot		};
118*c66ec88fSEmmanuel Vadot
119*c66ec88fSEmmanuel Vadot		...
120*c66ec88fSEmmanuel Vadot	};
121*c66ec88fSEmmanuel Vadot};
122