diff options
author | Michal Simek <michal.simek@xilinx.com> | 2014-03-13 12:07:57 (GMT) |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2014-05-13 07:13:59 (GMT) |
commit | 14cfc4f3735d9704cb6a630ef302be596d380684 (patch) | |
tree | 23c759ab37c1368763488a5548813231cfa1d3d0 /drivers/fpga/spartan2.c | |
parent | 2df9d5c431fca07c9868a36b48ee771bde6b19e8 (diff) | |
download | u-boot-14cfc4f3735d9704cb6a630ef302be596d380684.tar.xz |
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 'drivers/fpga/spartan2.c')
-rw-r--r-- | drivers/fpga/spartan2.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/fpga/spartan2.c b/drivers/fpga/spartan2.c index 0796729..7054056 100644 --- a/drivers/fpga/spartan2.c +++ b/drivers/fpga/spartan2.c @@ -41,7 +41,7 @@ static int spartan2_ss_dump(xilinx_desc *desc, const void *buf, size_t bsize); /* ------------------------------------------------------------------------- */ /* Spartan-II Generic Implementation */ -int spartan2_load(xilinx_desc *desc, const void *buf, size_t bsize) +static int spartan2_load(xilinx_desc *desc, const void *buf, size_t bsize) { int ret_val = FPGA_FAIL; @@ -64,7 +64,7 @@ int spartan2_load(xilinx_desc *desc, const void *buf, size_t bsize) return ret_val; } -int spartan2_dump(xilinx_desc *desc, const void *buf, size_t bsize) +static int spartan2_dump(xilinx_desc *desc, const void *buf, size_t bsize) { int ret_val = FPGA_FAIL; @@ -87,7 +87,7 @@ int spartan2_dump(xilinx_desc *desc, const void *buf, size_t bsize) return ret_val; } -int spartan2_info(xilinx_desc *desc) +static int spartan2_info(xilinx_desc *desc) { return FPGA_SUCCESS; } @@ -447,3 +447,9 @@ static int spartan2_ss_dump(xilinx_desc *desc, const void *buf, size_t bsize) __FUNCTION__); return FPGA_FAIL; } + +struct xilinx_fpga_op spartan2_op = { + .load = spartan2_load, + .dump = spartan2_dump, + .info = spartan2_info, +}; |