primer for GPIO on the Beagleboard -xM

I have one (rev A2, I think) and I want to access GPIO.

Is there a good, relatively complete source of info on how to do this? I see some things for the BeagleBoneBlack, but very little for the BB -xM. Are the instructions identical? For example, for the BBB there is some calculation that has to be done to associate a pin with the “device” exposed by the kernel. Is it done differently on the BB?

I also see a lot of short instructions like “change the MUX for the pin in the device tree”. I need to know what the device tree is, and how to change the MUX there.

I really need some basic information about how this works, preferably in one (or a few) places. Thanks.

The general concept behind GPIO from Linux is going to be very similar. As they’re both probably using libGPIO, if you’re using a modern kernel on your xM.

So you have:

/sysclass/gpio/ as the base path for libGPIO sysfs. Which in turn will have ‘export’, and ‘unexport’ files for exporting, and exporting gpio pins. Then of course. something like:

echo ‘24’ > /sys/class/gpio/export is going to have slightly different implications across platforms. Meaning that of course, ‘gpio24’ will have a different meaning for a Beaglebone versus a beagleboard. They’ll both be GPIO’s of course.

As to actual device tree file pin muxing . . . I’m not sure. I would think it should be similar, but I’m also not sure of the xM’s pin muxing capabilities.