18c2ecf20Sopenharmony_ci* Freescale i.MX7 Dual IOMUX Controller
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciiMX7D supports two iomuxc controllers, fsl,imx7d-iomuxc controller is similar
48c2ecf20Sopenharmony_cias previous iMX SoC generation and fsl,imx7d-iomuxc-lpsr which provides low
58c2ecf20Sopenharmony_cipower state retention capabilities on gpios that are part of iomuxc-lpsr
68c2ecf20Sopenharmony_ci(GPIO1_IO7..GPIO1_IO0). While iomuxc-lpsr provides its own set of registers for
78c2ecf20Sopenharmony_cimux and pad control settings, it shares the input select register from main
88c2ecf20Sopenharmony_ciiomuxc controller for daisy chain settings, the fsl,input-sel property extends
98c2ecf20Sopenharmony_cifsl,imx-pinctrl driver to support iomuxc-lpsr controller.
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciiomuxc_lpsr: iomuxc-lpsr@302c0000 {
128c2ecf20Sopenharmony_ci	compatible = "fsl,imx7d-iomuxc-lpsr";
138c2ecf20Sopenharmony_ci	reg = <0x302c0000 0x10000>;
148c2ecf20Sopenharmony_ci	fsl,input-sel = <&iomuxc>;
158c2ecf20Sopenharmony_ci};
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciiomuxc: iomuxc@30330000 {
188c2ecf20Sopenharmony_ci	compatible = "fsl,imx7d-iomuxc";
198c2ecf20Sopenharmony_ci	reg = <0x30330000 0x10000>;
208c2ecf20Sopenharmony_ci};
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciPeripherals using pads from iomuxc-lpsr support low state retention power
238c2ecf20Sopenharmony_cistate, under LPSR mode GPIO's state of pads are retain.
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ciPlease refer to fsl,imx-pinctrl.txt in this directory for common binding part
268c2ecf20Sopenharmony_ciand usage.
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ciRequired properties:
298c2ecf20Sopenharmony_ci- compatible: "fsl,imx7d-iomuxc" for main IOMUXC controller, or
308c2ecf20Sopenharmony_ci  "fsl,imx7d-iomuxc-lpsr" for Low Power State Retention IOMUXC controller.
318c2ecf20Sopenharmony_ci- fsl,pins: each entry consists of 6 integers and represents the mux and config
328c2ecf20Sopenharmony_ci  setting for one pin.  The first 5 integers <mux_reg conf_reg input_reg mux_val
338c2ecf20Sopenharmony_ci  input_val> are specified using a PIN_FUNC_ID macro, which can be found in
348c2ecf20Sopenharmony_ci  imx7d-pinfunc.h under device tree source folder.  The last integer CONFIG is
358c2ecf20Sopenharmony_ci  the pad setting value like pull-up on this pin.  Please refer to i.MX7 Dual
368c2ecf20Sopenharmony_ci  Reference Manual for detailed CONFIG settings.
378c2ecf20Sopenharmony_ci- fsl,input-sel: required property for iomuxc-lpsr controller, this property is
388c2ecf20Sopenharmony_ci  a phandle for main iomuxc controller which shares the input select register for
398c2ecf20Sopenharmony_ci  daisy chain settings.
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ciCONFIG bits definition:
428c2ecf20Sopenharmony_ciPAD_CTL_PUS_100K_DOWN           (0 << 5)
438c2ecf20Sopenharmony_ciPAD_CTL_PUS_5K_UP               (1 << 5)
448c2ecf20Sopenharmony_ciPAD_CTL_PUS_47K_UP              (2 << 5)
458c2ecf20Sopenharmony_ciPAD_CTL_PUS_100K_UP             (3 << 5)
468c2ecf20Sopenharmony_ciPAD_CTL_PUE                     (1 << 4)
478c2ecf20Sopenharmony_ciPAD_CTL_HYS                     (1 << 3)
488c2ecf20Sopenharmony_ciPAD_CTL_SRE_SLOW                (1 << 2)
498c2ecf20Sopenharmony_ciPAD_CTL_SRE_FAST                (0 << 2)
508c2ecf20Sopenharmony_ciPAD_CTL_DSE_X1                  (0 << 0)
518c2ecf20Sopenharmony_ciPAD_CTL_DSE_X4                  (1 << 0)
528c2ecf20Sopenharmony_ciPAD_CTL_DSE_X2                  (2 << 0)
538c2ecf20Sopenharmony_ciPAD_CTL_DSE_X6                  (3 << 0)
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ciExamples:
568c2ecf20Sopenharmony_ciWhile iomuxc-lpsr is intended to be used by dedicated peripherals to take
578c2ecf20Sopenharmony_ciadvantages of LPSR power mode, is also possible that an IP to use pads from
588c2ecf20Sopenharmony_ciany of the iomux controllers. For example the I2C1 IP can use SCL pad from
598c2ecf20Sopenharmony_ciiomuxc-lpsr controller and SDA pad from iomuxc controller as:
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_cii2c1: i2c@30a20000 {
628c2ecf20Sopenharmony_ci	pinctrl-names = "default";
638c2ecf20Sopenharmony_ci	pinctrl-0 = <&pinctrl_i2c1_1 &pinctrl_i2c1_2>;
648c2ecf20Sopenharmony_ci};
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ciiomuxc-lpsr@302c0000 {
678c2ecf20Sopenharmony_ci	compatible = "fsl,imx7d-iomuxc-lpsr";
688c2ecf20Sopenharmony_ci	reg = <0x302c0000 0x10000>;
698c2ecf20Sopenharmony_ci	fsl,input-sel = <&iomuxc>;
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci	pinctrl_i2c1_1: i2c1grp-1 {
728c2ecf20Sopenharmony_ci		fsl,pins = <
738c2ecf20Sopenharmony_ci			MX7D_PAD_GPIO1_IO04__I2C1_SCL 0x4000007f
748c2ecf20Sopenharmony_ci		>;
758c2ecf20Sopenharmony_ci	};
768c2ecf20Sopenharmony_ci};
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ciiomuxc@30330000 {
798c2ecf20Sopenharmony_ci	compatible = "fsl,imx7d-iomuxc";
808c2ecf20Sopenharmony_ci	reg = <0x30330000 0x10000>;
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci	pinctrl_i2c1_2: i2c1grp-2 {
838c2ecf20Sopenharmony_ci		fsl,pins = <
848c2ecf20Sopenharmony_ci			MX7D_PAD_I2C1_SDA__I2C1_SDA 0x4000007f
858c2ecf20Sopenharmony_ci		>;
868c2ecf20Sopenharmony_ci	};
878c2ecf20Sopenharmony_ci};
88