aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fpga/fpga-mgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fpga/fpga-mgr.h')
-rw-r--r--include/linux/fpga/fpga-mgr.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h
index 957b5ac9428a..55803186e0ea 100644
--- a/include/linux/fpga/fpga-mgr.h
+++ b/include/linux/fpga/fpga-mgr.h
@@ -69,6 +69,18 @@ enum fpga_mgr_states {
69#define FPGA_MGR_PARTIAL_RECONFIG BIT(0) 69#define FPGA_MGR_PARTIAL_RECONFIG BIT(0)
70 70
71/** 71/**
72 * struct fpga_image_info - information specific to a FPGA image
73 * @flags: boolean flags as defined above
74 * @enable_timeout_us: maximum time to enable traffic through bridge (uSec)
75 * @disable_timeout_us: maximum time to disable traffic through bridge (uSec)
76 */
77struct fpga_image_info {
78 u32 flags;
79 u32 enable_timeout_us;
80 u32 disable_timeout_us;
81};
82
83/**
72 * struct fpga_manager_ops - ops for low level fpga manager drivers 84 * struct fpga_manager_ops - ops for low level fpga manager drivers
73 * @state: returns an enum value of the FPGA's state 85 * @state: returns an enum value of the FPGA's state
74 * @write_init: prepare the FPGA to receive confuration data 86 * @write_init: prepare the FPGA to receive confuration data
@@ -82,10 +94,12 @@ enum fpga_mgr_states {
82 */ 94 */
83struct fpga_manager_ops { 95struct fpga_manager_ops {
84 enum fpga_mgr_states (*state)(struct fpga_manager *mgr); 96 enum fpga_mgr_states (*state)(struct fpga_manager *mgr);
85 int (*write_init)(struct fpga_manager *mgr, u32 flags, 97 int (*write_init)(struct fpga_manager *mgr,
98 struct fpga_image_info *info,
86 const char *buf, size_t count); 99 const char *buf, size_t count);
87 int (*write)(struct fpga_manager *mgr, const char *buf, size_t count); 100 int (*write)(struct fpga_manager *mgr, const char *buf, size_t count);
88 int (*write_complete)(struct fpga_manager *mgr, u32 flags); 101 int (*write_complete)(struct fpga_manager *mgr,
102 struct fpga_image_info *info);
89 void (*fpga_remove)(struct fpga_manager *mgr); 103 void (*fpga_remove)(struct fpga_manager *mgr);
90}; 104};
91 105
@@ -109,10 +123,11 @@ struct fpga_manager {
109 123
110#define to_fpga_manager(d) container_of(d, struct fpga_manager, dev) 124#define to_fpga_manager(d) container_of(d, struct fpga_manager, dev)
111 125
112int fpga_mgr_buf_load(struct fpga_manager *mgr, u32 flags, 126int fpga_mgr_buf_load(struct fpga_manager *mgr, struct fpga_image_info *info,
113 const char *buf, size_t count); 127 const char *buf, size_t count);
114 128
115int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags, 129int fpga_mgr_firmware_load(struct fpga_manager *mgr,
130 struct fpga_image_info *info,
116 const char *image_name); 131 const char *image_name);
117 132
118struct fpga_manager *of_fpga_mgr_get(struct device_node *node); 133struct fpga_manager *of_fpga_mgr_get(struct device_node *node);