summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorVarun Sethi <Varun.Sethi@freescale.com>2013-07-12 13:08:24 (GMT)
committerAndy Fleming <afleming@freescale.com>2013-07-12 23:04:07 (GMT)
commit17a88bbbadb880d5fec537e8be597f9e9a7c77f6 (patch)
tree0e0795703e7c6b8a2036aacfc1d75771af14f4b0 /drivers/iommu
parent1fd9018f9c6a10932e86285c256bfdf50da8c0c1 (diff)
downloadlinux-fsl-qoriq-17a88bbbadb880d5fec537e8be597f9e9a7c77f6.tar.xz
Put the PCI specific code in the PAMU driver under CONFIG_PCI.
This fixes the problem where the kernel build breaks, when PCI support is disabled. Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com> Change-Id: I698626ec0a40ba81ef132890bc339c6be10d8673 Reviewed-on: http://git.am.freescale.net:8181/3282 Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/fsl_pamu_domain.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index 4575e63..5b54505 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -691,6 +691,7 @@ static int fsl_pamu_attach_device(struct iommu_domain *domain,
const u32 *liodn;
u32 liodn_cnt;
int len, ret = 0;
+#ifdef CONFIG_PCI
struct pci_dev *pdev = NULL;
struct pci_controller *pci_ctl;
@@ -708,6 +709,7 @@ static int fsl_pamu_attach_device(struct iommu_domain *domain,
*/
dev = pci_ctl->parent;
}
+#endif
liodn = of_get_property(dev->of_node, "fsl,liodn", &len);
if (liodn) {
@@ -729,6 +731,7 @@ static void fsl_pamu_detach_device(struct iommu_domain *domain,
struct fsl_dma_domain *dma_domain = domain->priv;
const u32 *prop;
int len;
+#ifdef CONFIG_PCI
struct pci_dev *pdev = NULL;
struct pci_controller *pci_ctl;
@@ -746,6 +749,7 @@ static void fsl_pamu_detach_device(struct iommu_domain *domain,
*/
dev = pci_ctl->parent;
}
+#endif
prop = of_get_property(dev->of_node, "fsl,liodn", &len);
if (prop)
@@ -901,12 +905,6 @@ static int fsl_pamu_get_domain_attr(struct iommu_domain *domain,
return ret;
}
-static void swap_pci_ref(struct pci_dev **from, struct pci_dev *to)
-{
- pci_dev_put(*from);
- *from = to;
-}
-
static struct iommu_group *get_device_iommu_group(struct device *dev)
{
struct iommu_group *group;
@@ -918,6 +916,13 @@ static struct iommu_group *get_device_iommu_group(struct device *dev)
return group;
}
+#ifdef CONFIG_PCI
+static void swap_pci_ref(struct pci_dev **from, struct pci_dev *to)
+{
+ pci_dev_put(*from);
+ *from = to;
+}
+
static bool check_pci_ctl_endpt_part(struct pci_controller *pci_ctl)
{
u32 version;
@@ -1014,12 +1019,14 @@ static struct iommu_group *get_pci_device_group(struct pci_dev *pdev)
return group;
}
+#endif
static int fsl_pamu_add_device(struct device *dev)
{
struct iommu_group *group = NULL;
- struct pci_dev *pdev;
int ret;
+#ifdef CONFIG_PCI
+ struct pci_dev *pdev;
/*
* For platform devices we allocate a separate group for
@@ -1034,6 +1041,7 @@ static int fsl_pamu_add_device(struct device *dev)
group = get_pci_device_group(pdev);
} else
+#endif
group = get_device_iommu_group(dev);
if (!group || IS_ERR(group))
@@ -1108,8 +1116,9 @@ static u32 fsl_pamu_get_windows(struct iommu_domain *domain)
static struct iommu_domain *fsl_get_dev_domain(struct device *dev)
{
- struct pci_controller *pci_ctl;
struct device_domain_info *info;
+#ifdef CONFIG_PCI
+ struct pci_controller *pci_ctl;
struct pci_dev *pdev;
/*
@@ -1127,6 +1136,7 @@ static struct iommu_domain *fsl_get_dev_domain(struct device *dev)
*/
dev = pci_ctl->parent;
}
+#endif
info = dev->archdata.iommu_domain;
if (info && info->domain)
@@ -1162,7 +1172,9 @@ int pamu_domain_init()
return ret;
bus_set_iommu(&platform_bus_type, &fsl_pamu_ops);
+#ifdef CONFIG_PCI
bus_set_iommu(&pci_bus_type, &fsl_pamu_ops);
+#endif
return ret;
}