xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/microchip,pic32-pinctrl.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot* Microchip PIC32 Pin Controller
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotPlease refer to pinctrl-bindings.txt, ../gpio/gpio.txt, and
4*c66ec88fSEmmanuel Vadot../interrupt-controller/interrupts.txt for generic information regarding
5*c66ec88fSEmmanuel Vadotpin controller, GPIO, and interrupt bindings.
6*c66ec88fSEmmanuel Vadot
7*c66ec88fSEmmanuel VadotPIC32 'pin configuration node' is a node of a group of pins which can be
8*c66ec88fSEmmanuel Vadotused for a specific device or function. This node represents configurations of
9*c66ec88fSEmmanuel Vadotpins, optional function, and optional mux related configuration.
10*c66ec88fSEmmanuel Vadot
11*c66ec88fSEmmanuel VadotRequired properties for pin controller node:
12*c66ec88fSEmmanuel Vadot - compatible: "microchip,pic32mada-pinctrl"
13*c66ec88fSEmmanuel Vadot - reg: Address range of the pinctrl registers.
14*c66ec88fSEmmanuel Vadot - clocks: Clock specifier (see clock bindings for details)
15*c66ec88fSEmmanuel Vadot
16*c66ec88fSEmmanuel VadotRequired properties for pin configuration sub-nodes:
17*c66ec88fSEmmanuel Vadot - pins: List of pins to which the configuration applies.
18*c66ec88fSEmmanuel Vadot
19*c66ec88fSEmmanuel VadotOptional properties for pin configuration sub-nodes:
20*c66ec88fSEmmanuel Vadot----------------------------------------------------
21*c66ec88fSEmmanuel Vadot - function: Mux function for the specified pins.
22*c66ec88fSEmmanuel Vadot - bias-pull-up: Enable weak pull-up.
23*c66ec88fSEmmanuel Vadot - bias-pull-down: Enable weak pull-down.
24*c66ec88fSEmmanuel Vadot - input-enable: Set the pin as an input.
25*c66ec88fSEmmanuel Vadot - output-low: Set the pin as an output level low.
26*c66ec88fSEmmanuel Vadot - output-high: Set the pin as an output level high.
27*c66ec88fSEmmanuel Vadot - microchip,digital: Enable digital I/O.
28*c66ec88fSEmmanuel Vadot - microchip,analog: Enable analog I/O.
29*c66ec88fSEmmanuel Vadot
30*c66ec88fSEmmanuel VadotExample:
31*c66ec88fSEmmanuel Vadot
32*c66ec88fSEmmanuel Vadotpic32_pinctrl: pinctrl@1f801400{
33*c66ec88fSEmmanuel Vadot	#address-cells = <1>;
34*c66ec88fSEmmanuel Vadot	#size-cells = <1>;
35*c66ec88fSEmmanuel Vadot	compatible = "microchip,pic32mzda-pinctrl";
36*c66ec88fSEmmanuel Vadot	reg = <0x1f801400 0x400>;
37*c66ec88fSEmmanuel Vadot	clocks = <&rootclk PB1CLK>;
38*c66ec88fSEmmanuel Vadot
39*c66ec88fSEmmanuel Vadot	pinctrl_uart2: pinctrl_uart2 {
40*c66ec88fSEmmanuel Vadot		uart2-tx {
41*c66ec88fSEmmanuel Vadot			pins = "G9";
42*c66ec88fSEmmanuel Vadot			function = "U2TX";
43*c66ec88fSEmmanuel Vadot			microchip,digital;
44*c66ec88fSEmmanuel Vadot			output-low;
45*c66ec88fSEmmanuel Vadot		};
46*c66ec88fSEmmanuel Vadot		uart2-rx {
47*c66ec88fSEmmanuel Vadot			pins = "B0";
48*c66ec88fSEmmanuel Vadot			function = "U2RX";
49*c66ec88fSEmmanuel Vadot			microchip,digital;
50*c66ec88fSEmmanuel Vadot			input-enable;
51*c66ec88fSEmmanuel Vadot		};
52*c66ec88fSEmmanuel Vadot	};
53*c66ec88fSEmmanuel Vadot};
54*c66ec88fSEmmanuel Vadot
55*c66ec88fSEmmanuel Vadotuart2: serial@1f822200 {
56*c66ec88fSEmmanuel Vadot	compatible = "microchip,pic32mzda-uart";
57*c66ec88fSEmmanuel Vadot	reg = <0x1f822200 0x50>;
58*c66ec88fSEmmanuel Vadot	pinctrl-names = "default";
59*c66ec88fSEmmanuel Vadot	pinctrl-0 = <&pinctrl_uart2>;
60*c66ec88fSEmmanuel Vadot};
61