fpga: virtex2: Add slave serial programming support

This adds support for slave serial programming, in addition to the
previously supported slave SelectMAP mode. There are two ways that this
can be used:

-Using the clk and wdata callbacks in order to write image data one bit
at a time using pure bit-banging. This works, but is rather painfully
slow with typical image sizes.

-By specifying the wbulkdata callback instead, the image loading process
can be offloaded to SPI hardware. In this mode the clk and wdata
callbacks do not need to be specified. This allows the image to be
loaded much faster, taking only a few seconds with even relatively large
images.

Slave serial programming has been tested on the Kintex-7 series of
FPGAs.

Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
Robert Hancock
2019-06-18 09:47:16 -06:00
committed by Michal Simek
parent a0549f7390
commit 175dccd710
2 changed files with 86 additions and 23 deletions

View File

@@ -11,7 +11,7 @@
#include <xilinx.h>
/*
* Slave SelectMap Implementation function table.
* Slave SelectMap or Serial Implementation function table.
*/
typedef struct {
xilinx_pre_fn pre;
@@ -24,18 +24,11 @@ typedef struct {
xilinx_wr_fn wr;
xilinx_rdata_fn rdata;
xilinx_wdata_fn wdata;
xilinx_bwr_fn wbulkdata;
xilinx_busy_fn busy;
xilinx_abort_fn abort;
xilinx_post_fn post;
} xilinx_virtex2_slave_selectmap_fns;
/* Slave Serial Implementation function table */
typedef struct {
xilinx_pgm_fn pgm;
xilinx_clk_fn clk;
xilinx_rdata_fn rdata;
xilinx_wdata_fn wdata;
} xilinx_virtex2_slave_serial_fns;
} xilinx_virtex2_slave_fns;
#if defined(CONFIG_FPGA_VIRTEX2)
extern struct xilinx_fpga_op virtex2_op;