FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6658 Discussions

Unable to install kernel driver for testing PCI Express

Embeddedesigner
New Contributor I
282 Views

I'm referencing the L-Tile and H-Tile Avalon MM+ Intel FPGA IP for PCI Express User Guide (2024.09.13).

On page 19 and after compiling the design example, it wants the user to install the Linux kernel driver which tests the PCI link for reads/writes.

 

After I change the permission on the install, load and unload files, I then install the driver using sudo ./install 

it outputs a lot of errors.

 

make -C /lib/modules/6.12.0-120.el10.x86_64/build M=/home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux clean
make[1]: Entering directory '/usr/src/kernels/6.12.0-120.el10.x86_64'
make[1]: Leaving directory '/usr/src/kernels/6.12.0-120.el10.x86_64'
make -C /lib/modules/6.12.0-120.el10.x86_64/build M=/home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux modules
make[1]: Entering directory '/usr/src/kernels/6.12.0-120.el10.x86_64'
CC [M] /home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.o
/home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.c: In function ‘chr_mmap’:
/home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.c:313:19: error: assignment of read-only member ‘vm_flags’
313 | vma->vm_flags |= VM_PFNMAP | VM_DONTCOPY | VM_DONTEXPAND;
| ^~
In file included from ./include/linux/printk.h:6,
from ./include/linux/kernel.h:31,
from ./include/linux/cpumask.h:11,
from ./include/linux/smp.h:13,
from ./include/linux/lockdep.h:14,
from ./include/linux/mutex.h:17,
from ./include/linux/kernfs.h:11,
from ./include/linux/sysfs.h:16,
from ./include/linux/kobject.h:20,
from ./include/linux/cdev.h:5,
from /home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_setup.h:47,
from /home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.h:47,
from /home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.c:45:
/home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.c: In function ‘intel_fpga_pcie_chr_init’:
./include/linux/init.h:180:22: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Wincompatible-pointer-types]
180 | #define THIS_MODULE (&__this_module)
| ~^~~~~~~~~~~~~~~
| |
| struct module *
/home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.c:355:40: note: in expansion of macro ‘THIS_MODULE’
355 | global_bk.chr_class = class_create(THIS_MODULE,
| ^~~~~~~~~~~
In file included from ./include/linux/device.h:30,
from ./include/linux/cdev.h:8:
./include/linux/device/class.h:226:54: note: expected ‘const char *’ but argument is of type ‘struct module *’
226 | struct class * __must_check class_create(const char *name);
| ~~~~~~~~~~~~^~~~
/home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.c:355:27: error: too many arguments to function ‘class_create’
355 | global_bk.chr_class = class_create(THIS_MODULE,
| ^~~~~~~~~~~~
./include/linux/device/class.h:226:29: note: declared here
226 | struct class * __must_check class_create(const char *name);
| ^~~~~~~~~~~~
/home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.c: In function ‘chr_access’:
/home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.c:536:50: error: macro "access_ok" passed 3 arguments, but takes just 2
536 | if(! access_ok(VERIFY_WRITE, buf, sizeof(buf))) {
| ^
In file included from ./arch/x86/include/asm/uaccess.h:25,
from ./include/linux/uaccess.h:12,
from ./include/linux/sched/task.h:13,
from ./include/linux/sched/signal.h:9,
from ./include/linux/rcuwait.h:6,
from ./include/linux/percpu-rwsem.h:7,
from ./include/linux/fs.h:33,
from ./include/linux/compat.h:17,
from ./arch/x86/include/asm/ia32.h:7,
from ./arch/x86/include/asm/elf.h:10,
from ./include/linux/elf.h:6,
from ./include/linux/module.h:19,
from ./include/linux/device/driver.h:21,
from ./include/linux/device.h:32:
./include/asm-generic/access_ok.h:45:9: note: macro "access_ok" defined here
45 | #define access_ok(addr, size) likely(__access_ok(addr, size))
| ^~~~~~~~~
/home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.c:536:10: error: ‘access_ok’ undeclared (first use in this function)
536 | if(! access_ok(VERIFY_WRITE, buf, sizeof(buf))) {
| ^~~~~~~~~
/home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.c:536:10: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [scripts/Makefile.build:229: /home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux/intel_fpga_pcie_chr.o] Error 1
make[2]: *** [/usr/src/kernels/6.12.0-120.el10.x86_64/Makefile:1994: /home/rhobbs/Documents/avmm_bridge_512_0_example_design/software/kernel/linux] Error 2
make[1]: *** [Makefile:242: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/kernels/6.12.0-120.el10.x86_64'
make: *** [Makefile:17: all] Error 2
insmod: ERROR: could not load module ./intel_fpga_pcie_drv.ko: No such file or directory

 

Could someone please tell me what corrections are needed to install the driver?

After I did that, I then proceeded to step 4 which says verify the driver installation, and it lists nothing, so it did not work. This is supposed to be an out of the box solution, you just perform the steps to install the driver.  I need someone to please verify it works on there machine as well.

For reference, this was done on CentOS 10 [Coughlin] using Quartus Prime Pro Edition 25.1 (latest)

 

Thanks

Labels (1)
0 Kudos
1 Solution
ventt
Employee
63 Views

Hi Embeddedesigner,


Thank you for the updates.

 

Device configuration is outside of my area of expertise.

Could you please file a new post in the forum regarding your configuration issue? The device configuration support expert will be able to assist you with this issue.


Thanks.

Best Regards,

Ven


View solution in original post

0 Kudos
3 Replies
ventt
Employee
168 Views

Hi Embeddedesigner,


Thanks for reaching out.


Based on the error messages, the driver compilation failed due to kernel API compatibility issues.

 

The PCIe driver provided by the Design Example ( L-Tile and H-Tile Avalon MM+ Intel FPGA IP for PCI Express User Guide (2024.09.13)) was built using an older kernel version. According to the Design Example directory (../software/kernel/linux/README):

The driver was developed and tested on CentOS 7.0, 64-bit with 3.10.514 kernel compiled for x86_64 architecture.


Please ensure that your OS and kernel version meet the software requirements for installing the Linux kernel driver. As you use a different OS and kernel version, you will need to manually update the driver’s Kernel API to be compatible with your current OS.


Thanks.

Best Regards,

Ven


0 Kudos
Embeddedesigner
New Contributor I
87 Views

I want to close this thread as an acceptable answer, but I have encountered another more serious problem.

I will also go back and fix the updated kernal API drivers manually to fix the issue. The issue I'm having is actually programming my board, after I successfully generated the design example, compiled, set the .qsf file settings to the recommended pin assignments in the design example folder. It keeps stopping at 80% and outputs this error message:

 

Error(18950): Device has stopped receiving configuration data
Error(209012): Operation failed
Error(18948): Error message received from device: Device is in configuration state.

 

There is an internal Bug ID: 1508562679 that addresses this known issues with the Stratix10 fpga which states : 

 

Resolution

This problem is fixed starting in Intel® Quartus® Prime Pro Edition Software version 20.4. 

 

I have a running reference clock assigned, which is provided on the Terasic Apollo S10 SoM. 

 

 

Can you assist in a solution?

 

 

0 Kudos
ventt
Employee
64 Views

Hi Embeddedesigner,


Thank you for the updates.

 

Device configuration is outside of my area of expertise.

Could you please file a new post in the forum regarding your configuration issue? The device configuration support expert will be able to assist you with this issue.


Thanks.

Best Regards,

Ven


0 Kudos
Reply