How to get pin to mode 6 on beagle bone black

Manuel Stühn freebsdnewbie at freenet.de
Mon Jan 20 20:28:07 UTC 2020


On Mon, 20 Jan 2020 09:36:39 +0100
Hans Bentum <jwbentum44 at gmail.com> wrote:
[..]
> 
> Question:
> - Is is to be expected that a user level tool like gpioctl can see an input
> for a pin configurated for usage by the pru?

I'm successfully using Header 9 Pin 30 (GPIO112, PRU0[2], gpio3[16]) as pru-pin configured with this overlay:

/dts-v1/;
/plugin/;

/{
  compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
  version = "0001";

  fragment at 0 {
      target-path = "/ocp";

      __overlay__ {
        pruss: pruss at 4a300000 {
                   compatible = "ti,pruss-v2";
                   reg = <0x4a300000 0x080000>;
                   interrupt-parent = <&intc>;
                   interrupts = <20 21 22 23 24 25 26 27>;
                   status = "okay";
                   pinctrl-names = "default";
                   pinctrl-0 = <&pru_pru_pins>;
               };
      };
  };

  fragment at 1 {
      target = <&am33xx_pinmux>;
      __overlay__ {

        pru_pru_pins: pinmux_pru_pru_pins {
                  pinctrl-single,pins = <
                      0x198 0x26	/* PRU0-2 */
                      >;
              };
      };
  };

};


gpioctl shows this:
root at nanobsd-bbb:~ # gpioctl -l -f /dev/gpioc3 | grep 16
pin 16: 0       gpio_16<>

gpioctl does not recognize any toggle but pru does.

> Question:
> - I think /boot/dtb/am335x-boneblack.dtb must be is loaded. Is this
> correct. The serial console output does not print the
> name of the device tree file that is loaded. How can I know what is loaded?

I'm seeing this output generated by my bbb running FreeBSD 12.0-RELEASE-p2 over the serial console:


Loading kernel...
/boot/kernel/kernel text=0x8655ac data=0xb0da0+0x1f4ca0 syms=[0x4+0xa1060+0x4+0x101505]
Loading configured modules...
can't find '/boot/entropy'
/boot/dtb/am335x-boneblack.dtb size=0xc92c
Loaded DTB from file 'am335x-boneblack.dtb'.
Loading DTB overlays: 'ti_pruss.dtbo,onewire.dtbo'
/boot/dtb/overlays/ti_pruss.dtbo size=0x41f
/boot/dtb/overlays/onewire.dtbo size=0x1c2
applying DTB overlay '/boot/dtb/overlays/ti_pruss.dtbo'
applying DTB overlay '/boot/dtb/overlays/onewire.dtbo'
Kernel entry at 0x82400180...
Kernel args: (null)
---<<BOOT>>---

There can be seen that am335x-boneblack.dtb gets loaded, then ti_pruss.dtbo and onewire.dtbo are applied.

-- 
Manuel Stühn


More information about the freebsd-arm mailing list