@iar
2017-02-09T19:43:02.000000Z
字数 2324
阅读 93
Novu
- this is a introduction on how to config NovuFPGA driver.
- The architecture of the Driver.
- Code Review.
cd ~/LDD3/pci- pci- ./makedev.sh -- just bash this to install FPGA driver and set it uppci_skel.[ch] -- the FPGA kernel driver- Test/vgg2_test.c -- the vgg2 user level test programpci.[ch] -- the FPGA uesr level driverMakefile -- the makefile for FPGA user driver and test program- Log/*.log -- Contains curated log files of dmesg for records.
lspci: this is a package used to list all the pci devices, check man to see how to get more info. for example: sudo lspci -xv.dmesg: the log (printk's log), the main tool to debug linux kernel development(Panic, Oops), see all other drivers work history, also used to calculate the DMA send/recv time.insmod, rmmod: These are the command to install/uninstall driver.sudo bash: Use root privilige to run my shell script.sudo lspci to check if Host PC found 01:0.0 is the FPGA. (Handled by linux).dmesg: Take a look at all the drivers execution log since bootup, just to have a sense how they should behave.sudo dmesg -C. Since NovuFPGA driver enclose many lines of printk(mostly read/write info, memory alloc, success Ko ko Lo lo), it's better to clean dmesg, the kernrel log.cd ~/LDD3/pci and make clean && make: goto the pci driver folder and do a clean make. It will have a page of warning(TODO, need to fix these casting), however, it should shows compile successed.sudo bash makedev.sh: install the driver with some setup. This should show up the pci file info and install the driver. dmesg: To double check the init check(I do some sanity check by reading FPGA's config reg. I always have a new terminal for it. So left terminal shows normal output, right one shows long kernel log.cd ~/LDD3/pci/Test, and make clean && make: goto the test user driver folder and make the vgg2_test, RW_test, DMA_test executable. Simply change a little to make accordingly executable file. vgg2_test is the main one. Do a ls to check if an executable is made. (green item means executable).sudo dmesg -C, and then ./vgg2_test: as always, clean the kernel log. And run the vgg2_test executable.dmesg: now look at/find Ko ko ko ko... ko in the log, it should show up for 10 times since latest version of vgg2_test has 10 loops of wtr_ptr_set_val, toggling between 0x480, 0x500.