aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fpga/fpga-mgr.h
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2016-12-27 14:53:44 -0500
committerJonathan Corbet <corbet@lwn.net>2016-12-27 14:53:44 -0500
commit54ab6db0909061ab7ee07233d3cab86d29f86e6c (patch)
treea7650ab5c0fa3a6a3841de8e8693041b3e009054 /include/linux/fpga/fpga-mgr.h
parent217e2bfab22e740227df09f22165e834cddd8a3b (diff)
parent7ce7d89f48834cefece7804d38fc5d85382edf77 (diff)
Merge tag 'v4.10-rc1' into docs-next
Linux 4.10-rc1
Diffstat (limited to 'include/linux/fpga/fpga-mgr.h')
-rw-r--r--include/linux/fpga/fpga-mgr.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h
index 0940bf45e2f2..16551d5eac36 100644
--- a/include/linux/fpga/fpga-mgr.h
+++ b/include/linux/fpga/fpga-mgr.h
@@ -65,11 +65,26 @@ enum fpga_mgr_states {
65/* 65/*
66 * FPGA Manager flags 66 * FPGA Manager flags
67 * FPGA_MGR_PARTIAL_RECONFIG: do partial reconfiguration if supported 67 * FPGA_MGR_PARTIAL_RECONFIG: do partial reconfiguration if supported
68 * FPGA_MGR_EXTERNAL_CONFIG: FPGA has been configured prior to Linux booting
68 */ 69 */
69#define FPGA_MGR_PARTIAL_RECONFIG BIT(0) 70#define FPGA_MGR_PARTIAL_RECONFIG BIT(0)
71#define FPGA_MGR_EXTERNAL_CONFIG BIT(1)
72
73/**
74 * struct fpga_image_info - information specific to a FPGA image
75 * @flags: boolean flags as defined above
76 * @enable_timeout_us: maximum time to enable traffic through bridge (uSec)
77 * @disable_timeout_us: maximum time to disable traffic through bridge (uSec)
78 */
79struct fpga_image_info {
80 u32 flags;
81 u32 enable_timeout_us;
82 u32 disable_timeout_us;
83};
70 84
71/** 85/**
72 * struct fpga_manager_ops - ops for low level fpga manager drivers 86 * struct fpga_manager_ops - ops for low level fpga manager drivers
87 * @initial_header_size: Maximum number of bytes that should be passed into write_init
73 * @state: returns an enum value of the FPGA's state 88 * @state: returns an enum value of the FPGA's state
74 * @write_init: prepare the FPGA to receive confuration data 89 * @write_init: prepare the FPGA to receive confuration data
75 * @write: write count bytes of configuration data to the FPGA 90 * @write: write count bytes of configuration data to the FPGA
@@ -81,11 +96,14 @@ enum fpga_mgr_states {
81 * called, so leaving them out is fine. 96 * called, so leaving them out is fine.
82 */ 97 */
83struct fpga_manager_ops { 98struct fpga_manager_ops {
99 size_t initial_header_size;
84 enum fpga_mgr_states (*state)(struct fpga_manager *mgr); 100 enum fpga_mgr_states (*state)(struct fpga_manager *mgr);
85 int (*write_init)(struct fpga_manager *mgr, u32 flags, 101 int (*write_init)(struct fpga_manager *mgr,
102 struct fpga_image_info *info,
86 const char *buf, size_t count); 103 const char *buf, size_t count);
87 int (*write)(struct fpga_manager *mgr, const char *buf, size_t count); 104 int (*write)(struct fpga_manager *mgr, const char *buf, size_t count);
88 int (*write_complete)(struct fpga_manager *mgr, u32 flags); 105 int (*write_complete)(struct fpga_manager *mgr,
106 struct fpga_image_info *info);
89 void (*fpga_remove)(struct fpga_manager *mgr); 107 void (*fpga_remove)(struct fpga_manager *mgr);
90}; 108};
91 109
@@ -109,14 +127,17 @@ struct fpga_manager {
109 127
110#define to_fpga_manager(d) container_of(d, struct fpga_manager, dev) 128#define to_fpga_manager(d) container_of(d, struct fpga_manager, dev)
111 129
112int fpga_mgr_buf_load(struct fpga_manager *mgr, u32 flags, 130int fpga_mgr_buf_load(struct fpga_manager *mgr, struct fpga_image_info *info,
113 const char *buf, size_t count); 131 const char *buf, size_t count);
114 132
115int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags, 133int fpga_mgr_firmware_load(struct fpga_manager *mgr,
134 struct fpga_image_info *info,
116 const char *image_name); 135 const char *image_name);
117 136
118struct fpga_manager *of_fpga_mgr_get(struct device_node *node); 137struct fpga_manager *of_fpga_mgr_get(struct device_node *node);
119 138
139struct fpga_manager *fpga_mgr_get(struct device *dev);
140
120void fpga_mgr_put(struct fpga_manager *mgr); 141void fpga_mgr_put(struct fpga_manager *mgr);
121 142
122int fpga_mgr_register(struct device *dev, const char *name, 143int fpga_mgr_register(struct device *dev, const char *name,