Load fpga rbf from device tree overlay example?

Finally, I found a working solution:

  1. load_rbf.dts

/dts-v1/ /plugin/;
/ {
fragment@0 {
target-path = “/soc/base-fpga-region”;
#address-cells = <1>;
#size-cells = <1>;
overlay {
firmware-name = “de10_soc.rbf”;
#address-cells = <1>;
#size-cells = <1>;
};
};
};

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

Copy load_rbf.dtbo and de10_soc.rbf to /lib/firmware

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

  1. The magic command is:

devmem 0xff800000 32 0x00000019

I really don’t know what this does. However, by looking at how the bridge is enabled in u-boot:

#bridge_enable_handoff=mw $fpgaintf ${fpgaintf_handoff}; go $fpga2sdram_apply; mw $fpga2sdram ${fpga2sdram_handoff}; mw $axibridge ${axibridge_handoff}; mw $l3remap ${l3remap_handoff}

#mw $fpgaintf ${fpgaintf_handoff};
#fpgaintf=ffd08028
#fpgaintf_handoff=0x00000000
->devmem 0xffd08028 32 0x00000000

#go $fpga2sdram_apply;
->??

#mw $fpga2sdram ${fpga2sdram_handoff};
#fpga2sdram=ffc25080
#fpga2sdram_handoff=0x00000000
->devmem 0xffc25080 32 0x00000000

#mw $axibridge ${axibridge_handoff};
#axibridge=ffd0501c
#axibridge_handoff=0x00000000
->devmem 0xffd0501c 32 0x00000000

#mw $l3remap ${l3remap_handoff}
#l3remap=ff800000
#l3remap_handoff=0x00000019
->devmem 0xff800000 32 0x00000019

I found that this register needs to be written to 0x19 and then there is no bus error any more.