18c2ecf20Sopenharmony_ciImagination Technologies Pistachio SoC pin controllers
28c2ecf20Sopenharmony_ci======================================================
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ciThe pin controllers on Pistachio are a combined GPIO controller, (GPIO)
58c2ecf20Sopenharmony_ciinterrupt controller, and pinmux + pinconf device. The system ("east") pin
68c2ecf20Sopenharmony_cicontroller on Pistachio has 99 pins, 90 of which are MFIOs which can be
78c2ecf20Sopenharmony_ciconfigured as GPIOs. The 90 GPIOs are divided into 6 banks of up to 16 GPIOs
88c2ecf20Sopenharmony_cieach. The GPIO banks are represented as sub-nodes of the pad controller node.
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciPlease refer to pinctrl-bindings.txt, ../gpio/gpio.txt, and
118c2ecf20Sopenharmony_ci../interrupt-controller/interrupts.txt for generic information regarding
128c2ecf20Sopenharmony_cipin controller, GPIO, and interrupt bindings.
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciRequired properties for pin controller node:
158c2ecf20Sopenharmony_ci--------------------------------------------
168c2ecf20Sopenharmony_ci - compatible: "img,pistachio-system-pinctrl".
178c2ecf20Sopenharmony_ci - reg: Address range of the pinctrl registers.
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ciRequired properties for GPIO bank sub-nodes:
208c2ecf20Sopenharmony_ci--------------------------------------------
218c2ecf20Sopenharmony_ci - interrupts: Interrupt line for the GPIO bank.
228c2ecf20Sopenharmony_ci - gpio-controller: Indicates the device is a GPIO controller.
238c2ecf20Sopenharmony_ci - #gpio-cells: Must be two. The first cell is the GPIO pin number and the
248c2ecf20Sopenharmony_ci   second cell indicates the polarity. See <dt-bindings/gpio/gpio.h> for
258c2ecf20Sopenharmony_ci   a list of possible values.
268c2ecf20Sopenharmony_ci - interrupt-controller: Indicates the device is an interrupt controller.
278c2ecf20Sopenharmony_ci - #interrupt-cells: Must be two. The first cell is the GPIO pin number and
288c2ecf20Sopenharmony_ci   the second cell encodes the interrupt flags. See
298c2ecf20Sopenharmony_ci   <dt-bindings/interrupt-controller/irq.h> for a list of valid flags.
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciNote that the N GPIO bank sub-nodes *must* be named gpio0, gpio1, ... gpioN-1.
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciRequired properties for pin configuration sub-nodes:
348c2ecf20Sopenharmony_ci----------------------------------------------------
358c2ecf20Sopenharmony_ci - pins: List of pins to which the configuration applies. See below for a
368c2ecf20Sopenharmony_ci   list of possible pins.
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ciOptional properties for pin configuration sub-nodes:
398c2ecf20Sopenharmony_ci----------------------------------------------------
408c2ecf20Sopenharmony_ci - function: Mux function for the specified pins. This is not applicable for
418c2ecf20Sopenharmony_ci   non-MFIO pins. See below for a list of valid functions for each pin.
428c2ecf20Sopenharmony_ci - bias-high-impedance: Enable high-impedance mode.
438c2ecf20Sopenharmony_ci - bias-pull-up: Enable weak pull-up.
448c2ecf20Sopenharmony_ci - bias-pull-down: Enable weak pull-down.
458c2ecf20Sopenharmony_ci - bias-bus-hold: Enable bus-keeper mode.
468c2ecf20Sopenharmony_ci - drive-strength: Drive strength in mA. Supported values: 2, 4, 8, 12.
478c2ecf20Sopenharmony_ci - input-schmitt-enable: Enable Schmitt trigger.
488c2ecf20Sopenharmony_ci - input-schmitt-disable: Disable Schmitt trigger.
498c2ecf20Sopenharmony_ci - slew-rate: Slew rate control. 0 for slow, 1 for fast.
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciPin		Functions
528c2ecf20Sopenharmony_ci---		---------
538c2ecf20Sopenharmony_cimfio0		spim1
548c2ecf20Sopenharmony_cimfio1		spim1, spim0, uart1
558c2ecf20Sopenharmony_cimfio2		spim1, spim0, uart1
568c2ecf20Sopenharmony_cimfio3		spim1
578c2ecf20Sopenharmony_cimfio4		spim1
588c2ecf20Sopenharmony_cimfio5		spim1
598c2ecf20Sopenharmony_cimfio6		spim1
608c2ecf20Sopenharmony_cimfio7		spim1
618c2ecf20Sopenharmony_cimfio8		spim0
628c2ecf20Sopenharmony_cimfio9		spim0
638c2ecf20Sopenharmony_cimfio10		spim0
648c2ecf20Sopenharmony_cimfio11		spis
658c2ecf20Sopenharmony_cimfio12		spis
668c2ecf20Sopenharmony_cimfio13		spis
678c2ecf20Sopenharmony_cimfio14		spis
688c2ecf20Sopenharmony_cimfio15		sdhost, mips_trace_clk, mips_trace_data
698c2ecf20Sopenharmony_cimfio16		sdhost, mips_trace_dint, mips_trace_data
708c2ecf20Sopenharmony_cimfio17		sdhost, mips_trace_trigout, mips_trace_data
718c2ecf20Sopenharmony_cimfio18		sdhost, mips_trace_trigin, mips_trace_data
728c2ecf20Sopenharmony_cimfio19		sdhost, mips_trace_dm, mips_trace_data
738c2ecf20Sopenharmony_cimfio20		sdhost, mips_trace_probe_n, mips_trace_data
748c2ecf20Sopenharmony_cimfio21		sdhost, mips_trace_data
758c2ecf20Sopenharmony_cimfio22		sdhost, mips_trace_data
768c2ecf20Sopenharmony_cimfio23		sdhost
778c2ecf20Sopenharmony_cimfio24		sdhost
788c2ecf20Sopenharmony_cimfio25		sdhost
798c2ecf20Sopenharmony_cimfio26		sdhost
808c2ecf20Sopenharmony_cimfio27		sdhost
818c2ecf20Sopenharmony_cimfio28		i2c0, spim0
828c2ecf20Sopenharmony_cimfio29		i2c0, spim0
838c2ecf20Sopenharmony_cimfio30		i2c1, spim0
848c2ecf20Sopenharmony_cimfio31		i2c1, spim1
858c2ecf20Sopenharmony_cimfio32		i2c2
868c2ecf20Sopenharmony_cimfio33		i2c2
878c2ecf20Sopenharmony_cimfio34		i2c3
888c2ecf20Sopenharmony_cimfio35		i2c3
898c2ecf20Sopenharmony_cimfio36		i2s_out, audio_clk_in
908c2ecf20Sopenharmony_cimfio37		i2s_out, debug_raw_cca_ind
918c2ecf20Sopenharmony_cimfio38		i2s_out, debug_ed_sec20_cca_ind
928c2ecf20Sopenharmony_cimfio39		i2s_out, debug_ed_sec40_cca_ind
938c2ecf20Sopenharmony_cimfio40		i2s_out, debug_agc_done_0
948c2ecf20Sopenharmony_cimfio41		i2s_out, debug_agc_done_1
958c2ecf20Sopenharmony_cimfio42		i2s_out, debug_ed_cca_ind
968c2ecf20Sopenharmony_cimfio43		i2s_out, debug_s2l_done
978c2ecf20Sopenharmony_cimfio44		i2s_out
988c2ecf20Sopenharmony_cimfio45		i2s_dac_clk, audio_sync
998c2ecf20Sopenharmony_cimfio46		audio_trigger
1008c2ecf20Sopenharmony_cimfio47		i2s_in
1018c2ecf20Sopenharmony_cimfio48		i2s_in
1028c2ecf20Sopenharmony_cimfio49		i2s_in
1038c2ecf20Sopenharmony_cimfio50		i2s_in
1048c2ecf20Sopenharmony_cimfio51		i2s_in
1058c2ecf20Sopenharmony_cimfio52		i2s_in
1068c2ecf20Sopenharmony_cimfio53		i2s_in
1078c2ecf20Sopenharmony_cimfio54		i2s_in, spdif_in
1088c2ecf20Sopenharmony_cimfio55		uart0, spim0, spim1
1098c2ecf20Sopenharmony_cimfio56		uart0, spim0, spim1
1108c2ecf20Sopenharmony_cimfio57		uart0, spim0, spim1
1118c2ecf20Sopenharmony_cimfio58		uart0, spim1
1128c2ecf20Sopenharmony_cimfio59		uart1
1138c2ecf20Sopenharmony_cimfio60		uart1
1148c2ecf20Sopenharmony_cimfio61		spdif_out
1158c2ecf20Sopenharmony_cimfio62		spdif_in
1168c2ecf20Sopenharmony_cimfio63		eth, mips_trace_clk, mips_trace_data
1178c2ecf20Sopenharmony_cimfio64		eth, mips_trace_dint, mips_trace_data
1188c2ecf20Sopenharmony_cimfio65		eth, mips_trace_trigout, mips_trace_data
1198c2ecf20Sopenharmony_cimfio66		eth, mips_trace_trigin, mips_trace_data
1208c2ecf20Sopenharmony_cimfio67		eth, mips_trace_dm, mips_trace_data
1218c2ecf20Sopenharmony_cimfio68		eth, mips_trace_probe_n, mips_trace_data
1228c2ecf20Sopenharmony_cimfio69		eth, mips_trace_data
1238c2ecf20Sopenharmony_cimfio70		eth, mips_trace_data
1248c2ecf20Sopenharmony_cimfio71		eth
1258c2ecf20Sopenharmony_cimfio72		ir
1268c2ecf20Sopenharmony_cimfio73		pwmpdm, mips_trace_clk, sram_debug
1278c2ecf20Sopenharmony_cimfio74		pwmpdm, mips_trace_dint, sram_debug
1288c2ecf20Sopenharmony_cimfio75		pwmpdm, mips_trace_trigout, rom_debug
1298c2ecf20Sopenharmony_cimfio76		pwmpdm, mips_trace_trigin, rom_debug
1308c2ecf20Sopenharmony_cimfio77		mdc_debug, mips_trace_dm, rpu_debug
1318c2ecf20Sopenharmony_cimfio78		mdc_debug, mips_trace_probe_n, rpu_debug
1328c2ecf20Sopenharmony_cimfio79		ddr_debug, mips_trace_data, mips_debug
1338c2ecf20Sopenharmony_cimfio80		ddr_debug, mips_trace_data, mips_debug
1348c2ecf20Sopenharmony_cimfio81		dreq0, mips_trace_data, eth_debug
1358c2ecf20Sopenharmony_cimfio82		dreq1, mips_trace_data, eth_debug
1368c2ecf20Sopenharmony_cimfio83		mips_pll_lock, mips_trace_data, usb_debug
1378c2ecf20Sopenharmony_cimfio84		audio_pll_lock, mips_trace_data, usb_debug
1388c2ecf20Sopenharmony_cimfio85		rpu_v_pll_lock, mips_trace_data, sdhost_debug
1398c2ecf20Sopenharmony_cimfio86		rpu_l_pll_lock, mips_trace_data, sdhost_debug
1408c2ecf20Sopenharmony_cimfio87		sys_pll_lock, dreq2, socif_debug
1418c2ecf20Sopenharmony_cimfio88		wifi_pll_lock, dreq3, socif_debug
1428c2ecf20Sopenharmony_cimfio89		bt_pll_lock, dreq4, dreq5
1438c2ecf20Sopenharmony_citck
1448c2ecf20Sopenharmony_citrstn
1458c2ecf20Sopenharmony_citdi
1468c2ecf20Sopenharmony_citms
1478c2ecf20Sopenharmony_citdo
1488c2ecf20Sopenharmony_cijtag_comply
1498c2ecf20Sopenharmony_cisafe_mode
1508c2ecf20Sopenharmony_cipor_disable
1518c2ecf20Sopenharmony_ciresetn
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ciExample:
1548c2ecf20Sopenharmony_ci--------
1558c2ecf20Sopenharmony_cipinctrl@18101c00 {
1568c2ecf20Sopenharmony_ci	compatible = "img,pistachio-system-pinctrl";
1578c2ecf20Sopenharmony_ci	reg = <0x18101C00 0x400>;
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci	gpio0: gpio0 {
1608c2ecf20Sopenharmony_ci		interrupts = <GIC_SHARED 71 IRQ_TYPE_LEVEL_HIGH>;
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci		gpio-controller;
1638c2ecf20Sopenharmony_ci		#gpio-cells = <2>;
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci		interrupt-controller;
1668c2ecf20Sopenharmony_ci		#interrupt-cells = <2>;
1678c2ecf20Sopenharmony_ci	};
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci	...
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci	gpio5: gpio5 {
1728c2ecf20Sopenharmony_ci		interrupts = <GIC_SHARED 76 IRQ_TYPE_LEVEL_HIGH>;
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci		gpio-controller;
1758c2ecf20Sopenharmony_ci		#gpio-cells = <2>;
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci		interrupt-controller;
1788c2ecf20Sopenharmony_ci		#interrupt-cells = <2>;
1798c2ecf20Sopenharmony_ci	};
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci	...
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci	uart0_xfer: uart0-xfer {
1848c2ecf20Sopenharmony_ci		uart0-rxd {
1858c2ecf20Sopenharmony_ci			pins = "mfio55";
1868c2ecf20Sopenharmony_ci			function = "uart0";
1878c2ecf20Sopenharmony_ci		};
1888c2ecf20Sopenharmony_ci		uart0-txd {
1898c2ecf20Sopenharmony_ci			pins = "mfio56";
1908c2ecf20Sopenharmony_ci			function = "uart0";
1918c2ecf20Sopenharmony_ci		};
1928c2ecf20Sopenharmony_ci	};
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci	uart0_rts_cts: uart0-rts-cts {
1958c2ecf20Sopenharmony_ci		uart0-rts {
1968c2ecf20Sopenharmony_ci			  pins = "mfio57";
1978c2ecf20Sopenharmony_ci			  function = "uart0";
1988c2ecf20Sopenharmony_ci		};
1998c2ecf20Sopenharmony_ci		uart0-cts {
2008c2ecf20Sopenharmony_ci			  pins = "mfio58";
2018c2ecf20Sopenharmony_ci			  function = "uart0";
2028c2ecf20Sopenharmony_ci		};
2038c2ecf20Sopenharmony_ci	};
2048c2ecf20Sopenharmony_ci};
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ciuart@... {
2078c2ecf20Sopenharmony_ci	...
2088c2ecf20Sopenharmony_ci	pinctrl-names = "default";
2098c2ecf20Sopenharmony_ci	pinctrl-0 = <&uart0_xfer>, <&uart0_rts_cts>;
2108c2ecf20Sopenharmony_ci	...
2118c2ecf20Sopenharmony_ci};
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ciusb_vbus: fixed-regulator {
2148c2ecf20Sopenharmony_ci	...
2158c2ecf20Sopenharmony_ci	gpio = <&gpio5 6 GPIO_ACTIVE_HIGH>;
2168c2ecf20Sopenharmony_ci	...
2178c2ecf20Sopenharmony_ci};
218