162306a36Sopenharmony_ci* Freescale MXS Pin Controller
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciThe pins controlled by mxs pin controller are organized in banks, each bank
462306a36Sopenharmony_cihas 32 pins.  Each pin has 4 multiplexing functions, and generally, the 4th
562306a36Sopenharmony_cifunction is GPIO.  The configuration on the pins includes drive strength,
662306a36Sopenharmony_civoltage and pull-up.
762306a36Sopenharmony_ci
862306a36Sopenharmony_ciRequired properties:
962306a36Sopenharmony_ci- compatible: "fsl,imx23-pinctrl" or "fsl,imx28-pinctrl"
1062306a36Sopenharmony_ci- reg: Should contain the register physical address and length for the
1162306a36Sopenharmony_ci  pin controller.
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciPlease refer to pinctrl-bindings.txt in this directory for details of the
1462306a36Sopenharmony_cicommon pinctrl bindings used by client devices.
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciThe node of mxs pin controller acts as a container for an arbitrary number of
1762306a36Sopenharmony_cisubnodes.  Each of these subnodes represents some desired configuration for
1862306a36Sopenharmony_cia group of pins, and only affects those parameters that are explicitly listed.
1962306a36Sopenharmony_ciIn other words, a subnode that describes a drive strength parameter implies no
2062306a36Sopenharmony_ciinformation about pull-up. For this reason, even seemingly boolean values are
2162306a36Sopenharmony_ciactually tristates in this binding: unspecified, off, or on. Unspecified is
2262306a36Sopenharmony_cirepresented as an absent property, and off/on are represented as integer
2362306a36Sopenharmony_civalues 0 and 1.
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ciThose subnodes under mxs pin controller node will fall into two categories.
2662306a36Sopenharmony_ciOne is to set up a group of pins for a function, both mux selection and pin
2762306a36Sopenharmony_ciconfigurations, and it's called group node in the binding document.   The other
2862306a36Sopenharmony_cione is to adjust the pin configuration for some particular pins that need a
2962306a36Sopenharmony_cidifferent configuration than what is defined in group node.  The binding
3062306a36Sopenharmony_cidocument calls this type of node config node.
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ciOn mxs, there is no hardware pin group. The pin group in this binding only
3362306a36Sopenharmony_cimeans a group of pins put together for particular peripheral to work in
3462306a36Sopenharmony_ciparticular function, like SSP0 functioning as mmc0-8bit.  That said, the
3562306a36Sopenharmony_cigroup node should include all the pins needed for one function rather than
3662306a36Sopenharmony_cihaving these pins defined in several group nodes.  It also means each of
3762306a36Sopenharmony_ci"pinctrl-*" phandle in client device node should only have one group node
3862306a36Sopenharmony_cipointed in there, while the phandle can have multiple config node referenced
3962306a36Sopenharmony_cithere to adjust configurations for some pins in the group.
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ciRequired subnode-properties:
4262306a36Sopenharmony_ci- fsl,pinmux-ids: An integer array.  Each integer in the array specify a pin
4362306a36Sopenharmony_ci  with given mux function, with bank, pin and mux packed as below.
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci    [15..12] : bank number
4662306a36Sopenharmony_ci    [11..4]  : pin number
4762306a36Sopenharmony_ci    [3..0]   : mux selection
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci  This integer with mux selection packed is used as an entity by both group
5062306a36Sopenharmony_ci  and config nodes to identify a pin.  The mux selection in the integer takes
5162306a36Sopenharmony_ci  effects only on group node, and will get ignored by driver with config node,
5262306a36Sopenharmony_ci  since config node is only meant to set up pin configurations.
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci  Valid values for these integers are listed below.
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci- reg: Should be the index of the group nodes for same function.  This property
5762306a36Sopenharmony_ci  is required only for group nodes, and should not be present in any config
5862306a36Sopenharmony_ci  nodes.
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ciOptional subnode-properties:
6162306a36Sopenharmony_ci- fsl,drive-strength: Integer.
6262306a36Sopenharmony_ci    0: MXS_DRIVE_4mA
6362306a36Sopenharmony_ci    1: MXS_DRIVE_8mA
6462306a36Sopenharmony_ci    2: MXS_DRIVE_12mA
6562306a36Sopenharmony_ci    3: MXS_DRIVE_16mA
6662306a36Sopenharmony_ci- fsl,voltage: Integer.
6762306a36Sopenharmony_ci    0: MXS_VOLTAGE_LOW  - 1.8 V
6862306a36Sopenharmony_ci    1: MXS_VOLTAGE_HIGH - 3.3 V
6962306a36Sopenharmony_ci- fsl,pull-up: Integer.
7062306a36Sopenharmony_ci    0: MXS_PULL_DISABLE - Disable the internal pull-up
7162306a36Sopenharmony_ci    1: MXS_PULL_ENABLE  - Enable the internal pull-up
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ciNote that when enabling the pull-up, the internal pad keeper gets disabled.
7462306a36Sopenharmony_ciAlso, some pins doesn't have a pull up, in that case, setting the fsl,pull-up
7562306a36Sopenharmony_ciwill only disable the internal pad keeper.
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ciExamples:
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_cipinctrl@80018000 {
8062306a36Sopenharmony_ci	#address-cells = <1>;
8162306a36Sopenharmony_ci	#size-cells = <0>;
8262306a36Sopenharmony_ci	compatible = "fsl,imx28-pinctrl";
8362306a36Sopenharmony_ci	reg = <0x80018000 2000>;
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci	mmc0_8bit_pins_a: mmc0-8bit@0 {
8662306a36Sopenharmony_ci		reg = <0>;
8762306a36Sopenharmony_ci		fsl,pinmux-ids = <
8862306a36Sopenharmony_ci			MX28_PAD_SSP0_DATA0__SSP0_D0
8962306a36Sopenharmony_ci			MX28_PAD_SSP0_DATA1__SSP0_D1
9062306a36Sopenharmony_ci			MX28_PAD_SSP0_DATA2__SSP0_D2
9162306a36Sopenharmony_ci			MX28_PAD_SSP0_DATA3__SSP0_D3
9262306a36Sopenharmony_ci			MX28_PAD_SSP0_DATA4__SSP0_D4
9362306a36Sopenharmony_ci			MX28_PAD_SSP0_DATA5__SSP0_D5
9462306a36Sopenharmony_ci			MX28_PAD_SSP0_DATA6__SSP0_D6
9562306a36Sopenharmony_ci			MX28_PAD_SSP0_DATA7__SSP0_D7
9662306a36Sopenharmony_ci			MX28_PAD_SSP0_CMD__SSP0_CMD
9762306a36Sopenharmony_ci			MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT
9862306a36Sopenharmony_ci			MX28_PAD_SSP0_SCK__SSP0_SCK
9962306a36Sopenharmony_ci		>;
10062306a36Sopenharmony_ci		fsl,drive-strength = <MXS_DRIVE_4mA>;
10162306a36Sopenharmony_ci		fsl,voltage = <MXS_VOLTAGE_HIGH>;
10262306a36Sopenharmony_ci		fsl,pull-up = <MXS_PULL_ENABLE>;
10362306a36Sopenharmony_ci	};
10462306a36Sopenharmony_ci
10562306a36Sopenharmony_ci	mmc_cd_cfg: mmc-cd-cfg {
10662306a36Sopenharmony_ci		fsl,pinmux-ids = <MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT>;
10762306a36Sopenharmony_ci		fsl,pull-up = <MXS_PULL_DISABLE>;
10862306a36Sopenharmony_ci	};
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci	mmc_sck_cfg: mmc-sck-cfg {
11162306a36Sopenharmony_ci		fsl,pinmux-ids = <MX28_PAD_SSP0_SCK__SSP0_SCK>;
11262306a36Sopenharmony_ci		fsl,drive-strength = <MXS_DRIVE_12mA>;
11362306a36Sopenharmony_ci		fsl,pull-up = <MXS_PULL_DISABLE>;
11462306a36Sopenharmony_ci	};
11562306a36Sopenharmony_ci};
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ciIn this example, group node mmc0-8bit defines a group of pins for mxs SSP0
11862306a36Sopenharmony_cito function as a 8-bit mmc device, with 8mA, 3.3V and pull-up configurations
11962306a36Sopenharmony_ciapplied on all these pins.  And config nodes mmc-cd-cfg and mmc-sck-cfg are
12062306a36Sopenharmony_ciadjusting the configuration for pins card-detection and clock from what group
12162306a36Sopenharmony_cinode mmc0-8bit defines.  Only the configuration properties to be adjusted need
12262306a36Sopenharmony_cito be listed in the config nodes.
12362306a36Sopenharmony_ci
12462306a36Sopenharmony_ciValid values for i.MX28/i.MX23 pinmux-id are defined in
12562306a36Sopenharmony_ciarch/arm/boot/dts/imx28-pinfunc.h and arch/arm/boot/dts/imx23-pinfunc.h.
12662306a36Sopenharmony_ciThe definitions for the padconfig properties can be found in
12762306a36Sopenharmony_ciarch/arm/boot/dts/mxs-pinfunc.h.
128