162306a36Sopenharmony_ci* Freescale IOMUX Controller (IOMUXC) for i.MX
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciThe IOMUX Controller (IOMUXC), together with the IOMUX, enables the IC
462306a36Sopenharmony_cito share one PAD to several functional blocks. The sharing is done by
562306a36Sopenharmony_cimultiplexing the PAD input/output signals. For each PAD there are up to
662306a36Sopenharmony_ci8 muxing options (called ALT modes). Since different modules require
762306a36Sopenharmony_cidifferent PAD settings (like pull up, keeper, etc) the IOMUXC controls
862306a36Sopenharmony_cialso the PAD settings parameters.
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciPlease refer to pinctrl-bindings.txt in this directory for details of the
1162306a36Sopenharmony_cicommon pinctrl bindings used by client devices, including the meaning of the
1262306a36Sopenharmony_ciphrase "pin configuration node".
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ciFreescale IMX pin configuration node is a node of a group of pins which can be
1562306a36Sopenharmony_ciused for a specific device or function. This node represents both mux and config
1662306a36Sopenharmony_ciof the pins in that group. The 'mux' selects the function mode(also named mux
1762306a36Sopenharmony_cimode) this pin can work on and the 'config' configures various pad settings
1862306a36Sopenharmony_cisuch as pull-up, open drain, drive strength, etc.
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ciRequired properties for iomux controller:
2162306a36Sopenharmony_ci- compatible: "fsl,<soc>-iomuxc"
2262306a36Sopenharmony_ci  Please refer to each fsl,<soc>-pinctrl.txt binding doc for supported SoCs.
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ciRequired properties for pin configuration node:
2562306a36Sopenharmony_ci- fsl,pins: each entry consists of 6 integers and represents the mux and config
2662306a36Sopenharmony_ci  setting for one pin. The first 5 integers <mux_reg conf_reg input_reg mux_val
2762306a36Sopenharmony_ci  input_val> are specified using a PIN_FUNC_ID macro, which can be found in
2862306a36Sopenharmony_ci  imx*-pinfunc.h under device tree source folder. The last integer CONFIG is
2962306a36Sopenharmony_ci  the pad setting value like pull-up on this pin. And that's why fsl,pins entry
3062306a36Sopenharmony_ci  looks like <PIN_FUNC_ID CONFIG> in the example below.
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ciBits used for CONFIG:
3362306a36Sopenharmony_ciNO_PAD_CTL(1 << 31): indicate this pin does not need config.
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciSION(1 << 30): Software Input On Field.
3662306a36Sopenharmony_ciForce the selected mux mode input path no matter of MUX_MODE functionality.
3762306a36Sopenharmony_ciBy default the input path is determined by functionality of the selected
3862306a36Sopenharmony_cimux mode (regular).
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ciOther bits are used for PAD setting.
4162306a36Sopenharmony_ciPlease refer to each fsl,<soc>-pinctrl,txt binding doc for SoC specific part
4262306a36Sopenharmony_ciof bits definitions.
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ciNOTE:
4562306a36Sopenharmony_ciSome requirements for using fsl,imx-pinctrl binding:
4662306a36Sopenharmony_ci1. We have pin function node defined under iomux controller node to represent
4762306a36Sopenharmony_ci   what pinmux functions this SoC supports.
4862306a36Sopenharmony_ci2. The pin configuration node intends to work on a specific function should
4962306a36Sopenharmony_ci   to be defined under that specific function node.
5062306a36Sopenharmony_ci   The function node's name should represent well about what function
5162306a36Sopenharmony_ci   this group of pins in this pin configuration node are working on.
5262306a36Sopenharmony_ci3. The driver can use the function node's name and pin configuration node's
5362306a36Sopenharmony_ci   name describe the pin function and group hierarchy.
5462306a36Sopenharmony_ci   For example, Linux IMX pinctrl driver takes the function node's name
5562306a36Sopenharmony_ci   as the function name and pin configuration node's name as group name to
5662306a36Sopenharmony_ci   create the map table.
5762306a36Sopenharmony_ci4. Each pin configuration node should have a phandle, devices can set pins
5862306a36Sopenharmony_ci   configurations by referring to the phandle of that pin configuration node.
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ciExamples:
6162306a36Sopenharmony_ciusdhc@219c000 { /* uSDHC4 */
6262306a36Sopenharmony_ci	non-removable;
6362306a36Sopenharmony_ci	vmmc-supply = <&reg_3p3v>;
6462306a36Sopenharmony_ci	pinctrl-names = "default";
6562306a36Sopenharmony_ci	pinctrl-0 = <&pinctrl_usdhc4_1>;
6662306a36Sopenharmony_ci};
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ciiomuxc@20e0000 {
6962306a36Sopenharmony_ci	compatible = "fsl,imx6q-iomuxc";
7062306a36Sopenharmony_ci	reg = <0x020e0000 0x4000>;
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci	/* shared pinctrl settings */
7362306a36Sopenharmony_ci	usdhc4 {
7462306a36Sopenharmony_ci		pinctrl_usdhc4_1: usdhc4grp-1 {
7562306a36Sopenharmony_ci			fsl,pins = <
7662306a36Sopenharmony_ci				MX6QDL_PAD_SD4_CMD__SD4_CMD    0x17059
7762306a36Sopenharmony_ci				MX6QDL_PAD_SD4_CLK__SD4_CLK    0x10059
7862306a36Sopenharmony_ci				MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
7962306a36Sopenharmony_ci				MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
8062306a36Sopenharmony_ci				MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
8162306a36Sopenharmony_ci				MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
8262306a36Sopenharmony_ci				MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059
8362306a36Sopenharmony_ci				MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059
8462306a36Sopenharmony_ci				MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059
8562306a36Sopenharmony_ci				MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059
8662306a36Sopenharmony_ci			>;
8762306a36Sopenharmony_ci	};
8862306a36Sopenharmony_ci	....
8962306a36Sopenharmony_ci};
9062306a36Sopenharmony_ciRefer to the IOMUXC controller chapter in imx6q datasheet,
9162306a36Sopenharmony_ci0x17059 means enable hysteresis, 47KOhm Pull Up, 50Mhz speed,
9262306a36Sopenharmony_ci80Ohm driver strength and Fast Slew Rate.
9362306a36Sopenharmony_ciUser should refer to each SoC spec to set the correct value.
94