xref: /rk3399_rockchip-uboot/include/spartan3.h (revision 89083346d0627a5e6e271e61bd34ab5121f9462b)
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 
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;
60*89083346SWolfgang Wegner 	Xilinx_bwr_fn	bwr; /* block write function */
61875c7893SWolfgang Denk } Xilinx_Spartan3_Slave_Serial_fns;
62875c7893SWolfgang Denk 
63875c7893SWolfgang Denk /* Device Image Sizes
64875c7893SWolfgang Denk  *********************************************************************/
65875c7893SWolfgang Denk /* Spartan-III (1.2V) */
66875c7893SWolfgang Denk #define XILINX_XC3S50_SIZE	439264/8
67875c7893SWolfgang Denk #define XILINX_XC3S200_SIZE	1047616/8
68875c7893SWolfgang Denk #define XILINX_XC3S400_SIZE	1699136/8
69875c7893SWolfgang Denk #define XILINX_XC3S1000_SIZE	3223488/8
70875c7893SWolfgang Denk #define XILINX_XC3S1500_SIZE	5214784/8
71875c7893SWolfgang Denk #define XILINX_XC3S2000_SIZE	7673024/8
72875c7893SWolfgang Denk #define XILINX_XC3S4000_SIZE	11316864/8
73875c7893SWolfgang Denk #define XILINX_XC3S5000_SIZE	13271936/8
74875c7893SWolfgang Denk 
75923efd28SBruce Adler /* Spartan-3E (v3.4) */
76923efd28SBruce Adler #define	XILINX_XC3S100E_SIZE	581344/8
77923efd28SBruce Adler #define	XILINX_XC3S250E_SIZE	1353728/8
78923efd28SBruce Adler #define	XILINX_XC3S500E_SIZE	2270208/8
79923efd28SBruce Adler #define	XILINX_XC3S1200E_SIZE	3841184/8
80923efd28SBruce Adler #define	XILINX_XC3S1600E_SIZE	5969696/8
81923efd28SBruce Adler 
82875c7893SWolfgang Denk /* Descriptor Macros
83875c7893SWolfgang Denk  *********************************************************************/
843bff4ffaSMatthias Fuchs /* Spartan-III devices */
85875c7893SWolfgang Denk #define XILINX_XC3S50_DESC(iface, fn_table, cookie) \
86875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S50_SIZE, fn_table, cookie }
87875c7893SWolfgang Denk 
88875c7893SWolfgang Denk #define XILINX_XC3S200_DESC(iface, fn_table, cookie) \
89875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S200_SIZE, fn_table, cookie }
90875c7893SWolfgang Denk 
91875c7893SWolfgang Denk #define XILINX_XC3S400_DESC(iface, fn_table, cookie) \
92875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S400_SIZE, fn_table, cookie }
93875c7893SWolfgang Denk 
94875c7893SWolfgang Denk #define XILINX_XC3S1000_DESC(iface, fn_table, cookie) \
95875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S1000_SIZE, fn_table, cookie }
96875c7893SWolfgang Denk 
97875c7893SWolfgang Denk #define XILINX_XC3S1500_DESC(iface, fn_table, cookie) \
98875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S1500_SIZE, fn_table, cookie }
99875c7893SWolfgang Denk 
100875c7893SWolfgang Denk #define XILINX_XC3S2000_DESC(iface, fn_table, cookie) \
101a07faf7bSLaurent Pinchart { Xilinx_Spartan3, iface, XILINX_XC3S2000_SIZE, fn_table, cookie }
102875c7893SWolfgang Denk 
103875c7893SWolfgang Denk #define XILINX_XC3S4000_DESC(iface, fn_table, cookie) \
104a07faf7bSLaurent Pinchart { Xilinx_Spartan3, iface, XILINX_XC3S4000_SIZE, fn_table, cookie }
105875c7893SWolfgang Denk 
106875c7893SWolfgang Denk #define XILINX_XC3S5000_DESC(iface, fn_table, cookie) \
107a07faf7bSLaurent Pinchart { Xilinx_Spartan3, iface, XILINX_XC3S5000_SIZE, fn_table, cookie }
108875c7893SWolfgang Denk 
109923efd28SBruce Adler /* Spartan-3E devices */
110923efd28SBruce Adler #define XILINX_XC3S100E_DESC(iface, fn_table, cookie) \
111923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S100E_SIZE, fn_table, cookie }
112923efd28SBruce Adler 
113923efd28SBruce Adler #define XILINX_XC3S250E_DESC(iface, fn_table, cookie) \
114923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S250E_SIZE, fn_table, cookie }
115923efd28SBruce Adler 
116923efd28SBruce Adler #define XILINX_XC3S500E_DESC(iface, fn_table, cookie) \
117923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S500E_SIZE, fn_table, cookie }
118923efd28SBruce Adler 
119923efd28SBruce Adler #define XILINX_XC3S1200E_DESC(iface, fn_table, cookie) \
120923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S1200E_SIZE, fn_table, cookie }
121923efd28SBruce Adler 
122923efd28SBruce Adler #define XILINX_XC3S1600E_DESC(iface, fn_table, cookie) \
123923efd28SBruce Adler { Xilinx_Spartan3, iface, XILINX_XC3S1600E_SIZE, fn_table, cookie }
124923efd28SBruce Adler 
125875c7893SWolfgang Denk #endif /* _SPARTAN3_H_ */
126