1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2021 Intel Corporation
5 #ifndef _RTE_PMD_IFPGA_H_
6 #define _RTE_PMD_IFPGA_H_
9 * @file rte_pmd_ifpga.h
11 * ifpga PMD specific functions.
13 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
23 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
25 * Get raw device ID from PCI address string like 'Domain:Bus:Dev.Func'
28 * The PCI address of specified Intel FPGA device.
30 * The buffer to output device ID.
32 * - (0) if successful.
33 * - (-EINVAL) if bad parameter.
34 * - (-ENODEV) if FPGA is not probed by ifpga driver.
38 rte_pmd_ifpga_get_dev_id(const char *pci_addr, uint16_t *dev_id);
42 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
44 * Update image flash of specified Intel FPGA device
47 * The raw device ID of specified Intel FPGA device.
49 * The image file name string.
51 * The detailed update status for debug.
53 * - (0) if successful.
54 * - (-ENODEV) if dev_id is invalid.
55 * - (-EINVAL) if bad parameter or staging area is not initialized.
56 * - (-EBUSY) if FPGA is updating or rebooting.
57 * - (-EIO) if failed to open image file.
61 rte_pmd_ifpga_update_flash(uint16_t dev_id, const char *image,
66 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
68 * Stop flash update of specified Intel FPGA device
71 * The raw device ID of specified Intel FPGA device.
73 * Abort the update process by writing register if set non-zero.
75 * - (0) if successful.
76 * - (-ENODEV) if dev_id is invalid.
77 * - (-EINVAL) if bad parameter.
78 * - (-EAGAIN) if failed with force.
82 rte_pmd_ifpga_stop_update(uint16_t dev_id, int force);
86 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
88 * Check current Intel FPGA status and change it to reboot status if it is idle
91 * The raw device ID of specified Intel FPGA device.
93 * - (0) if FPGA is ready to reboot.
94 * - (-ENODEV) if dev_id is invalid.
95 * - (-ENOMEM) if share data is not initialized.
96 * - (-EBUSY) if FPGA is updating or rebooting.
100 rte_pmd_ifpga_reboot_try(uint16_t dev_id);
104 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
106 * Trigger full reconfiguration of specified Intel FPGA device
109 * The raw device ID of specified Intel FPGA device.
111 * Select reconfiguration type.
112 * 0 - reconfigure FPGA only.
113 * 1 - reboot the whole card including FPGA.
115 * Select image from which flash partition.
116 * 0 - factory partition.
117 * 1 - user partition.
119 * - (0) if successful.
120 * - (-ENODEV) if dev_id is invalid.
121 * - (-EINVAL) if bad parameter.
122 * - (-EBUSY) if failed to access BMC register.
126 rte_pmd_ifpga_reload(uint16_t dev_id, int type, int page);
132 #endif /* _RTE_PMD_IFPGA_H_ */