aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powernv/pci-ioda.c
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2018-12-19 19:52:25 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2018-12-21 16:20:46 +1100
commit83fb8ccf975138283c7f6d3685d9c5e2292381dd (patch)
tree98793761ca425d428b3b2f878604aab55e889f48 /arch/powerpc/platforms/powernv/pci-ioda.c
parentpowerpc/powernv/npu: Move single TVE handling to NPU PE (diff)
downloadlinux-dev-83fb8ccf975138283c7f6d3685d9c5e2292381dd.tar.xz
linux-dev-83fb8ccf975138283c7f6d3685d9c5e2292381dd.zip
powerpc/powernv/npu: Convert NPU IOMMU helpers to iommu_table_group_ops
At the moment NPU IOMMU is manipulated directly from the IODA2 PCI PE code; PCI PE acts as a master to NPU PE. Soon we will have compound IOMMU groups with several PEs from several different PHB (such as interconnected GPUs and NPUs) so there will be no single master but a one big IOMMU group. This makes a first step and converts an NPU PE with a set of extern function to a table group. This should cause no behavioral change. Note that pnv_npu_release_ownership() has never been implemented. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powernv/pci-ioda.c')
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 2f2dcad92346..87cc10bccbfa 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -2667,12 +2667,13 @@ static struct pnv_ioda_pe *gpe_table_group_to_npe(
static long pnv_pci_ioda2_npu_set_window(struct iommu_table_group *table_group,
int num, struct iommu_table *tbl)
{
+ struct pnv_ioda_pe *npe = gpe_table_group_to_npe(table_group);
long ret = pnv_pci_ioda2_set_window(table_group, num, tbl);
if (ret)
return ret;
- ret = pnv_npu_set_window(gpe_table_group_to_npe(table_group), num, tbl);
+ ret = npe->table_group.ops->set_window(&npe->table_group, num, tbl);
if (ret)
pnv_pci_ioda2_unset_window(table_group, num);
@@ -2683,17 +2684,20 @@ static long pnv_pci_ioda2_npu_unset_window(
struct iommu_table_group *table_group,
int num)
{
+ struct pnv_ioda_pe *npe = gpe_table_group_to_npe(table_group);
long ret = pnv_pci_ioda2_unset_window(table_group, num);
if (ret)
return ret;
- return pnv_npu_unset_window(gpe_table_group_to_npe(table_group), num);
+ return npe->table_group.ops->unset_window(&npe->table_group, num);
}
static void pnv_ioda2_npu_take_ownership(struct iommu_table_group *table_group)
{
- pnv_npu_take_ownership(gpe_table_group_to_npe(table_group));
+ struct pnv_ioda_pe *npe = gpe_table_group_to_npe(table_group);
+
+ npe->table_group.ops->take_ownership(&npe->table_group);
pnv_ioda2_take_ownership(table_group);
}