diff options
author | Bharat Bhushan <Bharat.Bhushan@freescale.com> | 2014-05-06 12:14:50 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2014-05-06 13:28:37 (GMT) |
commit | 88a2952dcfe99540b5602bb34814f01e4342d771 (patch) | |
tree | a1037e83e4474418c61cb15b2df01766104f7e16 /drivers/iommu | |
parent | d4110504d8cce07c5b373ff73bc1181507937405 (diff) | |
download | linux-fsl-qoriq-88a2952dcfe99540b5602bb34814f01e4342d771.tar.xz |
PAMU: Add support for get_dev_iommu_domain()
PAMU window setup of MSI bank for direct assigned device using
VFIO depends on getting iommu domain.
Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
Change-Id: I9c340ab7589ac6b8cee128f6e1598f48de6b0f77
Reviewed-on: http://git.am.freescale.net:8181/11893
Reviewed-by: Varun Sethi <Varun.Sethi@freescale.com>
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/fsl_pamu_domain.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index e62048b..7b54922 100644 --- a/drivers/iommu/fsl_pamu_domain.c +++ b/drivers/iommu/fsl_pamu_domain.c @@ -1302,6 +1302,17 @@ static u32 fsl_pamu_get_windows(struct iommu_domain *domain) return dma_domain->win_cnt; } +static struct iommu_domain *fsl_get_dev_domain(struct device *dev) +{ + struct device_domain_info *info; + + info = dev->archdata.iommu_domain; + if (info && info->domain) + return info->domain->iommu_domain; + + return NULL; +} + static struct iommu_ops fsl_pamu_ops = { .domain_init = fsl_pamu_domain_init, .domain_destroy = fsl_pamu_domain_destroy, @@ -1317,6 +1328,7 @@ static struct iommu_ops fsl_pamu_ops = { .domain_get_attr = fsl_pamu_get_domain_attr, .add_device = fsl_pamu_add_device, .remove_device = fsl_pamu_remove_device, + .get_dev_iommu_domain = fsl_get_dev_domain, }; int pamu_domain_init() |