Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Aug 2018 01:23:01 +0200
From:      Nicola Mingotti <nmingotti@gmail.com>
To:        "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   PRU Overlay Problem
Message-ID:  <9ac1edad-1fbf-0e4d-cb2f-3de077fff7f8@gmail.com>

next in thread | raw e-mail | index | archive | help

Hi !

I am trying to configure the PRU in BeagleBone Black, FreeBSD-12-ALPHA.

I found Rolf code online, it compiles and load => I  see the PRU
https://obsigna.com/articles/1530973669.html

Ok, the problem is I would like to configure the pins for the PRU either 
in the new format
that Ian says on in the old one. I tried to modify Rolf code copying 
from various resources
but i failed. I ask your help. I admint this thing for me is in good 
part obscure.

In previous post I saw the DTS sources are here:
https://github.com/freebsd/freebsd/tree/master/sys/gnu/dts/arm
But, i can't find the file defining the PRU, so I am stuck, i don't know 
where to copy from;)

here is were i landed :

--------------------- new style overlay ----------
/dts-v1/;
/plugin/;

/ {
     compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
     exclusive-use = "P9.27","P9.28","pru0";
};

&am33xx_pinmux {
      pru_pru_pins: pinmux_pru_pru_pins {
         pinctrl-single,pins = <
              0x1a4 0x05   /* P9.27 pr1_pru0_pru_r30_5, Mode 5 output 
pull-down   */
              0x19c 0x26   /* P9.28 pr1_pru0_pru_r31_3, Mode 6 input 
pull-down    */
         >;
     };
};

/* &"/" {     ummm, problem, doh  */
&ocp {
     #address-cells = <1>;
     #size-cells = <1>;
     pruss@4a300000 {
         status = "okay";
         compatible = "ti,pruss-v2";
         ti,deassert-hard-reset = "pruss", "pruss";
         reg = <0x4a300000 0x080000>;
         ti,pintc-offset = <0x20000>;
         interrupt-parent = <&intc>;
         interrupts = <20 21 22 23 24 25 26 27>;
         pinctrl-names = "default";
         pinctrl-0 = <&pru_pru_pins>;
     };
};
--------------------------------------

---------- old style overlay -----------------
/dts-v1/;
/plugin/;

/ {
     compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
     exclusive-use = "P9.27","P9.28", "pru0";


     pru_pru_pins: pinmux_pru_pru_pins {
          pinctrl-single,pins = <
                0x1a4 0x05   /* P9.27 pr1_pru0_pru_r30_5, Mode 5 output 
pull-down   */
                0x19c 0x26   /* P9.28 pr1_pru0_pru_r31_3, Mode 6 input 
pull-down    */
                >;
    };

    fragment@1 {
     target-path="/";
     __overlay__ {
         ocp {
             #address-cells = <1>;
             #size-cells = <1>;
             pruss@4a300000 {
                 status = "okay";
                 compatible = "ti,pruss-v2";
                 ti,deassert-hard-reset = "pruss", "pruss";
                 reg = <0x4a300000 0x080000>;
                 ti,pintc-offset = <0x20000>;
                 interrupt-parent = <&intc>;
                 interrupts = <20 21 22 23 24 25 26 27>;
                 pinctrl-0 = <&pru_pru_pins>;
             };
         };
     };
   };

};
---------------------------------------------------

bye
Nicola


-- 
--------------------------
Dr. Nicola Mingotti
R&D - Borghi Srl
CTO - BondInsider
--------------------------




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9ac1edad-1fbf-0e4d-cb2f-3de077fff7f8>