Am I doing something wrong or are my expectations incorrect?
I created an overlay file BB-PRUDAP-00A0 to take over P9_17 and P9_18 and set them to the IEP.
I added it to uEnv.txt and apparently it loaded:
`
root@beaglebone:~/prudap/lkm/prudap_lkm# ls -al /proc/device-tree/chosen/overlays/
total 0
drwxr-xr-x 2 root root 0 Jan 24 07:11 .
drwxr-xr-x 3 root root 0 Jan 24 07:11 …
-r–r–r-- 1 root root 25 Jan 24 07:11 AM335X-PRU-RPROC-4-14-TI-00A0
-r–r–r-- 1 root root 25 Jan 24 07:11 BB-ADC-00A0
-r–r–r-- 1 root root 25 Jan 24 07:11 BB-BONE-eMMC1-01-00A0
-r–r–r-- 1 root root 25 Jan 24 07:11 BB-PRUDAP-00A0
-r–r–r-- 1 root root 9 Jan 24 07:11 name
`
It also seems to have exclusive control over the pins:
`
root@beaglebone:~# config-pin P9_17 pwm
ERROR: open() for /sys/devices/platform/ocp/ocp:P9_17_pinmux/state failed, No such file or directory
`
However, when I check the actual pinmux values, I get:
`
[ 77.897980] prudap: spi0_cs0 pinmux state: 0x37
[ 77.897986] prudap: spi0_d1 pinmux state: 0x37
`
That’s not what I expect. I expected to see 0x2E and 0x2D like I requested in the overlay file.
What did I do wrong in the BB-PRUDAP-00A0.dts file. Those values are not what I wanted, but I can override those values in a kernel module. However, I expected the pinmux to be already set up due to the overlay file.
Any help would be appreciated.
Thanks.
BB-PRUDAP-00A0.dts file:
`
/dts-v1/;
/plugin/;
#include <dt-bindings/board/am335x-bbw-bbb-base.h>
#include <dt-bindings/pinctrl/am33xx.h>
/ {
compatible = “ti,beaglebone”, “ti,beaglebone-black”, “ti,beaglebone-green”;
// identification
part-number = “BB-PRUDAP”;
version = “00A0”;
// resources this cape uses
exclusive-use =
“P9.17”, // spi0_cs0
“P9.18”, // spi0_d1
“pruss_iep”; // hardware ip used
/*
- Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
fragment@0 {
target-path=“/”;
overlay {
chosen {
overlays {
BB-PRUDAP-00A0 = TIMESTAMP;
};
};
};
};
/*
- Free up the pins used by the cape from the pinmux helpers.
/
fragment@1 {
target = <&ocp>;
overlay {
P9_17_pinmux { status = “disabled”; }; / spi0_cs0 /
P9_18_pinmux { status = “disabled”; }; / spi0_d1 */
};
};
fragment@2 {
target = <&am33xx_pinmux>;
overlay {
bb_prudap_pins: pinmux_bb_prudap_pins {
pinctrl-single,pins = <
BONE_P9_17 0x2E /* spi0_cs0.i2c1_scl, SLEWCTRL_FAST | INPUT_EN | PULL_DISABLE | MODE6 (IEP-edio/digio data out 7) /
BONE_P9_18 0x2D / spi0_d1.i2c1_sda, SLEWCTRL_FAST | INPUT_EN | PULL_DISABLE | MODE5 (IEP-edio/digio data in 6) */
;
};
};
};
fragment@3 {
target = <&pruss_iep>;
overlay {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&bb_prudap_pins>;
};
};
};
`
/boot/uEnv.txt for completeness:
`
root@beaglebone:~/prudap/lkm/prudap_lkm# cat /boot/uEnv.txt
#Docs: Beagleboard:U-boot partitioning layout 2.0 - eLinux.org
uname_r=4.14.108-ti-r113
#uuid=
#dtb=
###U-Boot Overlays###
###Documentation: Beagleboard:BeagleBoneBlack Debian - eLinux.org
###Master Enable
enable_uboot_overlays=1