summaryrefslogtreecommitdiff
path: root/drivers/fpga/spartan3.c
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 /drivers/fpga/spartan3.c
parent2df9d5c431fca07c9868a36b48ee771bde6b19e8 (diff)
downloadu-boot-imx-14cfc4f3735d9704cb6a630ef302be596d380684.zip
u-boot-imx-14cfc4f3735d9704cb6a630ef302be596d380684.tar.gz
u-boot-imx-14cfc4f3735d9704cb6a630ef302be596d380684.tar.bz2
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/spartan3.c')
-rw-r--r--drivers/fpga/spartan3.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/fpga/spartan3.c b/drivers/fpga/spartan3.c
index 1304b4c..5c9412c 100644
--- a/drivers/fpga/spartan3.c
+++ b/drivers/fpga/spartan3.c
@@ -45,7 +45,7 @@ static int spartan3_ss_dump(xilinx_desc *desc, const void *buf, size_t bsize);
/* ------------------------------------------------------------------------- */
/* Spartan-II Generic Implementation */
-int spartan3_load(xilinx_desc *desc, const void *buf, size_t bsize)
+static int spartan3_load(xilinx_desc *desc, const void *buf, size_t bsize)
{
int ret_val = FPGA_FAIL;
@@ -68,7 +68,7 @@ int spartan3_load(xilinx_desc *desc, const void *buf, size_t bsize)
return ret_val;
}
-int spartan3_dump(xilinx_desc *desc, const void *buf, size_t bsize)
+static int spartan3_dump(xilinx_desc *desc, const void *buf, size_t bsize)
{
int ret_val = FPGA_FAIL;
@@ -91,7 +91,7 @@ int spartan3_dump(xilinx_desc *desc, const void *buf, size_t bsize)
return ret_val;
}
-int spartan3_info(xilinx_desc *desc)
+static int spartan3_info(xilinx_desc *desc)
{
return FPGA_SUCCESS;
}
@@ -465,3 +465,9 @@ static int spartan3_ss_dump(xilinx_desc *desc, const void *buf, size_t bsize)
__FUNCTION__);
return FPGA_FAIL;
}
+
+struct xilinx_fpga_op spartan3_op = {
+ .load = spartan3_load,
+ .dump = spartan3_dump,
+ .info = spartan3_info,
+};