Insop Song | e7185c69 | 2014-01-20 23:47:06 -0800 | [diff] [blame] | 1 | ============================================================================== |
| 2 | Linux Driver Source for Xilinx FPGA firmware download |
| 3 | ============================================================================== |
| 4 | |
| 5 | |
| 6 | TABLE OF CONTENTS. |
| 7 | |
| 8 | 1. SUMMARY |
| 9 | 2. BACKGROUND |
| 10 | 3. DESIGN |
| 11 | 4. HOW TO USE |
| 12 | 5. REFERENCE |
| 13 | |
| 14 | 1. SUMMARY |
| 15 | |
| 16 | - Download Xilinx FPGA firmware |
| 17 | - This module downloads Xilinx FPGA firmware using gpio pins. |
| 18 | |
| 19 | 2. BACKGROUND |
| 20 | |
| 21 | An FPGA (Field Programmable Gate Array) is a programmable hardware that is |
| 22 | used in various applications. Hardware design needs to programmed through |
| 23 | a dedicated device or CPU assisted way (serial or parallel). |
| 24 | This driver provides a way to download FPGA firmware. |
| 25 | |
| 26 | 3. DESIGN |
| 27 | |
| 28 | - load Xilinx FPGA bitstream format[1] firmware image file using |
| 29 | kernel firmware framework, request_firmware() |
| 30 | - program the Xilinx FPGA using SelectMAP (parallel) mode [2] |
| 31 | - FPGA prgram is done by gpio based bit-banging, as an example |
| 32 | - platform independent file: gs_fpgaboot.c |
| 33 | - platform dependent file: io.c |
| 34 | |
| 35 | |
| 36 | 4. HOW TO USE |
| 37 | |
| 38 | $ insmod gs_fpga.ko file="xlinx_fpga_top_bitstream.bit" |
| 39 | $ rmmod gs_fpga |
| 40 | |
| 41 | 5. USE CASE (from a mailing list discussion with Greg) |
| 42 | |
| 43 | a. As a FPGA development support tool, |
| 44 | During FPGA firmware development, you need to download a new FPGA |
| 45 | image frequently. |
| 46 | You would do that with a dedicated JTAG, which usually a limited |
| 47 | resource in the lab. |
| 48 | However, if you use my driver, you don't have to have a dedicated JTAG. |
| 49 | This is a real gain :) |
| 50 | |
| 51 | b. For the FPGA that runs without config after the download, which |
| 52 | doesn't talk to any of Linux interfaces (such as PCIE). |
| 53 | |
| 54 | We download FPGA firmware from user triggered or some other way, and that's it. |
| 55 | Since that FPGA runs on its own, it doesn't require a linux driver |
| 56 | after the download. |
| 57 | |
| 58 | c. For the FPGA that requires config after the download, which talk to |
| 59 | any of linux interfaces (such as PCIE) |
| 60 | |
| 61 | Then, this type of FPGA config can be put into device tree and have a |
| 62 | separate driver (pcie or others), then THAT driver calls my driver to |
| 63 | download FPGA firmware during the Linux boot, the take over the device |
| 64 | through the interface. |
| 65 | |
| 66 | 6. REFERENCE |
| 67 | |
| 68 | 1. Xilinx APP NOTE XAPP583: |
| 69 | http://www.xilinx.com/support/documentation/application_notes/xapp583-fpga-configuration.pdf |
| 70 | 2. bitstream file info: |
| 71 | http://home.earthlink.net/~davesullins/software/bitinfo.html |