BeagleBone Linux GPIO number mappings

I just bought a BeagleBone in hopes of getting my hands into embedded Linux. As my first venture into Linux kernel module development, I am trying to use the Linux gpio* APIs to toggle GPIOs but no amount of Googling (ya, google-ing, no bing-ing) has given me a straight answer to Linux GPIO number mappings on the BeagleBone. I am hoping somebody out there can point me in the right direction.

Thank you

GPIO Number = (GPIO Bank * 32) + GPIO Num

e.g. GPIO Bank 1, GPIO 8

(1 * 32) + 8 = 40.


Thanks for the answer but where is this mapping taking place? Which source/header file?


I can't really say unfortunately, I would imagine this page is a good place to start[1].It will probably be a mix of standard kernel GPIO mapping and the OMAP boards bending it to their will.