mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
fpga: dfl: fme: add interrupt support for global error reporting
Error reporting interrupt is very useful to notify users that some errors are detected by the hardware. Once users are notified, they could query hardware logged error states, no need to continuously poll on these states. This patch adds interrupt support for fme global error reporting sub feature. It follows the common DFL interrupt notification and handling mechanism. And it implements two ioctls below for user to query number of irqs supported, and set/unset interrupt triggers. Ioctls: * DFL_FPGA_FME_ERR_GET_IRQ_NUM get the number of irqs, which is used to determine whether/how many interrupts fme error reporting feature supports. * DFL_FPGA_FME_ERR_SET_IRQ set/unset given eventfds as fme error reporting interrupt triggers. Signed-off-by: Luwei Kang <luwei.kang@intel.com> Signed-off-by: Wu Hao <hao.wu@intel.com> Signed-off-by: Xu Yilun <yilun.xu@intel.com> Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Wu Hao <hao.wu@intel.com> Signed-off-by: Moritz Fischer <mdf@kernel.org>
This commit is contained in:
parent
fe6a3d6521
commit
d43f20bae5
3 changed files with 47 additions and 0 deletions
|
@ -230,4 +230,27 @@ struct dfl_fpga_fme_port_pr {
|
|||
*/
|
||||
#define DFL_FPGA_FME_PORT_ASSIGN _IOW(DFL_FPGA_MAGIC, DFL_FME_BASE + 2, int)
|
||||
|
||||
/**
|
||||
* DFL_FPGA_FME_ERR_GET_IRQ_NUM - _IOR(DFL_FPGA_MAGIC, DFL_FME_BASE + 3,
|
||||
* __u32 num_irqs)
|
||||
*
|
||||
* Get the number of irqs supported by the fpga fme error reporting private
|
||||
* feature. Currently hardware supports up to 1 irq.
|
||||
* Return: 0 on success, -errno on failure.
|
||||
*/
|
||||
#define DFL_FPGA_FME_ERR_GET_IRQ_NUM _IOR(DFL_FPGA_MAGIC, \
|
||||
DFL_FME_BASE + 3, __u32)
|
||||
|
||||
/**
|
||||
* DFL_FPGA_FME_ERR_SET_IRQ - _IOW(DFL_FPGA_MAGIC, DFL_FME_BASE + 4,
|
||||
* struct dfl_fpga_irq_set)
|
||||
*
|
||||
* Set fpga fme error reporting interrupt trigger if evtfds[n] is valid.
|
||||
* Unset related interrupt trigger if evtfds[n] is a negative value.
|
||||
* Return: 0 on success, -errno on failure.
|
||||
*/
|
||||
#define DFL_FPGA_FME_ERR_SET_IRQ _IOW(DFL_FPGA_MAGIC, \
|
||||
DFL_FME_BASE + 4, \
|
||||
struct dfl_fpga_irq_set)
|
||||
|
||||
#endif /* _UAPI_LINUX_FPGA_DFL_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue