fpga: add config complete timeout
authorAlan Tull <atull@opensource.altera.com>
Fri, 24 Mar 2017 00:34:27 +0000 (19:34 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Apr 2017 15:45:28 +0000 (17:45 +0200)
Adding timeout for maximum allowed time for FPGA to go to
operating mode after a FPGA region has been programmed.

Signed-off-by: Alan Tull <atull@opensource.altera.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/fpga/fpga-region.c
include/linux/fpga/fpga-mgr.h

index 2fe2a52c66cab8ebcbc0b4b396b0073f5ebd2c56..ae4c61aada99286cd353eb5047e55e7dd90ed4e5 100644 (file)
@@ -385,6 +385,9 @@ static int fpga_region_notify_pre_apply(struct fpga_region *region,
        of_property_read_u32(nd->overlay, "region-freeze-timeout-us",
                             &info->disable_timeout_us);
 
+       of_property_read_u32(nd->overlay, "config-complete-timeout-us",
+                            &info->config_complete_timeout_us);
+
        /* If FPGA was externally programmed, don't specify firmware */
        if ((info->flags & FPGA_MGR_EXTERNAL_CONFIG) && firmware_name) {
                pr_err("error: specified firmware and external-fpga-config");
index e2ef94fd37afd8b5246f1f50657475d42952a129..b4ac24c4411d0fae1a77aa40024f7b9a5285ad5c 100644 (file)
@@ -77,11 +77,14 @@ enum fpga_mgr_states {
  * @flags: boolean flags as defined above
  * @enable_timeout_us: maximum time to enable traffic through bridge (uSec)
  * @disable_timeout_us: maximum time to disable traffic through bridge (uSec)
+ * @config_complete_timeout_us: maximum time for FPGA to switch to operating
+ *        status in the write_complete op.
  */
 struct fpga_image_info {
        u32 flags;
        u32 enable_timeout_us;
        u32 disable_timeout_us;
+       u32 config_complete_timeout_us;
 };
 
 /**