BBB - Automatically download device tree overlay when loading

I have a device tree overlay:

/dts-v1/; /plugin/; / { compatible = "ti,beaglebone", "ti,beaglebone-black"; part-number = "mousetraps"; version = "00A1"; /* https://github.com/derekmolloy/boneDeviceTree/blob/master/docs/BeagleboneBlackP9HeaderTable.pdf */ fragment@0 { target = <&am33xx_pinmux>; __overlay__ { mousetrap_pins: pinmux_mousetrap_pins { pinctrl-single,pins = < 0x070 0x2f /* P9_11 30 INPUT MODE7 none */ 0x074 0x2f /* P9_13 31 INPUT MODE7 none */ 0x040 0x2f /* P9_15 48 INPUT MODE7 none */ 0x15c 0x2f /* P9_17 05 INPUT MODE7 none */ >; }; }; }; fragment@1 { target = <&ocp>; __overlay__ { test_helper: helper { compatible = "bone-pinmux-helper"; pinctrl-names = "default"; pinctrl-0 = <&mousetrap_pins>; status = "okay"; }; }; }; }; 

which I can successfully download with:

 echo mousetraps:00A1 >/sys/devices/bone_capemgr.8/driver/bone_capemgr.8/slots ; dmesg | grep bone 

How can I configure BBB / Angstrom to load automatically at boot time?

In particular, how can I connect the dtbo file to the regular Tree Tree boot mechanism? I know that I can add an echo to the linux init script, but there seems to be something that starts the dtbo file upload.

+4
source share
3 answers

One way to do this is to copy the dtbo parameter to /lib/firmware and change capemgr.extra_override in the bootargs kernel (in uEnv.txt ) to point to dtbo . This method also requires changes to the /arch/arm/boot/dts/am335-bone-common.dtsi file. Details in this discussion .

Please note that loading the device tree overlay from the file system is apparently related to the latest kernels (from the official repository) on black beaglebone. To overcome this, an alternative method for compiling the overlay is described here .

+3
source

you can add an argument to the uEnv.txt file this applies to your new overlay, as suggested earlier, add the following line to the end of uEnv.txt

 nano /mnt/boot/uEnv.txt #add this to the end of the single line of uEnv.txt: capemgr.enable_partno=mousetraps 

the full process is described here

+3
source

It worked for me with

  • BeagleBone Black rev C
  • Debian 8.7 2017-03-19 4GB SD IoT from latest-images
  • Kernel 4.4.68-ti-r106

From the link provided by @ craig-mcqueen, and using this example tree overlay

In the file /boot/uboot/uEnv.txt (DM-GPIO-Test is the name of my overlay):

 cmdline=coherent_pool=1M cape_universal=enable bone_capemgr.enable _partno=DM-GPIO-Test noapic 

Create /etc/initramfs-tools/hooks/dtbo

 #!/bin/sh set -e . /usr/share/initramfs-tools/hook-functions # Copy Device Tree fragments mkdir -p "${DESTDIR}/lib/firmware" cp -p /lib/firmware/*.dtbo "${DESTDIR}/lib/firmware/" 

Make it executable:

 sudo chmod +x /etc/initramfs-tools/hooks/dtbo 

Backup initrd:

 sudo cp /boot/initrd.img-4.4.68-ti-r106 /boot/initrd.img-4.4.68-ti-r106.bak 

Update initrd:

 /opt/scripts/tools/developers/update_initrd.sh 

Reboot

 sudo reboot 

Make sure it has been downloaded:

 root@beaglebone :/home/debian# cat /sys/devices/platform/bone_capemgr/slots 0: PF---- -1 1: PF---- -1 2: PF---- -1 3: PF---- -1 4: POL- 0 Override Board Name,00A0,Override Manuf,DM-GPIO-Test 
0
source

Source: https://habr.com/ru/post/1492534/


All Articles