aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Tull <atull@opensource.altera.com>2016-11-01 15:14:24 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-10 11:03:35 -0500
commit40e83578fd1e503cf3b7b2707d3985e53505cb3b (patch)
treef729c2b2b8e6c041c682ca11abaa3e82744f5578
parent9dce0287a60d72656a787b075f1b9162ff3cb142 (diff)
doc: fpga-mgr: add fpga image info to api
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. 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 documents the change in the FPGA Manager API functions, replacing the 'u32 flag' parameter with a pointer to struct fpga_image_info. 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>
-rw-r--r--Documentation/fpga/fpga-mgr.txt32
1 files changed, 21 insertions, 11 deletions
diff --git a/Documentation/fpga/fpga-mgr.txt b/Documentation/fpga/fpga-mgr.txt
index d056d691e8fd..087924f2b20c 100644
--- a/Documentation/fpga/fpga-mgr.txt
+++ b/Documentation/fpga/fpga-mgr.txt
@@ -18,21 +18,25 @@ API Functions:
18To program the FPGA from a file or from a buffer: 18To program the FPGA from a file or from a buffer:
19------------------------------------------------- 19-------------------------------------------------
20 20
21 int fpga_mgr_buf_load(struct fpga_manager *mgr, u32 flags, 21 int fpga_mgr_buf_load(struct fpga_manager *mgr,
22 struct fpga_image_info *info,
22 const char *buf, size_t count); 23 const char *buf, size_t count);
23 24
24Load the FPGA from an image which exists as a buffer in memory. 25Load the FPGA from an image which exists as a buffer in memory.
25 26
26 int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags, 27 int fpga_mgr_firmware_load(struct fpga_manager *mgr,
28 struct fpga_image_info *info,
27 const char *image_name); 29 const char *image_name);
28 30
29Load the FPGA from an image which exists as a file. The image file must be on 31Load the FPGA from an image which exists as a file. The image file must be on
30the firmware search path (see the firmware class documentation). 32the firmware search path (see the firmware class documentation). If successful,
31 33the FPGA ends up in operating mode. Return 0 on success or a negative error
32For both these functions, flags == 0 for normal full reconfiguration or 34code.
33FPGA_MGR_PARTIAL_RECONFIG for partial reconfiguration. If successful, the FPGA
34ends up in operating mode. Return 0 on success or a negative error code.
35 35
36A FPGA design contained in a FPGA image file will likely have particulars that
37affect how the image is programmed to the FPGA. These are contained in struct
38fpga_image_info. Currently the only such particular is a single flag bit
39indicating whether the image is for full or partial reconfiguration.
36 40
37To get/put a reference to a FPGA manager: 41To get/put a reference to a FPGA manager:
38----------------------------------------- 42-----------------------------------------
@@ -72,8 +76,11 @@ struct device_node *mgr_node = ...
72char *buf = ... 76char *buf = ...
73int count = ... 77int count = ...
74 78
79/* struct with information about the FPGA image to program. */
80struct fpga_image_info info;
81
75/* flags indicates whether to do full or partial reconfiguration */ 82/* flags indicates whether to do full or partial reconfiguration */
76int flags = 0; 83info.flags = 0;
77 84
78int ret; 85int ret;
79 86
@@ -81,7 +88,7 @@ int ret;
81struct fpga_manager *mgr = of_fpga_mgr_get(mgr_node); 88struct fpga_manager *mgr = of_fpga_mgr_get(mgr_node);
82 89
83/* Load the buffer to the FPGA */ 90/* Load the buffer to the FPGA */
84ret = fpga_mgr_buf_load(mgr, flags, buf, count); 91ret = fpga_mgr_buf_load(mgr, &info, buf, count);
85 92
86/* Release the FPGA manager */ 93/* Release the FPGA manager */
87fpga_mgr_put(mgr); 94fpga_mgr_put(mgr);
@@ -98,8 +105,11 @@ struct device_node *mgr_node = ...
98/* FPGA image is in this file which is in the firmware search path */ 105/* FPGA image is in this file which is in the firmware search path */
99const char *path = "fpga-image-9.rbf" 106const char *path = "fpga-image-9.rbf"
100 107
108/* struct with information about the FPGA image to program. */
109struct fpga_image_info info;
110
101/* flags indicates whether to do full or partial reconfiguration */ 111/* flags indicates whether to do full or partial reconfiguration */
102int flags = 0; 112info.flags = 0;
103 113
104int ret; 114int ret;
105 115
@@ -107,7 +117,7 @@ int ret;
107struct fpga_manager *mgr = of_fpga_mgr_get(mgr_node); 117struct fpga_manager *mgr = of_fpga_mgr_get(mgr_node);
108 118
109/* Get the firmware image (path) and load it to the FPGA */ 119/* Get the firmware image (path) and load it to the FPGA */
110ret = fpga_mgr_firmware_load(mgr, flags, path); 120ret = fpga_mgr_firmware_load(mgr, &info, path);
111 121
112/* Release the FPGA manager */ 122/* Release the FPGA manager */
113fpga_mgr_put(mgr); 123fpga_mgr_put(mgr);