1#
2# GPIO infrastructure and drivers
3#
4
5menuconfig GPIO
6	bool "GPIO support"
7	default y
8	help
9	  Enable support for GPIOs (General-purpose Input/Output) in U-Boot.
10	  GPIOs allow U-Boot to read the state of an input line (high or
11	  low) and set the state of an output line. This can be used to
12	  drive LEDs, control power to various system parts and read user
13	  input. GPIOs can be useful to enable a 'sign-of-life' LED,
14	  for example. Enable this option to build the drivers in
15	  drivers/gpio as part of an U-Boot build.
16
17if GPIO
18
19config DM_GPIO
20	bool "Enable Driver Model for GPIO drivers"
21	depends on DM
22	help
23	  Enable driver model for GPIO access. The standard GPIO
24	  interface (gpio_get_value(), etc.) is then implemented by
25	  the GPIO uclass. Drivers provide methods to query the
26	  particular GPIOs that they provide. The uclass interface
27	  is defined in include/asm-generic/gpio.h.
28
29config SPL_DM_GPIO
30	bool "Enable Driver Model for GPIO drivers in SPL"
31	depends on DM_GPIO && SPL_DM && SPL_GPIO
32	default y
33	help
34	  Enable driver model for GPIO access in SPL. The standard GPIO
35	  interface (gpio_get_value(), etc.) is then implemented by
36	  the GPIO uclass. Drivers provide methods to query the
37	  particular GPIOs that they provide. The uclass interface
38	  is defined in include/asm-generic/gpio.h.
39
40config TPL_DM_GPIO
41	bool "Enable Driver Model for GPIO drivers in TPL"
42	depends on DM_GPIO && TPL_DM && TPL_GPIO
43	default y
44	help
45	  Enable driver model for GPIO access in TPL. The standard GPIO
46	  interface (gpio_get_value(), etc.) is then implemented by
47	  the GPIO uclass. Drivers provide methods to query the
48	  particular GPIOs that they provide. The uclass interface
49	  is defined in include/asm-generic/gpio.h.
50
51config GPIO_HOG
52	bool "Enable GPIO hog support"
53	depends on DM_GPIO
54	help
55	  Enable gpio hog support
56	  The GPIO chip may contain GPIO hog definitions. GPIO hogging
57	  is a mechanism providing automatic GPIO request and config-
58	  uration as part of the gpio-controller's driver probe function.
59
60config DM_GPIO_LOOKUP_LABEL
61	bool "Enable searching for gpio labelnames"
62	depends on DM_GPIO
63	help
64	  This option enables searching for gpio names in
65	  the defined gpio labels, if the search for the
66	  gpio bank name failed. This makes sense if you use
67	  different gpios on different hardware versions
68	  for the same functionality in board code.
69
70config SPL_DM_GPIO_LOOKUP_LABEL
71	bool "Enable searching for gpio labelnames"
72	depends on DM_GPIO && SPL_DM && SPL_GPIO
73	help
74	  This option enables searching for gpio names in
75	  the defined gpio labels, if the search for the
76	  gpio bank name failed. This makes sense if you use
77	  different gpios on different hardware versions
78	  for the same functionality in board code.
79
80config ALTERA_PIO
81	bool "Altera PIO driver"
82	depends on DM_GPIO
83	help
84	  Select this to enable PIO for Altera devices. Please find
85	  details on the "Embedded Peripherals IP User Guide" of Altera.
86
87config BCM6345_GPIO
88	bool "BCM6345 GPIO driver"
89	depends on DM_GPIO && (ARCH_BMIPS || ARCH_BCM68360 || \
90			       ARCH_BCM6858 || ARCH_BCM63158)
91	help
92	  This driver supports the GPIO banks on BCM6345 SoCs.
93
94config CORTINA_GPIO
95	bool "Cortina-Access GPIO driver"
96	depends on DM_GPIO && CORTINA_PLATFORM
97	help
98	  Enable support for the GPIO controller in Cortina CAxxxx SoCs.
99	  This driver supports all CPU ISA variants supported by Cortina
100	  Access CAxxxx SoCs.
101
102config DWAPB_GPIO
103	bool "DWAPB GPIO driver"
104	depends on DM && DM_GPIO
105	help
106	  Support for the Designware APB GPIO driver.
107
108config AT91_GPIO
109	bool "AT91 PIO GPIO driver"
110	help
111	  Say yes here to select AT91 PIO GPIO driver. AT91 PIO
112	  controller manages up to 32 fully programmable input/output
113	  lines. Each I/O line may be dedicated as a general-purpose
114	  I/O or be assigned to a function of an embedded peripheral.
115	  The assignment to a function of an embedded peripheral is
116	  the responsibility of AT91 Pinctrl driver. This driver is
117	  responsible for the general-purpose I/O.
118
119config ATMEL_PIO4
120	bool "ATMEL PIO4 driver"
121	depends on DM_GPIO
122	help
123	  Say yes here to support the Atmel PIO4 driver.
124	  The PIO4 is new version of Atmel PIO controller, which manages
125	  up to 128 fully programmable input/output lines. Each I/O line
126	  may be dedicated as a general purpose I/O or be assigned to
127	  a function of an embedded peripheral.
128
129config DA8XX_GPIO
130	bool "DA8xx GPIO Driver"
131	help
132	  This driver supports the DA8xx GPIO controller
133
134config INTEL_BROADWELL_GPIO
135	bool "Intel Broadwell GPIO driver"
136	depends on DM
137	help
138	  This driver supports Broadwell U devices which have an expanded
139	  GPIO feature set. The difference is large enough to merit a separate
140	  driver from the common Intel ICH6 driver. It supports a total of
141	  95 GPIOs which can be configured from the device tree.
142
143config INTEL_GPIO
144	bool "Intel generic GPIO driver"
145	depends on DM_GPIO
146	help
147	  Say yes here to select Intel generic GPIO driver. This controller
148	  supports recent chips (e.g. Apollo Lake). It permits basic GPIO
149	  control including setting pins to input/output. It makes use of its
150	  parent pinctrl driver to actually effect changes.
151
152config INTEL_ICH6_GPIO
153	bool "Intel ICH6 compatible legacy GPIO driver"
154	depends on DM_GPIO
155	help
156	  Say yes here to select Intel ICH6 compatible legacy GPIO driver.
157
158config IMX_RGPIO2P
159	bool "i.MX7ULP RGPIO2P driver"
160	depends on DM
161	help
162	  This driver supports i.MX7ULP Rapid GPIO2P controller.
163
164config IPROC_GPIO
165	bool "Broadcom iProc GPIO driver(without pinconf)"
166	help
167	  The Broadcom iProc based SoCs- Cygnus, NS2, NS3, NSP and Stingray,
168	  use the same GPIO Controller IP hence this driver could be used
169	  for all.
170
171	  The Broadcom iProc based SoCs have multiple GPIO controllers and only
172	  the always-ON GPIO controller (CRMU/AON) is supported by this driver.
173
174config HSDK_CREG_GPIO
175	bool "HSDK CREG GPIO griver"
176	depends on DM_GPIO
177	help
178	  This driver supports CREG GPIOs on Synopsys HSDK SOC.
179
180config LPC32XX_GPIO
181	bool "LPC32XX GPIO driver"
182	depends on DM
183	help
184	  Support for the LPC32XX GPIO driver.
185
186config MAX7320_GPIO
187	bool "MAX7320 I2C GPIO Expander driver"
188	depends on DM_GPIO && DM_I2C
189	help
190	 Support for MAX7320 I2C 8/16-bit GPIO expander.
191	 original maxim device has 8 push/pull outputs,
192	 some clones offers 16bit.
193
194config MCP230XX_GPIO
195	bool "MCP230XX GPIO driver"
196	depends on DM
197	help
198	  Support for Microchip's MCP230XX I2C connected GPIO devices.
199	  The following chips are supported:
200	   - MCP23008
201	   - MCP23017
202	   - MCP23018
203
204config MSCC_SGPIO
205	bool "Microsemi Serial GPIO driver"
206	depends on DM_GPIO && SOC_VCOREIII
207	help
208	  Support for the VCoreIII SoC serial GPIO device. By using a
209          serial interface, the SIO controller significantly extends
210          the number of available GPIOs with a minimum number of
211          additional pins on the device. The primary purpose of the
212          SIO controller is to connect control signals from SFP
213          modules and to act as an LED controller.
214
215config MSM_GPIO
216	bool "Qualcomm GPIO driver"
217	depends on DM_GPIO
218	help
219	  Support GPIO controllers on Qualcomm Snapdragon family of SoCs.
220	  This controller have single bank (default name "soc"), every
221	  gpio has it's own set of registers.
222	  Only simple GPIO operations are supported (get/set, change of
223	  direction and checking pin function).
224	  Supported devices:
225	  - APQ8016
226	  - MSM8916
227
228config MXC_GPIO
229	bool "Freescale/NXP MXC GPIO driver"
230	help
231	  Support GPIO controllers on various i.MX platforms
232
233config MXS_GPIO
234	bool "Freescale/NXP MXS GPIO driver"
235	help
236	  Support GPIO controllers on i.MX23 and i.MX28 platforms
237
238config OMAP_GPIO
239	bool "TI OMAP GPIO driver"
240	depends on ARCH_OMAP2PLUS
241	default y
242	help
243	  Support GPIO controllers on the TI OMAP3/4/5 and related (such as
244	  AM335x/AM43xx/AM57xx/DRA7xx/etc) families of SoCs.
245
246config CMD_PCA953X
247	bool "Enable the pca953x command"
248	help
249	  Deprecated: This should be converted to driver model.
250
251	  This command provides access to a pca953x GPIO device using the
252	  legacy GPIO interface. Several subcommands are provided which mirror
253	  the standard 'gpio' command. It should use that instead.
254
255config PM8916_GPIO
256	bool "Qualcomm PM8916 PMIC GPIO/keypad driver"
257	depends on DM_GPIO && PMIC_PM8916
258	help
259	  Support for GPIO pins and power/reset buttons found on
260	  Qualcomm PM8916 PMIC.
261	  Default name for GPIO bank is "pm8916".
262	  Power and reset buttons are placed in "pm8916_key" bank and
263          have gpio numbers 0 and 1 respectively.
264
265config PCF8575_GPIO
266	bool "PCF8575 I2C GPIO Expander driver"
267	depends on DM_GPIO && DM_I2C
268	help
269	 Support for PCF8575 I2C 16-bit GPIO expander. Most of these
270	 chips are from NXP and TI.
271
272config RCAR_GPIO
273	bool "Renesas RCar GPIO driver"
274	depends on DM_GPIO && ARCH_RMOBILE
275	help
276	  This driver supports the GPIO banks on Renesas RCar SoCs.
277
278config RZA1_GPIO
279	bool "Renesas RZ/A1 GPIO driver"
280	depends on DM_GPIO && RZA1
281	help
282	  This driver supports the GPIO banks on Renesas RZ/A1 R7S72100 SoCs.
283
284config ROCKCHIP_GPIO
285	bool "Rockchip GPIO driver"
286	depends on DM_GPIO
287	help
288	  Support GPIO access on Rockchip SoCs. The GPIOs are arranged into
289	  a number of banks (different for each SoC type) each with 32 GPIOs.
290	  The GPIOs for a device are defined in the device tree with one node
291	  for each bank.
292
293config SANDBOX_GPIO
294	bool "Enable sandbox GPIO driver"
295	depends on SANDBOX && DM && DM_GPIO
296	help
297	  This driver supports some simulated GPIOs which can be adjusted
298	  using 'back door' functions like sandbox_gpio_set_value(). Then the
299	  GPIOs can be inspected through the normal get_get_value()
300	  interface. The purpose of this is to allow GPIOs to be used as
301	  normal in sandbox, perhaps with test code actually driving the
302	  behaviour of those GPIOs.
303
304config SANDBOX_GPIO_COUNT
305	int "Number of sandbox GPIOs"
306	depends on SANDBOX_GPIO
307	default 128
308	help
309	  The sandbox driver can support any number of GPIOs. Generally these
310	  are specified using the device tree. But you can also have a number
311	  of 'anonymous' GPIOs that do not belong to any device or bank.
312	  Select a suitable value depending on your needs.
313
314config SUNXI_GPIO
315	bool "Allwinner GPIO driver"
316	depends on ARCH_SUNXI
317	help
318	  Support the GPIO device in Allwinner SoCs.
319
320config XILINX_GPIO
321	bool "Xilinx GPIO driver"
322	depends on DM_GPIO
323	help
324	  This config enable the Xilinx GPIO driver for Microblaze.
325
326config CMD_TCA642X
327	bool "tca642x - Command to access tca642x state"
328	help
329	  DEPRECATED - This needs conversion to driver model
330
331	  This provides a way to looking at the pin state of this device.
332	  This mirrors the 'gpio' command and that should be used in preference
333	  to custom code.
334
335config TEGRA_GPIO
336	bool "Tegra20..210 GPIO driver"
337	depends on DM_GPIO
338	help
339	  Support for the GPIO controller contained in NVIDIA Tegra20 through
340	  Tegra210.
341
342config TEGRA186_GPIO
343	bool "Tegra186 GPIO driver"
344	depends on DM_GPIO
345	help
346	  Support for the GPIO controller contained in NVIDIA Tegra186. This
347	  covers both the "main" and "AON" controller instances, even though
348	  they have slightly different register layout.
349
350config GPIO_UNIPHIER
351	bool "UniPhier GPIO"
352	depends on ARCH_UNIPHIER
353	help
354	  Say yes here to support UniPhier GPIOs.
355
356config VYBRID_GPIO
357	bool "Vybrid GPIO driver"
358	depends on DM
359	help
360	  Say yes here to support Vybrid vf610 GPIOs.
361
362config PIC32_GPIO
363	bool "Microchip PIC32 GPIO driver"
364	depends on DM_GPIO && MACH_PIC32
365	default y
366	help
367	  Say yes here to support Microchip PIC32 GPIOs.
368
369config OCTEON_GPIO
370	bool "Octeon II/III/TX/TX2 GPIO driver"
371	depends on DM_GPIO && PCI && (ARCH_OCTEON || ARCH_OCTEONTX || ARCH_OCTEONTX2)
372	default y
373	help
374	  Add support for the Marvell Octeon GPIO driver. This is used with
375	  various Octeon parts such as Octeon II/III and OcteonTX/TX2.
376	  Octeon II/III has 32 GPIOs (count defined via DT) and OcteonTX/TX2
377	  has 64 GPIOs (count defined via internal register).
378
379config STM32_GPIO
380	bool "ST STM32 GPIO driver"
381	depends on DM_GPIO && (ARCH_STM32 || ARCH_STM32MP)
382	default y
383	help
384	  Device model driver support for STM32 GPIO controller. It should be
385	  usable on many stm32 families like stm32f4/f7/h7 and stm32mp1.
386	  Tested on STM32F7.
387
388config SIFIVE_GPIO
389	bool "SiFive GPIO driver"
390	depends on DM_GPIO
391	help
392	  Device model driver for GPIO controller present in SiFive FU540 SoC. This
393	  driver enables GPIO interface on HiFive Unleashed A00 board.
394
395config MVEBU_GPIO
396	bool "Marvell MVEBU GPIO driver"
397	depends on DM_GPIO && (ARCH_MVEBU || ARCH_KIRKWOOD)
398	default y
399	help
400	  Say yes here to support Marvell MVEBU (Armada XP/38x) GPIOs.
401
402config ZYNQ_GPIO
403	bool "Zynq GPIO driver"
404	depends on DM_GPIO
405	default y if ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL
406	help
407	  Supports GPIO access on Zynq SoC.
408
409config DM_74X164
410	bool "74x164 serial-in/parallel-out 8-bits shift register"
411	depends on DM_GPIO
412	help
413	  Driver for 74x164 compatible serial-in/parallel-out 8-outputs
414	  shift registers, such as 74lv165, 74hc595.
415	  This driver can be used to provide access to more gpio outputs.
416
417config DM_PCA953X
418	bool "PCA95[357]x, PCA9698, TCA64xx, and MAX7310 I/O ports"
419	depends on DM_GPIO && DM_I2C
420	help
421	  Say yes here to provide access to several register-oriented
422	  SMBus I/O expanders, made mostly by NXP or TI.  Compatible
423	  models include:
424
425	  4 bits:	pca9536, pca9537
426
427	  8 bits:	max7310, max7315, pca6107, pca9534, pca9538, pca9554,
428			pca9556, pca9557, pca9574, tca6408, xra1202
429
430	  16 bits:	max7312, max7313, pca9535, pca9539, pca9555, pca9575,
431			tca6416
432
433	  24 bits:	tca6424
434
435	  40 bits:	pca9505, pca9698
436
437	  Now, max 24 bits chips and PCA953X compatible chips are
438	  supported
439
440config SPL_DM_PCA953X
441	bool "PCA95[357]x, PCA9698, TCA64xx, and MAX7310 I/O ports in SPL"
442	depends on DM_GPIO
443	help
444	  Say yes here to provide access to several register-oriented
445	  SMBus I/O expanders, made mostly by NXP or TI.  Compatible
446	  models include:
447
448	  4 bits:	pca9536, pca9537
449
450	  8 bits:	max7310, max7315, pca6107, pca9534, pca9538, pca9554,
451			pca9556, pca9557, pca9574, tca6408, xra1202
452
453	  16 bits:	max7312, max7313, pca9535, pca9539, pca9555, pca9575,
454			tca6416
455
456	  24 bits:	tca6424
457
458	  40 bits:	pca9505, pca9698
459
460	  Now, max 24 bits chips and PCA953X compatible chips are
461	  supported
462
463config MPC8XXX_GPIO
464	bool "Freescale MPC8XXX GPIO driver"
465	depends on DM_GPIO
466	help
467	  This driver supports the built-in GPIO controller of MPC8XXX CPUs.
468	  Each GPIO bank is identified by its own entry in the device tree,
469	  i.e.
470
471	  gpio-controller@fc00 {
472		#gpio-cells = <2>;
473		compatible = "fsl,pq3-gpio";
474		reg = <0xfc00 0x100>
475	  }
476
477	  By default, each bank is assumed to have 32 GPIOs, but the ngpios
478	  setting is honored, so the number of GPIOs for each bank is
479	  configurable to match the actual GPIO count of the SoC (e.g. the
480	  32/32/23 banks of the P1022 SoC).
481
482	  Aside from the standard functions of input/output mode, and output
483	  value setting, the open-drain feature, which can configure individual
484	  GPIOs to work as open-drain outputs, is supported.
485
486config MPC83XX_SPISEL_BOOT
487	bool "Freescale MPC83XX SPISEL_BOOT driver"
488	depends on DM_GPIO && ARCH_MPC830X
489	help
490	  GPIO driver to set/clear dedicated SPISEL_BOOT output on MPC83XX.
491
492	  This pin is typically used as spi chip select to a spi nor flash.
493
494config MT7620_GPIO
495	bool "MediaTek MT7620 GPIO driver"
496	depends on DM_GPIO && SOC_MT7620
497	default y
498	help
499	  Device model driver for GPIO controller present in MediaTek MT7620
500	  and earlier SoCs.
501
502config MT7621_GPIO
503	bool "MediaTek MT7621 GPIO driver"
504	depends on DM_GPIO && SOC_MT7628
505	default y
506	help
507	  Say yes here to support MediaTek MT7621 compatible GPIOs.
508
509config NX_GPIO
510	bool "Nexell GPIO driver"
511	depends on DM_GPIO
512	help
513	  Support GPIO access on Nexell SoCs. The GPIOs are arranged into
514	  a number of banks (different for each SoC type) each with 32 GPIOs.
515	  The GPIOs for a device are defined in the device tree with one node
516	  for each bank.
517
518config NOMADIK_GPIO
519	bool "Nomadik GPIO driver"
520	depends on DM_GPIO
521	help
522	  Support GPIO access on ST-Ericsson Ux500 SoCs. The GPIOs are arranged
523	  into a number of banks each with 32 GPIOs. The GPIOs for a device are
524	  defined in the device tree with one node for each bank.
525
526endif
527