I'm working on bringing up AN829, the Altera DMA example, on a Cyclone 10 GX Development Kit. The FPGA is loaded and shows up on the PCIe bus.
05:00.0 Non-VGA unclassified device: Altera Corporation Device e003 (rev 01)
And the kernel module is loaded
Cyclone10GX_PCIeGen2x4_DMA_18_0_project/driver/AN829_driver$ lsmod | grep altera altera_dma 20480 0 altera_cvp 16384 0 fpga_mgr 16384 1 altera_cvp
But the device isn't listed in /proc/devices
Cyclone10GX_PCIeGen2x4_DMA_18_0_project/driver/AN829_driver$ cat /proc/devices Character devices: 1 mem 4 /dev/vc/0 4 tty 4 ttyS 5 /dev/tty 5 /dev/console 5 /dev/ptmx 5 ttyprintk 6 lp 7 vcs 10 misc 13 input 21 sg 29 fb 89 i2c 99 ppdev 108 ppp 116 alsa 128 ptm 136 pts 180 usb 189 usb_device 204 ttyMAX 216 rfcomm 226 drm 240 mei 241 hidraw 242 aux 243 ptp 244 pps 245 ttyDBC 246 bsg 247 hmm_device 248 watchdog 249 rtc 250 dax 251 dimmctl 252 ndctl 253 tpm 254 gpiochip Block devices: 7 loop 8 sd 9 md 11 sr 65 sd 66 sd 67 sd 68 sd 69 sd 70 sd 71 sd 128 sd 129 sd 130 sd 131 sd 132 sd 133 sd 134 sd 135 sd 253 device-mapper 254 mdp 259 blkext
Since the device isn't listed in /proc/devices, it can't get the major/minor identifiers required to create /dev/altera_dma, and the altera_load_dma process fails.
Any idea why the kernel module might load, but fail to create an entry in /proc/devices?
The OS is Ubuntu 16.04
Just try to understand the problem in more detail:
Here is the link of the AN 829:
Yes, "sudo ./install cyclone10" is what creates and load the "altera_dma" module you see in the lsmod output. However, this fails with an obscure error around the following lines:
major=`grep -w $module /proc/devices | cut -f1 -d" "` mknod /dev/$device c $major 0
Since the card isn't listed in /proc/devices, $major is null and mknod fails. I cannot execute "sudo ./run" successfully since the driver did not fully load.
I was able to get a little farther, though. It turns out AN829, within the Quartus PCIe Hard IP Core settings, uses a PCIe device class of 0x000000. This is technically invalid. I changed it to 0x040000 and now the driver installs. This is great news.
Unfortunately, the card tries to reserve a large block of address space (0x000000 - 0x7FFFFF for BAR 2 and 0x800000 - 0x8001FF for BAR 0). The machine I have it slotted in seems to be failing to allocate that address space (it's over half of the total available PCIe space).
So I made progress, but still haven't gotten AN829 working.
Were you able to solve this issue? I have been trying to reduce the required memory allocation of BAR2 to less than 512MB (working with embedded devices ) in the reference design with no results. The Cyclone 10 GX Development Kit appears with lspci -vv but memory shows as <unassigned> for each block.
Just FYI.. I recently tested AN829 in centos for Arria 10 device, everything is working fine. Perhaps, you can check if the same problem happen in other Linux OS and see if there is any dependency.
I was able to get it working, but it was by switching to a machine with a larger PCIe address space. I kept getting <unassigned> for the memory space when I was on the other computer. It's not a great solution, but it worked.
Yes, in machines with larger PCI address memory space I had no problems. In fact, the issue was in one particular embedded device with limited memory space. However, I managed to solve it modifying the IP core from system designer to have a smaller PCIe memory size and changing the base addresses. Also the driver kernel from the linux side required some tuning for these new memory chunks. Thank you for all your help!