]> git.ipfire.org Git - people/ms/u-boot.git/blame_incremental - include/fpga.h
Merge git://git.denx.de/u-boot-mmc
[people/ms/u-boot.git] / include / fpga.h
... / ...
CommitLineData
1/*
2 * (C) Copyright 2002
3 * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#include <linux/types.h> /* for ulong typedef */
9
10#ifndef _FPGA_H_
11#define _FPGA_H_
12
13#ifndef CONFIG_MAX_FPGA_DEVICES
14#define CONFIG_MAX_FPGA_DEVICES 5
15#endif
16
17/* fpga_xxxx function return value definitions */
18#define FPGA_SUCCESS 0
19#define FPGA_FAIL -1
20
21/* device numbers must be non-negative */
22#define FPGA_INVALID_DEVICE -1
23
24/* root data type defintions */
25typedef enum { /* typedef fpga_type */
26 fpga_min_type, /* range check value */
27 fpga_xilinx, /* Xilinx Family) */
28 fpga_altera, /* unimplemented */
29 fpga_lattice, /* Lattice family */
30 fpga_undefined /* invalid range check value */
31} fpga_type; /* end, typedef fpga_type */
32
33typedef struct { /* typedef fpga_desc */
34 fpga_type devtype; /* switch value to select sub-functions */
35 void *devdesc; /* real device descriptor */
36} fpga_desc; /* end, typedef fpga_desc */
37
38typedef struct { /* typedef fpga_desc */
39 unsigned int blocksize;
40 char *interface;
41 char *dev_part;
42 char *filename;
43 int fstype;
44} fpga_fs_info;
45
46typedef enum {
47 BIT_FULL = 0,
48 BIT_PARTIAL,
49 BIT_NONE = 0xFF,
50} bitstream_type;
51
52/* root function definitions */
53void fpga_init(void);
54int fpga_add(fpga_type devtype, void *desc);
55int fpga_count(void);
56const fpga_desc *const fpga_get_desc(int devnum);
57int fpga_is_partial_data(int devnum, size_t img_len);
58int fpga_load(int devnum, const void *buf, size_t bsize,
59 bitstream_type bstype);
60int fpga_fsload(int devnum, const void *buf, size_t size,
61 fpga_fs_info *fpga_fsinfo);
62int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
63 bitstream_type bstype);
64int fpga_dump(int devnum, const void *buf, size_t bsize);
65int fpga_info(int devnum);
66const fpga_desc *const fpga_validate(int devnum, const void *buf,
67 size_t bsize, char *fn);
68
69#endif /* _FPGA_H_ */