diff options
| author | Wu Hao <hao.wu@intel.com> | 2018-06-29 20:53:10 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-15 07:55:44 -0400 |
| commit | ecb5fbe299dfaad778033259f35bc696fa1fb743 (patch) | |
| tree | 6a3db26d67f707197718d8b772f19fbca8fe8e5c /include/linux/fpga | |
| parent | 571d78bd458a831cf51dff2afa1dda3309bd82b2 (diff) | |
fpga: mgr: add status for fpga-manager
This patch adds status sysfs interface for fpga manager, it's a
read only interface which allows user to get fpga manager status,
including full/partial reconfiguration error and other status
information. It adds a status callback to fpga_manager_ops too,
allows each fpga_manager driver to define its own method to
collect latest status from hardware.
The following sysfs file is created:
* /sys/class/fpga_manager/<fpga>/status
Return status of fpga manager, including reconfiguration errors.
Signed-off-by: Wu Hao <hao.wu@intel.com>
Acked-by: Alan Tull <atull@kernel.org>
Acked-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/fpga')
| -rw-r--r-- | include/linux/fpga/fpga-mgr.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h index 3eb6b9d60d65..e249b7250345 100644 --- a/include/linux/fpga/fpga-mgr.h +++ b/include/linux/fpga/fpga-mgr.h | |||
| @@ -101,6 +101,7 @@ struct fpga_image_info { | |||
| 101 | * struct fpga_manager_ops - ops for low level fpga manager drivers | 101 | * struct fpga_manager_ops - ops for low level fpga manager drivers |
| 102 | * @initial_header_size: Maximum number of bytes that should be passed into write_init | 102 | * @initial_header_size: Maximum number of bytes that should be passed into write_init |
| 103 | * @state: returns an enum value of the FPGA's state | 103 | * @state: returns an enum value of the FPGA's state |
| 104 | * @status: returns status of the FPGA, including reconfiguration error code | ||
| 104 | * @write_init: prepare the FPGA to receive confuration data | 105 | * @write_init: prepare the FPGA to receive confuration data |
| 105 | * @write: write count bytes of configuration data to the FPGA | 106 | * @write: write count bytes of configuration data to the FPGA |
| 106 | * @write_sg: write the scatter list of configuration data to the FPGA | 107 | * @write_sg: write the scatter list of configuration data to the FPGA |
| @@ -115,6 +116,7 @@ struct fpga_image_info { | |||
| 115 | struct fpga_manager_ops { | 116 | struct fpga_manager_ops { |
| 116 | size_t initial_header_size; | 117 | size_t initial_header_size; |
| 117 | enum fpga_mgr_states (*state)(struct fpga_manager *mgr); | 118 | enum fpga_mgr_states (*state)(struct fpga_manager *mgr); |
| 119 | u64 (*status)(struct fpga_manager *mgr); | ||
| 118 | int (*write_init)(struct fpga_manager *mgr, | 120 | int (*write_init)(struct fpga_manager *mgr, |
| 119 | struct fpga_image_info *info, | 121 | struct fpga_image_info *info, |
| 120 | const char *buf, size_t count); | 122 | const char *buf, size_t count); |
| @@ -126,6 +128,13 @@ struct fpga_manager_ops { | |||
| 126 | const struct attribute_group **groups; | 128 | const struct attribute_group **groups; |
| 127 | }; | 129 | }; |
| 128 | 130 | ||
| 131 | /* FPGA manager status: Partial/Full Reconfiguration errors */ | ||
| 132 | #define FPGA_MGR_STATUS_OPERATION_ERR BIT(0) | ||
| 133 | #define FPGA_MGR_STATUS_CRC_ERR BIT(1) | ||
| 134 | #define FPGA_MGR_STATUS_INCOMPATIBLE_IMAGE_ERR BIT(2) | ||
| 135 | #define FPGA_MGR_STATUS_IP_PROTOCOL_ERR BIT(3) | ||
| 136 | #define FPGA_MGR_STATUS_FIFO_OVERFLOW_ERR BIT(4) | ||
| 137 | |||
| 129 | /** | 138 | /** |
| 130 | * struct fpga_manager - fpga manager structure | 139 | * struct fpga_manager - fpga manager structure |
| 131 | * @name: name of low level fpga manager | 140 | * @name: name of low level fpga manager |
