xref: /linux/Documentation/devicetree/bindings/pinctrl/atmel,at91rm9200-pinctrl.yaml (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
1*bef17a41SManikandan Muralidharan# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*bef17a41SManikandan Muralidharan%YAML 1.2
3*bef17a41SManikandan Muralidharan---
4*bef17a41SManikandan Muralidharan$id: http://devicetree.org/schemas/pinctrl/atmel,at91rm9200-pinctrl.yaml#
5*bef17a41SManikandan Muralidharan$schema: http://devicetree.org/meta-schemas/core.yaml#
6*bef17a41SManikandan Muralidharan
7*bef17a41SManikandan Muralidharantitle: Microchip PIO3 Pinmux Controller
8*bef17a41SManikandan Muralidharan
9*bef17a41SManikandan Muralidharanmaintainers:
10*bef17a41SManikandan Muralidharan  - Manikandan Muralidharan <manikandan.m@microchip.com>
11*bef17a41SManikandan Muralidharan
12*bef17a41SManikandan Muralidharandescription:
13*bef17a41SManikandan Muralidharan  The AT91 Pinmux Controller, enables the IC to share one PAD to several
14*bef17a41SManikandan Muralidharan  functional blocks. The sharing is done by multiplexing the PAD input/output
15*bef17a41SManikandan Muralidharan  signals. For each PAD there are up to 8 muxing options (called periph modes).
16*bef17a41SManikandan Muralidharan  Since different modules require different PAD settings (like pull up, keeper,
17*bef17a41SManikandan Muralidharan  etc) the controller controls also the PAD settings parameters.
18*bef17a41SManikandan Muralidharan
19*bef17a41SManikandan Muralidharanproperties:
20*bef17a41SManikandan Muralidharan  compatible:
21*bef17a41SManikandan Muralidharan    oneOf:
22*bef17a41SManikandan Muralidharan      - items:
23*bef17a41SManikandan Muralidharan          - enum:
24*bef17a41SManikandan Muralidharan              - atmel,at91rm9200-pinctrl
25*bef17a41SManikandan Muralidharan              - atmel,at91sam9x5-pinctrl
26*bef17a41SManikandan Muralidharan              - atmel,sama5d3-pinctrl
27*bef17a41SManikandan Muralidharan              - microchip,sam9x60-pinctrl
28*bef17a41SManikandan Muralidharan          - const: simple-mfd
29*bef17a41SManikandan Muralidharan      - items:
30*bef17a41SManikandan Muralidharan          - enum:
31*bef17a41SManikandan Muralidharan              - microchip,sam9x7-pinctrl
32*bef17a41SManikandan Muralidharan          - const: microchip,sam9x60-pinctrl
33*bef17a41SManikandan Muralidharan          - const: simple-mfd
34*bef17a41SManikandan Muralidharan
35*bef17a41SManikandan Muralidharan  '#address-cells':
36*bef17a41SManikandan Muralidharan    const: 1
37*bef17a41SManikandan Muralidharan
38*bef17a41SManikandan Muralidharan  '#size-cells':
39*bef17a41SManikandan Muralidharan    const: 1
40*bef17a41SManikandan Muralidharan
41*bef17a41SManikandan Muralidharan  ranges: true
42*bef17a41SManikandan Muralidharan
43*bef17a41SManikandan Muralidharan  atmel,mux-mask:
44*bef17a41SManikandan Muralidharan    $ref: /schemas/types.yaml#/definitions/uint32-matrix
45*bef17a41SManikandan Muralidharan    description: |
46*bef17a41SManikandan Muralidharan      Array of mask (periph per bank) to describe if a pin can be
47*bef17a41SManikandan Muralidharan      configured in this periph mode. All the periph and bank need to
48*bef17a41SManikandan Muralidharan      be described.
49*bef17a41SManikandan Muralidharan
50*bef17a41SManikandan Muralidharan      #How to create such array:
51*bef17a41SManikandan Muralidharan
52*bef17a41SManikandan Muralidharan      Each column will represent the possible peripheral of the pinctrl
53*bef17a41SManikandan Muralidharan      Each line will represent a pio bank
54*bef17a41SManikandan Muralidharan
55*bef17a41SManikandan Muralidharan      #Example:
56*bef17a41SManikandan Muralidharan
57*bef17a41SManikandan Muralidharan      In at91sam9260.dtsi,
58*bef17a41SManikandan Muralidharan      Peripheral: 2 ( A and B)
59*bef17a41SManikandan Muralidharan      Bank: 3 (A, B and C)
60*bef17a41SManikandan Muralidharan
61*bef17a41SManikandan Muralidharan      #    A          B
62*bef17a41SManikandan Muralidharan      0xffffffff 0xffc00c3b  # pioA
63*bef17a41SManikandan Muralidharan      0xffffffff 0x7fff3ccf  # pioB
64*bef17a41SManikandan Muralidharan      0xffffffff 0x007fffff  # pioC
65*bef17a41SManikandan Muralidharan
66*bef17a41SManikandan Muralidharan      For each peripheral/bank we will describe in a u32 if a pin can be
67*bef17a41SManikandan Muralidharan      configured in it by putting 1 to the pin bit (1 << pin)
68*bef17a41SManikandan Muralidharan
69*bef17a41SManikandan Muralidharan      Let's take the pioA on peripheral B whose value is 0xffc00c3b
70*bef17a41SManikandan Muralidharan      From the datasheet Table 10-2.
71*bef17a41SManikandan Muralidharan      Peripheral B
72*bef17a41SManikandan Muralidharan      PA0     MCDB0
73*bef17a41SManikandan Muralidharan      PA1     MCCDB
74*bef17a41SManikandan Muralidharan      PA2
75*bef17a41SManikandan Muralidharan      PA3     MCDB3
76*bef17a41SManikandan Muralidharan      PA4     MCDB2
77*bef17a41SManikandan Muralidharan      PA5     MCDB1
78*bef17a41SManikandan Muralidharan      PA6
79*bef17a41SManikandan Muralidharan      PA7
80*bef17a41SManikandan Muralidharan      PA8
81*bef17a41SManikandan Muralidharan      PA9
82*bef17a41SManikandan Muralidharan      PA10    ETX2
83*bef17a41SManikandan Muralidharan      PA11    ETX3
84*bef17a41SManikandan Muralidharan      PA12
85*bef17a41SManikandan Muralidharan      PA13
86*bef17a41SManikandan Muralidharan      PA14
87*bef17a41SManikandan Muralidharan      PA15
88*bef17a41SManikandan Muralidharan      PA16
89*bef17a41SManikandan Muralidharan      PA17
90*bef17a41SManikandan Muralidharan      PA18
91*bef17a41SManikandan Muralidharan      PA19
92*bef17a41SManikandan Muralidharan      PA20
93*bef17a41SManikandan Muralidharan      PA21
94*bef17a41SManikandan Muralidharan      PA22    ETXER
95*bef17a41SManikandan Muralidharan      PA23    ETX2
96*bef17a41SManikandan Muralidharan      PA24    ETX3
97*bef17a41SManikandan Muralidharan      PA25    ERX2
98*bef17a41SManikandan Muralidharan      PA26    ERX3
99*bef17a41SManikandan Muralidharan      PA27    ERXCK
100*bef17a41SManikandan Muralidharan      PA28    ECRS
101*bef17a41SManikandan Muralidharan      PA29    ECOL
102*bef17a41SManikandan Muralidharan      PA30    RXD4
103*bef17a41SManikandan Muralidharan      PA31    TXD4
104*bef17a41SManikandan Muralidharan
105*bef17a41SManikandan MuralidharanallOf:
106*bef17a41SManikandan Muralidharan  - $ref: pinctrl.yaml#
107*bef17a41SManikandan Muralidharan
108*bef17a41SManikandan Muralidharanrequired:
109*bef17a41SManikandan Muralidharan  - compatible
110*bef17a41SManikandan Muralidharan  - ranges
111*bef17a41SManikandan Muralidharan  - "#address-cells"
112*bef17a41SManikandan Muralidharan  - "#size-cells"
113*bef17a41SManikandan Muralidharan  - atmel,mux-mask
114*bef17a41SManikandan Muralidharan
115*bef17a41SManikandan MuralidharanpatternProperties:
116*bef17a41SManikandan Muralidharan  'gpio@[0-9a-f]+$':
117*bef17a41SManikandan Muralidharan    $ref: /schemas/gpio/atmel,at91rm9200-gpio.yaml
118*bef17a41SManikandan Muralidharan    unevaluatedProperties: false
119*bef17a41SManikandan Muralidharan
120*bef17a41SManikandan MuralidharanadditionalProperties:
121*bef17a41SManikandan Muralidharan  type: object
122*bef17a41SManikandan Muralidharan  additionalProperties:
123*bef17a41SManikandan Muralidharan    type: object
124*bef17a41SManikandan Muralidharan    additionalProperties: false
125*bef17a41SManikandan Muralidharan
126*bef17a41SManikandan Muralidharan    properties:
127*bef17a41SManikandan Muralidharan      atmel,pins:
128*bef17a41SManikandan Muralidharan        $ref: /schemas/types.yaml#/definitions/uint32-matrix
129*bef17a41SManikandan Muralidharan        description: |
130*bef17a41SManikandan Muralidharan          Each entry consists of 4 integers and represents the pins
131*bef17a41SManikandan Muralidharan          mux and config setting.The format is
132*bef17a41SManikandan Muralidharan          atmel,pins = <PIN_BANK PIN_BANK_NUM PERIPH CONFIG>.
133*bef17a41SManikandan Muralidharan          Supported pin number and mux varies for different SoCs, and
134*bef17a41SManikandan Muralidharan          are defined in <include/dt-bindings/pinctrl/at91.h>.
135*bef17a41SManikandan Muralidharan          items:
136*bef17a41SManikandan Muralidharan            items:
137*bef17a41SManikandan Muralidharan              - description:
138*bef17a41SManikandan Muralidharan                  Pin bank
139*bef17a41SManikandan Muralidharan              - description:
140*bef17a41SManikandan Muralidharan                  Pin bank index
141*bef17a41SManikandan Muralidharan              - description:
142*bef17a41SManikandan Muralidharan                  Peripheral function
143*bef17a41SManikandan Muralidharan              - description:
144*bef17a41SManikandan Muralidharan                  Pad configuration
145*bef17a41SManikandan Muralidharan
146*bef17a41SManikandan Muralidharanexamples:
147*bef17a41SManikandan Muralidharan  - |
148*bef17a41SManikandan Muralidharan     #include <dt-bindings/clock/at91.h>
149*bef17a41SManikandan Muralidharan     #include <dt-bindings/interrupt-controller/irq.h>
150*bef17a41SManikandan Muralidharan     #include <dt-bindings/pinctrl/at91.h>
151*bef17a41SManikandan Muralidharan
152*bef17a41SManikandan Muralidharan     pinctrl@fffff400 {
153*bef17a41SManikandan Muralidharan       #address-cells = <1>;
154*bef17a41SManikandan Muralidharan       #size-cells = <1>;
155*bef17a41SManikandan Muralidharan       compatible = "atmel,at91rm9200-pinctrl", "simple-mfd";
156*bef17a41SManikandan Muralidharan       ranges = <0xfffff400 0xfffff400 0x600>;
157*bef17a41SManikandan Muralidharan
158*bef17a41SManikandan Muralidharan       atmel,mux-mask = <
159*bef17a41SManikandan Muralidharan         /*    A         B     */
160*bef17a41SManikandan Muralidharan         0xffffffff 0xffc00c3b  /* pioA */
161*bef17a41SManikandan Muralidharan         0xffffffff 0x7fff3ccf  /* pioB */
162*bef17a41SManikandan Muralidharan         0xffffffff 0x007fffff  /* pioC */
163*bef17a41SManikandan Muralidharan         >;
164*bef17a41SManikandan Muralidharan
165*bef17a41SManikandan Muralidharan       dbgu {
166*bef17a41SManikandan Muralidharan         pinctrl_dbgu: dbgu-0 {
167*bef17a41SManikandan Muralidharan           atmel,pins =
168*bef17a41SManikandan Muralidharan             <AT91_PIOB 14 AT91_PERIPH_A AT91_PINCTRL_PULL_UP
169*bef17a41SManikandan Muralidharan              AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_NONE>;
170*bef17a41SManikandan Muralidharan         };
171*bef17a41SManikandan Muralidharan       };
172*bef17a41SManikandan Muralidharan
173*bef17a41SManikandan Muralidharan       pioA: gpio@fffff400 {
174*bef17a41SManikandan Muralidharan         compatible = "atmel,at91rm9200-gpio";
175*bef17a41SManikandan Muralidharan         reg = <0xfffff400 0x200>;
176*bef17a41SManikandan Muralidharan         interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
177*bef17a41SManikandan Muralidharan         #gpio-cells = <2>;
178*bef17a41SManikandan Muralidharan         gpio-controller;
179*bef17a41SManikandan Muralidharan         interrupt-controller;
180*bef17a41SManikandan Muralidharan         #interrupt-cells = <2>;
181*bef17a41SManikandan Muralidharan         clocks = <&pmc PMC_TYPE_PERIPHERAL 2>;
182*bef17a41SManikandan Muralidharan       };
183*bef17a41SManikandan Muralidharan     };
184*bef17a41SManikandan Muralidharan...
185