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

Linux driver for AVMM Arria10 PCIe is deprecated

Nyah
Beginner
505 Views

Hello!

i'am try build drivers from https://community.intel.com/t5/FPGA-Wiki/Reference-Design-Gen3x8-AVMM-DMA-Arria-10/ta-p/735904

 

I have error with "struct timeval".

Makefile is fixed ccflags-y += "-Wno-date-time", but error is still happened.

target PC: Ubuntu 20.04 ;linux 5.11

Thanks!

 

rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.symvers *.order
make -C /lib/modules/5.11.0-27-generic/build M=/home/pcuser/projects/avmm_dma_linux
make[1]: Entering directory '/usr/src/linux-headers-5.11.0-27-generic'
  CC [M]  /home/pcuser/projects//avmm_dma_linux/altera_dma.o
In file included from /home/pcuser/projects//avmm_dma_linux/altera_dma.c:14:
/home/pcuser/projects//avmm_dma_linux/altera_dma_cmd.h:49:20: error: field ‘write_time’ has incomplete type
   49 |     struct timeval write_time;
      |                    ^~~~~~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma_cmd.h:50:20: error: field ‘read_time’ has incomplete type
   50 |     struct timeval read_time;
      |                    ^~~~~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma_cmd.h:51:20: error: field ‘simul_time’ has incomplete type
   51 |     struct timeval simul_time;
      |                    ^~~~~~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c: In function ‘init_rp_mem’:
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:272:9: warning: unused variable ‘increment_value’ [-Wunused-variable]
  272 |     u32 increment_value = 0;
      |         ^~~~~~~~~~~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c: In function ‘rp_ep_compare’:
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:311:3: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
  311 |   else
      |   ^~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:313:8: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
  313 |        printk(KERN_DEBUG "ep_tmp = %08x\n", ep_tmp);
      |        ^~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:287:9: warning: unused variable ‘count’ [-Wunused-variable]
  287 |     u32 count = 1;
      |         ^~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:286:12: warning: unused variable ‘rp_tmp’ [-Wunused-variable]
  286 |     u32 j, rp_tmp, ep_tmp;
      |            ^~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c: In function ‘dma_test’:
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:368:20: error: storage size of ‘tv1’ isn’t known
  368 |     struct timeval tv1;
      |                    ^~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:369:20: error: storage size of ‘tv2’ isn’t known
  369 |     struct timeval tv2;
      |                    ^~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:370:20: error: storage size of ‘diff’ isn’t known
  370 |     struct timeval diff;
      |                    ^~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:436:2: error: implicit declaration of function ‘do_gettimeofday’; did you mean ‘do_settimeofday64’? [-Werror=implicit-function-declaration]
  436 |  do_gettimeofday(&tv1);
      |  ^~~~~~~~~~~~~~~
      |  do_settimeofday64
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:370:20: warning: unused variable ‘diff’ [-Wunused-variable]
  370 |     struct timeval diff;
      |                    ^~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:369:20: warning: unused variable ‘tv2’ [-Wunused-variable]
  369 |     struct timeval tv2;
      |                    ^~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:368:20: warning: unused variable ‘tv1’ [-Wunused-variable]
  368 |     struct timeval tv1;
      |                    ^~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:362:13: warning: unused variable ‘ep_tmp’ [-Wunused-variable]
  362 | u32 rp_tmp, ep_tmp;
      |             ^~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:362:5: warning: unused variable ‘rp_tmp’ [-Wunused-variable]
  362 | u32 rp_tmp, ep_tmp;
      |     ^~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:361:12: warning: unused variable ‘j’ [-Wunused-variable]
  361 |     int i, j;
      |            ^
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:360:63: warning: unused variable ‘simul_write_count’ [-Wunused-variable]
  360 |     int loop_count = 0, num_loop_count = 1, simul_read_count, simul_write_count;
      |                                                               ^~~~~~~~~~~~~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:360:45: warning: unused variable ‘simul_read_count’ [-Wunused-variable]
  360 |     int loop_count = 0, num_loop_count = 1, simul_read_count, simul_write_count;
      |                                             ^~~~~~~~~~~~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:360:25: warning: unused variable ‘num_loop_count’ [-Wunused-variable]
  360 |     int loop_count = 0, num_loop_count = 1, simul_read_count, simul_write_count;
      |                         ^~~~~~~~~~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:360:9: warning: unused variable ‘loop_count’ [-Wunused-variable]
  360 |     int loop_count = 0, num_loop_count = 1, simul_read_count, simul_write_count;
      |         ^~~~~~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c: In function ‘diff_timeval’:
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:937:24: error: dereferencing pointer to incomplete type ‘struct timeval’
  937 |     long int diff = (t2->tv_usec + 1000000 * t2->tv_sec) - (t1->tv_usec + 1000000 * t1->tv_sec);
      |                        ^~
In file included from /home/pcuser/projects//avmm_dma_linux/altera_dma.c:15:
/home/pcuser/projects//avmm_dma_linux/altera_dma.c: At top level:
/home/pcuser/projects//avmm_dma_linux/altera_dma.h:171:12: warning: ‘rp_compare’ declared ‘static’ but never defined [-Wunused-function]
  171 | static int rp_compare(u8 *virt_addr1, u8 *virt_addr2, u32 num_dwords);
      |            ^~~~~~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c: In function ‘altera_dma_ioctl’:
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:25:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
   25 |             dma_test(bk_ptr, bk_ptr->pci_dev);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pcuser/projects//avmm_dma_linux/altera_dma.c:26:9: note: here
   26 |         case ALTERA_CMD_WAIT_DMA:
      |         ^~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:287: /home/pcuser/projects//avmm_dma_linux/altera_dma.o] Error 1
make[1]: *** [Makefile:1848: /home/pcuser/projects//avmm_dma_linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-27-generic'
make: *** [Makefile:11: all] Error 2
insmod: ERROR: could not load module ./altera_dma.ko: No such file or directory

 

0 Kudos
1 Reply
Harris
Employee
493 Views

Hi,

 

It's an OS/compiler compatibility issue. The original driver is compiled on Centos, and it is just for customer's reference. We don't provide support to PCIe driver. I suggest you try to find the solution from the internet with search engine. Thanks. 

 

BR/Harris

0 Kudos
Reply