blob: 618eddd8384a47a3161970d5ef152669bd0da961 [file] [log] [blame]
Tom Rini10e47792018-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.
wdenkc6097192002-11-03 00:24:07 +00005 */
6
7#ifndef _SPARTAN2_H_
8#define _SPARTAN2_H_
9
10#include <xilinx.h>
11
wdenkc6097192002-11-03 00:24:07 +000012/* Slave Parallel Implementation function table */
13typedef struct {
Michal Simekb4079cf2014-03-13 12:58:20 +010014 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 Simek5206cca2014-03-13 11:23:43 +010027} xilinx_spartan2_slave_parallel_fns;
wdenkc6097192002-11-03 00:24:07 +000028
29/* Slave Serial Implementation function table */
30typedef struct {
Michal Simekb4079cf2014-03-13 12:58:20 +010031 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 Simek5206cca2014-03-13 11:23:43 +010038} xilinx_spartan2_slave_serial_fns;
wdenkc6097192002-11-03 00:24:07 +000039
Michal Simek77323392014-07-16 10:43:47 +020040#if defined(CONFIG_FPGA_SPARTAN2)
Michal Simek75fafac2014-03-13 13:07:57 +010041extern struct xilinx_fpga_op spartan2_op;
Michal Simek77323392014-07-16 10:43:47 +020042# define FPGA_SPARTAN2_OPS &spartan2_op
43#else
44# define FPGA_SPARTAN2_OPS NULL
45#endif
Michal Simek75fafac2014-03-13 13:07:57 +010046
wdenkc6097192002-11-03 00:24:07 +000047/* Device Image Sizes
48 *********************************************************************/
49/* Spartan-II (2.5V) */
Wolfgang Denka1be4762008-05-20 16:00:29 +020050#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
wdenkc6097192002-11-03 00:24:07 +000056
wdenk02ac0212005-01-09 17:19:34 +000057/* 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
wdenkc6097192002-11-03 00:24:07 +000064/* Descriptor Macros
65 *********************************************************************/
66/* Spartan-II devices */
67#define XILINX_XC2S15_DESC(iface, fn_table, cookie) \
Michal Simek77323392014-07-16 10:43:47 +020068{ xilinx_spartan2, iface, XILINX_XC2S15_SIZE, fn_table, cookie, \
69 FPGA_SPARTAN2_OPS }
wdenkc6097192002-11-03 00:24:07 +000070
71#define XILINX_XC2S30_DESC(iface, fn_table, cookie) \
Michal Simek77323392014-07-16 10:43:47 +020072{ xilinx_spartan2, iface, XILINX_XC2S30_SIZE, fn_table, cookie, \
73 FPGA_SPARTAN2_OPS }
wdenkc6097192002-11-03 00:24:07 +000074
75#define XILINX_XC2S50_DESC(iface, fn_table, cookie) \
Michal Simek77323392014-07-16 10:43:47 +020076{ xilinx_spartan2, iface, XILINX_XC2S50_SIZE, fn_table, cookie, \
77 FPGA_SPARTAN2_OPS }
wdenkc6097192002-11-03 00:24:07 +000078
79#define XILINX_XC2S100_DESC(iface, fn_table, cookie) \
Michal Simek77323392014-07-16 10:43:47 +020080{ xilinx_spartan2, iface, XILINX_XC2S100_SIZE, fn_table, cookie, \
81 FPGA_SPARTAN2_OPS }
wdenkc6097192002-11-03 00:24:07 +000082
83#define XILINX_XC2S150_DESC(iface, fn_table, cookie) \
Michal Simek77323392014-07-16 10:43:47 +020084{ xilinx_spartan2, iface, XILINX_XC2S150_SIZE, fn_table, cookie, \
85 FPGA_SPARTAN2_OPS }
wdenkc6097192002-11-03 00:24:07 +000086
Matthias Fuchs41481632007-12-27 17:12:56 +010087#define XILINX_XC2S200_DESC(iface, fn_table, cookie) \
Michal Simek77323392014-07-16 10:43:47 +020088{ xilinx_spartan2, iface, XILINX_XC2S200_SIZE, fn_table, cookie, \
89 FPGA_SPARTAN2_OPS }
Matthias Fuchs41481632007-12-27 17:12:56 +010090
wdenk02ac0212005-01-09 17:19:34 +000091#define XILINX_XC2S50E_DESC(iface, fn_table, cookie) \
Michal Simek77323392014-07-16 10:43:47 +020092{ xilinx_spartan2, iface, XILINX_XC2S50E_SIZE, fn_table, cookie, \
93 FPGA_SPARTAN2_OPS }
wdenk02ac0212005-01-09 17:19:34 +000094
95#define XILINX_XC2S100E_DESC(iface, fn_table, cookie) \
Michal Simek77323392014-07-16 10:43:47 +020096{ xilinx_spartan2, iface, XILINX_XC2S100E_SIZE, fn_table, cookie, \
97 FPGA_SPARTAN2_OPS }
wdenk02ac0212005-01-09 17:19:34 +000098
99#define XILINX_XC2S150E_DESC(iface, fn_table, cookie) \
Michal Simek77323392014-07-16 10:43:47 +0200100{ xilinx_spartan2, iface, XILINX_XC2S150E_SIZE, fn_table, cookie, \
101 FPGA_SPARTAN2_OPS }
wdenk02ac0212005-01-09 17:19:34 +0000102
103#define XILINX_XC2S200E_DESC(iface, fn_table, cookie) \
Michal Simek77323392014-07-16 10:43:47 +0200104{ xilinx_spartan2, iface, XILINX_XC2S200E_SIZE, fn_table, cookie, \
105 FPGA_SPARTAN2_OPS }
wdenk02ac0212005-01-09 17:19:34 +0000106
107#define XILINX_XC2S300E_DESC(iface, fn_table, cookie) \
Michal Simek77323392014-07-16 10:43:47 +0200108{ xilinx_spartan2, iface, XILINX_XC2S300E_SIZE, fn_table, cookie, \
109 FPGA_SPARTAN2_OPS }
wdenk02ac0212005-01-09 17:19:34 +0000110
wdenkc6097192002-11-03 00:24:07 +0000111#endif /* _SPARTAN2_H_ */