Lines Matching refs:epc

9 #include <linux/pci-epc.h>
34 static int cdns_pcie_ep_write_header(struct pci_epc *epc, u8 fn, u8 vfn,
37 struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
43 dev_err(&epc->dev, "Only Virtual Function #1 has deviceID\n");
76 static int cdns_pcie_ep_set_bar(struct pci_epc *epc, u8 fn, u8 vfn,
79 struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
150 static void cdns_pcie_ep_clear_bar(struct pci_epc *epc, u8 fn, u8 vfn,
153 struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
183 static int cdns_pcie_ep_map_addr(struct pci_epc *epc, u8 fn, u8 vfn,
186 struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
192 dev_err(&epc->dev, "no free outbound region\n");
205 static void cdns_pcie_ep_unmap_addr(struct pci_epc *epc, u8 fn, u8 vfn,
208 struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
225 static int cdns_pcie_ep_set_msi(struct pci_epc *epc, u8 fn, u8 vfn, u8 mmc)
227 struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
247 static int cdns_pcie_ep_get_msi(struct pci_epc *epc, u8 fn, u8 vfn)
249 struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
270 static int cdns_pcie_ep_get_msix(struct pci_epc *epc, u8 func_no, u8 vfunc_no)
272 struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
289 static int cdns_pcie_ep_set_msix(struct pci_epc *epc, u8 fn, u8 vfn,
293 struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
430 static int cdns_pcie_ep_map_msi_irq(struct pci_epc *epc, u8 fn, u8 vfn,
435 struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
469 ret = cdns_pcie_ep_map_addr(epc, fn, vfn, addr,
533 static int cdns_pcie_ep_raise_irq(struct pci_epc *epc, u8 fn, u8 vfn,
537 struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
562 static int cdns_pcie_ep_start(struct pci_epc *epc)
564 struct cdns_pcie_ep *ep = epc_get_drvdata(epc);
567 int max_epfs = sizeof(epc->function_num_map) * 8;
574 cdns_pcie_writel(pcie, CDNS_PCIE_LM_EP_FUNC_CFG, epc->function_num_map);
578 if (!(epc->function_num_map & BIT(epf)))
615 cdns_pcie_ep_get_features(struct pci_epc *epc, u8 func_no, u8 vfunc_no)
648 struct pci_epc *epc;
679 epc = devm_pci_epc_create(dev, &cdns_pcie_epc_ops);
680 if (IS_ERR(epc)) {
681 dev_err(dev, "failed to create epc device\n");
682 return PTR_ERR(epc);
685 epc_set_drvdata(epc, ep);
687 if (of_property_read_u8(np, "max-functions", &epc->max_functions) < 0)
688 epc->max_functions = 1;
690 ep->epf = devm_kcalloc(dev, epc->max_functions, sizeof(*ep->epf),
695 epc->max_vfs = devm_kcalloc(dev, epc->max_functions,
696 sizeof(*epc->max_vfs), GFP_KERNEL);
697 if (!epc->max_vfs)
701 epc->max_vfs, epc->max_functions);
703 for (i = 0; i < epc->max_functions; i++) {
705 if (epc->max_vfs[i] == 0)
707 epf->epf = devm_kcalloc(dev, epc->max_vfs[i],
714 ret = pci_epc_mem_init(epc, pcie->mem_res->start,
721 ep->irq_cpu_addr = pci_epc_mem_alloc_addr(epc, &ep->irq_phys_addr,
740 pci_epc_mem_exit(epc);