xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/fsl,imx-pinctrl.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot* Freescale IOMUX Controller (IOMUXC) for i.MX
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotThe IOMUX Controller (IOMUXC), together with the IOMUX, enables the IC
4*c66ec88fSEmmanuel Vadotto share one PAD to several functional blocks. The sharing is done by
5*c66ec88fSEmmanuel Vadotmultiplexing the PAD input/output signals. For each PAD there are up to
6*c66ec88fSEmmanuel Vadot8 muxing options (called ALT modes). Since different modules require
7*c66ec88fSEmmanuel Vadotdifferent PAD settings (like pull up, keeper, etc) the IOMUXC controls
8*c66ec88fSEmmanuel Vadotalso the PAD settings parameters.
9*c66ec88fSEmmanuel Vadot
10*c66ec88fSEmmanuel VadotPlease refer to pinctrl-bindings.txt in this directory for details of the
11*c66ec88fSEmmanuel Vadotcommon pinctrl bindings used by client devices, including the meaning of the
12*c66ec88fSEmmanuel Vadotphrase "pin configuration node".
13*c66ec88fSEmmanuel Vadot
14*c66ec88fSEmmanuel VadotFreescale IMX pin configuration node is a node of a group of pins which can be
15*c66ec88fSEmmanuel Vadotused for a specific device or function. This node represents both mux and config
16*c66ec88fSEmmanuel Vadotof the pins in that group. The 'mux' selects the function mode(also named mux
17*c66ec88fSEmmanuel Vadotmode) this pin can work on and the 'config' configures various pad settings
18*c66ec88fSEmmanuel Vadotsuch as pull-up, open drain, drive strength, etc.
19*c66ec88fSEmmanuel Vadot
20*c66ec88fSEmmanuel VadotRequired properties for iomux controller:
21*c66ec88fSEmmanuel Vadot- compatible: "fsl,<soc>-iomuxc"
22*c66ec88fSEmmanuel Vadot  Please refer to each fsl,<soc>-pinctrl.txt binding doc for supported SoCs.
23*c66ec88fSEmmanuel Vadot
24*c66ec88fSEmmanuel VadotRequired properties for pin configuration node:
25*c66ec88fSEmmanuel Vadot- fsl,pins: each entry consists of 6 integers and represents the mux and config
26*c66ec88fSEmmanuel Vadot  setting for one pin. The first 5 integers <mux_reg conf_reg input_reg mux_val
27*c66ec88fSEmmanuel Vadot  input_val> are specified using a PIN_FUNC_ID macro, which can be found in
28*c66ec88fSEmmanuel Vadot  imx*-pinfunc.h under device tree source folder. The last integer CONFIG is
29*c66ec88fSEmmanuel Vadot  the pad setting value like pull-up on this pin. And that's why fsl,pins entry
30*c66ec88fSEmmanuel Vadot  looks like <PIN_FUNC_ID CONFIG> in the example below.
31*c66ec88fSEmmanuel Vadot
32*c66ec88fSEmmanuel VadotBits used for CONFIG:
33*c66ec88fSEmmanuel VadotNO_PAD_CTL(1 << 31): indicate this pin does not need config.
34*c66ec88fSEmmanuel Vadot
35*c66ec88fSEmmanuel VadotSION(1 << 30): Software Input On Field.
36*c66ec88fSEmmanuel VadotForce the selected mux mode input path no matter of MUX_MODE functionality.
37*c66ec88fSEmmanuel VadotBy default the input path is determined by functionality of the selected
38*c66ec88fSEmmanuel Vadotmux mode (regular).
39*c66ec88fSEmmanuel Vadot
40*c66ec88fSEmmanuel VadotOther bits are used for PAD setting.
41*c66ec88fSEmmanuel VadotPlease refer to each fsl,<soc>-pinctrl,txt binding doc for SoC specific part
42*c66ec88fSEmmanuel Vadotof bits definitions.
43*c66ec88fSEmmanuel Vadot
44*c66ec88fSEmmanuel VadotNOTE:
45*c66ec88fSEmmanuel VadotSome requirements for using fsl,imx-pinctrl binding:
46*c66ec88fSEmmanuel Vadot1. We have pin function node defined under iomux controller node to represent
47*c66ec88fSEmmanuel Vadot   what pinmux functions this SoC supports.
48*c66ec88fSEmmanuel Vadot2. The pin configuration node intends to work on a specific function should
49*c66ec88fSEmmanuel Vadot   to be defined under that specific function node.
50*c66ec88fSEmmanuel Vadot   The function node's name should represent well about what function
51*c66ec88fSEmmanuel Vadot   this group of pins in this pin configuration node are working on.
52*c66ec88fSEmmanuel Vadot3. The driver can use the function node's name and pin configuration node's
53*c66ec88fSEmmanuel Vadot   name describe the pin function and group hierarchy.
54*c66ec88fSEmmanuel Vadot   For example, Linux IMX pinctrl driver takes the function node's name
55*c66ec88fSEmmanuel Vadot   as the function name and pin configuration node's name as group name to
56*c66ec88fSEmmanuel Vadot   create the map table.
57*c66ec88fSEmmanuel Vadot4. Each pin configuration node should have a phandle, devices can set pins
58*c66ec88fSEmmanuel Vadot   configurations by referring to the phandle of that pin configuration node.
59*c66ec88fSEmmanuel Vadot
60*c66ec88fSEmmanuel VadotExamples:
61*c66ec88fSEmmanuel Vadotusdhc@219c000 { /* uSDHC4 */
62*c66ec88fSEmmanuel Vadot	non-removable;
63*c66ec88fSEmmanuel Vadot	vmmc-supply = <&reg_3p3v>;
64*c66ec88fSEmmanuel Vadot	pinctrl-names = "default";
65*c66ec88fSEmmanuel Vadot	pinctrl-0 = <&pinctrl_usdhc4_1>;
66*c66ec88fSEmmanuel Vadot};
67*c66ec88fSEmmanuel Vadot
68*c66ec88fSEmmanuel Vadotiomuxc@20e0000 {
69*c66ec88fSEmmanuel Vadot	compatible = "fsl,imx6q-iomuxc";
70*c66ec88fSEmmanuel Vadot	reg = <0x020e0000 0x4000>;
71*c66ec88fSEmmanuel Vadot
72*c66ec88fSEmmanuel Vadot	/* shared pinctrl settings */
73*c66ec88fSEmmanuel Vadot	usdhc4 {
74*c66ec88fSEmmanuel Vadot		pinctrl_usdhc4_1: usdhc4grp-1 {
75*c66ec88fSEmmanuel Vadot			fsl,pins = <
76*c66ec88fSEmmanuel Vadot				MX6QDL_PAD_SD4_CMD__SD4_CMD    0x17059
77*c66ec88fSEmmanuel Vadot				MX6QDL_PAD_SD4_CLK__SD4_CLK    0x10059
78*c66ec88fSEmmanuel Vadot				MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
79*c66ec88fSEmmanuel Vadot				MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
80*c66ec88fSEmmanuel Vadot				MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
81*c66ec88fSEmmanuel Vadot				MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
82*c66ec88fSEmmanuel Vadot				MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059
83*c66ec88fSEmmanuel Vadot				MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059
84*c66ec88fSEmmanuel Vadot				MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059
85*c66ec88fSEmmanuel Vadot				MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059
86*c66ec88fSEmmanuel Vadot			>;
87*c66ec88fSEmmanuel Vadot	};
88*c66ec88fSEmmanuel Vadot	....
89*c66ec88fSEmmanuel Vadot};
90*c66ec88fSEmmanuel VadotRefer to the IOMUXC controller chapter in imx6q datasheet,
91*c66ec88fSEmmanuel Vadot0x17059 means enable hysteresis, 47KOhm Pull Up, 50Mhz speed,
92*c66ec88fSEmmanuel Vadot80Ohm driver strength and Fast Slew Rate.
93*c66ec88fSEmmanuel VadotUser should refer to each SoC spec to set the correct value.
94