GPIO configuration issue

Hello ,

I am using pre-configured image of ubuntu to boot the beagle board . I need some GPIO pins to be configured as dedicated input pins and some to be dedicated output pins.

With the help /sys/class/gpio/ gpio(136-139), i am able to customize only four pins ( gpio136 – gpio139) to work as desired . Remaining pins are showing some default behaviour . I tested with (gpio130-gpio133) , changes which I make from inside /dev/class/gpio/gpio(130-133) are not reflected on the h/w pins . As these pins are designed to implement multiplexed behaviour, where should i make changes to make them work as dedicated I/P or O/P pins .

Any relevant help would be greatly appreciated.

Thank you,


Check the board config file in your kernel sources (/arch/arm/mach-
omap2/board-omap3beagle.c) looking at the code maybe you can
understand how to expose such GPIO's to userspace

One pin can be connected to different internal modules, see the Beagleboard Manual and search for MUX modes.

In this particular case the actual configuration is a bit harder to find.

In general, you would take a look at the MUX settings in u-boot:

MUX mode 4 is the GPIO mode so everything seems to be fine.

The next thing to do is to check if the kernel overrides these settings:

Check the board_mux array and calls to omap_mux_init_... functions for possible overrides.

Problem here is:
GPIOs 130-139 are shared with the second MMC interface. The mmc array in line 320ff defines the used MMC interfaces. The underlying mmc code automatically (re)sets the muxing depending on those settings.

MMC2 is defined with 4 data lines, so the pins MMC2_CLK, MMC2_CMD, MMC2_DAT0..3 get remuxed by the omap mmc implementation, so GPIO 130..135 can't be used as GPIO.

A quick fix would be to remove the second MMC interface from mmc[] (which is only needed for a bbtoys like WiFi card connected via the expansion header).


I found this [1] helpful with pin Muxing on the Beagle. I can find some of my comments about changing the pin mux to access the PWM signals here [2].



Thank you so much. Your reply made a lot of things more
clear .However, i don't want to tweak the kernel source . Is there any
other way to fix this issue.

"The mmc array in line 320ff defines the used MMC interfaces". Did you
mean this line to be located here

I could not find anything related with mmc array there.