wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2002 |
| 3 | * Rich Ireland, Enterasys Networks, rireland@enterasys.com. |
| 4 | * Keith Outwater, keith_outwater@mvis.com |
| 5 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef _VIRTEX2_H_ |
| 10 | #define _VIRTEX2_H_ |
| 11 | |
| 12 | #include <xilinx.h> |
| 13 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 14 | /* |
| 15 | * Slave SelectMap Implementation function table. |
| 16 | */ |
| 17 | typedef struct { |
Michal Simek | b4079cf | 2014-03-13 12:58:20 +0100 | [diff] [blame] | 18 | xilinx_pre_fn pre; |
| 19 | xilinx_pgm_fn pgm; |
| 20 | xilinx_init_fn init; |
| 21 | xilinx_err_fn err; |
| 22 | xilinx_done_fn done; |
| 23 | xilinx_clk_fn clk; |
| 24 | xilinx_cs_fn cs; |
| 25 | xilinx_wr_fn wr; |
| 26 | xilinx_rdata_fn rdata; |
| 27 | xilinx_wdata_fn wdata; |
| 28 | xilinx_busy_fn busy; |
| 29 | xilinx_abort_fn abort; |
| 30 | xilinx_post_fn post; |
Michal Simek | 9025888 | 2014-03-13 11:33:36 +0100 | [diff] [blame] | 31 | } xilinx_virtex2_slave_selectmap_fns; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 32 | |
| 33 | /* Slave Serial Implementation function table */ |
| 34 | typedef struct { |
Michal Simek | b4079cf | 2014-03-13 12:58:20 +0100 | [diff] [blame] | 35 | xilinx_pgm_fn pgm; |
| 36 | xilinx_clk_fn clk; |
| 37 | xilinx_rdata_fn rdata; |
| 38 | xilinx_wdata_fn wdata; |
Michal Simek | 9025888 | 2014-03-13 11:33:36 +0100 | [diff] [blame] | 39 | } xilinx_virtex2_slave_serial_fns; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 40 | |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 41 | #if defined(CONFIG_FPGA_VIRTEX2) |
| 42 | extern struct xilinx_fpga_op virtex2_op; |
| 43 | # define FPGA_VIRTEX2_OPS &virtex2_op |
| 44 | #else |
| 45 | # define FPGA_VIRTEX2_OPS NULL |
| 46 | #endif |
| 47 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 48 | /* Device Image Sizes (in bytes) |
| 49 | *********************************************************************/ |
Michal Simek | 68ad797 | 2014-07-16 10:47:43 +0200 | [diff] [blame] | 50 | #define XILINX_XC2V40_SIZE (338208 / 8) |
| 51 | #define XILINX_XC2V80_SIZE (597408 / 8) |
| 52 | #define XILINX_XC2V250_SIZE (1591584 / 8) |
| 53 | #define XILINX_XC2V500_SIZE (2557857 / 8) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 54 | #define XILINX_XC2V1000_SIZE (3749408 / 8) |
| 55 | #define XILINX_XC2V1500_SIZE (5166240 / 8) |
| 56 | #define XILINX_XC2V2000_SIZE (6808352 / 8) |
| 57 | #define XILINX_XC2V3000_SIZE (9589408 / 8) |
| 58 | #define XILINX_XC2V4000_SIZE (14220192 / 8) |
| 59 | #define XILINX_XC2V6000_SIZE (19752096 / 8) |
| 60 | #define XILINX_XC2V8000_SIZE (26185120 / 8) |
| 61 | #define XILINX_XC2V10000_SIZE (33519264 / 8) |
| 62 | |
| 63 | /* Descriptor Macros |
| 64 | *********************************************************************/ |
| 65 | #define XILINX_XC2V40_DESC(iface, fn_table, cookie) \ |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 66 | { xilinx_virtex2, iface, XILINX_XC2V40_SIZE, fn_table, cookie, \ |
| 67 | FPGA_VIRTEX2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 68 | |
| 69 | #define XILINX_XC2V80_DESC(iface, fn_table, cookie) \ |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 70 | { xilinx_virtex2, iface, XILINX_XC2V80_SIZE, fn_table, cookie, \ |
| 71 | FPGA_VIRTEX2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 72 | |
| 73 | #define XILINX_XC2V250_DESC(iface, fn_table, cookie) \ |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 74 | { xilinx_virtex2, iface, XILINX_XC2V250_SIZE, fn_table, cookie, \ |
| 75 | FPGA_VIRTEX2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 76 | |
| 77 | #define XILINX_XC2V500_DESC(iface, fn_table, cookie) \ |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 78 | { xilinx_virtex2, iface, XILINX_XC2V500_SIZE, fn_table, cookie, \ |
| 79 | FPGA_VIRTEX2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 80 | |
| 81 | #define XILINX_XC2V1000_DESC(iface, fn_table, cookie) \ |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 82 | { xilinx_virtex2, iface, XILINX_XC2V1000_SIZE, fn_table, cookie, \ |
| 83 | FPGA_VIRTEX2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 84 | |
| 85 | #define XILINX_XC2V1500_DESC(iface, fn_table, cookie) \ |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 86 | { xilinx_virtex2, iface, XILINX_XC2V1500_SIZE, fn_table, cookie, \ |
| 87 | FPGA_VIRTEX2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 88 | |
| 89 | #define XILINX_XC2V2000_DESC(iface, fn_table, cookie) \ |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 90 | { xilinx_virtex2, iface, XILINX_XC2V2000_SIZE, fn_table, cookie, \ |
| 91 | FPGA_VIRTEX2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 92 | |
| 93 | #define XILINX_XC2V3000_DESC(iface, fn_table, cookie) \ |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 94 | { xilinx_virtex2, iface, XILINX_XC2V3000_SIZE, fn_table, cookie, \ |
| 95 | FPGA_VIRTEX2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 96 | |
| 97 | #define XILINX_XC2V4000_DESC(iface, fn_table, cookie) \ |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 98 | { xilinx_virtex2, iface, XILINX_XC2V4000_SIZE, fn_table, cookie, \ |
| 99 | FPGA_VIRTEX2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 100 | |
| 101 | #define XILINX_XC2V6000_DESC(iface, fn_table, cookie) \ |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 102 | { xilinx_virtex2, iface, XILINX_XC2V6000_SIZE, fn_table, cookie, \ |
| 103 | FPGA_VIRTEX2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 104 | |
| 105 | #define XILINX_XC2V8000_DESC(iface, fn_table, cookie) \ |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 106 | { xilinx_virtex2, iface, XILINX_XC2V8000_SIZE, fn_table, cookie, \ |
| 107 | FPGA_VIRTEX2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 108 | |
| 109 | #define XILINX_XC2V10000_DESC(iface, fn_table, cookie) \ |
Michal Simek | e0aca2e | 2014-07-16 10:48:08 +0200 | [diff] [blame] | 110 | { xilinx_virtex2, iface, XILINX_XC2V10000_SIZE, fn_table, cookie, \ |
| 111 | FPGA_VIRTEX2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 112 | |
| 113 | #endif /* _VIRTEX2_H_ */ |