Lines Matching refs:afu
74 struct cxl_afu *afu) in read_phys_addr() argument
92 afu->guest->handle = addr; in read_phys_addr()
95 afu->guest->p2n_phys += addr; in read_phys_addr()
96 afu->guest->p2n_size = size; in read_phys_addr()
99 afu->psn_phys += addr; in read_phys_addr()
100 afu->adapter->ps_size = size; in read_phys_addr()
115 static int read_vpd(struct cxl *adapter, struct cxl_afu *afu) in read_vpd() argument
126 rc = cxl_guest_read_afu_vpd(afu, vpd, len); in read_vpd()
135 int cxl_of_read_afu_handle(struct cxl_afu *afu, struct device_node *afu_np) in cxl_of_read_afu_handle() argument
137 if (read_handle(afu_np, &afu->guest->handle)) in cxl_of_read_afu_handle()
139 pr_devel("AFU handle: 0x%.16llx\n", afu->guest->handle); in cxl_of_read_afu_handle()
144 int cxl_of_read_afu_properties(struct cxl_afu *afu, struct device_node *np) in cxl_of_read_afu_properties() argument
167 rc = read_phys_addr(np, "reg", afu); in cxl_of_read_afu_properties()
171 rc = read_phys_addr(np, "assigned-addresses", afu); in cxl_of_read_afu_properties()
175 if (afu->psn_phys == 0) in cxl_of_read_afu_properties()
176 afu->psa = false; in cxl_of_read_afu_properties()
178 afu->psa = true; in cxl_of_read_afu_properties()
185 read_prop_dword(np, "ibm,#processes", &afu->max_procs_virtualised); in cxl_of_read_afu_properties()
191 read_vpd(NULL, afu); in cxl_of_read_afu_properties()
194 read_prop_dword(np, "ibm,max-ints-per-process", &afu->guest->max_ints); in cxl_of_read_afu_properties()
195 afu->irqs_max = afu->guest->max_ints; in cxl_of_read_afu_properties()
197 prop = read_prop_dword(np, "ibm,min-ints-per-process", &afu->pp_irqs); in cxl_of_read_afu_properties()
203 afu->pp_irqs--; in cxl_of_read_afu_properties()
211 read_prop64_dword(np, "ibm,error-buffer-size", &afu->eb_len); in cxl_of_read_afu_properties()
212 afu->eb_offset = 0; in cxl_of_read_afu_properties()
217 read_prop64_dword(np, "ibm,config-record-size", &afu->crs_len); in cxl_of_read_afu_properties()
218 afu->crs_offset = 0; in cxl_of_read_afu_properties()
220 read_prop_dword(np, "ibm,#config-records", &afu->crs_num); in cxl_of_read_afu_properties()
223 for (i = 0; i < afu->crs_num; i++) { in cxl_of_read_afu_properties()
224 rc = cxl_ops->afu_cr_read16(afu, i, PCI_DEVICE_ID, in cxl_of_read_afu_properties()
229 rc = cxl_ops->afu_cr_read16(afu, i, PCI_VENDOR_ID, in cxl_of_read_afu_properties()
234 rc = cxl_ops->afu_cr_read32(afu, i, PCI_CLASS_REVISION, in cxl_of_read_afu_properties()
259 afu->pp_psa = true; in cxl_of_read_afu_properties()
261 afu->pp_psa = false; in cxl_of_read_afu_properties()
271 afu->serr_hwirq = val; in cxl_of_read_afu_properties()
273 pr_devel("AFU handle: %#llx\n", afu->guest->handle); in cxl_of_read_afu_properties()
275 afu->guest->p2n_phys, afu->guest->p2n_size); in cxl_of_read_afu_properties()
277 afu->psn_phys, afu->adapter->ps_size); in cxl_of_read_afu_properties()
279 afu->max_procs_virtualised); in cxl_of_read_afu_properties()
280 pr_devel("Per-process irqs min=%i, max=%i\n", afu->pp_irqs, in cxl_of_read_afu_properties()
281 afu->irqs_max); in cxl_of_read_afu_properties()
282 pr_devel("Slice error interrupt=%#lx\n", afu->serr_hwirq); in cxl_of_read_afu_properties()
442 int afu; in cxl_of_remove() local
445 for (afu = 0; afu < adapter->slices; afu++) in cxl_of_remove()
446 cxl_guest_remove_afu(adapter->afu[afu]); in cxl_of_remove()