xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/atmel,at91-pio4-pinctrl.txt (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1c66ec88fSEmmanuel Vadot* Atmel PIO4 Controller
2c66ec88fSEmmanuel Vadot
3c66ec88fSEmmanuel VadotThe Atmel PIO4 controller is used to select the function of a pin and to
4c66ec88fSEmmanuel Vadotconfigure it.
5c66ec88fSEmmanuel Vadot
6c66ec88fSEmmanuel VadotRequired properties:
76be33864SEmmanuel Vadot- compatible:
86be33864SEmmanuel Vadot	"atmel,sama5d2-pinctrl"
96be33864SEmmanuel Vadot	"microchip,sama7g5-pinctrl"
10c66ec88fSEmmanuel Vadot- reg: base address and length of the PIO controller.
11c66ec88fSEmmanuel Vadot- interrupts: interrupt outputs from the controller, one for each bank.
12c66ec88fSEmmanuel Vadot- interrupt-controller: mark the device node as an interrupt controller.
13c66ec88fSEmmanuel Vadot- #interrupt-cells: should be two.
14c66ec88fSEmmanuel Vadot- gpio-controller: mark the device node as a gpio controller.
15c66ec88fSEmmanuel Vadot- #gpio-cells: should be two.
16c66ec88fSEmmanuel Vadot
17c66ec88fSEmmanuel VadotPlease refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for
18c66ec88fSEmmanuel Vadota general description of GPIO and interrupt bindings.
19c66ec88fSEmmanuel Vadot
20c66ec88fSEmmanuel VadotPlease refer to pinctrl-bindings.txt in this directory for details of the
21c66ec88fSEmmanuel Vadotcommon pinctrl bindings used by client devices.
22c66ec88fSEmmanuel Vadot
23c66ec88fSEmmanuel VadotSubnode format
24c66ec88fSEmmanuel VadotEach node (or subnode) will list the pins it needs and how to configured these
25c66ec88fSEmmanuel Vadotpins.
26c66ec88fSEmmanuel Vadot
27c66ec88fSEmmanuel Vadot	node {
28c66ec88fSEmmanuel Vadot		pinmux = <PIN_NUMBER_PINMUX>;
29c66ec88fSEmmanuel Vadot		GENERIC_PINCONFIG;
30c66ec88fSEmmanuel Vadot	};
31c66ec88fSEmmanuel Vadot
32c66ec88fSEmmanuel VadotRequired properties:
33c66ec88fSEmmanuel Vadot- pinmux: integer array. Each integer represents a pin number plus mux and
34c66ec88fSEmmanuel Vadotioset settings. Use the macros from boot/dts/<soc>-pinfunc.h file to get the
35c66ec88fSEmmanuel Vadotright representation of the pin.
36c66ec88fSEmmanuel Vadot
37c66ec88fSEmmanuel VadotOptional properties:
385def4c47SEmmanuel Vadot- GENERIC_PINCONFIG: generic pinconfig options to use:
395def4c47SEmmanuel Vadot	- bias-disable, bias-pull-down, bias-pull-up, drive-open-drain,
40*f126890aSEmmanuel Vadot	 drive-push-pull input-schmitt-enable, input-debounce, output-low,
41*f126890aSEmmanuel Vadot	 output-high.
425def4c47SEmmanuel Vadot	- for microchip,sama7g5-pinctrl only:
435def4c47SEmmanuel Vadot		- slew-rate: 0 - disabled, 1 - enabled (default)
44c66ec88fSEmmanuel Vadot- atmel,drive-strength: 0 or 1 for low drive, 2 for medium drive and 3 for
45c66ec88fSEmmanuel Vadothigh drive. The default value is low drive.
46c66ec88fSEmmanuel Vadot
47c66ec88fSEmmanuel VadotExample:
48c66ec88fSEmmanuel Vadot
49c66ec88fSEmmanuel Vadot#include <sama5d2-pinfunc.h>
50c66ec88fSEmmanuel Vadot
51c66ec88fSEmmanuel Vadot...
52c66ec88fSEmmanuel Vadot{
53c66ec88fSEmmanuel Vadot	pioA: pinctrl@fc038000 {
54c66ec88fSEmmanuel Vadot		compatible = "atmel,sama5d2-pinctrl";
55c66ec88fSEmmanuel Vadot		reg = <0xfc038000 0x600>;
56c66ec88fSEmmanuel Vadot		interrupts = <18 IRQ_TYPE_LEVEL_HIGH 7>,
57c66ec88fSEmmanuel Vadot			     <68 IRQ_TYPE_LEVEL_HIGH 7>,
58c66ec88fSEmmanuel Vadot			     <69 IRQ_TYPE_LEVEL_HIGH 7>,
59c66ec88fSEmmanuel Vadot			     <70 IRQ_TYPE_LEVEL_HIGH 7>;
60c66ec88fSEmmanuel Vadot		interrupt-controller;
61c66ec88fSEmmanuel Vadot		#interrupt-cells = <2>;
62c66ec88fSEmmanuel Vadot		gpio-controller;
63c66ec88fSEmmanuel Vadot		#gpio-cells = <2>;
64c66ec88fSEmmanuel Vadot		clocks = <&pioA_clk>;
65c66ec88fSEmmanuel Vadot
66c66ec88fSEmmanuel Vadot		pinctrl_i2c0_default: i2c0_default {
67c66ec88fSEmmanuel Vadot			pinmux = <PIN_PD21__TWD0>,
68c66ec88fSEmmanuel Vadot				 <PIN_PD22__TWCK0>;
69c66ec88fSEmmanuel Vadot			bias-disable;
70c66ec88fSEmmanuel Vadot		};
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadot		pinctrl_led_gpio_default: led_gpio_default {
73c66ec88fSEmmanuel Vadot			pinmux = <PIN_PB0>,
74c66ec88fSEmmanuel Vadot				 <PIN_PB5>;
75c66ec88fSEmmanuel Vadot			bias-pull-up;
76c66ec88fSEmmanuel Vadot			atmel,drive-strength = <ATMEL_PIO_DRVSTR_ME>;
77c66ec88fSEmmanuel Vadot		};
78c66ec88fSEmmanuel Vadot
79c66ec88fSEmmanuel Vadot		pinctrl_sdmmc1_default: sdmmc1_default {
80c66ec88fSEmmanuel Vadot			cmd_data {
81c66ec88fSEmmanuel Vadot				pinmux = <PIN_PA28__SDMMC1_CMD>,
82c66ec88fSEmmanuel Vadot					 <PIN_PA18__SDMMC1_DAT0>,
83c66ec88fSEmmanuel Vadot					 <PIN_PA19__SDMMC1_DAT1>,
84c66ec88fSEmmanuel Vadot					 <PIN_PA20__SDMMC1_DAT2>,
85c66ec88fSEmmanuel Vadot					 <PIN_PA21__SDMMC1_DAT3>;
86c66ec88fSEmmanuel Vadot				bias-pull-up;
87c66ec88fSEmmanuel Vadot			};
88c66ec88fSEmmanuel Vadot
89c66ec88fSEmmanuel Vadot			ck_cd {
90c66ec88fSEmmanuel Vadot				pinmux = <PIN_PA22__SDMMC1_CK>,
91c66ec88fSEmmanuel Vadot					 <PIN_PA30__SDMMC1_CD>;
92c66ec88fSEmmanuel Vadot				bias-disable;
93c66ec88fSEmmanuel Vadot			};
94c66ec88fSEmmanuel Vadot		};
95c66ec88fSEmmanuel Vadot		...
96c66ec88fSEmmanuel Vadot	};
97c66ec88fSEmmanuel Vadot};
98c66ec88fSEmmanuel Vadot...
99