1.. _OPAL_NPU_SPA_SETUP: 2 3OPAL_NPU_SPA_SETUP 4================== 5 6OpenCAPI devices only. 7 8Sets up a Shared Process Area (SPA) with the Shared Process Area 9Pointer (SPAP) set to the provided address `addr`, and sets the OTL PE 10mask (used for PASID to PE handle conversion) to `PE_mask`. 11 12If `addr` is NULL, the SPA will be disabled. `addr` must be 4K aligned. 13 14Parameters 15---------- 16:: 17 18 uint64_t phb_id 19 int bdfn 20 uint64_t addr 21 uint64_t PE_mask 22 23``phb_id`` 24 OPAL ID of PHB 25 26``bdfn`` 27 Bus-Device-Function number of OpenCAPI AFU 28 29``addr`` 30 Address of Shared Process Area, or NULL to disable SPA. Must be 4K aligned. 31 32``PE_mask`` 33 Process Element mask for PASID to PE handle conversion 34 35Return Values 36------------- 37 38OPAL_SUCCESS 39 SPAP and PE mask were successfully set 40 41OPAL_PARAMETER 42 A provided parameter was invalid 43 44OPAL_BUSY 45 SPA is already enabled (or if addr is NULL, SPA is already disabled) 46 47.. _OPAL_NPU_SPA_CLEAR_CACHE: 48 49OPAL_NPU_SPA_CLEAR_CACHE 50======================== 51 52OpenCAPI devices only. 53 54Invalidates the Process Element with the given `PE_handle` from the NPU's SPA cache. 55 56Parameters 57---------- 58:: 59 60 uint64_t phb_id 61 uint32_t bdfn 62 uint64_t PE_handle 63 64``phb_id`` 65 OPAL ID of PHB 66 67``bdfn`` 68 Bus-Device-Function number of OpenCAPI AFU 69 70``PE_handle`` 71 Handle of Process Element being cleared from SPA cache 72 73Return Values 74------------- 75 76OPAL_SUCCESS 77 PE was successfully cleared from SPA cache 78 79OPAL_PARAMETER 80 A provided parameter was invalid 81 82OPAL_BUSY 83 XSLO is currently invalidating a previously requested entry 84 85.. _OPAL_NPU_TL_SET: 86 87OPAL_NPU_TL_SET 88=============== 89 90OpenCAPI devices only. 91 92Update the NPU OTL configuration with device capabilities. 93 94Parameters 95---------- 96:: 97 98 uint64_t phb_id 99 uint32_t bdfn 100 long capabilities 101 uint64_t rate_phys 102 int rate_sz 103 104``phb_id`` 105 OPAL ID of PHB 106 107``bdfn`` 108 Bus-Device-Function number of OpenCAPI AFU 109 110``capabilities`` 111 Bitmap of TL templates the device can receive 112 113``rate_phys`` 114 Physical address of rates buffer 115 116``rate_sz`` 117 Size of rates buffer (must be equal to 32) 118 119Return Values 120------------- 121 122OPAL_SUCCESS 123 OTL configuration was successfully updated 124 125OPAL_PARAMETER 126 A provided parameter was invalid 127 128 .. _OPAL_NPU_MEM_ALLOC: 129 130OPAL_NPU_MEM_ALLOC 131================== 132 133OpenCAPI devices only. 134 135Sets up the NPU memory BAR for Lowest Point of Coherency (LPC) memory. 136 137At present, only one device per CPU can use LPC memory, and a maximum of 4TB 138can be allocated. 139 140Parameters 141---------- 142:: 143 144 uint64_t phb_id 145 uint32_t bdfn 146 uint64_t size 147 uint64_t *bar 148 149``phb_id`` 150 OPAL ID of PHB 151 152``bdfn`` 153 Bus-Device-Function number of OpenCAPI AFU 154 155``size`` 156 Size of requested LPC memory area in bytes 157 158``bar`` 159 Pointer to variable where base of LPC memory area will be returned 160 161Return Values 162------------- 163 164OPAL_SUCCESS 165 BAR setup completed successfully 166 167OPAL_PARAMETER 168 A provided parameter was invalid 169 170OPAL_RESOURCE 171 The BAR could not be assigned due to limitations 172 173.. _OPAL_NPU_MEM_RELEASE: 174 175OPAL_NPU_MEM_RELEASE 176==================== 177 178OpenCAPI devices only. 179 180Releases NPU memory BAR. 181 182Parameters 183---------- 184:: 185 186 uint64_t phb_id 187 uint32_t bdfn 188 189``phb_id`` 190 OPAL ID of PHB 191 192``bdfn`` 193 Bus-Device-Function number of OpenCAPI AFU 194 195Return Values 196------------- 197 198OPAL_SUCCESS 199 BAR setup completed successfully 200 201OPAL_PARAMETER 202 A provided parameter was invalid, or the specified device does not currently 203 have LPC memory assigned 204