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