Lines Matching refs:afu

182 	struct ocxl_hw_afu *afu = ctx->hw_afu;
183 struct device *dev = afu->dev;
254 struct ocxl_hw_afu *afu = ctx->hw_afu;
255 struct device *dev = afu->dev;
330 struct ocxl_hw_afu *afu = ctx->hw_afu;
331 struct ocxl_afu_config *acfg = &afu->acfg;
332 void *link_token = afu->link_token;
333 struct pci_dev *pdev = afu->pdev;
334 struct device *dev = afu->dev;
350 ctx->psn_phys = afu->gmmio_phys;
353 ctx->psn_phys = afu->ppmmio_phys + (ctx->pe * ctx->psn_size);
402 struct ocxl_hw_afu *afu = ctx->hw_afu;
403 struct ocxl_afu_config *acfg = &afu->acfg;
404 struct pci_dev *pdev = afu->pdev;
405 struct device *dev = afu->dev;
426 rc = ocxl_link_remove_pe(afu->link_token, ctx->pe);
472 struct ocxl_hw_afu *afu = afu_cookie;
474 return afu->ocxl_ctx;
486 struct ocxl_hw_afu *afu = afu_cookie;
487 struct device *dev = afu->dev;
499 rc = idr_alloc(&afu->idr, ctx, 0, afu->max_pasid, GFP_NOWAIT);
514 ctx->hw_afu = afu;
567 struct ocxl_hw_afu *afu = afu_cookie;
569 afu->perst_same_image = image;
592 struct ocxl_hw_afu *afu = ctx->hw_afu;
593 struct device *dev = afu->dev;
602 ocxl_link_free_irq(afu->link_token, ctx->irqs[i].hwirq);
617 struct ocxl_hw_afu *afu = ctx->hw_afu;
618 struct device *dev = afu->dev;
644 rc = ocxl_link_irq_alloc(afu->link_token, &hwirq);
660 ocxl_link_free_irq(afu->link_token, irqs[i].hwirq);
688 * @afu: AFU associated with the host.
690 static void ocxlflash_unconfig_afu(struct ocxl_hw_afu *afu)
692 if (afu->gmmio_virt) {
693 iounmap(afu->gmmio_virt);
694 afu->gmmio_virt = NULL;
704 struct ocxl_hw_afu *afu = afu_cookie;
707 if (!afu)
710 ocxlflash_release_context(afu->ocxl_ctx);
711 idr_destroy(&afu->idr);
714 pos = afu->acfg.dvsec_afu_control_pos;
715 ocxl_config_set_afu_state(afu->pdev, pos, 0);
717 ocxlflash_unconfig_afu(afu);
718 kfree(afu);
724 * @afu: AFU associated with the host.
728 static int ocxlflash_config_fn(struct pci_dev *pdev, struct ocxl_hw_afu *afu)
730 struct ocxl_fn_config *fcfg = &afu->fcfg;
745 afu->is_present = true;
758 afu->fn_actag_base = base;
759 afu->fn_actag_enabled = enabled;
765 rc = ocxl_link_setup(pdev, 0, &afu->link_token);
781 ocxl_link_release(pdev, afu->link_token);
788 * @afu: AFU associated with the host.
790 static void ocxlflash_unconfig_fn(struct pci_dev *pdev, struct ocxl_hw_afu *afu)
792 ocxl_link_release(pdev, afu->link_token);
797 * @afu: AFU associated with the host.
801 static int ocxlflash_map_mmio(struct ocxl_hw_afu *afu)
803 struct ocxl_afu_config *acfg = &afu->acfg;
804 struct pci_dev *pdev = afu->pdev;
805 struct device *dev = afu->dev;
827 afu->gmmio_virt = ioremap(gmmio, acfg->global_mmio_size);
828 if (unlikely(!afu->gmmio_virt)) {
834 afu->gmmio_phys = gmmio;
835 afu->ppmmio_phys = ppmmio;
848 * @afu: AFU associated with the host.
854 static int ocxlflash_config_afu(struct pci_dev *pdev, struct ocxl_hw_afu *afu)
856 struct ocxl_afu_config *acfg = &afu->acfg;
857 struct ocxl_fn_config *fcfg = &afu->fcfg;
865 if (!afu->is_present)
877 base = afu->fn_actag_base;
878 count = min_t(int, acfg->actag_supported, afu->fn_actag_enabled);
883 afu->afu_actag_base = base;
884 afu->afu_actag_enabled = count;
885 afu->max_pasid = 1 << acfg->pasid_supported_log;
889 rc = ocxlflash_map_mmio(afu);
912 struct ocxl_hw_afu *afu;
915 afu = kzalloc(sizeof(*afu), GFP_KERNEL);
916 if (unlikely(!afu)) {
921 afu->pdev = pdev;
922 afu->dev = dev;
923 idr_init(&afu->idr);
925 rc = ocxlflash_config_fn(pdev, afu);
932 rc = ocxlflash_config_afu(pdev, afu);
939 ctx = ocxlflash_dev_context_init(pdev, afu);
947 afu->ocxl_ctx = ctx;
949 return afu;
951 ocxlflash_unconfig_afu(afu);
953 ocxlflash_unconfig_fn(pdev, afu);
955 idr_destroy(&afu->idr);
956 kfree(afu);
957 afu = NULL;
1310 struct ocxl_hw_afu *afu = ctx->hw_afu;
1311 struct device *dev = afu->dev;