Booting FPGA from linux

I work on a custom board with a Cyclone V SoC FPGA. I have created preloader & (u-boot) bootloader successfully. I have generated a linux 4.15.7 kernel with Buildroot and it also loads without problem. I can access the FPGA matrix with my custom drivers and so on…

All parts are loaded at boot time by the u-boot startup script.

Now I want to load the FPGA from my linux userland. I’ve read several threads on rocketboard, SO, etc… I understand that the first solution was to copy the RBF file onto /dev/fpga0 but this is not yet supported. (https://rocketboards.org/foswiki/Documentation/GSRD131ProgrammingFPGA)

The new solution is to use Device tree Overlay (How to program FPGA from HPS (de10-nano)).

But Device-tree overlay is not yet supported in recent linux kernel. My question is : What’s is the recommended method to load the FPGA matrix from linux ?

This does not address your question directly but…
We still use kernel 3.10 so we can do it with /dev/fpga0 which was removed in kernel 4.x. The recommended way now is to use the device tree overlay method. I believe this is supported as I’ve seen threads in the past where it’s been done. I don’t know about Kernel 4.15. We started using 4.22 early last year and it’s now out of date as it does not contain the latest security patches. You might take look at the latest altera open source Kernel on github.

To clarify: We use kernel 3.10 for Cyclone 5 and Kernel 4.x for Arria 10.

Cheers!

The problem I had was that I used a generic kernel (4.17) which doesn’t use configfs anymore. I changed my kernel with the “socfpga-linux-4.16” (https://github.com/altera-opensource/linux-socfpga/tree/socfpga-4.16) and now everything is fine and works as expected