1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright(c) 2007-2022 Intel Corporation */
3 /******************************************************************************
4  * @file icp_adf_cfg.h
5  *
6  * @defgroup icp_AdfCfg Acceleration Driver Framework Configuration Interface.
7  *
8  * @ingroup icp_Adf
9  *
10  * @description
11  *      This is the top level header file for the run-time system configuration
12  *      parameters. This interface may be used by components of this API to
13  *      access the supported run-time configuration parameters.
14  *
15  *****************************************************************************/
16 
17 #ifndef ICP_ADF_CFG_H
18 #define ICP_ADF_CFG_H
19 
20 #include "cpa.h"
21 #include "icp_accel_devices.h"
22 
23 /******************************************************************************
24 * Section for #define's & typedef's
25 ******************************************************************************/
26 /* Address of the UOF firmware */
27 #define ICP_CFG_UOF_ADDRESS_KEY ("Firmware_UofAddress")
28 /* Size of the UOF firmware */
29 #define ICP_CFG_UOF_SIZE_BYTES_KEY ("Firmware_UofSizeInBytes")
30 /* Address of the MMP firmware */
31 #define ICP_CFG_MMP_ADDRESS_KEY ("Firmware_MmpAddress")
32 /* Size of the MMP firmware */
33 #define ICP_CFG_MMP_SIZE_BYTES_KEY ("Firmware_MMpSizeInBytes")
34 /* MMP firmware version */
35 #define ICP_CFG_MMP_VER_KEY ("Firmware_MmpVer")
36 /* UOF firmware version */
37 #define ICP_CFG_UOF_VER_KEY ("Firmware_UofVer")
38 /* Tools version */
39 #define ICP_CFG_TOOLS_VER_KEY ("Firmware_ToolsVer")
40 /* Hardware rev id */
41 #define ICP_CFG_HW_REV_ID_KEY ("HW_RevId")
42 /* Lowest Compatible Driver Version */
43 #define ICP_CFG_LO_COMPATIBLE_DRV_KEY ("Lowest_Compat_Drv_Ver")
44 /* Pke Service Disabled flag */
45 #define ICP_CFG_PKE_DISABLED ("PkeServiceDisabled")
46 /* SRAM Physical Address Key */
47 #define ADF_SRAM_PHYSICAL_ADDRESS ("Sram_PhysicalAddress")
48 /* SRAM Virtual Address Key */
49 #define ADF_SRAM_VIRTUAL_ADDRESS ("Sram_VirtualAddress")
50 /* SRAM Size In Bytes Key */
51 #define ADF_SRAM_SIZE_IN_BYTES ("Sram_SizeInBytes")
52 /* Device node id, tells to which die the device is
53  * connected to */
54 #define ADF_DEV_NODE_ID "Device_NodeId"
55 /* Device package id, this is accel_dev id */
56 #define ADF_DEV_PKG_ID "Device_PkgId"
57 /* Device bus address, B.D.F (Bus(8bits),Device(5bits),Function(3bits)) */
58 #define ADF_DEV_BUS_ADDRESS ("Device_BusAddress")
59 /* Number of Acceleration Engines */
60 #define ADF_DEV_NUM_AE ("Device_Num_AE")
61 /* Number of Accelerators */
62 #define ADF_DEV_NUM_ACCEL ("Device_Num_Accel")
63 /* Max Number of Acceleration Engines */
64 #define ADF_DEV_MAX_AE ("Device_Max_AE")
65 /* Max Number of Accelerators */
66 #define ADF_DEV_MAX_ACCEL ("Device_Max_Accel")
67 /* QAT/AE Mask*/
68 #define ADF_DEV_MAX_RING_PER_QAT ("Device_Max_Num_Rings_per_Accel")
69 /* Number of Accelerators */
70 #define ADF_DEV_ACCELAE_MASK_FMT ("Device_Accel_AE_Mask_%d")
71 /* VF ring offset */
72 #define ADF_VF_RING_OFFSET_KEY ("VF_RingOffset")
73 /* Mask of Accelerators */
74 #define ADF_DEV_AE_MASK ("Device_AE_Mask")
75 /* Whether or not arbitration is supported */
76 #define ADF_DEV_ARB_SUPPORTED ("ArbitrationSupported")
77 /* Slice Watch Dog Timer for CySym+Comp */
78 #define ADF_DEV_SSM_WDT_BULK "CySymAndDcWatchDogTimer"
79 /* Slice Watch Dog Timer for CyAsym */
80 #define ADF_DEV_SSM_WDT_PKE "CyAsymWatchDogTimer"
81 
82 /* String names for the exposed sections of config file. */
83 #define GENERAL_SEC "GENERAL"
84 #define WIRELESS_SEC "WIRELESS_INT_"
85 #define DYN_SEC "DYN"
86 #define DEV_LIMIT_CFG_ACCESS_TMPL "_D_L_ACC"
87 /*#define WIRELESS_ENABLED                "WirelessEnabled"*/
88 
89 /*
90  * icp_adf_cfgGetParamValue
91  *
92  * Description:
93  * This function is used to determine the value for a given parameter name.
94  *
95  * Returns:
96  *   CPA_STATUS_SUCCESS   on success
97  *   CPA_STATUS_FAIL      on failure
98  */
99 CpaStatus icp_adf_cfgGetParamValue(icp_accel_dev_t *accel_dev,
100 				   const char *section,
101 				   const char *param_name,
102 				   char *param_value);
103 /*
104  * icp_adf_cfgGetRingNumber
105  *
106  * Description:
107  * Function returns ring number configured for the service.
108  * NOTE: this function will only be used by QATAL in kernelspace.
109  * Returns:
110  *   CPA_STATUS_SUCCESS   on success
111  *   CPA_STATUS_FAIL      on failure
112  */
113 CpaStatus icp_adf_cfgGetRingNumber(icp_accel_dev_t *accel_dev,
114 				   const char *section_name,
115 				   const Cpa32U accel_num,
116 				   const Cpa32U bank_num,
117 				   const char *pServiceName,
118 				   Cpa32U *pRingNum);
119 
120 /*
121  * icp_adf_get_busAddress
122  * Gets the B.D.F. of the physical device
123  */
124 Cpa16U icp_adf_get_busAddress(Cpa16U packageId);
125 
126 #endif /* ICP_ADF_CFG_H */
127