On Fri, Jan 24, 2020 at 1:32 AM Andrew P. Lentvorski <bsd...@gmail.com> wrote:
>
>
> 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>;

The pruss_ieq doesn't have pinctrl, you need to stick it in the pruss node:

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/AM335X-PRU-RPROC-4-14-TI-PRUCAPE-00A0.dts#L119-L131

It's really best to copy AM335X-PRU-RPROC-4-14-TI-PRUCAPE-00A0.dts to
your overlay name, and then rip out the pins you don't use..

Regards,


--
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYgOpUOqzDkLRJ5v%2BtEGNJAR5nN2-0d8osLTcza36g_%2BzA%40mail.gmail.com.

Reply via email to