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 | d79de1d | 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 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 13 | /* Slave Parallel Implementation function table */ |
| 14 | typedef struct { |
Michal Simek | b4079cf | 2014-03-13 12:58:20 +0100 | [diff] [blame] | 15 | xilinx_pre_fn pre; |
| 16 | xilinx_pgm_fn pgm; |
| 17 | xilinx_init_fn init; |
| 18 | xilinx_err_fn err; |
| 19 | xilinx_done_fn done; |
| 20 | xilinx_clk_fn clk; |
| 21 | xilinx_cs_fn cs; |
| 22 | xilinx_wr_fn wr; |
| 23 | xilinx_rdata_fn rdata; |
| 24 | xilinx_wdata_fn wdata; |
| 25 | xilinx_busy_fn busy; |
| 26 | xilinx_abort_fn abort; |
| 27 | xilinx_post_fn post; |
Michal Simek | 5206cca | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 28 | } xilinx_spartan2_slave_parallel_fns; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 29 | |
| 30 | /* Slave Serial Implementation function table */ |
| 31 | typedef struct { |
Michal Simek | b4079cf | 2014-03-13 12:58:20 +0100 | [diff] [blame] | 32 | xilinx_pre_fn pre; |
| 33 | xilinx_pgm_fn pgm; |
| 34 | xilinx_clk_fn clk; |
| 35 | xilinx_init_fn init; |
| 36 | xilinx_done_fn done; |
| 37 | xilinx_wr_fn wr; |
| 38 | xilinx_post_fn post; |
Michal Simek | 5206cca | 2014-03-13 11:23:43 +0100 | [diff] [blame] | 39 | } xilinx_spartan2_slave_serial_fns; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 40 | |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 41 | #if defined(CONFIG_FPGA_SPARTAN2) |
Michal Simek | 75fafac | 2014-03-13 13:07:57 +0100 | [diff] [blame] | 42 | extern struct xilinx_fpga_op spartan2_op; |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 43 | # define FPGA_SPARTAN2_OPS &spartan2_op |
| 44 | #else |
| 45 | # define FPGA_SPARTAN2_OPS NULL |
| 46 | #endif |
Michal Simek | 75fafac | 2014-03-13 13:07:57 +0100 | [diff] [blame] | 47 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 48 | /* Device Image Sizes |
| 49 | *********************************************************************/ |
| 50 | /* Spartan-II (2.5V) */ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 51 | #define XILINX_XC2S15_SIZE 197728/8 |
| 52 | #define XILINX_XC2S30_SIZE 336800/8 |
| 53 | #define XILINX_XC2S50_SIZE 559232/8 |
| 54 | #define XILINX_XC2S100_SIZE 781248/8 |
| 55 | #define XILINX_XC2S150_SIZE 1040128/8 |
| 56 | #define XILINX_XC2S200_SIZE 1335872/8 |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 57 | |
wdenk | 02ac021 | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 58 | /* Spartan-IIE (1.8V) */ |
| 59 | #define XILINX_XC2S50E_SIZE 630048/8 |
| 60 | #define XILINX_XC2S100E_SIZE 863840/8 |
| 61 | #define XILINX_XC2S150E_SIZE 1134496/8 |
| 62 | #define XILINX_XC2S200E_SIZE 1442016/8 |
| 63 | #define XILINX_XC2S300E_SIZE 1875648/8 |
| 64 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 65 | /* Descriptor Macros |
| 66 | *********************************************************************/ |
| 67 | /* Spartan-II devices */ |
| 68 | #define XILINX_XC2S15_DESC(iface, fn_table, cookie) \ |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 69 | { xilinx_spartan2, iface, XILINX_XC2S15_SIZE, fn_table, cookie, \ |
| 70 | FPGA_SPARTAN2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 71 | |
| 72 | #define XILINX_XC2S30_DESC(iface, fn_table, cookie) \ |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 73 | { xilinx_spartan2, iface, XILINX_XC2S30_SIZE, fn_table, cookie, \ |
| 74 | FPGA_SPARTAN2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 75 | |
| 76 | #define XILINX_XC2S50_DESC(iface, fn_table, cookie) \ |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 77 | { xilinx_spartan2, iface, XILINX_XC2S50_SIZE, fn_table, cookie, \ |
| 78 | FPGA_SPARTAN2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 79 | |
| 80 | #define XILINX_XC2S100_DESC(iface, fn_table, cookie) \ |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 81 | { xilinx_spartan2, iface, XILINX_XC2S100_SIZE, fn_table, cookie, \ |
| 82 | FPGA_SPARTAN2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 83 | |
| 84 | #define XILINX_XC2S150_DESC(iface, fn_table, cookie) \ |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 85 | { xilinx_spartan2, iface, XILINX_XC2S150_SIZE, fn_table, cookie, \ |
| 86 | FPGA_SPARTAN2_OPS } |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 87 | |
Matthias Fuchs | 4148163 | 2007-12-27 17:12:56 +0100 | [diff] [blame] | 88 | #define XILINX_XC2S200_DESC(iface, fn_table, cookie) \ |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 89 | { xilinx_spartan2, iface, XILINX_XC2S200_SIZE, fn_table, cookie, \ |
| 90 | FPGA_SPARTAN2_OPS } |
Matthias Fuchs | 4148163 | 2007-12-27 17:12:56 +0100 | [diff] [blame] | 91 | |
wdenk | 02ac021 | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 92 | #define XILINX_XC2S50E_DESC(iface, fn_table, cookie) \ |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 93 | { xilinx_spartan2, iface, XILINX_XC2S50E_SIZE, fn_table, cookie, \ |
| 94 | FPGA_SPARTAN2_OPS } |
wdenk | 02ac021 | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 95 | |
| 96 | #define XILINX_XC2S100E_DESC(iface, fn_table, cookie) \ |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 97 | { xilinx_spartan2, iface, XILINX_XC2S100E_SIZE, fn_table, cookie, \ |
| 98 | FPGA_SPARTAN2_OPS } |
wdenk | 02ac021 | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 99 | |
| 100 | #define XILINX_XC2S150E_DESC(iface, fn_table, cookie) \ |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 101 | { xilinx_spartan2, iface, XILINX_XC2S150E_SIZE, fn_table, cookie, \ |
| 102 | FPGA_SPARTAN2_OPS } |
wdenk | 02ac021 | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 103 | |
| 104 | #define XILINX_XC2S200E_DESC(iface, fn_table, cookie) \ |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 105 | { xilinx_spartan2, iface, XILINX_XC2S200E_SIZE, fn_table, cookie, \ |
| 106 | FPGA_SPARTAN2_OPS } |
wdenk | 02ac021 | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 107 | |
| 108 | #define XILINX_XC2S300E_DESC(iface, fn_table, cookie) \ |
Michal Simek | 7732339 | 2014-07-16 10:43:47 +0200 | [diff] [blame] | 109 | { xilinx_spartan2, iface, XILINX_XC2S300E_SIZE, fn_table, cookie, \ |
| 110 | FPGA_SPARTAN2_OPS } |
wdenk | 02ac021 | 2005-01-09 17:19:34 +0000 | [diff] [blame] | 111 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 112 | #endif /* _SPARTAN2_H_ */ |