xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/fsl,mxs-pinctrl.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot* Freescale MXS Pin Controller
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotThe pins controlled by mxs pin controller are organized in banks, each bank
4*c66ec88fSEmmanuel Vadothas 32 pins.  Each pin has 4 multiplexing functions, and generally, the 4th
5*c66ec88fSEmmanuel Vadotfunction is GPIO.  The configuration on the pins includes drive strength,
6*c66ec88fSEmmanuel Vadotvoltage and pull-up.
7*c66ec88fSEmmanuel Vadot
8*c66ec88fSEmmanuel VadotRequired properties:
9*c66ec88fSEmmanuel Vadot- compatible: "fsl,imx23-pinctrl" or "fsl,imx28-pinctrl"
10*c66ec88fSEmmanuel Vadot- reg: Should contain the register physical address and length for the
11*c66ec88fSEmmanuel Vadot  pin controller.
12*c66ec88fSEmmanuel Vadot
13*c66ec88fSEmmanuel VadotPlease refer to pinctrl-bindings.txt in this directory for details of the
14*c66ec88fSEmmanuel Vadotcommon pinctrl bindings used by client devices.
15*c66ec88fSEmmanuel Vadot
16*c66ec88fSEmmanuel VadotThe node of mxs pin controller acts as a container for an arbitrary number of
17*c66ec88fSEmmanuel Vadotsubnodes.  Each of these subnodes represents some desired configuration for
18*c66ec88fSEmmanuel Vadota group of pins, and only affects those parameters that are explicitly listed.
19*c66ec88fSEmmanuel VadotIn other words, a subnode that describes a drive strength parameter implies no
20*c66ec88fSEmmanuel Vadotinformation about pull-up. For this reason, even seemingly boolean values are
21*c66ec88fSEmmanuel Vadotactually tristates in this binding: unspecified, off, or on. Unspecified is
22*c66ec88fSEmmanuel Vadotrepresented as an absent property, and off/on are represented as integer
23*c66ec88fSEmmanuel Vadotvalues 0 and 1.
24*c66ec88fSEmmanuel Vadot
25*c66ec88fSEmmanuel VadotThose subnodes under mxs pin controller node will fall into two categories.
26*c66ec88fSEmmanuel VadotOne is to set up a group of pins for a function, both mux selection and pin
27*c66ec88fSEmmanuel Vadotconfigurations, and it's called group node in the binding document.   The other
28*c66ec88fSEmmanuel Vadotone is to adjust the pin configuration for some particular pins that need a
29*c66ec88fSEmmanuel Vadotdifferent configuration than what is defined in group node.  The binding
30*c66ec88fSEmmanuel Vadotdocument calls this type of node config node.
31*c66ec88fSEmmanuel Vadot
32*c66ec88fSEmmanuel VadotOn mxs, there is no hardware pin group. The pin group in this binding only
33*c66ec88fSEmmanuel Vadotmeans a group of pins put together for particular peripheral to work in
34*c66ec88fSEmmanuel Vadotparticular function, like SSP0 functioning as mmc0-8bit.  That said, the
35*c66ec88fSEmmanuel Vadotgroup node should include all the pins needed for one function rather than
36*c66ec88fSEmmanuel Vadothaving these pins defined in several group nodes.  It also means each of
37*c66ec88fSEmmanuel Vadot"pinctrl-*" phandle in client device node should only have one group node
38*c66ec88fSEmmanuel Vadotpointed in there, while the phandle can have multiple config node referenced
39*c66ec88fSEmmanuel Vadotthere to adjust configurations for some pins in the group.
40*c66ec88fSEmmanuel Vadot
41*c66ec88fSEmmanuel VadotRequired subnode-properties:
42*c66ec88fSEmmanuel Vadot- fsl,pinmux-ids: An integer array.  Each integer in the array specify a pin
43*c66ec88fSEmmanuel Vadot  with given mux function, with bank, pin and mux packed as below.
44*c66ec88fSEmmanuel Vadot
45*c66ec88fSEmmanuel Vadot    [15..12] : bank number
46*c66ec88fSEmmanuel Vadot    [11..4]  : pin number
47*c66ec88fSEmmanuel Vadot    [3..0]   : mux selection
48*c66ec88fSEmmanuel Vadot
49*c66ec88fSEmmanuel Vadot  This integer with mux selection packed is used as an entity by both group
50*c66ec88fSEmmanuel Vadot  and config nodes to identify a pin.  The mux selection in the integer takes
51*c66ec88fSEmmanuel Vadot  effects only on group node, and will get ignored by driver with config node,
52*c66ec88fSEmmanuel Vadot  since config node is only meant to set up pin configurations.
53*c66ec88fSEmmanuel Vadot
54*c66ec88fSEmmanuel Vadot  Valid values for these integers are listed below.
55*c66ec88fSEmmanuel Vadot
56*c66ec88fSEmmanuel Vadot- reg: Should be the index of the group nodes for same function.  This property
57*c66ec88fSEmmanuel Vadot  is required only for group nodes, and should not be present in any config
58*c66ec88fSEmmanuel Vadot  nodes.
59*c66ec88fSEmmanuel Vadot
60*c66ec88fSEmmanuel VadotOptional subnode-properties:
61*c66ec88fSEmmanuel Vadot- fsl,drive-strength: Integer.
62*c66ec88fSEmmanuel Vadot    0: MXS_DRIVE_4mA
63*c66ec88fSEmmanuel Vadot    1: MXS_DRIVE_8mA
64*c66ec88fSEmmanuel Vadot    2: MXS_DRIVE_12mA
65*c66ec88fSEmmanuel Vadot    3: MXS_DRIVE_16mA
66*c66ec88fSEmmanuel Vadot- fsl,voltage: Integer.
67*c66ec88fSEmmanuel Vadot    0: MXS_VOLTAGE_LOW  - 1.8 V
68*c66ec88fSEmmanuel Vadot    1: MXS_VOLTAGE_HIGH - 3.3 V
69*c66ec88fSEmmanuel Vadot- fsl,pull-up: Integer.
70*c66ec88fSEmmanuel Vadot    0: MXS_PULL_DISABLE - Disable the internal pull-up
71*c66ec88fSEmmanuel Vadot    1: MXS_PULL_ENABLE  - Enable the internal pull-up
72*c66ec88fSEmmanuel Vadot
73*c66ec88fSEmmanuel VadotNote that when enabling the pull-up, the internal pad keeper gets disabled.
74*c66ec88fSEmmanuel VadotAlso, some pins doesn't have a pull up, in that case, setting the fsl,pull-up
75*c66ec88fSEmmanuel Vadotwill only disable the internal pad keeper.
76*c66ec88fSEmmanuel Vadot
77*c66ec88fSEmmanuel VadotExamples:
78*c66ec88fSEmmanuel Vadot
79*c66ec88fSEmmanuel Vadotpinctrl@80018000 {
80*c66ec88fSEmmanuel Vadot	#address-cells = <1>;
81*c66ec88fSEmmanuel Vadot	#size-cells = <0>;
82*c66ec88fSEmmanuel Vadot	compatible = "fsl,imx28-pinctrl";
83*c66ec88fSEmmanuel Vadot	reg = <0x80018000 2000>;
84*c66ec88fSEmmanuel Vadot
85*c66ec88fSEmmanuel Vadot	mmc0_8bit_pins_a: mmc0-8bit@0 {
86*c66ec88fSEmmanuel Vadot		reg = <0>;
87*c66ec88fSEmmanuel Vadot		fsl,pinmux-ids = <
88*c66ec88fSEmmanuel Vadot			MX28_PAD_SSP0_DATA0__SSP0_D0
89*c66ec88fSEmmanuel Vadot			MX28_PAD_SSP0_DATA1__SSP0_D1
90*c66ec88fSEmmanuel Vadot			MX28_PAD_SSP0_DATA2__SSP0_D2
91*c66ec88fSEmmanuel Vadot			MX28_PAD_SSP0_DATA3__SSP0_D3
92*c66ec88fSEmmanuel Vadot			MX28_PAD_SSP0_DATA4__SSP0_D4
93*c66ec88fSEmmanuel Vadot			MX28_PAD_SSP0_DATA5__SSP0_D5
94*c66ec88fSEmmanuel Vadot			MX28_PAD_SSP0_DATA6__SSP0_D6
95*c66ec88fSEmmanuel Vadot			MX28_PAD_SSP0_DATA7__SSP0_D7
96*c66ec88fSEmmanuel Vadot			MX28_PAD_SSP0_CMD__SSP0_CMD
97*c66ec88fSEmmanuel Vadot			MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT
98*c66ec88fSEmmanuel Vadot			MX28_PAD_SSP0_SCK__SSP0_SCK
99*c66ec88fSEmmanuel Vadot		>;
100*c66ec88fSEmmanuel Vadot		fsl,drive-strength = <MXS_DRIVE_4mA>;
101*c66ec88fSEmmanuel Vadot		fsl,voltage = <MXS_VOLTAGE_HIGH>;
102*c66ec88fSEmmanuel Vadot		fsl,pull-up = <MXS_PULL_ENABLE>;
103*c66ec88fSEmmanuel Vadot	};
104*c66ec88fSEmmanuel Vadot
105*c66ec88fSEmmanuel Vadot	mmc_cd_cfg: mmc-cd-cfg {
106*c66ec88fSEmmanuel Vadot		fsl,pinmux-ids = <MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT>;
107*c66ec88fSEmmanuel Vadot		fsl,pull-up = <MXS_PULL_DISABLE>;
108*c66ec88fSEmmanuel Vadot	};
109*c66ec88fSEmmanuel Vadot
110*c66ec88fSEmmanuel Vadot	mmc_sck_cfg: mmc-sck-cfg {
111*c66ec88fSEmmanuel Vadot		fsl,pinmux-ids = <MX28_PAD_SSP0_SCK__SSP0_SCK>;
112*c66ec88fSEmmanuel Vadot		fsl,drive-strength = <MXS_DRIVE_12mA>;
113*c66ec88fSEmmanuel Vadot		fsl,pull-up = <MXS_PULL_DISABLE>;
114*c66ec88fSEmmanuel Vadot	};
115*c66ec88fSEmmanuel Vadot};
116*c66ec88fSEmmanuel Vadot
117*c66ec88fSEmmanuel VadotIn this example, group node mmc0-8bit defines a group of pins for mxs SSP0
118*c66ec88fSEmmanuel Vadotto function as a 8-bit mmc device, with 8mA, 3.3V and pull-up configurations
119*c66ec88fSEmmanuel Vadotapplied on all these pins.  And config nodes mmc-cd-cfg and mmc-sck-cfg are
120*c66ec88fSEmmanuel Vadotadjusting the configuration for pins card-detection and clock from what group
121*c66ec88fSEmmanuel Vadotnode mmc0-8bit defines.  Only the configuration properties to be adjusted need
122*c66ec88fSEmmanuel Vadotto be listed in the config nodes.
123*c66ec88fSEmmanuel Vadot
124*c66ec88fSEmmanuel VadotValid values for i.MX28/i.MX23 pinmux-id are defined in
125*c66ec88fSEmmanuel Vadotarch/arm/boot/dts/imx28-pinfunc.h and arch/arm/boot/dts/imx23-pinfunc.h.
126*c66ec88fSEmmanuel VadotThe definitions for the padconfig properties can be found in
127*c66ec88fSEmmanuel Vadotarch/arm/boot/dts/mxs-pinfunc.h.
128