Trouble loading device tree overlays

I am trying to load a device tree overlay.

I am using the DTC version which comes with Quartus 16.1

I am using the following command.

dtc -I dts -O dtb -o overlay_dum.dtbo -@ overlay_dum.dts

I am attempting to load into the 4.1.17-ltsi kernel which I compiled from following the SOC W2 tutorial.
In fact I am using the .dts and .dtb provided with that lab, as I’m on a DE10 Nano board.

I use the following commands in linux.

mount-t configfs configfs /config
mkdir /config/device-tree/overlays/test
echo overlay.dtbo > /config/device-tree/overlays/test/path

I am running the commands from the /lib/firmware directory. This is where the .dtbo’s and .rbf is living.

I have only arrived at this conclusion after realizing that the way the FPGA is programmed from linux
has changed quite a bit since GHRD 13.1 instructions.

Of note, is that I do see the bridges and the fpga_region probed successfully in the linux bootup.

My .dts’s that I am trying to load look like this:

 /dts-v1/ /plugin/; 
/ { 
   fragment@0 { 
      target-path = <&soc>; 
      __overlay__ { 
            sysid_qsys: sysid@0x100001000 { 
            compatible = "altr,sysid-16.0", "altr,sysid-1.0"; 
            id = <2899645442>; 
            timestamp = <1460474164>; 
         };    
      }; 
   }; 
};

and this:

 /dts-v1/ /plugin/; 
/ { 
   fragment@0 { 
      target-path = "/soc/base-fpga-region"; 
      #address-cells = <2>; 
      #size-cells = <1>; 
      __overlay__ { 
         #address-cells = <2>; 
         #size-cells = <1>; 
          firmware-name = "soc_system.rbf";         
      }; 
   }; 
};

However upon attempting to echo them into /config/device-tree/overlays/test/path I get the following errors:

create_overlay: Failed to resolve tree.

With the .rbf loading one I get an additional error.

of_overlay_create: of_build_overlay_info() failed for tree @/
create_overlay: Failed to create overlay (err=-19)

Any ideas would be fantastic. I’ve been working on this for a couple days now.

The only thing I haven’t tried is building my own rootfs. Does device tree overlay loading require a specific rootfs. I am using a prebuilt one. The SOC W2 loads a filesystem from ram, which I disabled in favor of my filesystem on the sd card.

The filesystem I am using is one for Beaglebone Black with filename:
debian-8.7-bare-armhf-2017-01-14.tar.xz

~ Moved to main reply.

Hello,
for those looking for solution here, I have described it in at this thred: https://forum.rocketboards.org/t/problem-with-fpga2hps-bridge/990/9 .

I am trying to load a device tree overlay.


load_rbf.dts

/dts-v1/ /plugin/;
/ {
fragment@0 {
target-path = “/soc/base-fpga-region”;

	#address-cells = <0x1>;
	#size-cells = <0x1>;
	
	overlay {
		firmware-name = "soc_system.rbf";
		#address-cells = <0x1>;
		#size-cells = <0x1>;
	};
};

};


dtc -O dtb -o load_rbf.dtbo -b 0 -@ load_rbf.dts

root@cyclone5:~# mkdir /config
root@cyclone5:~# mkdir /lib/firmware
root@cyclone5:~# mount -t configfs configfs /config
root@cyclone5:~# rmdir /config/device-tree/overlays/test
root@cyclone5:~# mkdir /config/device-tree/overlays/test
root@cyclone5:~# cd /lib/firmware
root@cyclone5:/lib/firmware# echo load_rbf.dtbo > /config/device-tree/overlays/test/path
[ 268.563040] OF: overlay: of_build_overlay_info() failed for tree@/
[ 268.569235] create_overlay: Failed to create overlay (err=-19)
sh: write error: No such device
root@cyclone5:/lib/firmware#

It was not good when I first tried it.

so, I retry it.


load_rbf.dts

/dts-v1/ /plugin/;
/ {
fragment@0 {
target-path = “/soc/base-fpga-region”;

	#address-cells = <0x1>;
	#size-cells = <0x1>;
	
	__overlay__ {
		firmware-name = "soc_system.rbf";
		#address-cells = <0x1>;
		#size-cells = <0x1>;
	};
};

};

It was good when I second tried it.

root@cyclone5:/lib/firmware#
root@cyclone5:/lib/firmware# rmdir /config/device-tree/overlays/test
root@cyclone5:/lib/firmware# mkdir /config/device-tree/overlays/test
root@cyclone5:/lib/firmware# echo load_rbf.dtbo > /config/device-tree/overlays/test/path
[ 1109.480533] fpga_manager fpga0: writing soc_system.rbf to Altera SOCFPGA FPGA Manager
root@cyclone5:/lib/firmware#
root@cyclone5:/lib/firmware#


socfpga.dtsi


base_fpga_region: base-fpga-region {
compatible = “fpga-region”;
fpga-mgr = <&fpgamgr0>;

		#address-cells = <0x1>;
		#size-cells = <0x1>;
	};

root@cyclone5:/lib/firmware# hostnamectl
Static hostname: cyclone5
Icon name: computer
Machine ID: 1f36c7e58e984ad3a1d913517117911f
Boot ID: 6ca16699b9d84868ac697dda9f20d6b6
Operating System: The 횇ngstr철m Distribution v2017.06
Kernel: Linux 4.9.78-ltsi
Architecture: arm
root@cyclone5:/lib/firmware#
root@cyclone5:/lib/firmware#

I hope this helps someone.
Good luck!