diff mbox series

[3/3] add debugfs interface for fpga config complete timeout

Message ID 20220517084146.4510-1-adrian.ho.yin.ng@intel.com (mailing list archive)
State New
Headers show
Series fpga: fpga-mgr: Add support for DebugFS for FPGA Manager Framework | expand

Commit Message

Ng, Adrian Ho Yin May 17, 2022, 8:41 a.m. UTC
From: Matthew Gerlach <matthew.gerlach@intel.com>

Add debugfs interface and documentation for setting the maximum
time in microseconds for the FPGA to go to the operating
state after the region has been programmed.

Signed-off-by: Matthew Gerlach <matthew.gerlach@linux.intel.com>
---
 Documentation/fpga/debugfs.txt  | 6 ++++++
 drivers/fpga/fpga-mgr-debugfs.c | 5 +++++
 2 files changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/Documentation/fpga/debugfs.txt b/Documentation/fpga/debugfs.txt
index 1b34d5460d5d..b01950f76e20 100644
--- a/Documentation/fpga/debugfs.txt
+++ b/Documentation/fpga/debugfs.txt
@@ -9,6 +9,12 @@  three files:
 
    $ echo 1 > /sys/kernel/debug/fpga_manager/fpga0/flags
 
+ - [RW] config_complete_timeout_us:	time out in microseconds to wait for
+					FPGA to go to operating state after
+					region has been programmed.
+
+   $ echo 4 > /sys/kernel/debug/fpga_manager/fpga0/config_complete_timeout_us
+
  - [RW] firmware_name:  Name of an FPGA image firmware file.  Writing initiates
                         a complete FPGA programming cycle.  Note that the image
                         file must be in a directory on the firmware search path
diff --git a/drivers/fpga/fpga-mgr-debugfs.c b/drivers/fpga/fpga-mgr-debugfs.c
index 30af59b92bf3..83b712d4eb14 100644
--- a/drivers/fpga/fpga-mgr-debugfs.c
+++ b/drivers/fpga/fpga-mgr-debugfs.c
@@ -153,8 +153,13 @@  void fpga_mgr_debugfs_add(struct fpga_manager *mgr)
 			    &fpga_mgr_image_fops);
 
 	info = &debugfs->info;
+
 	debugfs_create_u32("flags", 0600, debugfs->debugfs_dir, &info->flags);
 
+	debugfs_create_u32("config_complete_timeout_us", 0600,
+			   debugfs->debugfs_dir,
+			   &info->config_complete_timeout_us);
+
 	mgr->debugfs = debugfs;
 }