xref: /rk3399_rockchip-uboot/include/spartan3.h (revision 875c78934ee252744be1e5b2a9ad7ec5df239239)
1*875c7893SWolfgang Denk /*
2*875c7893SWolfgang Denk  * (C) Copyright 2002
3*875c7893SWolfgang Denk  * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
4*875c7893SWolfgang Denk  *
5*875c7893SWolfgang Denk  * See file CREDITS for list of people who contributed to this
6*875c7893SWolfgang Denk  * project.
7*875c7893SWolfgang Denk  *
8*875c7893SWolfgang Denk  * This program is free software; you can redistribute it and/or
9*875c7893SWolfgang Denk  * modify it under the terms of the GNU General Public License as
10*875c7893SWolfgang Denk  * published by the Free Software Foundation; either version 2 of
11*875c7893SWolfgang Denk  * the License, or (at your option) any later version.
12*875c7893SWolfgang Denk  *
13*875c7893SWolfgang Denk  * This program is distributed in the hope that it will be useful,
14*875c7893SWolfgang Denk  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15*875c7893SWolfgang Denk  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16*875c7893SWolfgang Denk  * GNU General Public License for more details.
17*875c7893SWolfgang Denk  *
18*875c7893SWolfgang Denk  * You should have received a copy of the GNU General Public License
19*875c7893SWolfgang Denk  * along with this program; if not, write to the Free Software
20*875c7893SWolfgang Denk  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21*875c7893SWolfgang Denk  * MA 02111-1307 USA
22*875c7893SWolfgang Denk  *
23*875c7893SWolfgang Denk  */
24*875c7893SWolfgang Denk 
25*875c7893SWolfgang Denk #ifndef _SPARTAN3_H_
26*875c7893SWolfgang Denk #define _SPARTAN3_H_
27*875c7893SWolfgang Denk 
28*875c7893SWolfgang Denk #include <xilinx.h>
29*875c7893SWolfgang Denk 
30*875c7893SWolfgang Denk extern int Spartan3_load( Xilinx_desc *desc, void *image, size_t size );
31*875c7893SWolfgang Denk extern int Spartan3_dump( Xilinx_desc *desc, void *buf, size_t bsize );
32*875c7893SWolfgang Denk extern int Spartan3_info( Xilinx_desc *desc );
33*875c7893SWolfgang Denk extern int Spartan3_reloc( Xilinx_desc *desc, ulong reloc_off );
34*875c7893SWolfgang Denk 
35*875c7893SWolfgang Denk /* Slave Parallel Implementation function table */
36*875c7893SWolfgang Denk typedef struct {
37*875c7893SWolfgang Denk 	Xilinx_pre_fn	pre;
38*875c7893SWolfgang Denk 	Xilinx_pgm_fn	pgm;
39*875c7893SWolfgang Denk 	Xilinx_init_fn	init;
40*875c7893SWolfgang Denk 	Xilinx_err_fn	err;
41*875c7893SWolfgang Denk 	Xilinx_done_fn	done;
42*875c7893SWolfgang Denk 	Xilinx_clk_fn	clk;
43*875c7893SWolfgang Denk 	Xilinx_cs_fn	cs;
44*875c7893SWolfgang Denk 	Xilinx_wr_fn	wr;
45*875c7893SWolfgang Denk 	Xilinx_rdata_fn	rdata;
46*875c7893SWolfgang Denk 	Xilinx_wdata_fn	wdata;
47*875c7893SWolfgang Denk 	Xilinx_busy_fn	busy;
48*875c7893SWolfgang Denk 	Xilinx_abort_fn	abort;
49*875c7893SWolfgang Denk 	Xilinx_post_fn	post;
50*875c7893SWolfgang Denk 	int           	relocated;
51*875c7893SWolfgang Denk } Xilinx_Spartan3_Slave_Parallel_fns;
52*875c7893SWolfgang Denk 
53*875c7893SWolfgang Denk /* Slave Serial Implementation function table */
54*875c7893SWolfgang Denk typedef struct {
55*875c7893SWolfgang Denk 	Xilinx_pre_fn	pre;
56*875c7893SWolfgang Denk 	Xilinx_pgm_fn	pgm;
57*875c7893SWolfgang Denk 	Xilinx_clk_fn	clk;
58*875c7893SWolfgang Denk 	Xilinx_init_fn	init;
59*875c7893SWolfgang Denk 	Xilinx_done_fn	done;
60*875c7893SWolfgang Denk 	Xilinx_wr_fn	wr;
61*875c7893SWolfgang Denk 	int           	relocated;
62*875c7893SWolfgang Denk } Xilinx_Spartan3_Slave_Serial_fns;
63*875c7893SWolfgang Denk 
64*875c7893SWolfgang Denk /* Device Image Sizes
65*875c7893SWolfgang Denk  *********************************************************************/
66*875c7893SWolfgang Denk /* Spartan-III (1.2V) */
67*875c7893SWolfgang Denk #define XILINX_XC3S50_SIZE  	439264/8
68*875c7893SWolfgang Denk #define XILINX_XC3S200_SIZE  	1047616/8
69*875c7893SWolfgang Denk #define XILINX_XC3S400_SIZE  	1699136/8
70*875c7893SWolfgang Denk #define XILINX_XC3S1000_SIZE 	3223488/8
71*875c7893SWolfgang Denk #define XILINX_XC3S1500_SIZE 	5214784/8
72*875c7893SWolfgang Denk #define XILINX_XC3S2000_SIZE 	7673024/8
73*875c7893SWolfgang Denk #define XILINX_XC3S4000_SIZE 	11316864/8
74*875c7893SWolfgang Denk #define XILINX_XC3S5000_SIZE 	13271936/8
75*875c7893SWolfgang Denk 
76*875c7893SWolfgang Denk /* Descriptor Macros
77*875c7893SWolfgang Denk  *********************************************************************/
78*875c7893SWolfgang Denk /* Spartan-II devices */
79*875c7893SWolfgang Denk #define XILINX_XC3S50_DESC(iface, fn_table, cookie) \
80*875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S50_SIZE, fn_table, cookie }
81*875c7893SWolfgang Denk 
82*875c7893SWolfgang Denk #define XILINX_XC3S200_DESC(iface, fn_table, cookie) \
83*875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S200_SIZE, fn_table, cookie }
84*875c7893SWolfgang Denk 
85*875c7893SWolfgang Denk #define XILINX_XC3S400_DESC(iface, fn_table, cookie) \
86*875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S400_SIZE, fn_table, cookie }
87*875c7893SWolfgang Denk 
88*875c7893SWolfgang Denk #define XILINX_XC3S1000_DESC(iface, fn_table, cookie) \
89*875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S1000_SIZE, fn_table, cookie }
90*875c7893SWolfgang Denk 
91*875c7893SWolfgang Denk #define XILINX_XC3S1500_DESC(iface, fn_table, cookie) \
92*875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S1500_SIZE, fn_table, cookie }
93*875c7893SWolfgang Denk 
94*875c7893SWolfgang Denk #define XILINX_XC3S2000_DESC(iface, fn_table, cookie) \
95*875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S2000E_SIZE, fn_table, cookie }
96*875c7893SWolfgang Denk 
97*875c7893SWolfgang Denk #define XILINX_XC3S4000_DESC(iface, fn_table, cookie) \
98*875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S4000E_SIZE, fn_table, cookie }
99*875c7893SWolfgang Denk 
100*875c7893SWolfgang Denk #define XILINX_XC3S5000_DESC(iface, fn_table, cookie) \
101*875c7893SWolfgang Denk { Xilinx_Spartan3, iface, XILINX_XC3S5000E_SIZE, fn_table, cookie }
102*875c7893SWolfgang Denk 
103*875c7893SWolfgang Denk #endif /* _SPARTAN3_H_ */
104