• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How to handle dts overlay's for beglebone black

JWB

New Member

Thanks: 2
Messages: 8

#1
Hello,
At work an electrical engineer wants to use the beaglebone black. He uses a dts overlay. I pointed him to FreeBSD and he likes the idea using that. My question is: How do I handle the overlay in FreeBSD. If I am correct the overlay handling is not the same as in Linux.
Do I have to insert the overlay somewhere (pinmux@800 section ?) inside the am335x-boneblack.dts file? Can someone point me to documentation about it or explain how to do it?
I am using FreeBSD 12.0-CURRENT r319859

This is the ovelay:
Code:
/dts-v1/;
/plugin/;

/{
    compatible = "ti,beaglebone", "ti,beaglebone-black";
    part_number = "BB_ITS";
    version = "00A0";
   
    exclusive-use =
        "P9.23",        /* A0 */
        "P9.14",        /* A1 */
        "P9.15",        /* A2 */
        "P9.16",        /* A3 */
        "P9.17",        /* SPI0_CS */
        "P9.18",        /* SPI0_DI */
        "P9.21",        /* SPI0_DO */
        "P9.22",        /* SPI0_CLK */
        "P9.13",       
        "P9.24",       
        "P9.26";       
       
    fragment@0 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            bb_its: pinmux_bb_its {
                pinctrl-single,pins = <
                  0x074 0x27
                  0x048 0x27
                  0x040 0x27
                  0x04c 0x27
                  0x15c 0x27 /* pin nummer tabel Beaglebone Black P9 Header, 0x17 : 00 = fast, 0 = output, 1 = pullup, 0 = pullup enabled, 111 = mode 7 (GPIO) */
                  0x158 0x27
                  0x154 0x27
                  0x150 0x27   
                  0x044 0x27   
                  0x184 0x27   
                  0x180 0x27   
                  >;
            };
        };
    };

    fragment@1 {
        target = <&ocp>;
        __overlay__ {
            bb_its_pinmux {
                compatible = "bone-pinmux-helper";
                status = "okay";
                pinctrl-names = "default";
                pinctrl-0 = <&bb_its>;
            };
        };
    };
   
    fragment@2{
    target = <&pruss>;
    __overlay__ {
      status = "okay";
    };
  };
};
 

ondra_knezour

Aspiring Daemon

Thanks: 161
Messages: 709

#2
I don't have personal experience with DTS, but you may find following useful
This commit introduces handler for "fdt_overlays" variable that can be
defined either as a loader env variable or U-Boot env variable.
fdt_overlays is comma-separated list of .dtbo files located in
/boot/dtb/ directory along with base .dtb. ubldr loads files and
applies them one-by-one to base .dtb and then passes result blob to
the kernel.
Taken from this commit, should be in tree now.
 

obsigna

Aspiring Daemon

Thanks: 330
Messages: 645

#4
Since my BLog post which Phishfry mentioned, unfortunately something has been broken with the DTB overlays on FreeBSD 12-CURRENT, while FreeBSD 11.1-RELEASE works well. As a matter fact in the moment, the latest snapshot of FreeBSD 12 from February, 1, doesn't work at all on my BBB. So, I suggest to stay with FreeBSD 11.1-RELEASE for production systems, and let's hope that all the glitches and issues with FreeBSD 12-CURRENT become ironed out before the release of 12.
 

Phishfry

Daemon

Thanks: 573
Messages: 2,050

#5
I noticed a entry for pruss at the bottom of the overlay. I don't think that is needed. If you checkout dmesg it shows pruss started on FreeBSD 11.1

I am interested in the outcome of reserving pins like that.(exclusive use)

So let us know how it works out.
 

JWB

New Member

Thanks: 2
Messages: 8

#6
Thanks for the answers. I am using the method described in https://obsigna.net/?p=660 now.
I let you know if we succeed using the beaglebone with FreeBSD, but it will take some time.
The pruss are not default available with FreeBSD 12.0 - CURRENT version I am using now. See Thread 61334
I will investigate if 11.1 is a better option for me.