Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

configfs do not mount device-tree/overlays

I'm working on a Cyclone V SOC FPGA from Altera with a double Cortex-A9 processor. The embedded system (linux 4.15.7) is created with Buildroot-2018.02. U-boot is used to load the system i-e FPGA.rbf file, device tree blob and zImage and everything works fine.

I want now to integrate the RBF file to my linux and program the FPGA from Linux. I found several methods and the one I understand is the most common is to use CONFIGFS with a device-tree overlay.

So I changed my device tree to integrate the overlay, the u-boot boot script to disable FPGA load and also the following options in the linux ".config" file with make linux-xconfig :

+CONFIG_OF_OVERLAY=y
+CONFIG_ALTERA_STAPL=y
+CONFIG_CONFIGFS_FS=y
+CONFIG_SAMPLES=y
+CONFIG_SAMPLE_CONFIGFS=m

These options are the state were I am now after several try.

After a make and a reboot, once the kernel is loaded, I enter the following command in the console :

mkdir /config
mount -t configfs none /config

At this state, I'm expecting to see some device tree files in the /config folder but there wasn't any, only one rdma_cm folder :

# ls /config
rdma_cm

I continued my reading on this topic and found that I must enable the CONFIG_OF_CONFIGFS option in my linux kernel.

PROBLEM: This option is not available in my linux kernel. Also, file drivers/of/configfs.c is no here too. I've searched in vain to find how to enable device tree overlay for my kernel version.

How can I configure my kernel to make device-tree available in configfs ?

like image 297
grorel Avatar asked Oct 17 '22 17:10

grorel


1 Answers

I had the same problem as you. So I had to make a device driver by myself.

This device driver is tentative and I expect Linux mainline to officially support Device Tree Overlay ConfigFS.

The device driver I made is available at the following URL.

  • https://github.com/ikwzm/dtbocfg

If you are using Debian, you can build the Debian Package of the device driver with the following URL.

  • https://github.com/ikwzm/dtbocfg-kmod-dpkg

If you want to try Device Tree Overlay using this device driver, please refer to the following URL.

  • https://github.com/ikwzm/FPGA-SoC-Linux
  • https://github.com/ikwzm/FPGA-SoC-Linux-Example-1-DE10-Nano
like image 92
ikwzm Avatar answered Oct 21 '22 08:10

ikwzm