PRU access in kernel 6.19.5

How do I reserve pins for a PRU to use in kernel 6.19.5? The dtb AM335X-PRU-RPROC-4-19-TI-00A0.dtbo seems to be missing?

Plates share a list of pru pins you are using?

Want to use P9-28 and P9_30.

Kevin

Thanks, half way home, flying back from EW, I should have an example tomorrow, if I don’t sleep in, otherwise ping me Sunday

I decompiled am335x-boneblack.dtb and added the following where all the other pins were being mapped, recompiled and moved it to /boot/dtbs/6.19.5-bone10/am335x-boneblack.dtb.

                                                    pru0-pins {

                                                            pinctrl-single,pins = <0x19c 0x05 0x198 0x05>;

                                                    };

                                                    pru1-pins {

                                                            pinctrl-single,pins = <0x038 0x26>;

                                                    };

But after rebooting those pins were still set to mode 7. Not sure what else I need to do.

Kevin

What I did was clone BeagleBoard-DeviceTrees and then use TI sysconfig to get the setting you need in a device tree, write a new device tree overlay, then compile.

I looked at the TI tool. When I configure the two pins I want it gives me a .dtsi file that is pretty much the same as what I posted here earlier, except that the offsets for the pins are different. If I subract the base fro what the tool produces it appears to think P9_28 is at offset 0x0ac rather than 0x19c as all the docs I read claim, similarly the other pin. So, I am wary about using that. What I’m wondering is whether something is changing my settings after boot?

Kevin

I’ve found the sysconfig tool to be the most accurate that I’ve looked at. Specifically it shows how sensitive you are to the exact chip you have. E.g. I have a AM3359 BBB, and there are some subtle pin mux differences. For the AM3358 you have to make sure you have the right package, some of the AM3358 chips in different packages have different number of pins, and so pin outs, and so pin mux.

Problem is its a bit of a mine field - and I only been able to get certainty with the sysconfig tool.

Trying to remember the package that the BBB uses with the AM3358 design, ZCZ or something let me check …

This is what I get for an AM3358ZCZ to output R30 bits 0-15 on PRU1 - you’ll need to check on the schematic where those pins go, what the interact with on the default BBB, and so what needs to be disabled.

/* This file was auto-generated by TI PinMux on 17/03/2026 at 11:39:03. */
/* This file should only be used as a reference. Some pins/peripherals, */
/* depending on your use case, may need additional configuration. */


&am33xx_pinmux {
	mypru_pruss11_pins_default: mypru_pruss11-default-pins {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE5) /* (R1) lcd_data0.pr1_pru1_pru_r30[0] */
			AM33XX_IOPAD(0x8a4, PIN_OUTPUT | MUX_MODE5) /* (R2) lcd_data1.pr1_pru1_pru_r30[1] */
			AM33XX_IOPAD(0x8a8, PIN_OUTPUT | MUX_MODE5) /* (R3) lcd_data2.pr1_pru1_pru_r30[2] */
			AM33XX_IOPAD(0x8ac, PIN_OUTPUT | MUX_MODE5) /* (R4) lcd_data3.pr1_pru1_pru_r30[3] */
			AM33XX_IOPAD(0x8b0, PIN_OUTPUT | MUX_MODE5) /* (T1) lcd_data4.pr1_pru1_pru_r30[4] */
			AM33XX_IOPAD(0x8b4, PIN_OUTPUT | MUX_MODE5) /* (T2) lcd_data5.pr1_pru1_pru_r30[5] */
			AM33XX_IOPAD(0x8b8, PIN_OUTPUT | MUX_MODE5) /* (T3) lcd_data6.pr1_pru1_pru_r30[6] */
			AM33XX_IOPAD(0x8bc, PIN_OUTPUT | MUX_MODE5) /* (T4) lcd_data7.pr1_pru1_pru_r30[7] */
			AM33XX_IOPAD(0x8e0, PIN_OUTPUT | MUX_MODE5) /* (U5) lcd_vsync.pr1_pru1_pru_r30[8] */
			AM33XX_IOPAD(0x8e4, PIN_OUTPUT | MUX_MODE5) /* (R5) lcd_hsync.pr1_pru1_pru_r30[9] */
			AM33XX_IOPAD(0x8e8, PIN_OUTPUT | MUX_MODE5) /* (V5) lcd_pclk.pr1_pru1_pru_r30[10] */
			AM33XX_IOPAD(0x8ec, PIN_OUTPUT | MUX_MODE5) /* (R6) lcd_ac_bias_en.pr1_pru1_pru_r30[11] */
			AM33XX_IOPAD(0x880, PIN_OUTPUT | MUX_MODE5) /* (U9) gpmc_csn1.pr1_pru1_pru_r30[12] */
			AM33XX_IOPAD(0x884, PIN_OUTPUT | MUX_MODE5) /* (V9) gpmc_csn2.pr1_pru1_pru_r30[13] */
			AM33XX_IOPAD(0x970, PIN_OUTPUT | MUX_MODE5) /* (E15) uart0_rxd.pr1_pru1_pru_r30[14] */
			AM33XX_IOPAD(0x974, PIN_OUTPUT | MUX_MODE5) /* (E16) uart0_txd.pr1_pru1_pru_r30[15] */
		>;
	};
};

So, I had the wrong package, should have been ZCZ. The TI tool now gives me what look like correct results (these are actually what I posted earlier, but with macros). I made this overlay file, pru-pins.dtso.

/dts-v1/;
/plugin/;

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

&{/chosen} {
        overlays {
                pru-pins.kernel = __TIMESTAMP__;
        };
};

&am33xx_pinmux {
        mypru_pruss11_pins_default: mypru_pruss11-default-pins {
                pinctrl-single,pins = <
                        AM33XX_IOPAD(0x998, PIN_OUTPUT | MUX_MODE5) /* (D12) mcasp0_axr0.pr1_pru0_pru_r30[2] */
                        AM33XX_IOPAD(0x99c, PIN_OUTPUT | MUX_MODE5) /* (C12) mcasp0_ahclkr.pr1_pru0_pru_r30[3] */
                >;
        };


};

I cloned BeagleBoard-DeviceTrees, ran sudo make_install arm, compiled the above overlay, copied it to /boot/dtbs/6.19.5-bone10/overlays, change my /boot/uEmv.txt to include the line uboot_overlay_addr4=pru-pins.dtbo, and rebooted. After the reboot I see:

debian@BeagleBone:~$ cat /sys/kernel/debug/pinctrl/44e*single/pins |grep 99c

pin 103 (PIN103) 17:gpio-64-95 44e1099c 00000027 pinctrl-single

debian@BeagleBone:~$ cat /sys/kernel/debug/pinctrl/44e*single/pins |grep 998

pin 102 (PIN102) 16:gpio-64-95 44e10998 00000027 pinctrl-single

So, clearly the overlay did not take effect, or these pins should be mode 5.

Any insights into what eles I need to do?

Kevin

1 Like

Did you check if the pin is referenced elsewhere in the device tree - with the pins having mux, can often have many functions that the pin can be allocated to. You’ll need to make sure you disable everything else that access that pin. I usually set whatever that function is to “disabled”, and then just delete their pin mux in the device tree …

E.g.

/* remove HDMI as pins shared with PWM0 */
&lcdc {
      status = "disabled";
      };

&mcasp0 {
      status = "disabled";
      };

&am33xx_pinmux {
	nxp_hdmi_bonelt_pins: nxp-hdmi-bonelt-pins {
	}; /* removes the hdmi tda998x pins */

	nxp_hdmi_bonelt_off_pins: nxp-hdmi-bonelt-off-pins {
	}; /* more hdmi pins */

	mcasp0_pins: mcasp0-pins {
	}; /* more hdmi pins */

    epwmss0_pins: pinmux_epwmss0_pins {
                pinctrl-single,pins = <
                        AM33XX_IOPAD(0x990, PIN_OUTPUT | MUX_MODE1) /* (A13) mcasp0_aclkx.ehrpwm0A */
                        AM33XX_IOPAD(0x994, PIN_OUTPUT | MUX_MODE1) /* (B13) mcasp0_fsx.ehrpwm0B */
                >;
        };
};

&epwmss0 {
        status = "okay";
};

&ehrpwm0 {
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&epwmss0_pins>;
};



As David points out, without quite saying it, the magic line is:
pinctrl-0 = <&epwmss0_pins>;

Without that line, the changes in the pinmux stanza will be ignored.

Just change this:

&am33xx_pinmux {
        mypru_pruss11_pins_default: mypru_pruss11-default-pins {
                pinctrl-single,pins = <
                        AM33XX_IOPAD(0x998, PIN_OUTPUT | MUX_MODE5) /* (D12) mcasp0_axr0.pr1_pru0_pru_r30[2] */
                        AM33XX_IOPAD(0x99c, PIN_OUTPUT | MUX_MODE5) /* (C12) mcasp0_ahclkr.pr1_pru0_pru_r30[3] */
                >;
        };
};

to this and they should be enabled…

&am33xx_pinmux {
        pinctrl-names = "default";
        pinctrl-0 = <&mypru_pruss11_pins_default>;

        mypru_pruss11_pins_default: mypru_pruss11-default-pins {
                pinctrl-single,pins = <
                        AM33XX_IOPAD(0x998, PIN_OUTPUT | MUX_MODE5) /* (D12) mcasp0_axr0.pr1_pru0_pru_r30[2] */
                        AM33XX_IOPAD(0x99c, PIN_OUTPUT | MUX_MODE5) /* (C12) mcasp0_ahclkr.pr1_pru0_pru_r30[3] */
                >;
        };
};
1 Like

I tried both of the suggestions here:

/dts-v1/;
/plugin/;

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

&{/chosen} {
        overlays {
                pru-pins.kernel = __TIMESTAMP__;
        };
};

&mcasp0 {
        status = "disabled";
        };

&am33xx_pinmux {
        pinctrl-names = "default";
        pinctrl-0 = <&mypru_pruss11_pins_default>;


        mypru_pruss11_pins_default: mypru_pruss11-default-pins {
                pinctrl-single,pins = <
                        AM33XX_IOPAD(0x998, PIN_OUTPUT | MUX_MODE5) /* (D12) mcasp0_axr0.pr1_pru0_pru_r30[2] */
                        AM33XX_IOPAD(0x99c, PIN_OUTPUT | MUX_MODE5) /* (C12) mcasp0_ahclkr.pr1_pru0_pru_r30[3] */
                >;
        };


};

mcasp0 was using one of the pins, the other I can’t see any reference to in the device tree. I tried this both with specifying the dtb (am335x-boneblack.dtbo) in uEnv.txt, and also leaving that dtb line commented out. I copied my overlay to /boot/dtbs/6.19.6-bone11/overlays (I grabbed the latest image).

Here is my uEnv.txt:

#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=6.19.6-bone11
#uuid=
dtb=am335x-boneblack.dtb

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1
###
###Overide capes with eeprom
#uboot_overlay_addr0=<file0>.dtbo
#uboot_overlay_addr1=<file1>.dtbo
#uboot_overlay_addr2=<file2>.dtbo
#uboot_overlay_addr3=<file3>.dtbo
###
###Additional custom capes
uboot_overlay_addr4=pru-pins.dtbo
#uboot_overlay_addr5=<file5>.dtbo
#uboot_overlay_addr6=<file6>.dtbo
#uboot_overlay_addr7=<file7>.dtbo
###
###Custom Cape
#dtb_overlay=<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
#disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
#uboot_overlay_pru=AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo
###
###Cape Universal Enable
#enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

console=ttyS0,115200n8
cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100

#In the event of edid real failures, uncomment this next line:
#cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 video=HDMI-A-1:1024x768@60e

#Use an overlayfs on top of a read-only root filesystem:
#cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 overlayroot=tmpfs

##enable Generic eMMC Flasher:
#cmdline=init=/usr/sbin/init-beagle-flasher

Also, nothing shows up in /sys/firmware/devicetree/base/chosen.

ls /sys/firmware/devicetree/base/chosen

base_dtb base_dtb_timestamp bootargs linux,initrd-end linux,initrd-start name stdout-path

Kevin