freebsd-dev/sys/arm/allwinner
Ian Lepore e1275c6805 Add gpio methods to read/write/configure up to 32 pins simultaneously.
Sometimes it is necessary to combine several gpio pins into an ad-hoc bus
and manipulate the pins as a group. In such cases manipulating the pins
individualy is not an option, because the value on the "bus" assumes
potentially-invalid intermediate values as each pin is changed in turn. Note
that the "bus" may be something as simple as a bi-color LED where changing
colors requires changing both gpio pins at once, or something as complex as
a bitbanged multiplexed address/data bus connected to a microcontroller.

In addition to the absolute requirement of simultaneously changing the
output values of driven pins, a desirable feature of these new methods is to
provide a higher-performance mechanism for reading and writing multiple
pins, especially from userland where pin-at-a-time access incurs a noticible
syscall time penalty.

These new interfaces are NOT intended to abstract away all the ugly details
of how gpio is implemented on any given platform. In fact, to use these
properly you absolutely must know something about how the gpio hardware is
organized. Typically there are "banks" of gpio pins controlled by registers
which group several pins together. A bank may be as small as 2 pins or as
big as "all the pins on the device, hundreds of them." In the latter case, a
driver might support this interface by allowing access to any 32 adjacent
pins within the overall collection. Or, more likely, any 32 adjacent pins
starting at any multiple of 32. Whatever the hardware restrictions may be,
you would need to understand them to use this interface.

In additional to defining the interfaces, two example implementations are
included here, for imx5/6, and allwinner. These represent the two primary
types of gpio hardware drivers. imx6 has multiple gpio devices, each
implementing a single bank of 32 pins. Allwinner implements a single large
gpio number space from 1-n pins, and the driver internally translates that
linear number space to a bank+pin scheme based on how the pins are grouped
into control registers. The allwinner implementation imposes the restriction
that the first_pin argument to the new functions must always be pin 0 of a
bank.

Differential Revision:	https://reviews.freebsd.org/D11810
2017-09-10 18:08:25 +00:00
..
a10 Add information about interrupts in the Allwinner padconf files and 2016-12-15 15:52:13 +00:00
a13 Add information about interrupts in the Allwinner padconf files and 2016-12-15 15:52:13 +00:00
a20 Add information about interrupts in the Allwinner padconf files and 2016-12-15 15:52:13 +00:00
a31 allwinner: A31: Add ccung driver 2017-02-28 15:44:21 +00:00
a33 Allwinner: Add A33 support 2017-01-04 03:35:39 +00:00
a64 Fix building arm64 kernel after r310117 2016-12-15 17:26:16 +00:00
a83t Remove the old Allwinner std.* files, these are not part of the common 2016-10-03 16:47:46 +00:00
clk allwiner: modclk: Do not try to enable parent clock if it doesn't exist 2017-08-02 20:17:04 +00:00
clkng arm64: Add Allwinner H5 SoC 2017-08-02 20:19:19 +00:00
h3 Add clkng driver for Allwinner SoC 2017-02-26 16:00:20 +00:00
a10_ahci.c ALLWINNER: ahci_devclass is local variable, don't export it. 2016-09-30 05:30:16 +00:00
a10_codec.c Add support for Allwinner H3 audio codec. 2016-11-03 23:22:04 +00:00
a10_dmac.c Register the device's xref handle at attach time. 2016-11-02 23:53:47 +00:00
a10_dmac.h Add support for the Allwinner DMA controller. This will be used by the at 2016-02-15 19:56:35 +00:00
a10_ehci.c Allwinner EHCI: Do not fail if we cannot get a phy 2017-07-18 19:50:02 +00:00
a10_fb.c EXTRES: Add OF node as argument to all <foo>_get_by_ofw_<bar>() functions. 2016-07-10 18:28:15 +00:00
a10_gpio.c Add gpio methods to read/write/configure up to 32 pins simultaneously. 2017-09-10 18:08:25 +00:00
a10_gpio.h Remove function declaration that doesn't exist. 2017-04-18 06:58:04 +00:00
a10_hdmi.c Enable the SCL and SDA i2c line for DDC. 2016-11-24 01:24:26 +00:00
a10_hdmiaudio.c Add Allwinner A20 HDMI support. 2016-02-25 20:17:18 +00:00
a10_mmc.c allwinner: Add A64 ccung support 2017-07-03 19:30:03 +00:00
a10_mmc.h a10_mmc: Remove completly the PIO code now all access is done by DMA. 2016-09-10 17:45:35 +00:00
a10_sramc.c Stop including fdt_common.h from the arm code when it's unneeded. 2016-11-14 11:41:22 +00:00
a10_sramc.h Add function for mapping SRAM-D area to USB0 (OTG) controller. Use a lower 2016-04-08 10:54:59 +00:00
a10_timer.c Rename timer.c to a10_timer.c 2017-02-07 19:28:32 +00:00
a31_dmac.c Add support for the integrated DMA controller found in the Allwinner A31, 2016-11-02 23:58:10 +00:00
allwinner_pinctrl.h Add information about interrupts in the Allwinner padconf files and 2016-12-15 15:52:13 +00:00
aw_ccu.c arm64: Add Allwinner H5 SoC 2017-08-02 20:19:19 +00:00
aw_cir.c Use hwreset_get_by_ofw_idx() function instead, since there is 2017-04-19 05:59:00 +00:00
aw_console.c Start to rename files with common or generic names to be SoC specific. The 2017-06-04 09:11:14 +00:00
aw_if_dwc.c Rename allwinner_machdep.{c.h} to aw_machdep.{c.h} as all allwinner source 2016-08-17 21:44:02 +00:00
aw_machdep.c Allwinner: Add support for H2 Plus SoC 2017-06-24 16:41:26 +00:00
aw_machdep.h Allwinner: Add A33 support 2017-01-04 03:35:39 +00:00
aw_mp.c ARM: SEV/WFE instructions are implemented starting from ARMv6K, 2016-10-06 13:18:18 +00:00
aw_mp.h Merge a20_mp_start_ap and a31_mp_start_ap into one function. 2016-05-10 18:00:37 +00:00
aw_nmi.c Stop including fdt_common.h from the arm code when it's unneeded. 2016-11-14 11:41:22 +00:00
aw_reset.c Attach hwreset resources at the same time as clock resources. 2016-04-08 23:07:16 +00:00
aw_rsb.c allwinner: Add support for P2WI in RSB driver 2016-10-24 20:33:42 +00:00
aw_rtc.c Remove dependency on allwinner_soc_family() as it is not available on arm64. 2016-08-25 10:14:56 +00:00
aw_sid.c Add support for reading root key on A83T/A64. 2016-09-03 15:22:50 +00:00
aw_sid.h Add support for the SID (Security ID Module) on Allwinner A10 and A20. 2016-07-20 11:23:06 +00:00
aw_thermal.c On H3, initialize alarm and shutdown trip points and do temperature 2016-11-19 14:56:22 +00:00
aw_ts.c Stop including fdt_common.h from the arm code when it's unneeded. 2016-11-14 11:41:22 +00:00
aw_usbphy.c Add support for Allwinner A64 USB PHY. 2016-08-31 10:45:53 +00:00
aw_wdog.c Add the missing void to function signatures in much of the arm code. 2016-12-13 13:43:22 +00:00
aw_wdog.h Add support for the Allwinner A31 watchdog to the existing A10 watchdog 2016-02-25 16:50:36 +00:00
axp81x.c Attach later so axp81x attaches after aw_nmi. 2016-09-07 01:09:25 +00:00
axp209.c Switch to iicdev_readfrom/writeto() to do xfers with proper bus ownership. 2017-08-03 18:43:54 +00:00
axp209reg.h Add support for AXP221 Power Management Unit. 2016-11-04 20:02:52 +00:00
files.allwinner Start to rename files with common or generic names to be SoC specific. The 2017-06-04 09:11:14 +00:00
files.allwinner_up Rename timer.c to a10_timer.c 2017-02-07 19:28:32 +00:00
if_awg.c if_awg: Add "allwinner,sun50i-a64-emac" compatible string. 2017-07-09 12:35:19 +00:00
if_awgreg.h Allwinner Gigabit EMAC performance improvements. 2016-07-13 20:46:54 +00:00
if_emac.c Test that the emac device is enabled in probe function 2016-11-23 18:07:44 +00:00
if_emacreg.h Simplify the receiver code a bit. 2015-04-18 00:35:00 +00:00
std.allwinner Remake support for SMP kernel on UP cpu: 2017-02-02 06:14:44 +00:00
std.allwinner_up Remake support for SMP kernel on UP cpu: 2017-02-02 06:14:44 +00:00
sunxi_dma_if.m Add support for the Allwinner DMA controller. This will be used by the at 2016-02-15 19:56:35 +00:00