Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Deciphering GPIO on Raspberry Pi B+





On Apr 14, 2018, at 10:07 PM, Michael van Elst <mlelstv%serpens.de@localhost> wrote:

thorpej%me.com@localhost (Jason Thorpe) writes:

So, can I assume that the only reason this is broken up into 2 separate “gpio” instances is because the GPIO subsystem can’t handle more than 32 pins on a single controller?

indeed. But it also maps to the real two GPIO systems of the Pi.

But from an application user’s perspective, the documentation doesn’t really treat them at 2 GPIO systems.  It refers to GPIO20 and GPIO33, not “GPIO block 0 pin 20” and “GPIO block 1 pin 1"

And what’s the best way to figure out which GPIO pins are available for application use and not consumed by other system functions?

You look at the PDF and find that GPIO2-27 are available, GPIO0-1 is
reserved for the HAT EEPROM, but could be used too if it doesn't look
like an EEPROM.

But that doesn’t really answer my question, because there’s really no indication as to how *NetBSD* has configured the GPIO at start-up time.  For example, which of the GPIO pins have alternate functions enabled (and, if so, which one)?  And how does that change depending on what drivers are present in the kernel at start-up time?  For example, “vcaudio” uses a couple if GPIO pins, but are those pins put into that alternate function when the “vcaudio” driver is attached, or when the device is opened for use?  There’s also the question of the on-board LEDs — which GPIO pins are consumed by those?

Obviously, the only ones I really need to care about are the ones actually brought out to the 40-pin header, but knowing which ones of those I can actually use based on how NetBSD has configured the system and the proper way to refer to them (“gpio0 + BCM pin number” or “gpio1 + BCM pin number - 32”) would be useful information.  (This bifurcation of the GPIO pin space is annoying because it’s going to potentially make some intended-to-be-portable-to-other-GPIO-having-hardware code more complicated for the NetBSD case.)

The other question is what alternate functions are available and
how the other 26 GPIOs are used:

-> https://elinux.org/RPi_BCM2835_GPIOs

Well, this is certainly a handy reference.  Someone with access to do so should link to it on the NetBSD RPI wiki page.


--
--
                               Michael van Elst
Internet: mlelstv%serpens.de@localhost
                               "A potential Snark may lurk in every tree."



Home | Main Index | Thread Index | Old Index