blob: 9a64771c6051ca59ed377e685693cc86c7357c8b [file] [log] [blame]
wdenkc6097192002-11-03 00:24:07 +00001/*
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
wdenkc6097192002-11-03 00:24:07 +000030/* Xilinx types
31 *********************************************************************/
Wolfgang Denka1be4762008-05-20 16:00:29 +020032typedef 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) */
Michal Simek15d654c2013-04-22 15:43:02 +020040 devcfg, /* devcfg interface (zynq) */
Wolfgang Denka1be4762008-05-20 16:00:29 +020041 max_xilinx_iface_type /* insert all new types before this */
42} Xilinx_iface; /* end, typedef Xilinx_iface */
wdenkc6097192002-11-03 00:24:07 +000043
Wolfgang Denka1be4762008-05-20 16:00:29 +020044typedef 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 */
Michal Simek15d654c2013-04-22 15:43:02 +020050 xilinx_zynq, /* Zynq Family */
Wolfgang Denka1be4762008-05-20 16:00:29 +020051 max_xilinx_type /* insert all new types before this */
52} Xilinx_Family; /* end, typedef Xilinx_Family */
wdenkc6097192002-11-03 00:24:07 +000053
Wolfgang Denka1be4762008-05-20 16:00:29 +020054typedef 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 */
Michal Simek6ff890d2013-04-26 15:04:48 +020060 char *name; /* device name in bitstream */
Wolfgang Denka1be4762008-05-20 16:00:29 +020061} Xilinx_desc; /* end, typedef Xilinx_desc */
wdenkc6097192002-11-03 00:24:07 +000062
63/* Generic Xilinx Functions
64 *********************************************************************/
Wolfgang Denk74f9b382011-07-30 13:33:49 +000065extern 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);
wdenkc6097192002-11-03 00:24:07 +000068
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 );
Wolfgang Wegnerd37e5552009-10-30 16:55:02 +010084typedef int (*Xilinx_bwr_fn)( void *buf, size_t len, int flush, int cookie );
wdenkc6097192002-11-03 00:24:07 +000085
86#endif /* _XILINX_H_ */