Problem setting pin modes and configurations using a device tree overlay.

Hey all,

I’ve been trying to write a device tree overlay for my beaglebone black, setting certain pins as I2C, UART, and GPIOs with internal pullup/pulldown resistors. Attached is my current device tree overlay (I have many versions that don’t seem to work). I’ve tried multiple drivers like gpio-leds for output and gpio-keys for inputs. My current overlay is using the gpio-keys driver. I’m able to compile the source file into a binary using dtc -I dts -O dtb -@ lowercape_rev1_v33.dtso -o lowercape_rev1_v33.dtbo. Then I take the dtbo file and copy it into /boot/dtbs/6.19.6-bone11. Next I modify my /boot/uEnv.txt so that it includes the line uboot_overlay_addr4=/boot/dtbs/6.19.6-bone11/lowercape_rev1_v33.dtbo. Note that in this file I have disabled the universal cape and the video, audio, wireless, and adc uboot overlays. When I reboot the device I do see that the overlay loads (by looking at the output of sudo beagle-version) . I also don’t see any errors from that output. By using gpioinfo I do see that the pins I’m trying to set are claimed by the gpio-keys driver however when I actually look at their pin configurations using cat /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pins I find that the pins are not what I set in my dtso file. For instance, P8.8 I set to have an internal pull-down resistor configuration in mode 7 (GPIO). The output of cat /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single/pins | grep 894 shows: pin 37 (PIN37) 3:gpio-32-63 44e10894 0000002f pinctrl-single which indicates that the pin is floating. Does anyone have any ideas as to why this is happening? Is there something wrong in my dtso? Any help would be greatly appreciated. I’ve been trying to hurdle this wall for sometime now.

All I’m really trying to do is set the boot configuration (mode and pullup/downs) of these pins so that I can use the gpioset and gpioget commands on them. I know that by using the gpio-keys driver I can’t use those commands anymore but I’ve been trying different things to see if I could just set each of these pins to the correct pinmux.

lowercape_rev1_v33.dtso (6.4 KB)

-DJL

At first glance the problem could be in any of the raw hex values. How were they calculated? It’s more maintainable to use the constants in the headers (albeit a bit more work to preprocess the .dtso with gcc first).

I recommend starting from a known good example. Or if you really need to keep this, I’d strip it down to one single pin. Then from either one, configure one kernel device, then one pin block and so on. Sorry I can’t help further - DeviceTree is tricky!

/dts-v1/;
/plugin/;

&{/chosen} {
        overlays {
                LowerCape_Rev1 = "2026-05-18"; /* Set the date this overlay was created */
        };
};

&am33xx_pinmux {
        lower_cape_rev1_chip0: lower-cape-rev1-chip0 {
                pinctrl-single,pins = <
                        0x002c 0x27 /* Set P8.17 as in/out gpio0_27, Mode 7, Internal Pulldown Resistor Enabled */
                        0x0028 0x27 /* Set P8.14 as in/out gpio0_26, Mode 7, Internal Pulldown Resistor Enabled */						

                >;
        };
        lower_cape_rev1_chip1: lower-cape-rev1-chip1 {
                pinctrl-single,pins = <
                        0x0034 0x27 /* Set P8.11 as in/out gpio1_13, Mode 7, Internal Pulldown Resistor Enabled */	
                        0x0030 0x27 /* Set P8.12 as in/out gpio1_12, Mode 7, Internal Pulldown Resistor Enabled */
                        0x003c 0x27 /* Set P8.15 as in/out gpio1_15, Mode 7, Internal Pulldown Resistor Enabled */
                        0x0038 0x27 /* Set P8.16 as in/out gpio1_14, Mode 7, Internal Pulldown Resistor Enabled */
                        0x007c 0x27 /* Set P8.26 as in/out gpio1_29, Mode 7, Internal Pulldown Resistor Enabled */
                        0x0044 0x27 /* Set P9.23 as in/out gpio1_17, Mode 7, Internal Pulldown Resistor Enabled */						

                >;
        };
        lower_cape_rev1_chip2: lower-cape-rev1-chip2 {
                pinctrl-single,pins = <
                        0x0094 0x27 /* Set P8.8 as in/out gpio2_3, Mode 7, Internal Pulldown Resistor Enabled */
                        0x008c 0x27 /* Set P8.18 as in/out gpio2_1, Mode 7, Internal Pulldown Resistor Enabled */						

                >;
        };
        lower_cape_rev1_chip3: lower-cape-rev1-chip3 {
                pinctrl-single,pins = <
                        0x01a4 0x27 /* Set P9.27 as in/out gpio3_19, Mode 7, Internal Pulldown Resistor Enabled */
                        0x0198 0x2f /* Set P9.30 as in/out gpio3_16, Mode 7, Internal Pullup/Pulldown Disabled */


                >;
        };
        lower_cape_rev1_uart4: lower-cape-rev1-uart4 {
                pinctrl-single,pins = <
                        0x0070 0x2e /* Set P9.11 as UART4_RX, Mode 6, No internal pullup or pulldown */
						0x0074 0x2e /* Set P9.13 as UART4_TX, Mode 6, No internal Pullup or pulldown */
						
                >;
        };
        lower_cape_rev1_uart1: lower-cape-rev1-uart1 {
                pinctrl-single,pins = <
                        0x0180 0x28 /* Set P9.26 as UART1_RX, Mode 0, No internal pullup or pulldown */
						0x0184 0x28 /* Set P9.24 as UART1_TX, Mode 0, No internal Pullup or pulldown */
						
                >;
        };
        lower_cape_rev1_i2c2: lower-cape-rev1-i2c2 {
                pinctrl-single,pins = <
                        0x017c 0x2b /* Set P9.19 as I2C2_SCL, Mode 3, No internal pullup or pulldown */
						0x0178 0x2b /* Set P9.20 as I2C2_SDA, Mode 3, No internal Pullup or pulldown */
						
                >;
        };
};

&uart1 {
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&lower_cape_rev1_uart1>;
};

&uart4 {
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&lower_cape_rev1_uart4>;
};

&i2c2 {
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&lower_cape_rev1_i2c2>;
		clock-frequency=<100000>;
};


/* Power on the hardware blocks */
&gpio0 {
        status = "okay";
};

&gpio1 {
        status = "okay";
};

&gpio2 {
        status = "okay";
};

&gpio3 {
        status = "okay";
};

/* Configure and name the individual lines inside the root path */
&{/} {
	/* --- Bank 0 Helper Node --- */
	lower_cape_gpio0_labels {
		compatible = "gpio-keys";
		pinctrl-names = "default";
        pinctrl-0 = <&lower_cape_rev1_chip0>;
		
		pin_p8_17 {
			gpios = <&gpio0 27 0>; /*P8.17*/
			label = "P8.17";
			linux,code = <0>;
			linux,input-type = <5>;
			debounce-interval = <50>;
		};
		
		pin_p8_14 {
			gpios = <&gpio0 26 0>; /*P8.14*/
			label = "P8.14";
            linux,code = <1>;
			linux,input-type = <5>;
			debounce-interval = <50>;
		};	
		
	};
	
	/* --- Bank 1 Helper Node --- */
	lower_cape_gpio1_labels {
		compatible = "gpio-keys";
		pinctrl-names = "default";
        pinctrl-0 = <&lower_cape_rev1_chip1>;
		
		pin_p8_11 {
			gpios = <&gpio1 13 0>; /*P8.11*/
			label = "P8.11";
            linux,code = <2>;
			linux,input-type = <5>;
			debounce-interval = <50>;
		};
			
		pin_p8_12 {
			gpios = <&gpio1 12 0>; /*P8.12*/
			label = "P8.12";
            linux,code = <3>;
			linux,input-type = <5>;
			debounce-interval = <50>;
		};
			
		pin_p8_15 {
			gpios = <&gpio1 15 0>; /*P8.15*/
			label = "P8.15";
            linux,code = <4>;
			linux,input-type = <5>;
			debounce-interval = <50>;
		};

		pin_p8_16 {
			gpios = <&gpio1 14 0>; /*P8.16*/
			label = "P8.16";
            linux,code = <5>;
			linux,input-type = <5>;
			debounce-interval = <50>;
		};

		pin_p8_26 {
			gpios = <&gpio1 29 0>; /*P8.26*/
			label = "P8.26";
            linux,code = <6>;
			linux,input-type = <5>;
			debounce-interval = <50>;
		};
		
		pin_p8_23 {
			gpios = <&gpio1 17 0>; /*P9.23*/
			label = "P9.23";
            linux,code = <7>;
			linux,input-type = <5>;
			debounce-interval = <50>;
		};	
		
	};
	
	/* --- Bank 2 Helper Node --- */
	lower_cape_gpio2_labels {
		compatible = "gpio-keys";
		pinctrl-names = "default";
        pinctrl-0 = <&lower_cape_rev1_chip2>;
		
		pin_p8_8 {
			gpios = <&gpio2 3 0>; /*P8.8*/
			label = "P8.8";
            linux,code = <8>;
			linux,input-type = <5>;
			debounce-interval = <50>;
		};
		
		pin_p8_18 {
			gpios = <&gpio2 1 0>; /*P8.18*/
			label = "P8.18";
            linux,code = <9>;
			linux,input-type = <5>;
			debounce-interval = <50>;
		};		
		
	};	
	
	/* --- Bank 3 Helper Node --- */
	lower_cape_gpio3_labels {
		compatible = "gpio-keys";
		pinctrl-names = "default";
        pinctrl-0 = <&lower_cape_rev1_chip3>;		
		
		pin_p9_27 {
			gpios = <&gpio3 19 0>; /*P9.27*/
			label = "P9.27";
            linux,code = <10>;
			linux,input-type = <5>;
			debounce-interval = <50>;
		};	

		pin_p9_30 {
			gpios = <&gpio3 16 0>; /*P9.30*/
			label = "P9.30";
            linux,code = <11>;
            linux,input-type = <5>;
			debounce-interval = <50>;
		};			

	};
	
};

1 Like

Hey James!

Thanks for taking the time to help. I actually found my mistake in the overlay yesterday. Apparently, when you declare the mode and configuration for each pin in the &33xx_pinmux { ... block there is a third argument for each pin. From what I can tell, this third argument is a bitmask. In my overlay I set this mask to 0x00 (see the final overlay).

/dts-v1/;
/plugin/;

&{/chosen} {
overlays {
LowerCape_Rev1 = “2026-05-13”; /* Set the date this overlay was created */
};
};

&am33xx_pinmux {
lower_cape_rev1_chip0: lower-cape-rev1-chip0 {
pinctrl-single,pins = <
0x002c 0x27 0x00 /* Set P8.17 as in/out gpio0_27, Mode 7, Internal Pulldown Resistor Enabled /
0x01b4 0x27 0x00 / Set P9.41A as in/out gpio0_20, Mode 7, Internal Pulldown Resistor Enabled /
0x0028 0x27 0x00 / Set P8.14 as in/out gpio0_26, Mode 7, Internal Pulldown Resistor Enabled */

            >;
    };
    lower_cape_rev1_chip1: lower-cape-rev1-chip1 {
            pinctrl-single,pins = <
                    0x0034 0x27 0x00 /* Set P8.11 as in/out gpio1_13, Mode 7, Internal Pulldown Resistor Enabled */	
                    0x0030 0x27 0x00 /* Set P8.12 as in/out gpio1_12, Mode 7, Internal Pulldown Resistor Enabled */
                    0x003c 0x27 0x00 /* Set P8.15 as in/out gpio1_15, Mode 7, Internal Pulldown Resistor Enabled */
                    0x0038 0x27 0x00 /* Set P8.16 as in/out gpio1_14, Mode 7, Internal Pulldown Resistor Enabled */
                    0x007c 0x27 0x00 /* Set P8.26 as in/out gpio1_29, Mode 7, Internal Pulldown Resistor Enabled */
                    0x0044 0x27 0x00 /* Set P9.23 as in/out gpio1_17, Mode 7, Internal Pulldown Resistor Enabled */						

            >;
    };
    lower_cape_rev1_chip2: lower-cape-rev1-chip2 {
            pinctrl-single,pins = <
                    0x0094 0x27 0x00 /* Set P8.8 as in/out gpio2_3, Mode 7, Internal Pulldown Resistor Enabled */
                    0x009c 0x27 0x00 /* Set P8.9 as in/out gpio2_5, Mode 7, Internal Pulldown Resistor Enabled */
                    0x0098 0x27 0x00 /* Set P8.10 as in/out gpio2_4, Mode 7, Internal Pulldown Resistor Enabled */						
                    0x008c 0x27 0x00 /* Set P8.18 as in/out gpio2_1, Mode 7, Internal Pulldown Resistor Enabled */						

            >;
    };
    lower_cape_rev1_chip3: lower-cape-rev1-chip3 {
            pinctrl-single,pins = <
                    0x01ac 0x27 0x00 /* Set P9.25 as in/out gpio3_21, Mode 7, Internal Pulldown Resistor Enabled */
                    0x01a4 0x27 0x00 /* Set P9.27 as in/out gpio3_19, Mode 7, Internal Pulldown Resistor Enabled */
                    0x0194 0x37 0x00 /* Set P9.29 as in/out gpio3_15, Mode 7, Internal Pullup Resistor Enabled /
                    0x0198 0x0f 0x00 /* Set P9.30 as in/out gpio3_16, Mode 7, Internal Pullup/Pulldown Disabled, Input Disabled */
                    0x0190 0x37 0x00 /* Set P9.31 as in/out gpio3_14, Mode 7, Internal Pullup Resistor Enabled */

            >;
    };
    lower_cape_rev1_uart4: lower-cape-rev1-uart4 {
            pinctrl-single,pins = <
                    0x0070 0x2e 0x00 /* Set P9.11 as UART4_RX, Mode 6, No internal pullup or pulldown */
					0x0074 0x0e 0x00 /* Set P9.13 as UART4_TX, Mode 6, No internal Pullup or pulldown */
					
            >;
    };
    lower_cape_rev1_uart1: lower-cape-rev1-uart1 {
            pinctrl-single,pins = <
                    0x0180 0x28 0x00 /* Set P9.26 as UART1_RX, Mode 0, No internal pullup or pulldown */
					0x0184 0x08 0x00 /* Set P9.24 as UART1_TX, Mode 0, No internal Pullup or pulldown */
					
            >;
    };
    lower_cape_rev1_i2c2: lower-cape-rev1-i2c2 {
            pinctrl-single,pins = <
                    0x017c 0x2b 0x00 /* Set P9.19 as I2C2_SCL, Mode 3, No internal pullup or pulldown */
					0x0178 0x2b 0x00 /* Set P9.20 as I2C2_SDA, Mode 3, No internal Pullup or pulldown */
					
            >;
    };

};

&uart1 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&lower_cape_rev1_uart1>;
};

&uart4 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&lower_cape_rev1_uart4>;
};

&gpio0 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&lower_cape_rev1_chip0>;
};

&gpio1 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&lower_cape_rev1_chip1>;
};

&gpio2 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&lower_cape_rev1_chip2>;
};

&gpio3 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&lower_cape_rev1_chip3>;
};

&i2c2 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&lower_cape_rev1_i2c2>;
clock-frequency=<100000>;
};

I compiled the source overlay again using the device tree compiler copied it into /boot/dtbs/6.19.6-bone11 , added the overlay to /boot/uEnv.txt and finally rebooted using sudo reboot. All pins were set correctly and I was able to use the gpioget and gpioset commands.

It’s odd how for the beaglebone black kernel version I’m using I need to add this third bitmask in the pin declarations while on the Pocket Beagle 2 kernel I was using a month ago, having just the pad address offset and the pin mode value was all I needed ( I didn’t add the third 0x00 bitmask value in the PB2 overlay I made). I guess the developers didn’t see a need for the third bitmask so got rid of it in the PB2 kernels? Regardless, this overlay works now and and I can rest easy at night now :joy: .

As for how I got the address offsets and values, I referred to the BBB schematics (rev C3 because I couldn’t find rev D which is what my board is at) to figure out which ball on the AM335x chip the pins were connected to. Then I looked through the AM335x chip manual (AM335x Sitara™ Processors datasheet (Rev. L) -Table 4-2) to find the pin name associated with that ball. Finally I went to the AM335x Technical Reference Manual (Oct. 2011) Table 9.10 to find the offset for the pin name I found in the datasheet. Hopefully that all makes sense.

To find the second value (which I call the pin mode declaration value) I just remember that bits 0-2 set the mode (0-7), bit 3 either enables or disables pull resistors (0 for enabled, 1 for disabled), bit 4 sets the pull resistor configuration (1 for pullup, 0 for pulldown), bit 5 either enables or disables that pins internal receiver (1 enables the internal receiver, 0 disables it), and bit 6 sets the slew rate (0 for fast, 1 for slow).

Thanks again!

-DJL

1 Like

I am following along in this effort. I understand you may already be done but I would like to receive updates to the post. So, I am posting to get updates.

Thank you for figuring this out… It always helps when people in the community come to a summary on finalizing their insight.

1 Like

While I can appreciate you using the raw values to understand whats going on,
I can’t help thinking you’re working too hard.

All of that knowledge has already been condensed into:

#include <dt-bindings/pinctrl/am33xx.h>

What I’m saying is, why not just use what has already been given to you?
An example:

You can also use build_and_install.sh to do all the heavy lifting for you…

Did you get your pull up and down resistors to work? If not look here. If so great!
You are using 6.19.6-bone11?

https://forum.beagleboard.org/t/config-pin-pin-muxing-on-beaglebone-black-on-bookworm
https://forum.beagleboard.org/t/compiling-custom-linux-kernel-for-beaglebone-black-industrial-6-18-16-bone23

While on the subject, @RobertCNelson gave a really good explanation
about the subtleties of that extra “zero” you’ve discovered as the third argument…

Have a look here:

Learned something myself there… :wink:

This to me is the crux - using the macro that does the settings makes it clear what you have to pass, and in particular the the MuxMode sets the mode of the pin for multifunction pins.

What’s also bad about that macro. In 5.9, this was also changed on the back side.. Making sure you're not a bot!

1 Like

Iranders,

Thanks for this. I’ve seen others using this header file in other overlays but wanted to first understand what the macro was doing. Now that I understand the offsets and pin configuration bits, I’ll start using it. I can see how it would make the overlay much more clear for a reader. Is it safe to say that you would still need to know the name of the AM335x ball the pin is connected to? Say for instance you wanted to set P8.8 to a input pullup (GPIO mode 7) you would use this:

AM33XX_PADCONF(AM335X_PIN_GPMC_OEN_REN , PIN_INPUT_PULLUP, 7)

Also, I have seen others use build_and_install.sh but haven’t done much reading into it. I’ll have to read up on it.

Thanks!

-DJL

1 Like

jtbrooks,

I did end up getting the overlay to work and all my pins were configured correctly. My issue was that I was unaware that for each line of pinctrl-single,pins = < ... in the &am33xx_pinmux block there was a third value that acts like a bitmask. I set that mask to 0x00.

Also, thanks for the links to the other forms, they were good reads.

-DJL

1 Like

Daniel,

I copied your device tree overlay, changed the name and fixed a few typos, everything compiled just fine.

djl_P8_11_37-00A0.dtso (4.2 KB)

I changed P8.11 to pull up, which it did.

sudo gpioget -c /dev/gpiochip0 13
"13"=active

Very nice! I’m going to do some more testing when I get some time.

1 Like

I took your overlay, simplified it and did a little testing.

cat djl_pinmux-00A0.dtso
/dts-v1/;
/plugin/;

/*dtc -I dts -O dtb -@ djl_pinmux-00A0.dtso -o djl_pinmux-00A0.dtbo*/

&{/chosen} {
   overlays {
      LowerCape_Rev1 = "2026-05-13"; /* Set the date this overlay was created */
      /*djl_pinmux-00A0.kernel = __TIMESTAMP__;*/
   };
};

&am33xx_pinmux {
   lower_cape_rev1_chip0: lower-cape-rev1-chip0 {
      pinctrl-single,pins = <
            0x0034 0x37 0x00 /* Set P8.11 gpio0:13 */
            0x00bc 0x37 0x00 /* Set P8.40 gpio1:13 */
            0x01ac 0x37 0x00 /* Set P9.25 gpio2:21 */
            0x00dc 0x37 0x00 /* Set P8.32 gpio3:11 */

            >;
    };

};


&gpio0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&lower_cape_rev1_chip0>;
};

Here is the pinmux settings before and after the overlay is applied, so everything is working.

Before:
pinmux|grep -E "P8.11|P8.40|P9.25|P8.32"
gpio0:13 | GPMC_AD13 P8.11         | 0x44e10834 | 0x0834 | 0x37  |    7  | FRXPULLUP
gpio1:13 | LCD_DATA7 P8.40         | 0x44e108bc | 0x08bc | 0x2f  |    7  | FRX
gpio3:11 | LCD_DATA15 P8.32        | 0x44e108dc | 0x08dc | 0x2f  |    7  | FRX
gpio2:21 | MCASP0_AHCLKX P9.25     | 0x44e109ac | 0x09ac | 0x27  |    7  | FRXPULLDN

After:

pinmux|grep -E "P8.11|P8.40|P9.25|P8.32"
gpio0:13 | GPMC_AD13 P8.11         | 0x44e10834 | 0x0834 | 0x37  |    7  | FRXPULLUP
gpio1:13 | LCD_DATA7 P8.40         | 0x44e108bc | 0x08bc | 0x37  |    7  | FRXPULLUP
gpio3:11 | LCD_DATA15 P8.32        | 0x44e108dc | 0x08dc | 0x37  |    7  | FRXPULLUP
gpio2:21 | MCASP0_AHCLKX P9.25     | 0x44e109ac | 0x09ac | 0x37  |    7  | FRXPULLUP


You can see from this output that the chip and pin numbers are all on different chips, so &gpio0 does nothing. ???

There is still something strange going on.

pinmux|grep -E "P8.11|P8.40|P9.25|P8.32"
gpio0:13 | GPMC_AD13 P8.11         | 0x44e10834 | 0x0834 | 0x37  |    7  | FRXPULLUP
gpio1:13 | LCD_DATA7 P8.40         | 0x44e108bc | 0x08bc | 0x37  |    7  | FRXPULLUP
gpio3:11 | LCD_DATA15 P8.32        | 0x44e108dc | 0x08dc | 0x37  |    7  | FRXPULLUP
gpio2:21 | MCASP0_AHCLKX P9.25     | 0x44e109ac | 0x09ac | 0x37  |    7  | FRXPULLUP
debian@BeagleBone:~$ sudo gpioget -c /dev/gpiochip0 13
[sudo] password for debian: 
"13"=active
debian@BeagleBone:~$ sudo gpioget -c /dev/gpiochip0 13
"13"=active
debian@BeagleBone:~$ sudo gpioget -c /dev/gpiochip1 13
"13"=inactive
debian@BeagleBone:~$ sudo gpioget -c /dev/gpiochip3 11
"11"=inactive
debian@BeagleBone:~$ sudo gpioget -c /dev/gpiochip2 21
"21"=active

P8.40 and P8.32 shows pulled up but reads inactive. Hmmmm

jtbrooks,

I see that in your overlay you are targeting the main gpio0 controller for all those pins, however, only P8.32 belongs to chip 0. Now I don’t know for certain but I’d imagine that assigning pins to gpio controllers that the pin does not belong to would probably cause unexpected errors. That is why in my working overlay I had multiple blocks within the &am33xx_pinmux block, one for each chip such as lower_cape_rev1_chip1: lower-cape-rev1-chip1 { , lower_cape_rev1_chip2: lower-cape-rev1-chip2 {, etc.

Then I assign each pinmux block to it’s appropriate gpio controller such as:

&gpio0 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&lower_cape_rev1_chip0>;
};

&gpio1 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&lower_cape_rev1_chip1>;
};

I would try to do something like that. At least that is the way I’ve done it and it works for me. There might be an easier way.

Also, I noticed that your chip and line numbers don’t align with the AM335x datasheet. For instance, from the beaglebone black (rev C3) schematic P8.11 connects to a node called “GPIO1_13” (which points to chip1 line 13). That node is connected to Ball R12 of the AM335x. Looking through the AM335x datasheet (table 4-2 on the Oct 2011 version) for a ZCZ ball designator of R12 (page 26), mode 7 is indeed GPIO1_13. I’m not sure if the linux kernel assigns the chip and line designators for each pin differently but this is how I found the chip and line numbers for each pin I was trying to configure.

For the pins you’re trying to configure:

/*P8.11 - GPIO1_13*/
/*P8.40 - GPIO2_13*/
/*P9.25 - GPIO3_21*/
/*P8.32 - GPIO0_11*/

Hopefully what I’m saying makes sense. And hopefully someone more knowledgeable can chip in (no pun intended) if what I’m saying is wrong.

Right, that’s my point, seems to work with just gpio0

gpiochip3 - 32 lines:
	line  27:	"P8_17"         	input

In your original overlay you have P8.17 under chip 0. gpioinfo shows it under chip 3. So it’s a little confusing.