aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fpga/fpga-mgr.h
diff options
context:
space:
mode:
authorAlan Tull <atull@opensource.altera.com>2016-11-01 15:14:26 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-10 11:03:35 -0500
commit1df2865f8dd9d56cb76aa7aa1298921e7bece2af (patch)
tree13bfefb2d88b52d1d326867d91dd0c016cc83075 /include/linux/fpga/fpga-mgr.h
parenta33ddf80b67a79530c3aa2c9f87e2bbd3aea3e22 (diff)
fpga-mgr: add fpga image information struct
This patch adds a minor change in the FPGA Manager API to hold information that is specific to an FPGA image file. This change is expected to bring little, if any, pain. The socfpga and zynq drivers are fixed up in this patch. An FPGA image file will have particulars that affect how the image is programmed to the FPGA. One example is that current 'flags' currently has one bit which shows whether the FPGA image was built for full reconfiguration or partial reconfiguration. Another example is timeout values for enabling or disabling the bridges in the FPGA. As the complexity of the FPGA design increases, the bridges in the FPGA may take longer times to enable or disable. This patch adds a new 'struct fpga_image_info', moves the current 'u32 flags' to it. Two other image-specific u32's are added for the bridge enable/disable timeouts. The FPGA Manager API functions are changed, replacing the 'u32 flag' parameter with a pointer to struct fpga_image_info. Subsequent patches fix the existing low level FPGA manager drivers. Signed-off-by: Alan Tull <atull@opensource.altera.com> Acked-by: Moritz Fischer <moritz.fischer@ettus.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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);