Skip to content
Carsten edited this page Nov 9, 2017 · 22 revisions

Welcome to the BeagleBone-GPIO wiki!

I am using BeagleBone Black and Kernel 4.4.30-ti-r64

If bit 0..2 in the pin mux setting are already set, you can use the pin as GPIO pin directly.

How to check :

export PINS=/sys/kernel/debug/pinctrl/44e10800.pinmux/pins
cat $PINS
cat $PINS | grep 948
cat $PINS | grep 94C

If bit 0..2 in the pin mux setting is different you need to change the device tree.

I tried to use cape manager but without success.

Finally this worked for me to set MDC and MDIO pins as GPIO pins:

Install DTB-REBUILDER

cd /home/debian
git clone https://github.com/RobertCNelson/dtb-rebuilder.git
cd dtb-rebuilder/
./dtc-overlay.sh

Change a DTS source file

cd src/arm

Change MDIO and MDC as GPIO pins from MUX_MODE0 to MUX_MODE7

nano am335x-bone-common.dtsi

davinci_mdio_default: davinci_mdio_default {
            pinctrl-single,pins = <
            /* MDIO */
           AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE7)    /* mdio_data.mdio_data */
           AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE7)                   /* mdio_clk.mdio_clk */
           >;
        };

After changing a DTS / DTSI file

 make clean
 make all
 make install

Apply and verify changes

Reboot

export PINS=/sys/kernel/debug/pinctrl/44e10800.pinmux/pins
cat $PINS | grep 94