3 * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
5 * See file CREDITS for list of people who contributed to this
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.
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.
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,
25 #include <linux/types.h> /* for ulong typedef */
30 #ifndef CONFIG_MAX_FPGA_DEVICES
31 #define CONFIG_MAX_FPGA_DEVICES 5
34 /* fpga_xxxx function return value definitions */
35 #define FPGA_SUCCESS 0
38 /* device numbers must be non-negative */
39 #define FPGA_INVALID_DEVICE -1
41 /* root data type defintions */
42 typedef enum { /* typedef fpga_type */
43 fpga_min_type, /* range check value */
44 fpga_xilinx, /* Xilinx Family) */
45 fpga_altera, /* unimplemented */
46 fpga_lattice, /* Lattice family */
47 fpga_undefined /* invalid range check value */
48 } fpga_type; /* end, typedef fpga_type */
50 typedef struct { /* typedef fpga_desc */
51 fpga_type devtype; /* switch value to select sub-functions */
52 void *devdesc; /* real device descriptor */
53 } fpga_desc; /* end, typedef fpga_desc */
56 /* root function definitions */
57 extern void fpga_init(void);
58 extern int fpga_add(fpga_type devtype, void *desc);
59 extern int fpga_count(void);
60 extern int fpga_load(int devnum, const void *buf, size_t bsize);
61 extern int fpga_loadbitstream(int devnum, char *fpgadata, size_t size);
62 extern int fpga_dump(int devnum, const void *buf, size_t bsize);
63 extern int fpga_info(int devnum);
64 extern const fpga_desc *const fpga_validate(int devnum, const void *buf,
65 size_t bsize, char *fn);