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