mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
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>
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user