blob: fcb27b01e4a7ea261b2126abe4a5d2c56371c556 [file] [log] [blame]
Wolfgang Denk875c7892005-09-25 16:44:21 +02001/*
2 * (C) Copyright 2002
3 * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Wolfgang Denk875c7892005-09-25 16:44:21 +02006 */
7
8#ifndef _SPARTAN3_H_
9#define _SPARTAN3_H_
10
11#include <xilinx.h>
12
Wolfgang Denk875c7892005-09-25 16:44:21 +020013/* Slave Parallel Implementation function table */
14typedef struct {
Michal Simek2df9d5c2014-03-13 12:58:20 +010015 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 Simek2a6e3862014-03-13 11:28:42 +010028} xilinx_spartan3_slave_parallel_fns;
Wolfgang Denk875c7892005-09-25 16:44:21 +020029
30/* Slave Serial Implementation function table */
31typedef struct {
Michal Simek2df9d5c2014-03-13 12:58:20 +010032 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;
39 xilinx_bwr_fn bwr; /* block write function */
40 xilinx_abort_fn abort;
Michal Simek2a6e3862014-03-13 11:28:42 +010041} xilinx_spartan3_slave_serial_fns;
Wolfgang Denk875c7892005-09-25 16:44:21 +020042
Michal Simeka99a06c2014-07-16 10:46:35 +020043#if defined(CONFIG_FPGA_SPARTAN3)
Michal Simek14cfc4f2014-03-13 13:07:57 +010044extern struct xilinx_fpga_op spartan3_op;
Michal Simeka99a06c2014-07-16 10:46:35 +020045# define FPGA_SPARTAN3_OPS &spartan3_op
46#else
47# define FPGA_SPARTAN3_OPS NULL
48#endif
Michal Simek14cfc4f2014-03-13 13:07:57 +010049
Wolfgang Denk875c7892005-09-25 16:44:21 +020050/* Device Image Sizes
51 *********************************************************************/
52/* Spartan-III (1.2V) */
Wolfgang Denk53677ef2008-05-20 16:00:29 +020053#define XILINX_XC3S50_SIZE 439264/8
54#define XILINX_XC3S200_SIZE 1047616/8
55#define XILINX_XC3S400_SIZE 1699136/8
56#define XILINX_XC3S1000_SIZE 3223488/8
57#define XILINX_XC3S1500_SIZE 5214784/8
58#define XILINX_XC3S2000_SIZE 7673024/8
59#define XILINX_XC3S4000_SIZE 11316864/8
60#define XILINX_XC3S5000_SIZE 13271936/8
Wolfgang Denk875c7892005-09-25 16:44:21 +020061
Bruce Adler923efd22007-08-10 14:54:47 -070062/* Spartan-3E (v3.4) */
63#define XILINX_XC3S100E_SIZE 581344/8
64#define XILINX_XC3S250E_SIZE 1353728/8
65#define XILINX_XC3S500E_SIZE 2270208/8
66#define XILINX_XC3S1200E_SIZE 3841184/8
67#define XILINX_XC3S1600E_SIZE 5969696/8
68
Stefano Babic28cdc1c2011-12-28 06:47:00 +000069/*
70 * Spartan-6 : the Spartan-6 family can be programmed
71 * exactly as the Spartan-3
72 */
73#define XILINK_XC6SLX4_SIZE (3713568/8)
74
Wolfgang Denk875c7892005-09-25 16:44:21 +020075/* Descriptor Macros
76 *********************************************************************/
Matthias Fuchs3bff4ff2007-12-27 17:12:56 +010077/* Spartan-III devices */
Wolfgang Denk875c7892005-09-25 16:44:21 +020078#define XILINX_XC3S50_DESC(iface, fn_table, cookie) \
Michal Simeka99a06c2014-07-16 10:46:35 +020079{ xilinx_spartan3, iface, XILINX_XC3S50_SIZE, fn_table, cookie, \
80 FPGA_SPARTAN3_OPS }
Wolfgang Denk875c7892005-09-25 16:44:21 +020081
82#define XILINX_XC3S200_DESC(iface, fn_table, cookie) \
Michal Simeka99a06c2014-07-16 10:46:35 +020083{ xilinx_spartan3, iface, XILINX_XC3S200_SIZE, fn_table, cookie, \
84 FPGA_SPARTAN3_OPS }
Wolfgang Denk875c7892005-09-25 16:44:21 +020085
86#define XILINX_XC3S400_DESC(iface, fn_table, cookie) \
Michal Simeka99a06c2014-07-16 10:46:35 +020087{ xilinx_spartan3, iface, XILINX_XC3S400_SIZE, fn_table, cookie, \
88 FPGA_SPARTAN3_OPS }
Wolfgang Denk875c7892005-09-25 16:44:21 +020089
90#define XILINX_XC3S1000_DESC(iface, fn_table, cookie) \
Michal Simeka99a06c2014-07-16 10:46:35 +020091{ xilinx_spartan3, iface, XILINX_XC3S1000_SIZE, fn_table, cookie, \
92 FPGA_SPARTAN3_OPS }
Wolfgang Denk875c7892005-09-25 16:44:21 +020093
94#define XILINX_XC3S1500_DESC(iface, fn_table, cookie) \
Michal Simeka99a06c2014-07-16 10:46:35 +020095{ xilinx_spartan3, iface, XILINX_XC3S1500_SIZE, fn_table, cookie, \
96 FPGA_SPARTAN3_OPS }
Wolfgang Denk875c7892005-09-25 16:44:21 +020097
98#define XILINX_XC3S2000_DESC(iface, fn_table, cookie) \
Michal Simeka99a06c2014-07-16 10:46:35 +020099{ xilinx_spartan3, iface, XILINX_XC3S2000_SIZE, fn_table, cookie, \
100 FPGA_SPARTAN3_OPS }
Wolfgang Denk875c7892005-09-25 16:44:21 +0200101
102#define XILINX_XC3S4000_DESC(iface, fn_table, cookie) \
Michal Simeka99a06c2014-07-16 10:46:35 +0200103{ xilinx_spartan3, iface, XILINX_XC3S4000_SIZE, fn_table, cookie, \
104 FPGA_SPARTAN3_OPS }
Wolfgang Denk875c7892005-09-25 16:44:21 +0200105
106#define XILINX_XC3S5000_DESC(iface, fn_table, cookie) \
Michal Simeka99a06c2014-07-16 10:46:35 +0200107{ xilinx_spartan3, iface, XILINX_XC3S5000_SIZE, fn_table, cookie, \
108 FPGA_SPARTAN3_OPS }
Wolfgang Denk875c7892005-09-25 16:44:21 +0200109
Bruce Adler923efd22007-08-10 14:54:47 -0700110/* Spartan-3E devices */
111#define XILINX_XC3S100E_DESC(iface, fn_table, cookie) \
Michal Simeka99a06c2014-07-16 10:46:35 +0200112{ xilinx_spartan3, iface, XILINX_XC3S100E_SIZE, fn_table, cookie, \
113 FPGA_SPARTAN3_OPS }
Bruce Adler923efd22007-08-10 14:54:47 -0700114
115#define XILINX_XC3S250E_DESC(iface, fn_table, cookie) \
Michal Simeka99a06c2014-07-16 10:46:35 +0200116{ xilinx_spartan3, iface, XILINX_XC3S250E_SIZE, fn_table, cookie, \
117 FPGA_SPARTAN3_OPS }
Bruce Adler923efd22007-08-10 14:54:47 -0700118
119#define XILINX_XC3S500E_DESC(iface, fn_table, cookie) \
Michal Simeka99a06c2014-07-16 10:46:35 +0200120{ xilinx_spartan3, iface, XILINX_XC3S500E_SIZE, fn_table, cookie, \
121 FPGA_SPARTAN3_OPS }
Bruce Adler923efd22007-08-10 14:54:47 -0700122
123#define XILINX_XC3S1200E_DESC(iface, fn_table, cookie) \
Michal Simek14cfc4f2014-03-13 13:07:57 +0100124{ xilinx_spartan3, iface, XILINX_XC3S1200E_SIZE, fn_table, cookie, \
Michal Simeka99a06c2014-07-16 10:46:35 +0200125 FPGA_SPARTAN3_OPS }
Bruce Adler923efd22007-08-10 14:54:47 -0700126
127#define XILINX_XC3S1600E_DESC(iface, fn_table, cookie) \
Michal Simek14cfc4f2014-03-13 13:07:57 +0100128{ xilinx_spartan3, iface, XILINX_XC3S1600E_SIZE, fn_table, cookie, \
Michal Simeka99a06c2014-07-16 10:46:35 +0200129 FPGA_SPARTAN3_OPS }
Bruce Adler923efd22007-08-10 14:54:47 -0700130
Stefano Babic28cdc1c2011-12-28 06:47:00 +0000131#define XILINX_XC6SLX4_DESC(iface, fn_table, cookie) \
Michal Simeka99a06c2014-07-16 10:46:35 +0200132{ xilinx_spartan3, iface, XILINK_XC6SLX4_SIZE, fn_table, cookie, \
133 FPGA_SPARTAN3_OPS }
Stefano Babic28cdc1c2011-12-28 06:47:00 +0000134
Wolfgang Denk875c7892005-09-25 16:44:21 +0200135#endif /* _SPARTAN3_H_ */