Hi divyaganti,
Thank you for the suggestion! Sorry that I missed your message earlier.
I haven't gotten a chance to try bullets 1,3 & 4 in your suggestion (I'll try them out and keep you posted), but I tried your steps for driver installation.
I did pick a major id that hasn't been taken by the devices shown in /proc/devices, and I did see the following
root# mknod /dev/altera_dma c 243 0
root# chmod 0644 /dev/altera_dma
root# ls -al /dev/altera_dma
crw-r--r-- 1 root root 243, 0 Nov 9 12:48 /dev/altera_dma
, and insmod didn't throw any complain.
Unfortunately, when I try to run the software as root, the ./run script still throws
Couldn't open the device.
I had made the device ID consistent on both sides (both are e003 for now). I had planned to change the device side DID to e093 as suggested by eapenabrm, but for some reason when I tried to recompile the design after changing the device ID register in Qsys, the assembler, which was the final step, failed and complained
Error (210027): Can't use configuration device EPCQL256 with selected programming mode
So I haven't been able to test using e093 as the device ID yet.
Does anything in the above description look weird to you?
Any further suggestion is much appreciated!!!
--- Quote Start ---
I second eapenabrm's suggestions.
1. Make sure the FPGA is programmed with the correct image. A simple way would be to connect a counter signal to an LED so it keeps blinking.
2. Check if lspci shows the Altera FPGA as a device ( On linux) or on the device manager ( on windows). Again check the device id in the PCIe QSYS component or what is returned by lspci are the same and make sure your driver is looking for the same device.
3. For the reads, I had made a mistake in connecting my QSYS components. The slave attached to the PCIe component did not return a readdatavalid, whereas the PCIe component expected it. Thus, I never "read" anything back. After I changed it, the reads started to work.
4. I would also suggest using a signal tap to monitor the BAR (register interface). You can trigger on reads or writes, while the driver is running. You can then see if the behaviour of the system is as expected on not.
I used the following steps to setup the driver, and not their scripts
rmmod altera_dma.ko
rf /dev/altera_dma
cat /proc/devices # choose a device number that isn't already taken. In this case I have used 243
mknod /dev/altera_dma c 243 0
chmod 0644 /dev/altera_dma
ls -al /dev/altera_dma
insmod altera_dma.ko
rm -f ./user/user
gcc ./user/user.c -o ./user/user
./run
--- Quote End ---