summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/pinctrl/renesas,pfc-pinctrl.txt
blob: d5dac7b843a9d1612e0271f81cc0e9405db55229 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
* Renesas Pin Function Controller (GPIO and Pin Mux/Config)

The Pin Function Controller (PFC) is a Pin Mux/Config controller. On SH7372,
SH73A0, R8A73A4 and R8A7740 it also acts as a GPIO controller.


Pin Control
-----------

Required Properties:

  - compatible: should be one of the following.
    - "renesas,pfc-r8a73a4": for R8A73A4 (R-Mobile APE6) compatible pin-controller.
    - "renesas,pfc-r8a7740": for R8A7740 (R-Mobile A1) compatible pin-controller.
    - "renesas,pfc-r8a7778": for R8A7778 (R-Mobile M1) compatible pin-controller.
    - "renesas,pfc-r8a7779": for R8A7779 (R-Car H1) compatible pin-controller.
    - "renesas,pfc-r8a7790": for R8A7790 (R-Car H2) compatible pin-controller.
    - "renesas,pfc-sh7372": for SH7372 (SH-Mobile AP4) compatible pin-controller.
    - "renesas,pfc-sh73a0": for SH73A0 (SH-Mobile AG5) compatible pin-controller.

  - reg: Base address and length of each memory resource used by the pin
    controller hardware module.

Optional properties:

  - #gpio-range-cells: Mandatory when the PFC doesn't handle GPIO, forbidden
    otherwise. Should be 3.

The PFC node also acts as a container for pin configuration nodes. Please refer
to pinctrl-bindings.txt in this directory for the definition of the term "pin
configuration node" and for the common pinctrl bindings used by client devices.

Each pin configuration node represents a desired configuration for a pin, a
pin group, or a list of pins or pin groups. The configuration can include the
function to select on those pin(s) and pin configuration parameters (such as
pull-up and pull-down).

Pin configuration nodes contain pin configuration properties, either directly
or grouped in child subnodes. Both pin muxing and configuration parameters can
be grouped in that way and referenced as a single pin configuration node by
client devices.

A configuration node or subnode must reference at least one pin (through the
pins or pin groups properties) and contain at least a function or one
configuration parameter. When the function is present only pin groups can be
used to reference pins.

All pin configuration nodes and subnodes names are ignored. All of those nodes
are parsed through phandles and processed purely based on their content.

Pin Configuration Node Properties:

- renesas,pins : An array of strings, each string containing the name of a pin.
- renesas,groups : An array of strings, each string containing the name of a pin
  group.

- renesas,function: A string containing the name of the function to mux to the
  pin group(s) specified by the renesas,groups property

  Valid values for pin, group and function names can be found in the group and
  function arrays of the PFC data file corresponding to the SoC
  (drivers/pinctrl/sh-pfc/pfc-*.c)

The pin configuration parameters use the generic pinconf bindings defined in
pinctrl-bindings.txt in this directory. The supported parameters are
bias-disable, bias-pull-up and bias-pull-down.


GPIO
----

On SH7372, SH73A0, R8A73A4 and R8A7740 the PFC node is also a GPIO controller
node.

Required Properties:

  - gpio-controller: Marks the device node as a gpio controller.

  - #gpio-cells: Should be 2. The first cell is the GPIO number and the second
    cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. Only the
    GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.

The syntax of the gpio specifier used by client nodes should be the following
with values derived from the SoC user manual.

  <[phandle of the gpio controller node]
   [pin number within the gpio controller]
   [flags]>

On other mach-shmobile platforms GPIO is handled by the gpio-rcar driver.
Please refer to Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
for documentation of the GPIO device tree bindings on those platforms.


Examples
--------

Example 1: SH73A0 (SH-Mobile AG5) pin controller node

	pfc: pfc@e6050000 {
		compatible = "renesas,pfc-sh73a0";
		reg = <0xe6050000 0x8000>,
		      <0xe605801c 0x1c>;
		gpio-controller;
		#gpio-cells = <2>;
	};

Example 2: A GPIO LED node that references a GPIO

	#include <dt-bindings/gpio/gpio.h>

	leds {
		compatible = "gpio-leds";
		led1 {
			gpios = <&pfc 20 GPIO_ACTIVE_LOW>;
		};
	};

Example 3: KZM-A9-GT (SH-Mobile AG5) default pin state hog and pin control maps
           for the MMCIF and SCIFA4 devices

	&pfc {
		pinctrl-0 = <&scifa4_pins>;
		pinctrl-names = "default";

		mmcif_pins: mmcif {
			mux {
				renesas,groups = "mmc0_data8_0", "mmc0_ctrl_0";
				renesas,function = "mmc0";
			};
			cfg {
				renesas,groups = "mmc0_data8_0";
				renesas,pins = "PORT279";
				bias-pull-up;
			};
		};

		scifa4_pins: scifa4 {
			renesas,groups = "scifa4_data", "scifa4_ctrl";
			renesas,function = "scifa4";
		};
	};

Example 4: KZM-A9-GT (SH-Mobile AG5) default pin state for the MMCIF device

	&mmcif {
		pinctrl-0 = <&mmcif_pins>;
		pinctrl-names = "default";

		bus-width = <8>;
		vmmc-supply = <&reg_1p8v>;
		status = "okay";
	};