xref: /rk3399_rockchip-uboot/include/spartan3.h (revision a07faf7b9ad5a86763a577c79922c4ff9a70ef23)
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 
30875c7893SWolfgang Denk extern int Spartan3_load( Xilinx_desc *desc, void *image, size_t size );
31875c7893SWolfgang Denk extern int Spartan3_dump( Xilinx_desc *desc, void *buf, size_t bsize );
32875c7893SWolfgang Denk extern int Spartan3_info( Xilinx_desc *desc );
33875c7893SWolfgang Denk extern int Spartan3_reloc( Xilinx_desc *desc, ulong reloc_off );
34875c7893SWolfgang Denk 
35875c7893SWolfgang Denk /* Slave Parallel Implementation function table */
36875c7893SWolfgang Denk typedef struct {
37875c7893SWolfgang Denk 	Xilinx_pre_fn	pre;
38875c7893SWolfgang Denk 	Xilinx_pgm_fn	pgm;
39875c7893SWolfgang Denk 	Xilinx_init_fn	init;
40875c7893SWolfgang Denk 	Xilinx_err_fn	err;
41875c7893SWolfgang Denk 	Xilinx_done_fn	done;
42875c7893SWolfgang Denk 	Xilinx_clk_fn	clk;
43875c7893SWolfgang Denk 	Xilinx_cs_fn	cs;
44875c7893SWolfgang Denk 	Xilinx_wr_fn	wr;
45875c7893SWolfgang Denk 	Xilinx_rdata_fn	rdata;
46875c7893SWolfgang Denk 	Xilinx_wdata_fn	wdata;
47875c7893SWolfgang Denk 	Xilinx_busy_fn	busy;
48875c7893SWolfgang Denk 	Xilinx_abort_fn	abort;
49875c7893SWolfgang Denk 	Xilinx_post_fn	post;
50875c7893SWolfgang Denk 	int		relocated;
51875c7893SWolfgang Denk } Xilinx_Spartan3_Slave_Parallel_fns;
52875c7893SWolfgang Denk 
53875c7893SWolfgang Denk /* Slave Serial Implementation function table */
54875c7893SWolfgang Denk typedef struct {
55875c7893SWolfgang Denk 	Xilinx_pre_fn	pre;
56875c7893SWolfgang Denk 	Xilinx_pgm_fn	pgm;
57875c7893SWolfgang Denk 	Xilinx_clk_fn	clk;
58875c7893SWolfgang Denk 	Xilinx_init_fn	init;
59875c7893SWolfgang Denk 	Xilinx_done_fn	done;
60875c7893SWolfgang Denk 	Xilinx_wr_fn	wr;
6121d39d59SMatthias Fuchs 	Xilinx_post_fn	post;
62875c7893SWolfgang Denk 	int		relocated;
63875c7893SWolfgang Denk } Xilinx_Spartan3_Slave_Serial_fns;
64875c7893SWolfgang Denk 
65875c7893SWolfgang Denk /* Device Image Sizes
66875c7893SWolfgang Denk  *********************************************************************/
67875c7893SWolfgang Denk /* Spartan-III (1.2V) */
68875c7893SWolfgang Denk #define XILINX_XC3S50_SIZE	439264/8
69875c7893SWolfgang Denk #define XILINX_XC3S200_SIZE	1047616/8
70875c7893SWolfgang Denk #define XILINX_XC3S400_SIZE	1699136/8
71875c7893SWolfgang Denk #define XILINX_XC3S1000_SIZE	3223488/8
72875c7893SWolfgang Denk #define XILINX_XC3S1500_SIZE	5214784/8
73875c7893SWolfgang Denk #define XILINX_XC3S2000_SIZE	7673024/8
74875c7893SWolfgang Denk #define XILINX_XC3S4000_SIZE	11316864/8
75875c7893SWolfgang Denk #define XILINX_XC3S5000_SIZE	13271936/8
76875c7893SWolfgang Denk 
77923efd28SBruce Adler /* Spartan-3E (v3.4) */
78923efd28SBruce Adler #define	XILINX_XC3S100E_SIZE	581344/8
79923efd28SBruce Adler #define	XILINX_XC3S250E_SIZE	1353728/8
80923efd28SBruce Adler #define	XILINX_XC3S500E_SIZE	2270208/8
81923efd28SBruce Adler #define	XILINX_XC3S1200E_SIZE	3841184/8
82923efd28SBruce Adler #define	XILINX_XC3S1600E_SIZE	5969696/8
83923efd28SBruce Adler 
84875c7893SWolfgang Denk /* Descriptor Macros
85875c7893SWolfgang Denk  *********************************************************************/
863bff4ffaSMatthias Fuchs /* Spartan-III devices */
87875c7893SWolfgang Denk #define XILINX_XC3S50_DESC(iface, fn_table, cookie) \
88875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S50_SIZE, fn_table, cookie }
89875c7893SWolfgang Denk 
90875c7893SWolfgang Denk #define XILINX_XC3S200_DESC(iface, fn_table, cookie) \
91875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S200_SIZE, fn_table, cookie }
92875c7893SWolfgang Denk 
93875c7893SWolfgang Denk #define XILINX_XC3S400_DESC(iface, fn_table, cookie) \
94875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S400_SIZE, fn_table, cookie }
95875c7893SWolfgang Denk 
96875c7893SWolfgang Denk #define XILINX_XC3S1000_DESC(iface, fn_table, cookie) \
97875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S1000_SIZE, fn_table, cookie }
98875c7893SWolfgang Denk 
99875c7893SWolfgang Denk #define XILINX_XC3S1500_DESC(iface, fn_table, cookie) \
100875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S1500_SIZE, fn_table, cookie }
101875c7893SWolfgang Denk 
102875c7893SWolfgang Denk #define XILINX_XC3S2000_DESC(iface, fn_table, cookie) \
103*a07faf7bSLaurent Pinchart { Xilinx_Spartan3, iface, XILINX_XC3S2000_SIZE, fn_table, cookie }
104875c7893SWolfgang Denk 
105875c7893SWolfgang Denk #define XILINX_XC3S4000_DESC(iface, fn_table, cookie) \
106*a07faf7bSLaurent Pinchart { Xilinx_Spartan3, iface, XILINX_XC3S4000_SIZE, fn_table, cookie }
107875c7893SWolfgang Denk 
108875c7893SWolfgang Denk #define XILINX_XC3S5000_DESC(iface, fn_table, cookie) \
109*a07faf7bSLaurent Pinchart { Xilinx_Spartan3, iface, XILINX_XC3S5000_SIZE, fn_table, cookie }
110875c7893SWolfgang Denk 
111923efd28SBruce Adler /* Spartan-3E devices */
112923efd28SBruce Adler #define XILINX_XC3S100E_DESC(iface, fn_table, cookie) \
113923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S100E_SIZE, fn_table, cookie }
114923efd28SBruce Adler 
115923efd28SBruce Adler #define XILINX_XC3S250E_DESC(iface, fn_table, cookie) \
116923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S250E_SIZE, fn_table, cookie }
117923efd28SBruce Adler 
118923efd28SBruce Adler #define XILINX_XC3S500E_DESC(iface, fn_table, cookie) \
119923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S500E_SIZE, fn_table, cookie }
120923efd28SBruce Adler 
121923efd28SBruce Adler #define XILINX_XC3S1200E_DESC(iface, fn_table, cookie) \
122923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S1200E_SIZE, fn_table, cookie }
123923efd28SBruce Adler 
124923efd28SBruce Adler #define XILINX_XC3S1600E_DESC(iface, fn_table, cookie) \
125923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S1600E_SIZE, fn_table, cookie }
126923efd28SBruce Adler 
127875c7893SWolfgang Denk #endif /* _SPARTAN3_H_ */
128