Part Number: AM3358
Hi,
This question is somewhat related to a question that was asked by someone else over a year and a half ago (https://e2e.ti.com/support/processors/f/791/t/742464?AM3356-Configuration-of-MMC0-pins-to-GPIO-mode)..
I'm using a BeagleBone Black (kernel 4.14.108-ti-r131), and I was able to successfully configure the MMC0 Dat0 and Dat1 pins to GPIO mode.
In am335x-bone-common.dtsi, I just modified the 2 entries related to pinmux_mmc1_pins and changed them to MUX_MODE_7:
AM33XX_PADCONF(AM335X_PIN_MMC0_DAT0, PIN_OUTPUT_PULLUP, MUX_MODE7)
AM33XX_PADCONF(AM335X_PIN_MMC0_DAT1, PIN_OUTPUT_PULLUP, MUX_MODE7)
I then recompiled the .dtb files, installed them, rebooted my BeagleBone, and I was able to toggle those 2 pins as GPIO through sysfs:
cd /sys/class/gpio
echo 92 > export
cd gpio92
echo "out" > direction
echo 1 > value
echo 0 > value
cd /sys/class/gpio
echo 93 > export
cd gpio93
echo "out" > direction
echo 1 > value
echo 0 > value
Being able to do this made me very happy. I used the show-pins script and it showed me that those pins were in GPIO mode and had changed values. I also verified the toggling using a logic analyzer.
My question now is how can I change those 2 pins back to MMC0 mode through sysfs? I "unexported" them and the usage went back to "mmc@48060000 (pinmux_mmc1_pins)" according to show-pins, but the mode is still MODE7 and I want to set it back to MODE0.
I was hoping there was some similar way to "echo" to a directory or a file to change that.
Thanks!