xref: /rk3399_rockchip-uboot/include/spartan3.h (revision 28cdc1c8e2682a008c8da15ce8fa153f6f01ea95)
1875c7893SWolfgang Denk /*
2875c7893SWolfgang Denk  * (C) Copyright 2002
3875c7893SWolfgang Denk  * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
4875c7893SWolfgang Denk  *
5875c7893SWolfgang Denk  * See file CREDITS for list of people who contributed to this
6875c7893SWolfgang Denk  * project.
7875c7893SWolfgang Denk  *
8875c7893SWolfgang Denk  * This program is free software; you can redistribute it and/or
9875c7893SWolfgang Denk  * modify it under the terms of the GNU General Public License as
10875c7893SWolfgang Denk  * published by the Free Software Foundation; either version 2 of
11875c7893SWolfgang Denk  * the License, or (at your option) any later version.
12875c7893SWolfgang Denk  *
13875c7893SWolfgang Denk  * This program is distributed in the hope that it will be useful,
14875c7893SWolfgang Denk  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15875c7893SWolfgang Denk  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16875c7893SWolfgang Denk  * GNU General Public License for more details.
17875c7893SWolfgang Denk  *
18875c7893SWolfgang Denk  * You should have received a copy of the GNU General Public License
19875c7893SWolfgang Denk  * along with this program; if not, write to the Free Software
20875c7893SWolfgang Denk  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21875c7893SWolfgang Denk  * MA 02111-1307 USA
22875c7893SWolfgang Denk  *
23875c7893SWolfgang Denk  */
24875c7893SWolfgang Denk 
25875c7893SWolfgang Denk #ifndef _SPARTAN3_H_
26875c7893SWolfgang Denk #define _SPARTAN3_H_
27875c7893SWolfgang Denk 
28875c7893SWolfgang Denk #include <xilinx.h>
29875c7893SWolfgang Denk 
30e6a857daSWolfgang Denk extern int Spartan3_load(Xilinx_desc *desc, const void *image, size_t size);
31e6a857daSWolfgang Denk extern int Spartan3_dump(Xilinx_desc *desc, const void *buf, size_t bsize);
32875c7893SWolfgang Denk extern int Spartan3_info(Xilinx_desc *desc);
33875c7893SWolfgang Denk 
34875c7893SWolfgang Denk /* Slave Parallel Implementation function table */
35875c7893SWolfgang Denk typedef struct {
36875c7893SWolfgang Denk 	Xilinx_pre_fn	pre;
37875c7893SWolfgang Denk 	Xilinx_pgm_fn	pgm;
38875c7893SWolfgang Denk 	Xilinx_init_fn	init;
39875c7893SWolfgang Denk 	Xilinx_err_fn	err;
40875c7893SWolfgang Denk 	Xilinx_done_fn	done;
41875c7893SWolfgang Denk 	Xilinx_clk_fn	clk;
42875c7893SWolfgang Denk 	Xilinx_cs_fn	cs;
43875c7893SWolfgang Denk 	Xilinx_wr_fn	wr;
44875c7893SWolfgang Denk 	Xilinx_rdata_fn	rdata;
45875c7893SWolfgang Denk 	Xilinx_wdata_fn	wdata;
46875c7893SWolfgang Denk 	Xilinx_busy_fn	busy;
47875c7893SWolfgang Denk 	Xilinx_abort_fn	abort;
48875c7893SWolfgang Denk 	Xilinx_post_fn	post;
49875c7893SWolfgang Denk } Xilinx_Spartan3_Slave_Parallel_fns;
50875c7893SWolfgang Denk 
51875c7893SWolfgang Denk /* Slave Serial Implementation function table */
52875c7893SWolfgang Denk typedef struct {
53875c7893SWolfgang Denk 	Xilinx_pre_fn	pre;
54875c7893SWolfgang Denk 	Xilinx_pgm_fn	pgm;
55875c7893SWolfgang Denk 	Xilinx_clk_fn	clk;
56875c7893SWolfgang Denk 	Xilinx_init_fn	init;
57875c7893SWolfgang Denk 	Xilinx_done_fn	done;
58875c7893SWolfgang Denk 	Xilinx_wr_fn	wr;
5921d39d59SMatthias Fuchs 	Xilinx_post_fn	post;
6089083346SWolfgang Wegner 	Xilinx_bwr_fn	bwr; /* block write function */
61b0bc8b70SWolfgang Wegner 	Xilinx_abort_fn abort;
62875c7893SWolfgang Denk } Xilinx_Spartan3_Slave_Serial_fns;
63875c7893SWolfgang Denk 
64875c7893SWolfgang Denk /* Device Image Sizes
65875c7893SWolfgang Denk  *********************************************************************/
66875c7893SWolfgang Denk /* Spartan-III (1.2V) */
67875c7893SWolfgang Denk #define XILINX_XC3S50_SIZE	439264/8
68875c7893SWolfgang Denk #define XILINX_XC3S200_SIZE	1047616/8
69875c7893SWolfgang Denk #define XILINX_XC3S400_SIZE	1699136/8
70875c7893SWolfgang Denk #define XILINX_XC3S1000_SIZE	3223488/8
71875c7893SWolfgang Denk #define XILINX_XC3S1500_SIZE	5214784/8
72875c7893SWolfgang Denk #define XILINX_XC3S2000_SIZE	7673024/8
73875c7893SWolfgang Denk #define XILINX_XC3S4000_SIZE	11316864/8
74875c7893SWolfgang Denk #define XILINX_XC3S5000_SIZE	13271936/8
75875c7893SWolfgang Denk 
76923efd28SBruce Adler /* Spartan-3E (v3.4) */
77923efd28SBruce Adler #define	XILINX_XC3S100E_SIZE	581344/8
78923efd28SBruce Adler #define	XILINX_XC3S250E_SIZE	1353728/8
79923efd28SBruce Adler #define	XILINX_XC3S500E_SIZE	2270208/8
80923efd28SBruce Adler #define	XILINX_XC3S1200E_SIZE	3841184/8
81923efd28SBruce Adler #define	XILINX_XC3S1600E_SIZE	5969696/8
82923efd28SBruce Adler 
83*28cdc1c8SStefano Babic /*
84*28cdc1c8SStefano Babic  * Spartan-6 : the Spartan-6 family can be programmed
85*28cdc1c8SStefano Babic  * exactly as the Spartan-3
86*28cdc1c8SStefano Babic  */
87*28cdc1c8SStefano Babic #define XILINK_XC6SLX4_SIZE	(3713568/8)
88*28cdc1c8SStefano Babic 
89875c7893SWolfgang Denk /* Descriptor Macros
90875c7893SWolfgang Denk  *********************************************************************/
913bff4ffaSMatthias Fuchs /* Spartan-III devices */
92875c7893SWolfgang Denk #define XILINX_XC3S50_DESC(iface, fn_table, cookie) \
93875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S50_SIZE, fn_table, cookie }
94875c7893SWolfgang Denk 
95875c7893SWolfgang Denk #define XILINX_XC3S200_DESC(iface, fn_table, cookie) \
96875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S200_SIZE, fn_table, cookie }
97875c7893SWolfgang Denk 
98875c7893SWolfgang Denk #define XILINX_XC3S400_DESC(iface, fn_table, cookie) \
99875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S400_SIZE, fn_table, cookie }
100875c7893SWolfgang Denk 
101875c7893SWolfgang Denk #define XILINX_XC3S1000_DESC(iface, fn_table, cookie) \
102875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S1000_SIZE, fn_table, cookie }
103875c7893SWolfgang Denk 
104875c7893SWolfgang Denk #define XILINX_XC3S1500_DESC(iface, fn_table, cookie) \
105875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S1500_SIZE, fn_table, cookie }
106875c7893SWolfgang Denk 
107875c7893SWolfgang Denk #define XILINX_XC3S2000_DESC(iface, fn_table, cookie) \
108a07faf7bSLaurent Pinchart { Xilinx_Spartan3, iface, XILINX_XC3S2000_SIZE, fn_table, cookie }
109875c7893SWolfgang Denk 
110875c7893SWolfgang Denk #define XILINX_XC3S4000_DESC(iface, fn_table, cookie) \
111a07faf7bSLaurent Pinchart { Xilinx_Spartan3, iface, XILINX_XC3S4000_SIZE, fn_table, cookie }
112875c7893SWolfgang Denk 
113875c7893SWolfgang Denk #define XILINX_XC3S5000_DESC(iface, fn_table, cookie) \
114a07faf7bSLaurent Pinchart { Xilinx_Spartan3, iface, XILINX_XC3S5000_SIZE, fn_table, cookie }
115875c7893SWolfgang Denk 
116923efd28SBruce Adler /* Spartan-3E devices */
117923efd28SBruce Adler #define XILINX_XC3S100E_DESC(iface, fn_table, cookie) \
118923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S100E_SIZE, fn_table, cookie }
119923efd28SBruce Adler 
120923efd28SBruce Adler #define XILINX_XC3S250E_DESC(iface, fn_table, cookie) \
121923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S250E_SIZE, fn_table, cookie }
122923efd28SBruce Adler 
123923efd28SBruce Adler #define XILINX_XC3S500E_DESC(iface, fn_table, cookie) \
124923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S500E_SIZE, fn_table, cookie }
125923efd28SBruce Adler 
126923efd28SBruce Adler #define XILINX_XC3S1200E_DESC(iface, fn_table, cookie) \
127923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S1200E_SIZE, fn_table, cookie }
128923efd28SBruce Adler 
129923efd28SBruce Adler #define XILINX_XC3S1600E_DESC(iface, fn_table, cookie) \
130923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S1600E_SIZE, fn_table, cookie }
131923efd28SBruce Adler 
132*28cdc1c8SStefano Babic #define XILINX_XC6SLX4_DESC(iface, fn_table, cookie) \
133*28cdc1c8SStefano Babic { Xilinx_Spartan3, iface, XILINK_XC6SLX4_SIZE, fn_table, cookie }
134*28cdc1c8SStefano Babic 
135875c7893SWolfgang Denk #endif /* _SPARTAN3_H_ */
136