diff options
author | Michal Simek <michal.simek@xilinx.com> | 2014-03-13 13:07:57 +0100 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2014-05-13 09:13:59 +0200 |
commit | 14cfc4f3735d9704cb6a630ef302be596d380684 (patch) | |
tree | 23c759ab37c1368763488a5548813231cfa1d3d0 /include/spartan2.h | |
parent | 2df9d5c431fca07c9868a36b48ee771bde6b19e8 (diff) | |
download | u-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/spartan2.h')
-rw-r--r-- | include/spartan2.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/include/spartan2.h b/include/spartan2.h index 25db6e7a60..2aca954e73 100644 --- a/include/spartan2.h +++ b/include/spartan2.h @@ -10,10 +10,6 @@ #include <xilinx.h> -int spartan2_load(xilinx_desc *desc, const void *image, size_t size); -int spartan2_dump(xilinx_desc *desc, const void *buf, size_t bsize); -int spartan2_info(xilinx_desc *desc); - /* Slave Parallel Implementation function table */ typedef struct { xilinx_pre_fn pre; @@ -42,6 +38,8 @@ typedef struct { xilinx_post_fn post; } xilinx_spartan2_slave_serial_fns; +extern struct xilinx_fpga_op spartan2_op; + /* Device Image Sizes *********************************************************************/ /* Spartan-II (2.5V) */ @@ -63,36 +61,36 @@ typedef struct { *********************************************************************/ /* Spartan-II devices */ #define XILINX_XC2S15_DESC(iface, fn_table, cookie) \ -{ xilinx_spartan2, iface, XILINX_XC2S15_SIZE, fn_table, cookie } +{ xilinx_spartan2, iface, XILINX_XC2S15_SIZE, fn_table, cookie, &spartan2_op } #define XILINX_XC2S30_DESC(iface, fn_table, cookie) \ -{ xilinx_spartan2, iface, XILINX_XC2S30_SIZE, fn_table, cookie } +{ xilinx_spartan2, iface, XILINX_XC2S30_SIZE, fn_table, cookie, &spartan2_op } #define XILINX_XC2S50_DESC(iface, fn_table, cookie) \ -{ xilinx_spartan2, iface, XILINX_XC2S50_SIZE, fn_table, cookie } +{ xilinx_spartan2, iface, XILINX_XC2S50_SIZE, fn_table, cookie, &spartan2_op } #define XILINX_XC2S100_DESC(iface, fn_table, cookie) \ -{ xilinx_spartan2, iface, XILINX_XC2S100_SIZE, fn_table, cookie } +{ xilinx_spartan2, iface, XILINX_XC2S100_SIZE, fn_table, cookie, &spartan2_op } #define XILINX_XC2S150_DESC(iface, fn_table, cookie) \ -{ xilinx_spartan2, iface, XILINX_XC2S150_SIZE, fn_table, cookie } +{ xilinx_spartan2, iface, XILINX_XC2S150_SIZE, fn_table, cookie, &spartan2_op } #define XILINX_XC2S200_DESC(iface, fn_table, cookie) \ -{ xilinx_spartan2, iface, XILINX_XC2S200_SIZE, fn_table, cookie } +{ xilinx_spartan2, iface, XILINX_XC2S200_SIZE, fn_table, cookie, &spartan2_op } #define XILINX_XC2S50E_DESC(iface, fn_table, cookie) \ -{ xilinx_spartan2, iface, XILINX_XC2S50E_SIZE, fn_table, cookie } +{ xilinx_spartan2, iface, XILINX_XC2S50E_SIZE, fn_table, cookie, &spartan2_op } #define XILINX_XC2S100E_DESC(iface, fn_table, cookie) \ -{ xilinx_spartan2, iface, XILINX_XC2S100E_SIZE, fn_table, cookie } +{ xilinx_spartan2, iface, XILINX_XC2S100E_SIZE, fn_table, cookie, &spartan2_op } #define XILINX_XC2S150E_DESC(iface, fn_table, cookie) \ -{ xilinx_spartan2, iface, XILINX_XC2S150E_SIZE, fn_table, cookie } +{ xilinx_spartan2, iface, XILINX_XC2S150E_SIZE, fn_table, cookie, &spartan2_op } #define XILINX_XC2S200E_DESC(iface, fn_table, cookie) \ -{ xilinx_spartan2, iface, XILINX_XC2S200E_SIZE, fn_table, cookie } +{ xilinx_spartan2, iface, XILINX_XC2S200E_SIZE, fn_table, cookie, &spartan2_op } #define XILINX_XC2S300E_DESC(iface, fn_table, cookie) \ -{ xilinx_spartan2, iface, XILINX_XC2S300E_SIZE, fn_table, cookie } +{ xilinx_spartan2, iface, XILINX_XC2S300E_SIZE, fn_table, cookie, &spartan2_op } #endif /* _SPARTAN2_H_ */ |