xref: /rk3399_rockchip-uboot/include/spartan3.h (revision 923efd286411ed052d9e074f59f8986d6081061c)
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;
61875c7893SWolfgang Denk 	int           	relocated;
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 
76*923efd28SBruce Adler /* Spartan-3E (v3.4) */
77*923efd28SBruce Adler #define	XILINX_XC3S100E_SIZE	581344/8
78*923efd28SBruce Adler #define	XILINX_XC3S250E_SIZE	1353728/8
79*923efd28SBruce Adler #define	XILINX_XC3S500E_SIZE	2270208/8
80*923efd28SBruce Adler #define	XILINX_XC3S1200E_SIZE	3841184/8
81*923efd28SBruce Adler #define	XILINX_XC3S1600E_SIZE	5969696/8
82*923efd28SBruce Adler 
83875c7893SWolfgang Denk /* Descriptor Macros
84875c7893SWolfgang Denk  *********************************************************************/
85875c7893SWolfgang Denk /* Spartan-II devices */
86875c7893SWolfgang Denk #define XILINX_XC3S50_DESC(iface, fn_table, cookie) \
87875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S50_SIZE, fn_table, cookie }
88875c7893SWolfgang Denk 
89875c7893SWolfgang Denk #define XILINX_XC3S200_DESC(iface, fn_table, cookie) \
90875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S200_SIZE, fn_table, cookie }
91875c7893SWolfgang Denk 
92875c7893SWolfgang Denk #define XILINX_XC3S400_DESC(iface, fn_table, cookie) \
93875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S400_SIZE, fn_table, cookie }
94875c7893SWolfgang Denk 
95875c7893SWolfgang Denk #define XILINX_XC3S1000_DESC(iface, fn_table, cookie) \
96875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S1000_SIZE, fn_table, cookie }
97875c7893SWolfgang Denk 
98875c7893SWolfgang Denk #define XILINX_XC3S1500_DESC(iface, fn_table, cookie) \
99875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S1500_SIZE, fn_table, cookie }
100875c7893SWolfgang Denk 
101875c7893SWolfgang Denk #define XILINX_XC3S2000_DESC(iface, fn_table, cookie) \
102875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S2000E_SIZE, fn_table, cookie }
103875c7893SWolfgang Denk 
104875c7893SWolfgang Denk #define XILINX_XC3S4000_DESC(iface, fn_table, cookie) \
105875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S4000E_SIZE, fn_table, cookie }
106875c7893SWolfgang Denk 
107875c7893SWolfgang Denk #define XILINX_XC3S5000_DESC(iface, fn_table, cookie) \
108875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S5000E_SIZE, fn_table, cookie }
109875c7893SWolfgang Denk 
110*923efd28SBruce Adler 
111*923efd28SBruce Adler /* Spartan-3E devices */
112*923efd28SBruce Adler #define XILINX_XC3S100E_DESC(iface, fn_table, cookie) \
113*923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S100E_SIZE, fn_table, cookie }
114*923efd28SBruce Adler 
115*923efd28SBruce Adler #define XILINX_XC3S250E_DESC(iface, fn_table, cookie) \
116*923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S250E_SIZE, fn_table, cookie }
117*923efd28SBruce Adler 
118*923efd28SBruce Adler #define XILINX_XC3S500E_DESC(iface, fn_table, cookie) \
119*923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S500E_SIZE, fn_table, cookie }
120*923efd28SBruce Adler 
121*923efd28SBruce Adler #define XILINX_XC3S1200E_DESC(iface, fn_table, cookie) \
122*923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S1200E_SIZE, fn_table, cookie }
123*923efd28SBruce Adler 
124*923efd28SBruce Adler #define XILINX_XC3S1600E_DESC(iface, fn_table, cookie) \
125*923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S1600E_SIZE, fn_table, cookie }
126*923efd28SBruce Adler 
127875c7893SWolfgang Denk #endif /* _SPARTAN3_H_ */
128