Search code examples
linuxbeagleboneblackgpiosysfs

Linux/AM3352: setting gpio via sysfs seem not working


I have a board based on the beagle bone black.

I have gpio that should do a hardware reset to the board (gpio117 = gpio3_21)

While in the u-boot it is working - I am doing

gpio clr 117

(set 0 causes the reset) and does get hardware reset

I the Linux, I am doing the following:

echo 117 > /sys/class/gpio/export

echo high > /sys/class/gpio/gpio117/direction

echo 0 > /sys/class/gpio/gpio117/value

And I get nothing

Am I doing wrong?

Do I need to change something in the kernel code? in the dts? in defconfig?


Solution

  • Apparently, the issue was in the pinmux mcasp0_ahclkx In the boneblack dts it was configured: AM33XX_IOPAD(0x9ac, PIN_INPUT_PULLUP | MUX_MODE0) /* mcasp0_ahcklx. */

    I changed it to: AM33XX_IOPAD(0x9ac, PIN_OUTPUT_PULLUP | MUX_MODE7) /* mcasp0_ahcklx.GPIO3_21 */

    In the u-boot, it did work because the default is mux 7 (gpio3_21)