Device tree overlay does not load pruss fragment but loads others

Hi -

I am using a device tree overlay to enable the pins for the multichannel serial periphearl controller (McSPI) on the beaglebone black. I am using the following device tree overlay to enable the pins for the McSPI:

`
/dts-v1/;
/plugin/;

/ {
compatible = “ti,beaglebone”, “ti,beaglebone-black”;

/* identification */
part-number = “PUGGLEBOARD”;
version = “00A1”;

/* Pins used */
exclusive-use =

/* Pins for Intan RHD2132 /
“P9.17”, /
SPI0_CS0 /
“P9.18”, /
SPI0_D1_MISO /
“P9.21”, /
SPI0_D0_MOSI /
“P9.22”, /
SPI0_SCLK */

/* Pins for BOB /
“P9.27”, /
ADC CONVST PRU0: pr1_pru0_pru_r30_5 /
“P9.28”, /
SPI1_CS0 /
“P9.29”, /
SPI1_D0_MOSI /
“P9.30”, /
SPI1_D1_MISO /
“P9.31”, /
SPI1_SCLK /
“P9.42”, /
SPI1_CS1 */

/* Hardware used */
“spi0”,
“spi1”,
“pruss”,
“pru0”;

fragment@0 {
target = <&am33xx_pinmux>;
overlay {
spi1_pins: pinmux_spi1_pins {
pinctrl-single,pins = <
0x190 0xB /* spi1_sclk, OUTPUT | MODE3 /
0x194 0xB /
spi1_d0, OUTPUT | MODE3 /
0x198 0x2B /
spi1_d1, INPUT | MODE3 /
0x19c 0xB /
spi1_cs0, OUTPUT | MODE3 /
0x164 0xA /
spi1_cs1, OUTPUT | MODE2 */

;
};
};
};

fragment@1 {
target = <&spi1>;
overlay {
#address-cells = <1>;
#size-cells = <0>;
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&spi1_pins>;
};
};

fragment@2 {
target = <&am33xx_pinmux>;
overlay {
spi0_pins: pinmux_spi0_pins {
pinctrl-single,pins = <
0x150 0x8 /* spi0_sclk, OUTPUT | MODE0 /
0x154 0x8 /
spi0_d0, OUTPUT | MODE0 /
0x158 0x28 /
spi0_d1, INPUT | MODE0 /
0x15c 0x8 /
spi0_cs0, OUTPUT | MODE0 */

;
};
};
};

fragment@3 {
target = <&spi0>;
overlay {
#address-cells = <1>;
#size-cells = <0>;
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&spi0_pins>;
};
};

fragment@4 {
target = <&am33xx_pinmux>;
overlay {
puggle_pins: pinmux_puggle_pins {
pinctrl-single,pins = <
0x1a4 0x05 /* P9.27, OUTPUT | MODE5 */

;
};
};
};

fragment@5 {
target = <&pruss>;
overlay {
#address-cells = <1>;
#size-cells = <0>;
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&puggle_pins>;
};
};
};
`

I am using the following script to compile and load the dto:


#!/bin/sh

if ! id | grep -q root; then
 echo "must be run as root"
 exit
fi

set -x
set -e
export SLOTS=/sys/devices/bone_capemgr.8/slots
export PINS=/sys/kernel/debug/pinctrl/44e10800.pinmux/pins
dtc -O dtb -o PUGGLE-00A1.dtbo -b 0 -@ PUGGLE-00A1.dts
cp PUGGLE-00A1.dtbo /lib/firmware/
cat $SLOTS
echo PUGGLE:00A1 > $SLOTS
cat $SLOTS

I am using device tree compiler version: DTC 1.4.0-gf345d9e4

All the pins from the spi fragments work and I am able to generate an SPI output using those pins. The problem is the single PRU pin I am trying to initialize. It’s pin P9.27 and I want to set it as an output in mode 5. But this pin never gets initialized. I checked this by catting the pins file as follows:

`
cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins | grep 9a4

`

and all I get out is:

`
pin 105 (44e109a4) 00000027 pinctrl-single

`

To debug this, I tried changing the pin to P9.25 and even P8.46 but neither of those pins were intialized either when I checked the pins file in kernel/debug. I even tried running this on a different beaglebone black, and still no luck.

Is there something fundamentally wrong in my device tree overlay? I’m a bit confused as to why the pins for the spi0 and spi1 fragments get loaded but not the pruss.

Thanks in advance!

Hi,
I am definitely not an expert in device tree overlays, but I somehow got most of the PRU output pins to work. I load and compile with the following command:

`
#!/bin/bash
NAME=lockbox

echo “Compiling the overlay from .dts to .dtbo”

dtc -O dtb -o $NAME-00A0.dtbo -b 0 -@ ./$NAME.dts

cp $NAME-00A0.dtbo /lib/firmware

`

My file lockbox.dts contains the following code:

`
/*

Sorry: I compile with what I wrote above. I load just as you do with


echo lockbox:00A1 > $SLOTS