PINE64
Memory addresses of GPIO pins - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: ROCK64 (https://forum.pine64.org/forumdisplay.php?fid=85)
+--- Forum: Linux on Rock64 (https://forum.pine64.org/forumdisplay.php?fid=88)
+--- Thread: Memory addresses of GPIO pins (/showthread.php?tid=6689)



Memory addresses of GPIO pins - AckRite - 10-22-2018

Hi everyone,

I'm trying to read GPIO output and using Rock64's RPi module is too slow as it is using file system.
Does anyone know memory addresses of those pins? I'd like to map directly and hopefully it will be faster.


RE: Memory addresses of GPIO pins - dkryder - 10-22-2018

probably need to get the rock64 TRM. http://opensource.rock-chips.com/wiki_Main_Page


RE: Memory addresses of GPIO pins - AckRite - 10-22-2018

(10-22-2018, 06:01 AM)dkryder Wrote: probably need to get the rock64 TRM. http://opensource.rock-chips.com/wiki_Main_Page

Thanks a lot, that's looks like something I can use!


RE: Memory addresses of GPIO pins - AckRite - 10-23-2018

So, just a rundown of steps that I need to perform in order to do mmap operations on GPIO for Rock64:

1. Select which GPIO pin I want to use (I need a full name, like GPIO3_A4)
2. Look up 18.5 "GPIO interface description" for which IOMUX bit I'll need to set (In case of GPIO3_A4 - GRF_GPIO3AL_IOMUX)
3. Look that IOMUX in 3.3.3 "Detail Register Description" and GPIO3A[4] for details of which bit to set.
4.Mmap to GRF memory (I can get offset from TPM Memory Mapping section, so address is probably FF10_0000, 64K of memory)
5. Offset to memory of that IOMUX, setup IOMUX to allow writes to bits 14:12 (bits specific to GPIO3A[4])
6. Write 000 to 14:12 to set up GPIO3A[4] to be accessible for GPIO operations
7. Get the offset of GPIO bank I'm about to use (TPM Memory Mapping section, in case of GPIO3 it's probably FF24_0000, 64K of memory)

And then the last part I'm not really sure about is where exactly do I set direction and get/set value of that pin, but it has probably to do with section 18.5.

Anyone willing to tell me I'm on the right track?