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 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef _SPARTAN2_H_ |
| 9 | #define _SPARTAN2_H_ |
| 10 | |
| 11 | #include <xilinx.h> |
| 12 | |
Michal Simek | f8c1be9 | 2014-03-13 12:49:21 +0100 | [diff] [blame] | 13 | int spartan2_load(xilinx_desc *desc, const void *image, size_t size); |
| 14 | int spartan2_dump(xilinx_desc *desc, const void *buf, size_t bsize); |
| 15 | int spartan2_info(xilinx_desc *desc); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 16 | |
| 17 | /* Slave Parallel Implementation function table */ |
| 18 | typedef struct { |
Michal Simek | 2df9d5c | 2014-03-13 12:58:20 +0100 | [diff] [blame^] | 19 | xilinx_pre_fn pre; |
| 20 | xilinx_pgm_fn pgm; |
| 21 | xilinx_init_fn init; |
| 22 | xilinx_err_fn err; |
| 23 | xilinx_done_fn done; |
| 24 | xilinx_clk_fn clk; |
| 25 | xilinx_cs_fn cs; |
| 26 | xilinx_wr_fn wr; |
| 27 | xilinx_rdata_fn rdata; |
| 28 | xilinx_wdata_fn wdata; |
| 29 | xilinx_busy_fn busy; |
| 30 | xilinx_abort_fn abort; |
| 31 | xilinx_post_fn post; |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 32 | } xilinx_spartan2_slave_parallel_fns; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 33 | |
| 34 | /* Slave Serial Implementation function table */ |
| 35 | typedef struct { |
Michal Simek | 2df9d5c | 2014-03-13 12:58:20 +0100 | [diff] [blame^] | 36 | xilinx_pre_fn pre; |
| 37 | xilinx_pgm_fn pgm; |
| 38 | xilinx_clk_fn clk; |
| 39 | xilinx_init_fn init; |
| 40 | xilinx_done_fn done; |
| 41 | xilinx_wr_fn wr; |
| 42 | xilinx_post_fn post; |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 43 | } xilinx_spartan2_slave_serial_fns; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 44 | |
| 45 | /* Device Image Sizes |
| 46 | *********************************************************************/ |
| 47 | /* Spartan-II (2.5V) */ |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 48 | #define XILINX_XC2S15_SIZE 197728/8 |
| 49 | #define XILINX_XC2S30_SIZE 336800/8 |
| 50 | #define XILINX_XC2S50_SIZE 559232/8 |
| 51 | #define XILINX_XC2S100_SIZE 781248/8 |
| 52 | #define XILINX_XC2S150_SIZE 1040128/8 |
| 53 | #define XILINX_XC2S200_SIZE 1335872/8 |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 54 | |
wdenk | 9dd611b | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 55 | /* Spartan-IIE (1.8V) */ |
| 56 | #define XILINX_XC2S50E_SIZE 630048/8 |
| 57 | #define XILINX_XC2S100E_SIZE 863840/8 |
| 58 | #define XILINX_XC2S150E_SIZE 1134496/8 |
| 59 | #define XILINX_XC2S200E_SIZE 1442016/8 |
| 60 | #define XILINX_XC2S300E_SIZE 1875648/8 |
| 61 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 62 | /* Descriptor Macros |
| 63 | *********************************************************************/ |
| 64 | /* Spartan-II devices */ |
| 65 | #define XILINX_XC2S15_DESC(iface, fn_table, cookie) \ |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 66 | { xilinx_spartan2, iface, XILINX_XC2S15_SIZE, fn_table, cookie } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 67 | |
| 68 | #define XILINX_XC2S30_DESC(iface, fn_table, cookie) \ |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 69 | { xilinx_spartan2, iface, XILINX_XC2S30_SIZE, fn_table, cookie } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 70 | |
| 71 | #define XILINX_XC2S50_DESC(iface, fn_table, cookie) \ |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 72 | { xilinx_spartan2, iface, XILINX_XC2S50_SIZE, fn_table, cookie } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 73 | |
| 74 | #define XILINX_XC2S100_DESC(iface, fn_table, cookie) \ |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 75 | { xilinx_spartan2, iface, XILINX_XC2S100_SIZE, fn_table, cookie } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 76 | |
| 77 | #define XILINX_XC2S150_DESC(iface, fn_table, cookie) \ |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 78 | { xilinx_spartan2, iface, XILINX_XC2S150_SIZE, fn_table, cookie } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 79 | |
Matthias Fuchs | 3bff4ff | 2007-12-27 17:12:56 +0100 | [diff] [blame] | 80 | #define XILINX_XC2S200_DESC(iface, fn_table, cookie) \ |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 81 | { xilinx_spartan2, iface, XILINX_XC2S200_SIZE, fn_table, cookie } |
Matthias Fuchs | 3bff4ff | 2007-12-27 17:12:56 +0100 | [diff] [blame] | 82 | |
wdenk | 9dd611b | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 83 | #define XILINX_XC2S50E_DESC(iface, fn_table, cookie) \ |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 84 | { xilinx_spartan2, iface, XILINX_XC2S50E_SIZE, fn_table, cookie } |
wdenk | 9dd611b | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 85 | |
| 86 | #define XILINX_XC2S100E_DESC(iface, fn_table, cookie) \ |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 87 | { xilinx_spartan2, iface, XILINX_XC2S100E_SIZE, fn_table, cookie } |
wdenk | 9dd611b | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 88 | |
| 89 | #define XILINX_XC2S150E_DESC(iface, fn_table, cookie) \ |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 90 | { xilinx_spartan2, iface, XILINX_XC2S150E_SIZE, fn_table, cookie } |
wdenk | 9dd611b | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 91 | |
| 92 | #define XILINX_XC2S200E_DESC(iface, fn_table, cookie) \ |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 93 | { xilinx_spartan2, iface, XILINX_XC2S200E_SIZE, fn_table, cookie } |
wdenk | 9dd611b | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 94 | |
| 95 | #define XILINX_XC2S300E_DESC(iface, fn_table, cookie) \ |
Michal Simek | b625b9a | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 96 | { xilinx_spartan2, iface, XILINX_XC2S300E_SIZE, fn_table, cookie } |
wdenk | 9dd611b | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 97 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 98 | #endif /* _SPARTAN2_H_ */ |