aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/cxl/cxl.h
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2015-05-27 02:07:18 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2015-06-02 23:27:20 -0400
commit6f7f0b3df6d49316c6f27390bb5ec250255be548 (patch)
tree28c8e7d088f936e08a66344c723003b71a5ca29b /drivers/misc/cxl/cxl.h
parent0520336afe5de76324c73f793bc40732e5c13359 (diff)
cxl: Add AFU virtual PHB and kernel API
This patch does two things. Firstly it presents the Accelerator Function Unit (AFUs) behind the POWER Service Layer (PSL) as PCI devices on a virtual PCI Host Bridge (vPHB). This in in addition to the PSL being a PCI device itself. As part of the Coherent Accelerator Interface Architecture (CAIA) AFUs can provide an AFU configuration. This AFU configuration recored is architected to be the same as a PCI config space. This patch sets discovers the AFU configuration records, provides AFU config space read/write functions to these configuration records. It then enumerates the PCI bus. It also hooks in PCI ops where appropriate. It also destroys the vPHB when the physical card is removed. Secondly, it add an in kernel API for AFU to use CXL. AFUs must present a driver that firstly binds as a PCI device. This PCI device can then be using to do CXL specific operations (that can't sit in the PCI ops) using this API. Signed-off-by: Michael Neuling <mikey@neuling.org> Acked-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/misc/cxl/cxl.h')
-rw-r--r--drivers/misc/cxl/cxl.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
index 2ec8e96e2de3..4fd66cabde1e 100644
--- a/drivers/misc/cxl/cxl.h
+++ b/drivers/misc/cxl/cxl.h
@@ -378,6 +378,9 @@ struct cxl_afu {
378 int spa_max_procs; 378 int spa_max_procs;
379 unsigned int psl_virq; 379 unsigned int psl_virq;
380 380
381 /* pointer to the vphb */
382 struct pci_controller *phb;
383
381 int pp_irqs; 384 int pp_irqs;
382 int irqs_max; 385 int irqs_max;
383 int num_procs; 386 int num_procs;
@@ -671,6 +674,8 @@ int cxl_afu_check_and_enable(struct cxl_afu *afu);
671int cxl_psl_purge(struct cxl_afu *afu); 674int cxl_psl_purge(struct cxl_afu *afu);
672 675
673void cxl_stop_trace(struct cxl *cxl); 676void cxl_stop_trace(struct cxl *cxl);
677int cxl_pci_vphb_add(struct cxl_afu *afu);
678void cxl_pci_vphb_remove(struct cxl_afu *afu);
674 679
675extern struct pci_driver cxl_pci_driver; 680extern struct pci_driver cxl_pci_driver;
676int afu_allocate_irqs(struct cxl_context *ctx, u32 count); 681int afu_allocate_irqs(struct cxl_context *ctx, u32 count);