summaryrefslogtreecommitdiffstats
path: root/kernel/Documentation/devicetree/bindings/pinctrl/fsl,imx27-pinctrl.txt
blob: d1706ea8257230121f2843bd7684faccd160198b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
* Freescale IMX27 IOMUX Controller

Required properties:
- compatible: "fsl,imx27-iomuxc"

The iomuxc driver node should define subnodes containing of pinctrl configuration subnodes.

Required properties for pin configuration node:
- fsl,pins: three integers array, represents a group of pins mux and config
  setting. The format is fsl,pins = <PIN MUX_ID CONFIG>.

  PIN is an integer between 0 and 0xbf. imx27 has 6 ports with 32 configurable
  configurable pins each. PIN is PORT * 32 + PORT_PIN, PORT_PIN is the pin
  number on the specific port (between 0 and 31).

  MUX_ID is
    function + (direction << 2) + (gpio_oconf << 4) + (gpio_iconfa << 8) + (gpio_iconfb << 10)

      function value is used to select the pin function.
      Possible values:
          0 - Primary function
          1 - Alternate function
          2 - GPIO
      Registers: GIUS (GPIO In Use), GPR (General Purpose Register)

      direction defines the data direction of the pin.
      Possible values:
          0 - Input
          1 - Output
      Register: DDIR

      gpio_oconf configures the gpio submodule output signal. This does not
      have any effect unless GPIO function is selected. A/B/C_IN are output
      signals of function blocks A,B and C. Specific function blocks are
      described in the reference manual.
      Possible values:
          0 - A_IN
          1 - B_IN
          2 - C_IN
          3 - Data Register
      Registers: OCR1, OCR2

      gpio_iconfa/b configures the gpio submodule input to functionblocks A and
      B. GPIO function should be selected if this is configured.
      Possible values:
          0 - GPIO_IN
          1 - Interrupt Status Register
          2 - Pulldown
          3 - Pullup
      Registers ICONFA1, ICONFA2, ICONFB1 and ICONFB2

  CONFIG can be 0 or 1, meaning Pullup disable/enable.


The iomux controller has gpio child nodes which are embedded in the iomux
control registers. They have to be defined as child nodes of the iomux device
node. If gpio subnodes are defined "#address-cells", "#size-cells" and "ranges"
properties for the iomux device node are required.

Example:

iomuxc: iomuxc@10015000 {
	compatible = "fsl,imx27-iomuxc";
	reg = <0x10015000 0x600>;
	#address-cells = <1>;
	#size-cells = <1>;
	ranges;

	gpio1: gpio@10015000 {
		...
	};

	...

	uart {
		pinctrl_uart1: uart-1 {
			fsl,pins = <
				0x8c 0x004 0x0 /* UART1_TXD__UART1_TXD */
				0x8d 0x000 0x0 /* UART1_RXD__UART1_RXD */
				0x8e 0x004 0x0 /* UART1_CTS__UART1_CTS */
				0x8f 0x000 0x0 /* UART1_RTS__UART1_RTS */
			>;
		};

		...
	};
};


For convenience there are macros defined in imx27-pinfunc.h which provide PIN
and MUX_ID. They are structured as MX27_PAD_<Pad name>__<Signal name>. The names
are defined in the i.MX27 reference manual.

The above example using macros:

iomuxc: iomuxc@10015000 {
	compatible = "fsl,imx27-iomuxc";
	reg = <0x10015000 0x600>;
	#address-cells = <1>;
	#size-cells = <1>;
	ranges;

	gpio1: gpio@10015000 {
		...
	};

	...

	uart {
		pinctrl_uart1: uart-1 {
			fsl,pins = <
				MX27_PAD_UART1_TXD__UART1_TXD 0x0
				MX27_PAD_UART1_RXD__UART1_RXD 0x0
				MX27_PAD_UART1_CTS__UART1_CTS 0x0
				MX27_PAD_UART1_RTS__UART1_RTS 0x0
			>;
		};

		...
	};
};