ioports

How GPIO is mapped in memory?

。_饼干妹妹 提交于 2019-12-06 00:36:42
问题 I am recently browsing GPIO driver for pi2, I found user space pi2 GPIO lib (like RPi.GPIO 0.5.11 of python) use /dev/mem for BCM2708 (begins at 0x20000000,and GPIO begins at 0x200000 relatively) to mmap a user space memory region in order to handler GPIO. But I found drivers/gpio in linux source tree is designed to be handled by /sys/class/gpio/* . I found nothing like I/O ports mapping like request_io_region and __io_remap . My question is How GPIO for BCM2708 mapped in memory ? Is there

How GPIO is mapped in memory?

妖精的绣舞 提交于 2019-12-04 06:50:11
I am recently browsing GPIO driver for pi2, I found user space pi2 GPIO lib (like RPi.GPIO 0.5.11 of python) use /dev/mem for BCM2708 (begins at 0x20000000,and GPIO begins at 0x200000 relatively) to mmap a user space memory region in order to handler GPIO. But I found drivers/gpio in linux source tree is designed to be handled by /sys/class/gpio/* . I found nothing like I/O ports mapping like request_io_region and __io_remap . My question is How GPIO for BCM2708 mapped in memory ? Is there another driver? And can I handle GPIO just by R&W to /sys/class/gpio/* ? I found nothing like I/O ports