From 14cfc4f3735d9704cb6a630ef302be596d380684 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 13 Mar 2014 13:07:57 +0100 Subject: 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 --- include/xilinx.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/xilinx.h') 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); -- cgit v1.2.1