blob: 7e8d93f24da45d094ef379f04ae948021a35f6d1 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
wdenkc6097192002-11-03 00:24:07 +00002/*
3 * (C) Copyright 2002
4 * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
5 * Keith Outwater, keith_outwater@mvis.com
wdenkc6097192002-11-03 00:24:07 +00006 */
7
8#ifndef _VIRTEX2_H_
9#define _VIRTEX2_H_
10
11#include <xilinx.h>
12
wdenkc6097192002-11-03 00:24:07 +000013/*
Robert Hancock175dccd2019-06-18 09:47:16 -060014 * Slave SelectMap or Serial Implementation function table.
wdenkc6097192002-11-03 00:24:07 +000015 */
16typedef struct {
Michal Simek2df9d5c2014-03-13 12:58:20 +010017 xilinx_pre_fn pre;
18 xilinx_pgm_fn pgm;
19 xilinx_init_fn init;
20 xilinx_err_fn err;
21 xilinx_done_fn done;
22 xilinx_clk_fn clk;
23 xilinx_cs_fn cs;
24 xilinx_wr_fn wr;
25 xilinx_rdata_fn rdata;
26 xilinx_wdata_fn wdata;
Robert Hancock175dccd2019-06-18 09:47:16 -060027 xilinx_bwr_fn wbulkdata;
Michal Simek2df9d5c2014-03-13 12:58:20 +010028 xilinx_busy_fn busy;
29 xilinx_abort_fn abort;
30 xilinx_post_fn post;
Robert Hancock175dccd2019-06-18 09:47:16 -060031} xilinx_virtex2_slave_fns;
wdenkc6097192002-11-03 00:24:07 +000032
Michal Simek6a6acd12014-07-16 10:48:08 +020033#if defined(CONFIG_FPGA_VIRTEX2)
34extern struct xilinx_fpga_op virtex2_op;
35# define FPGA_VIRTEX2_OPS &virtex2_op
36#else
37# define FPGA_VIRTEX2_OPS NULL
38#endif
39
wdenkc6097192002-11-03 00:24:07 +000040/* Device Image Sizes (in bytes)
41 *********************************************************************/
Michal Simeka3607362014-07-16 10:47:43 +020042#define XILINX_XC2V40_SIZE (338208 / 8)
43#define XILINX_XC2V80_SIZE (597408 / 8)
44#define XILINX_XC2V250_SIZE (1591584 / 8)
45#define XILINX_XC2V500_SIZE (2557857 / 8)
wdenkc6097192002-11-03 00:24:07 +000046#define XILINX_XC2V1000_SIZE (3749408 / 8)
47#define XILINX_XC2V1500_SIZE (5166240 / 8)
48#define XILINX_XC2V2000_SIZE (6808352 / 8)
49#define XILINX_XC2V3000_SIZE (9589408 / 8)
50#define XILINX_XC2V4000_SIZE (14220192 / 8)
51#define XILINX_XC2V6000_SIZE (19752096 / 8)
52#define XILINX_XC2V8000_SIZE (26185120 / 8)
53#define XILINX_XC2V10000_SIZE (33519264 / 8)
54
55/* Descriptor Macros
56 *********************************************************************/
57#define XILINX_XC2V40_DESC(iface, fn_table, cookie) \
Michal Simek6a6acd12014-07-16 10:48:08 +020058{ xilinx_virtex2, iface, XILINX_XC2V40_SIZE, fn_table, cookie, \
59 FPGA_VIRTEX2_OPS }
wdenkc6097192002-11-03 00:24:07 +000060
61#define XILINX_XC2V80_DESC(iface, fn_table, cookie) \
Michal Simek6a6acd12014-07-16 10:48:08 +020062{ xilinx_virtex2, iface, XILINX_XC2V80_SIZE, fn_table, cookie, \
63 FPGA_VIRTEX2_OPS }
wdenkc6097192002-11-03 00:24:07 +000064
65#define XILINX_XC2V250_DESC(iface, fn_table, cookie) \
Michal Simek6a6acd12014-07-16 10:48:08 +020066{ xilinx_virtex2, iface, XILINX_XC2V250_SIZE, fn_table, cookie, \
67 FPGA_VIRTEX2_OPS }
wdenkc6097192002-11-03 00:24:07 +000068
69#define XILINX_XC2V500_DESC(iface, fn_table, cookie) \
Michal Simek6a6acd12014-07-16 10:48:08 +020070{ xilinx_virtex2, iface, XILINX_XC2V500_SIZE, fn_table, cookie, \
71 FPGA_VIRTEX2_OPS }
wdenkc6097192002-11-03 00:24:07 +000072
73#define XILINX_XC2V1000_DESC(iface, fn_table, cookie) \
Michal Simek6a6acd12014-07-16 10:48:08 +020074{ xilinx_virtex2, iface, XILINX_XC2V1000_SIZE, fn_table, cookie, \
75 FPGA_VIRTEX2_OPS }
wdenkc6097192002-11-03 00:24:07 +000076
77#define XILINX_XC2V1500_DESC(iface, fn_table, cookie) \
Michal Simek6a6acd12014-07-16 10:48:08 +020078{ xilinx_virtex2, iface, XILINX_XC2V1500_SIZE, fn_table, cookie, \
79 FPGA_VIRTEX2_OPS }
wdenkc6097192002-11-03 00:24:07 +000080
81#define XILINX_XC2V2000_DESC(iface, fn_table, cookie) \
Michal Simek6a6acd12014-07-16 10:48:08 +020082{ xilinx_virtex2, iface, XILINX_XC2V2000_SIZE, fn_table, cookie, \
83 FPGA_VIRTEX2_OPS }
wdenkc6097192002-11-03 00:24:07 +000084
85#define XILINX_XC2V3000_DESC(iface, fn_table, cookie) \
Michal Simek6a6acd12014-07-16 10:48:08 +020086{ xilinx_virtex2, iface, XILINX_XC2V3000_SIZE, fn_table, cookie, \
87 FPGA_VIRTEX2_OPS }
wdenkc6097192002-11-03 00:24:07 +000088
89#define XILINX_XC2V4000_DESC(iface, fn_table, cookie) \
Michal Simek6a6acd12014-07-16 10:48:08 +020090{ xilinx_virtex2, iface, XILINX_XC2V4000_SIZE, fn_table, cookie, \
91 FPGA_VIRTEX2_OPS }
wdenkc6097192002-11-03 00:24:07 +000092
93#define XILINX_XC2V6000_DESC(iface, fn_table, cookie) \
Michal Simek6a6acd12014-07-16 10:48:08 +020094{ xilinx_virtex2, iface, XILINX_XC2V6000_SIZE, fn_table, cookie, \
95 FPGA_VIRTEX2_OPS }
wdenkc6097192002-11-03 00:24:07 +000096
97#define XILINX_XC2V8000_DESC(iface, fn_table, cookie) \
Michal Simek6a6acd12014-07-16 10:48:08 +020098{ xilinx_virtex2, iface, XILINX_XC2V8000_SIZE, fn_table, cookie, \
99 FPGA_VIRTEX2_OPS }
wdenkc6097192002-11-03 00:24:07 +0000100
101#define XILINX_XC2V10000_DESC(iface, fn_table, cookie) \
Michal Simek6a6acd12014-07-16 10:48:08 +0200102{ xilinx_virtex2, iface, XILINX_XC2V10000_SIZE, fn_table, cookie, \
103 FPGA_VIRTEX2_OPS }
wdenkc6097192002-11-03 00:24:07 +0000104
105#endif /* _VIRTEX2_H_ */