summaryrefslogtreecommitdiff
path: root/include/xilinx.h
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2014-03-13 13:07:57 +0100
committerMichal Simek <michal.simek@xilinx.com>2014-05-13 09:13:59 +0200
commit14cfc4f3735d9704cb6a630ef302be596d380684 (patch)
tree23c759ab37c1368763488a5548813231cfa1d3d0 /include/xilinx.h
parent2df9d5c431fca07c9868a36b48ee771bde6b19e8 (diff)
downloadu-boot-14cfc4f3735d9704cb6a630ef302be596d380684.tar.gz
u-boot-14cfc4f3735d9704cb6a630ef302be596d380684.tar.bz2
u-boot-14cfc4f3735d9704cb6a630ef302be596d380684.zip
fpga: xilinx: Simplify load/dump/info function handling
Connect FPGA version with appropriate operations to remove huge switch-cases for every FPGA family. Tested on Zynq. Spartan2/Spartan3/Virtex2 just compile test. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'include/xilinx.h')
-rw-r--r--include/xilinx.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/xilinx.h b/include/xilinx.h
index b72aece7c9..9801267c59 100644
--- a/include/xilinx.h
+++ b/include/xilinx.h
@@ -40,9 +40,16 @@ typedef struct { /* typedef xilinx_desc */
size_t size; /* bytes of data part can accept */
void *iface_fns; /* interface function table */
int cookie; /* implementation specific cookie */
+ struct xilinx_fpga_op *operations; /* operations */
char *name; /* device name in bitstream */
} xilinx_desc; /* end, typedef xilinx_desc */
+struct xilinx_fpga_op {
+ int (*load)(xilinx_desc *, const void *, size_t);
+ int (*dump)(xilinx_desc *, const void *, size_t);
+ int (*info)(xilinx_desc *);
+};
+
/* Generic Xilinx Functions
*********************************************************************/
int xilinx_load(xilinx_desc *desc, const void *image, size_t size);