1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#include <fpga.h>
26
27#ifndef _XILINX_H_
28#define _XILINX_H_
29
30
31
32#define CONFIG_SYS_SPARTAN2 CONFIG_SYS_FPGA_DEV( 0x1 )
33#define CONFIG_SYS_VIRTEX_E CONFIG_SYS_FPGA_DEV( 0x2 )
34#define CONFIG_SYS_VIRTEX2 CONFIG_SYS_FPGA_DEV( 0x4 )
35#define CONFIG_SYS_SPARTAN3 CONFIG_SYS_FPGA_DEV( 0x8 )
36#define CONFIG_SYS_XILINX_SPARTAN2 (CONFIG_SYS_FPGA_XILINX | CONFIG_SYS_SPARTAN2)
37#define CONFIG_SYS_XILINX_VIRTEX_E (CONFIG_SYS_FPGA_XILINX | CONFIG_SYS_VIRTEX_E)
38#define CONFIG_SYS_XILINX_VIRTEX2 (CONFIG_SYS_FPGA_XILINX | CONFIG_SYS_VIRTEX2)
39#define CONFIG_SYS_XILINX_SPARTAN3 (CONFIG_SYS_FPGA_XILINX | CONFIG_SYS_SPARTAN3)
40
41
42
43
44
45#define CONFIG_SYS_XILINX_IF_SS CONFIG_SYS_FPGA_IF( 0x1 )
46#define CONFIG_SYS_XILINX_IF_MS CONFIG_SYS_FPGA_IF( 0x2 )
47#define CONFIG_SYS_XILINX_IF_SP CONFIG_SYS_FPGA_IF( 0x4 )
48#define CONFIG_SYS_XILINX_IF_JTAG CONFIG_SYS_FPGA_IF( 0x8 )
49#define CONFIG_SYS_XILINX_IF_MSM CONFIG_SYS_FPGA_IF( 0x10 )
50#define CONFIG_SYS_XILINX_IF_SSM CONFIG_SYS_FPGA_IF( 0x20 )
51
52
53
54typedef enum {
55 min_xilinx_iface_type,
56 slave_serial,
57 master_serial,
58 slave_parallel,
59 jtag_mode,
60 master_selectmap,
61 slave_selectmap,
62 max_xilinx_iface_type
63} Xilinx_iface;
64
65typedef enum {
66 min_xilinx_type,
67 Xilinx_Spartan2,
68 Xilinx_VirtexE,
69 Xilinx_Virtex2,
70 Xilinx_Spartan3,
71 max_xilinx_type
72} Xilinx_Family;
73
74typedef struct {
75 Xilinx_Family family;
76 Xilinx_iface iface;
77 size_t size;
78 void *iface_fns;
79 int cookie;
80} Xilinx_desc;
81
82
83
84extern int xilinx_load( Xilinx_desc *desc, void *image, size_t size );
85extern int xilinx_dump( Xilinx_desc *desc, void *buf, size_t bsize );
86extern int xilinx_info( Xilinx_desc *desc );
87
88
89
90typedef int (*Xilinx_pgm_fn)( int assert_pgm, int flush, int cookie );
91typedef int (*Xilinx_init_fn)( int cookie );
92typedef int (*Xilinx_err_fn)( int cookie );
93typedef int (*Xilinx_done_fn)( int cookie );
94typedef int (*Xilinx_clk_fn)( int assert_clk, int flush, int cookie );
95typedef int (*Xilinx_cs_fn)( int assert_cs, int flush, int cookie );
96typedef int (*Xilinx_wr_fn)( int assert_write, int flush, int cookie );
97typedef int (*Xilinx_rdata_fn)( unsigned char *data, int cookie );
98typedef int (*Xilinx_wdata_fn)( unsigned char data, int flush, int cookie );
99typedef int (*Xilinx_busy_fn)( int cookie );
100typedef int (*Xilinx_abort_fn)( int cookie );
101typedef int (*Xilinx_pre_fn)( int cookie );
102typedef int (*Xilinx_post_fn)( int cookie );
103
104#endif
105