diff options
author | Jonathan Corbet <corbet@lwn.net> | 2016-12-27 14:53:44 -0500 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2016-12-27 14:53:44 -0500 |
commit | 54ab6db0909061ab7ee07233d3cab86d29f86e6c (patch) | |
tree | a7650ab5c0fa3a6a3841de8e8693041b3e009054 /include/linux/fpga/fpga-mgr.h | |
parent | 217e2bfab22e740227df09f22165e834cddd8a3b (diff) | |
parent | 7ce7d89f48834cefece7804d38fc5d85382edf77 (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.h | 29 |
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 | */ | ||
79 | struct 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 | */ |
83 | struct fpga_manager_ops { | 98 | struct 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 | ||
112 | int fpga_mgr_buf_load(struct fpga_manager *mgr, u32 flags, | 130 | int 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 | ||
115 | int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags, | 133 | int 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 | ||
118 | struct fpga_manager *of_fpga_mgr_get(struct device_node *node); | 137 | struct fpga_manager *of_fpga_mgr_get(struct device_node *node); |
119 | 138 | ||
139 | struct fpga_manager *fpga_mgr_get(struct device *dev); | ||
140 | |||
120 | void fpga_mgr_put(struct fpga_manager *mgr); | 141 | void fpga_mgr_put(struct fpga_manager *mgr); |
121 | 142 | ||
122 | int fpga_mgr_register(struct device *dev, const char *name, | 143 | int fpga_mgr_register(struct device *dev, const char *name, |