1ae75ff81SDong Aisheng* Freescale IOMUX Controller (IOMUXC) for i.MX 2ae75ff81SDong Aisheng 3ae75ff81SDong AishengThe IOMUX Controller (IOMUXC), together with the IOMUX, enables the IC 4ae75ff81SDong Aishengto share one PAD to several functional blocks. The sharing is done by 5ae75ff81SDong Aishengmultiplexing the PAD input/output signals. For each PAD there are up to 6ae75ff81SDong Aisheng8 muxing options (called ALT modes). Since different modules require 7ae75ff81SDong Aishengdifferent PAD settings (like pull up, keeper, etc) the IOMUXC controls 8ae75ff81SDong Aishengalso the PAD settings parameters. 9ae75ff81SDong Aisheng 10ae75ff81SDong AishengPlease refer to pinctrl-bindings.txt in this directory for details of the 11ae75ff81SDong Aishengcommon pinctrl bindings used by client devices, including the meaning of the 12ae75ff81SDong Aishengphrase "pin configuration node". 13ae75ff81SDong Aisheng 14ae75ff81SDong AishengFreescale IMX pin configuration node is a node of a group of pins which can be 15ae75ff81SDong Aishengused for a specific device or function. This node represents both mux and config 16ae75ff81SDong Aishengof the pins in that group. The 'mux' selects the function mode(also named mux 17ae75ff81SDong Aishengmode) this pin can work on and the 'config' configures various pad settings 18ae75ff81SDong Aishengsuch as pull-up, open drain, drive strength, etc. 19ae75ff81SDong Aisheng 20ae75ff81SDong AishengRequired properties for iomux controller: 21ae75ff81SDong Aisheng- compatible: "fsl,<soc>-iomuxc" 22ae75ff81SDong Aisheng Please refer to each fsl,<soc>-pinctrl.txt binding doc for supported SoCs. 23ae75ff81SDong Aisheng 24ae75ff81SDong AishengRequired properties for pin configuration node: 25d1c30115SShawn Guo- fsl,pins: each entry consists of 6 integers and represents the mux and config 26d1c30115SShawn Guo setting for one pin. The first 5 integers <mux_reg conf_reg input_reg mux_val 27d1c30115SShawn Guo input_val> are specified using a PIN_FUNC_ID macro, which can be found in 28d1c30115SShawn Guo imx*-pinfunc.h under device tree source folder. The last integer CONFIG is 29d1c30115SShawn Guo the pad setting value like pull-up on this pin. And that's why fsl,pins entry 30d1c30115SShawn Guo looks like <PIN_FUNC_ID CONFIG> in the example below. 31ae75ff81SDong Aisheng 32ae75ff81SDong AishengBits used for CONFIG: 33ae75ff81SDong AishengNO_PAD_CTL(1 << 31): indicate this pin does not need config. 34ae75ff81SDong Aisheng 35ae75ff81SDong AishengSION(1 << 30): Software Input On Field. 36ae75ff81SDong AishengForce the selected mux mode input path no matter of MUX_MODE functionality. 37ae75ff81SDong AishengBy default the input path is determined by functionality of the selected 38ae75ff81SDong Aishengmux mode (regular). 39ae75ff81SDong Aisheng 40ae75ff81SDong AishengOther bits are used for PAD setting. 41ae75ff81SDong AishengPlease refer to each fsl,<soc>-pinctrl,txt binding doc for SoC specific part 42ae75ff81SDong Aishengof bits definitions. 43ae75ff81SDong Aisheng 44ae75ff81SDong AishengNOTE: 45ae75ff81SDong AishengSome requirements for using fsl,imx-pinctrl binding: 46ae75ff81SDong Aisheng1. We have pin function node defined under iomux controller node to represent 47ae75ff81SDong Aisheng what pinmux functions this SoC supports. 48ae75ff81SDong Aisheng2. The pin configuration node intends to work on a specific function should 49ae75ff81SDong Aisheng to be defined under that specific function node. 50ae75ff81SDong Aisheng The function node's name should represent well about what function 51ae75ff81SDong Aisheng this group of pins in this pin configuration node are working on. 52ae75ff81SDong Aisheng3. The driver can use the function node's name and pin configuration node's 53ae75ff81SDong Aisheng name describe the pin function and group hierarchy. 54ae75ff81SDong Aisheng For example, Linux IMX pinctrl driver takes the function node's name 55ae75ff81SDong Aisheng as the function name and pin configuration node's name as group name to 56ae75ff81SDong Aisheng create the map table. 57ae75ff81SDong Aisheng4. Each pin configuration node should have a phandle, devices can set pins 58ae75ff81SDong Aisheng configurations by referring to the phandle of that pin configuration node. 59ae75ff81SDong Aisheng 60ae75ff81SDong AishengExamples: 61*48c926cdSMarco Franchiusdhc@219c000 { /* uSDHC4 */ 62a04ad043SDirk Behme non-removable; 63ae75ff81SDong Aisheng vmmc-supply = <®_3p3v>; 64ae75ff81SDong Aisheng pinctrl-names = "default"; 65ae75ff81SDong Aisheng pinctrl-0 = <&pinctrl_usdhc4_1>; 66ae75ff81SDong Aisheng}; 67ae75ff81SDong Aisheng 68*48c926cdSMarco Franchiiomuxc@20e0000 { 69ae75ff81SDong Aisheng compatible = "fsl,imx6q-iomuxc"; 70ae75ff81SDong Aisheng reg = <0x020e0000 0x4000>; 71ae75ff81SDong Aisheng 72ae75ff81SDong Aisheng /* shared pinctrl settings */ 73ae75ff81SDong Aisheng usdhc4 { 74ae75ff81SDong Aisheng pinctrl_usdhc4_1: usdhc4grp-1 { 75d1c30115SShawn Guo fsl,pins = < 76d1c30115SShawn Guo MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059 77d1c30115SShawn Guo MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059 78d1c30115SShawn Guo MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059 79d1c30115SShawn Guo MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059 80d1c30115SShawn Guo MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059 81d1c30115SShawn Guo MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059 82d1c30115SShawn Guo MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059 83d1c30115SShawn Guo MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059 84d1c30115SShawn Guo MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059 85d1c30115SShawn Guo MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059 86d1c30115SShawn Guo >; 87ae75ff81SDong Aisheng }; 88ae75ff81SDong Aisheng .... 89ae75ff81SDong Aisheng}; 90ae75ff81SDong AishengRefer to the IOMUXC controller chapter in imx6q datasheet, 91ae75ff81SDong Aisheng0x17059 means enable hysteresis, 47KOhm Pull Up, 50Mhz speed, 92ae75ff81SDong Aisheng80Ohm driver strength and Fast Slew Rate. 93ae75ff81SDong AishengUser should refer to each SoC spec to set the correct value. 94