]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/xilinx.h
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[people/ms/u-boot.git] / include / xilinx.h
CommitLineData
c609719b
WD
1/*
2 * (C) Copyright 2002
3 * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 *
23 */
24
25#include <fpga.h>
26
27#ifndef _XILINX_H_
28#define _XILINX_H_
29
c609719b
WD
30/* Xilinx types
31 *********************************************************************/
53677ef1
WD
32typedef enum { /* typedef Xilinx_iface */
33 min_xilinx_iface_type, /* low range check value */
34 slave_serial, /* serial data and external clock */
35 master_serial, /* serial data w/ internal clock (not used) */
36 slave_parallel, /* parallel data w/ external latch */
37 jtag_mode, /* jtag/tap serial (not used ) */
38 master_selectmap, /* master SelectMap (virtex2) */
39 slave_selectmap, /* slave SelectMap (virtex2) */
d5dae85f 40 devcfg, /* devcfg interface (zynq) */
53677ef1
WD
41 max_xilinx_iface_type /* insert all new types before this */
42} Xilinx_iface; /* end, typedef Xilinx_iface */
c609719b 43
53677ef1
WD
44typedef enum { /* typedef Xilinx_Family */
45 min_xilinx_type, /* low range check value */
46 Xilinx_Spartan2, /* Spartan-II Family */
47 Xilinx_VirtexE, /* Virtex-E Family */
48 Xilinx_Virtex2, /* Virtex2 Family */
49 Xilinx_Spartan3, /* Spartan-III Family */
d5dae85f 50 xilinx_zynq, /* Zynq Family */
53677ef1
WD
51 max_xilinx_type /* insert all new types before this */
52} Xilinx_Family; /* end, typedef Xilinx_Family */
c609719b 53
53677ef1
WD
54typedef struct { /* typedef Xilinx_desc */
55 Xilinx_Family family; /* part type */
56 Xilinx_iface iface; /* interface type */
57 size_t size; /* bytes of data part can accept */
58 void *iface_fns; /* interface function table */
59 int cookie; /* implementation specific cookie */
6631db47 60 char *name; /* device name in bitstream */
53677ef1 61} Xilinx_desc; /* end, typedef Xilinx_desc */
c609719b
WD
62
63/* Generic Xilinx Functions
64 *********************************************************************/
e6a857da
WD
65extern int xilinx_load(Xilinx_desc *desc, const void *image, size_t size);
66extern int xilinx_dump(Xilinx_desc *desc, const void *buf, size_t bsize);
67extern int xilinx_info(Xilinx_desc *desc);
c609719b
WD
68
69/* Board specific implementation specific function types
70 *********************************************************************/
71typedef int (*Xilinx_pgm_fn)( int assert_pgm, int flush, int cookie );
72typedef int (*Xilinx_init_fn)( int cookie );
73typedef int (*Xilinx_err_fn)( int cookie );
74typedef int (*Xilinx_done_fn)( int cookie );
75typedef int (*Xilinx_clk_fn)( int assert_clk, int flush, int cookie );
76typedef int (*Xilinx_cs_fn)( int assert_cs, int flush, int cookie );
77typedef int (*Xilinx_wr_fn)( int assert_write, int flush, int cookie );
78typedef int (*Xilinx_rdata_fn)( unsigned char *data, int cookie );
79typedef int (*Xilinx_wdata_fn)( unsigned char data, int flush, int cookie );
80typedef int (*Xilinx_busy_fn)( int cookie );
81typedef int (*Xilinx_abort_fn)( int cookie );
82typedef int (*Xilinx_pre_fn)( int cookie );
83typedef int (*Xilinx_post_fn)( int cookie );
89083346 84typedef int (*Xilinx_bwr_fn)( void *buf, size_t len, int flush, int cookie );
c609719b
WD
85
86#endif /* _XILINX_H_ */