I did not find anything like mapping I / O ports, such as request_io_region and __io_remap.
ARM has no I / O port. All peripheral registers are assigned to addresses in memory.
How is GPIO for BCM2708 displayed in memory?
GPIOs are typically implemented as control register peripherals, and the GPIO in the BCM2835 RPi follows this convention. This set of control registers may have a different name; for example, Atmel refers to these registers as a peripheral parallel input / output device (PIO).
Each GPIO (or, more precisely, each pin) will be represented by one or more bits in each function of the control register. The functions of the control register include pin assignment (for example, multiplexing), setting the output to high, setting the output signal to a low level, the reading level and the level and edge control level.
IOW there is not a single bit that can be read and written, which corresponds to the GPIO. For GPIOs in a particular register there will be a bit to extract the input level. There's a bit in a different register to set the GPIO output high and a bit in another register to set the GPIO output to low.
Is there any other driver?
Yes. The pinctrl (pin control) driver is the bottom layer (i.e. closer to the HW) than the GPIO. This is the pinctrl layer, which handles pin multiplexing (i.e. whether the pin is used for a peripheral function or as a GPIO).
The pinctrl driver for SoC (e.g. drivers/pinctrl/pinctrl-bcm2835.c ) is where you find devm_ioremap_resources () (which in turn calls devm_request_mem_region () and devm_ioremap () ) for the GPIO register block.
And can I only process GPIO R & W in / sys / class / gpio / *?
Yes. sysfs is provided to access these contacts that are not tied to peripherals.
ADDITION
The GPIO sysfs interface has limited capabilities.
Apparently, there are user-space libraries for accessing additional pin attributes (for example, to enable a pull-up or drop-down resistor), which are usually located in the pinctrl driver domain . Typically, these libraries access the PIO hardware registers directly through the / dev / mem psuedo-file. Remember that these methods are not safe and may interfere with other device drivers.