diff options
Diffstat (limited to 'Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt')
-rw-r--r-- | Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt new file mode 100644 index 000000000000..3a268127b054 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pinctrl.txt | |||
@@ -0,0 +1,141 @@ | |||
1 | * Atmel AT91 Pinmux Controller | ||
2 | |||
3 | The AT91 Pinmux Controler, enables the IC | ||
4 | to share one PAD to several functional blocks. The sharing is done by | ||
5 | multiplexing the PAD input/output signals. For each PAD there are up to | ||
6 | 8 muxing options (called periph modes). Since different modules require | ||
7 | different PAD settings (like pull up, keeper, etc) the contoller controls | ||
8 | also the PAD settings parameters. | ||
9 | |||
10 | Please refer to pinctrl-bindings.txt in this directory for details of the | ||
11 | common pinctrl bindings used by client devices, including the meaning of the | ||
12 | phrase "pin configuration node". | ||
13 | |||
14 | Atmel AT91 pin configuration node is a node of a group of pins which can be | ||
15 | used for a specific device or function. This node represents both mux and config | ||
16 | of the pins in that group. The 'pins' selects the function mode(also named pin | ||
17 | mode) this pin can work on and the 'config' configures various pad settings | ||
18 | such as pull-up, multi drive, etc. | ||
19 | |||
20 | Required properties for iomux controller: | ||
21 | - compatible: "atmel,at91rm9200-pinctrl" | ||
22 | - atmel,mux-mask: array of mask (periph per bank) to describe if a pin can be | ||
23 | configured in this periph mode. All the periph and bank need to be describe. | ||
24 | |||
25 | How to create such array: | ||
26 | |||
27 | Each column will represent the possible peripheral of the pinctrl | ||
28 | Each line will represent a pio bank | ||
29 | |||
30 | Take an example on the 9260 | ||
31 | Peripheral: 2 ( A and B) | ||
32 | Bank: 3 (A, B and C) | ||
33 | => | ||
34 | |||
35 | /* A B */ | ||
36 | 0xffffffff 0xffc00c3b /* pioA */ | ||
37 | 0xffffffff 0x7fff3ccf /* pioB */ | ||
38 | 0xffffffff 0x007fffff /* pioC */ | ||
39 | |||
40 | For each peripheral/bank we will descibe in a u32 if a pin can can be | ||
41 | configured in it by putting 1 to the pin bit (1 << pin) | ||
42 | |||
43 | Let's take the pioA on peripheral B | ||
44 | From the datasheet Table 10-2. | ||
45 | Peripheral B | ||
46 | PA0 MCDB0 | ||
47 | PA1 MCCDB | ||
48 | PA2 | ||
49 | PA3 MCDB3 | ||
50 | PA4 MCDB2 | ||
51 | PA5 MCDB1 | ||
52 | PA6 | ||
53 | PA7 | ||
54 | PA8 | ||
55 | PA9 | ||
56 | PA10 ETX2 | ||
57 | PA11 ETX3 | ||
58 | PA12 | ||
59 | PA13 | ||
60 | PA14 | ||
61 | PA15 | ||
62 | PA16 | ||
63 | PA17 | ||
64 | PA18 | ||
65 | PA19 | ||
66 | PA20 | ||
67 | PA21 | ||
68 | PA22 ETXER | ||
69 | PA23 ETX2 | ||
70 | PA24 ETX3 | ||
71 | PA25 ERX2 | ||
72 | PA26 ERX3 | ||
73 | PA27 ERXCK | ||
74 | PA28 ECRS | ||
75 | PA29 ECOL | ||
76 | PA30 RXD4 | ||
77 | PA31 TXD4 | ||
78 | |||
79 | => 0xffc00c3b | ||
80 | |||
81 | Required properties for pin configuration node: | ||
82 | - atmel,pins: 4 integers array, represents a group of pins mux and config | ||
83 | setting. The format is atmel,pins = <PIN_BANK PIN_BANK_NUM PERIPH CONFIG>. | ||
84 | The PERIPH 0 means gpio. | ||
85 | |||
86 | Bits used for CONFIG: | ||
87 | PULL_UP (1 << 0): indicate this pin need a pull up. | ||
88 | MULTIDRIVE (1 << 1): indicate this pin need to be configured as multidrive. | ||
89 | DEGLITCH (1 << 2): indicate this pin need deglitch. | ||
90 | PULL_DOWN (1 << 3): indicate this pin need a pull down. | ||
91 | DIS_SCHMIT (1 << 4): indicate this pin need to disable schmit trigger. | ||
92 | DEBOUNCE (1 << 16): indicate this pin need debounce. | ||
93 | DEBOUNCE_VAL (0x3fff << 17): debounce val. | ||
94 | |||
95 | NOTE: | ||
96 | Some requirements for using atmel,at91rm9200-pinctrl binding: | ||
97 | 1. We have pin function node defined under at91 controller node to represent | ||
98 | what pinmux functions this SoC supports. | ||
99 | 2. The driver can use the function node's name and pin configuration node's | ||
100 | name describe the pin function and group hierarchy. | ||
101 | For example, Linux at91 pinctrl driver takes the function node's name | ||
102 | as the function name and pin configuration node's name as group name to | ||
103 | create the map table. | ||
104 | 3. Each pin configuration node should have a phandle, devices can set pins | ||
105 | configurations by referring to the phandle of that pin configuration node. | ||
106 | 4. The gpio controller must be describe in the pinctrl simple-bus. | ||
107 | |||
108 | Examples: | ||
109 | |||
110 | pinctrl@fffff400 { | ||
111 | #address-cells = <1>; | ||
112 | #size-cells = <1>; | ||
113 | ranges; | ||
114 | compatible = "atmel,at91rm9200-pinctrl", "simple-bus"; | ||
115 | reg = <0xfffff400 0x600>; | ||
116 | |||
117 | atmel,mux-mask = < | ||
118 | /* A B */ | ||
119 | 0xffffffff 0xffc00c3b /* pioA */ | ||
120 | 0xffffffff 0x7fff3ccf /* pioB */ | ||
121 | 0xffffffff 0x007fffff /* pioC */ | ||
122 | >; | ||
123 | |||
124 | /* shared pinctrl settings */ | ||
125 | dbgu { | ||
126 | pinctrl_dbgu: dbgu-0 { | ||
127 | atmel,pins = | ||
128 | <1 14 0x1 0x0 /* PB14 periph A */ | ||
129 | 1 15 0x1 0x1>; /* PB15 periph with pullup */ | ||
130 | }; | ||
131 | }; | ||
132 | }; | ||
133 | |||
134 | dbgu: serial@fffff200 { | ||
135 | compatible = "atmel,at91sam9260-usart"; | ||
136 | reg = <0xfffff200 0x200>; | ||
137 | interrupts = <1 4 7>; | ||
138 | pinctrl-names = "default"; | ||
139 | pinctrl-0 = <&pinctrl_dbgu>; | ||
140 | status = "disabled"; | ||
141 | }; | ||