diff options
author | Yangbo Lu <yangbo.lu@nxp.com> | 2018-08-15 16:08:53 +0800 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2018-09-22 21:20:57 +0200 |
commit | a83eae385ab72c895e9af898a6fc392f05fe9728 (patch) | |
tree | 7b8a681e58dcc8e8403fa9913e9ce3a3d556e267 /target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch | |
parent | ad1dbc0ca304686a7f826528e674620791f34584 (diff) | |
download | upstream-a83eae385ab72c895e9af898a6fc392f05fe9728.tar.gz upstream-a83eae385ab72c895e9af898a6fc392f05fe9728.tar.bz2 upstream-a83eae385ab72c895e9af898a6fc392f05fe9728.zip |
layerscape: update linux 4.9 patches to LSDK-18.06
This patch is to update linux 4.9 patches to LSDK-18.06
release and to adjust config-4.9 accordingly.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Diffstat (limited to 'target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch')
-rw-r--r-- | target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch | 90 |
1 files changed, 65 insertions, 25 deletions
diff --git a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch index 816abbb9e7..afd29e4fe2 100644 --- a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch @@ -1,7 +1,7 @@ -From 0a6c701f92e1aa368c44632fa0985e92703354ed Mon Sep 17 00:00:00 2001 +From 89a1f0d7826df69d8e02268b97bc3da02e07203f Mon Sep 17 00:00:00 2001 From: Yangbo Lu <yangbo.lu@nxp.com> -Date: Wed, 17 Jan 2018 15:35:48 +0800 -Subject: [PATCH 22/30] iommu: support layerscape +Date: Thu, 5 Jul 2018 17:35:15 +0800 +Subject: [PATCH 22/32] iommu: support layerscape This is an integrated patch for layerscape smmu support. @@ -11,17 +11,17 @@ Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> --- - drivers/iommu/amd_iommu.c | 56 ++++++---- - drivers/iommu/arm-smmu-v3.c | 111 ++++++++++++++------ - drivers/iommu/arm-smmu.c | 100 +++++++++++++++--- - drivers/iommu/dma-iommu.c | 242 ++++++++++++++++++++++++++++++++++++------- - drivers/iommu/intel-iommu.c | 92 ++++++++++++---- - drivers/iommu/iommu.c | 219 ++++++++++++++++++++++++++++++++++++--- + drivers/iommu/amd_iommu.c | 56 +++++--- + drivers/iommu/arm-smmu-v3.c | 111 +++++++++++----- + drivers/iommu/arm-smmu.c | 100 ++++++++++++--- + drivers/iommu/dma-iommu.c | 242 +++++++++++++++++++++++++++++------ + drivers/iommu/intel-iommu.c | 92 ++++++++++--- + drivers/iommu/iommu.c | 240 ++++++++++++++++++++++++++++++++-- drivers/iommu/mtk_iommu.c | 2 + drivers/iommu/mtk_iommu_v1.c | 2 + include/linux/dma-iommu.h | 11 ++ - include/linux/iommu.h | 55 +++++++--- - 10 files changed, 739 insertions(+), 151 deletions(-) + include/linux/iommu.h | 57 +++++++-- + 10 files changed, 762 insertions(+), 151 deletions(-) --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -312,7 +312,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> out_unlock: mutex_unlock(&smmu_domain->init_mutex); return ret; -@@ -1712,6 +1723,9 @@ arm_smmu_iova_to_phys(struct iommu_domai +@@ -1695,6 +1706,9 @@ arm_smmu_unmap(struct iommu_domain *doma struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); struct io_pgtable_ops *ops = smmu_domain->pgtbl_ops; @@ -398,7 +398,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> #include <linux/spinlock.h> #include <linux/amba/bus.h> -+#include "../staging/fsl-mc/include/mc-bus.h" ++#include <linux/fsl/mc.h> #include "io-pgtable.h" @@ -1132,7 +1132,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> static void quirk_iommu_g4x_gfx(struct pci_dev *dev) --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c -@@ -36,6 +36,7 @@ +@@ -33,9 +33,11 @@ + #include <linux/bitops.h> + #include <linux/property.h> + #include <trace/events/iommu.h> ++#include <linux/fsl/mc.h> static struct kset *iommu_group_kset; static DEFINE_IDA(iommu_group_ida); @@ -1140,7 +1144,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> struct iommu_callback_data { const struct iommu_ops *ops; -@@ -68,6 +69,13 @@ struct iommu_group_attribute { +@@ -68,6 +70,13 @@ struct iommu_group_attribute { const char *buf, size_t count); }; @@ -1154,7 +1158,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> #define IOMMU_GROUP_ATTR(_name, _mode, _show, _store) \ struct iommu_group_attribute iommu_group_attr_##_name = \ __ATTR(_name, _mode, _show, _store) -@@ -86,6 +94,18 @@ static int __iommu_attach_group(struct i +@@ -86,6 +95,18 @@ static int __iommu_attach_group(struct i static void __iommu_detach_group(struct iommu_domain *domain, struct iommu_group *group); @@ -1173,7 +1177,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> static ssize_t iommu_group_attr_show(struct kobject *kobj, struct attribute *__attr, char *buf) { -@@ -133,8 +153,131 @@ static ssize_t iommu_group_show_name(str +@@ -133,8 +154,131 @@ static ssize_t iommu_group_show_name(str return sprintf(buf, "%s\n", group->name); } @@ -1305,7 +1309,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> static void iommu_group_release(struct kobject *kobj) { struct iommu_group *group = to_iommu_group(kobj); -@@ -212,6 +355,11 @@ struct iommu_group *iommu_group_alloc(vo +@@ -212,6 +356,11 @@ struct iommu_group *iommu_group_alloc(vo */ kobject_put(&group->kobj); @@ -1317,7 +1321,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> pr_debug("Allocated group %d\n", group->id); return group; -@@ -318,7 +466,7 @@ static int iommu_group_create_direct_map +@@ -318,7 +467,7 @@ static int iommu_group_create_direct_map struct device *dev) { struct iommu_domain *domain = group->default_domain; @@ -1326,7 +1330,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> struct list_head mappings; unsigned long pg_size; int ret = 0; -@@ -331,18 +479,21 @@ static int iommu_group_create_direct_map +@@ -331,18 +480,21 @@ static int iommu_group_create_direct_map pg_size = 1UL << __ffs(domain->pgsize_bitmap); INIT_LIST_HEAD(&mappings); @@ -1351,7 +1355,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> for (addr = start; addr < end; addr += pg_size) { phys_addr_t phys_addr; -@@ -358,7 +509,7 @@ static int iommu_group_create_direct_map +@@ -358,7 +510,7 @@ static int iommu_group_create_direct_map } out: @@ -1360,7 +1364,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> return ret; } -@@ -563,6 +714,19 @@ struct iommu_group *iommu_group_get(stru +@@ -563,6 +715,19 @@ struct iommu_group *iommu_group_get(stru EXPORT_SYMBOL_GPL(iommu_group_get); /** @@ -1380,7 +1384,34 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> * iommu_group_put - Decrement group reference * @group: the group to use * -@@ -845,10 +1009,19 @@ struct iommu_group *iommu_group_get_for_ +@@ -812,6 +977,26 @@ struct iommu_group *pci_device_group(str + return group; + } + ++/* Get the IOMMU group for device on fsl-mc bus */ ++struct iommu_group *fsl_mc_device_group(struct device *dev) ++{ ++ struct device *cont_dev = fsl_mc_cont_dev(dev); ++ struct iommu_group *group; ++ ++ /* Container device is responsible for creating the iommu group */ ++ if (fsl_mc_is_cont_dev(dev)) { ++ group = iommu_group_alloc(); ++ if (IS_ERR(group)) ++ return NULL; ++ } else { ++ get_device(cont_dev); ++ group = iommu_group_get(cont_dev); ++ put_device(cont_dev); ++ } ++ ++ return group; ++} ++ + /** + * iommu_group_get_for_dev - Find or create the IOMMU group for a device + * @dev: target device +@@ -845,10 +1030,19 @@ struct iommu_group *iommu_group_get_for_ * IOMMU driver. */ if (!group->default_domain) { @@ -1403,7 +1434,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> } ret = iommu_group_add_device(group, dev); -@@ -1557,20 +1730,38 @@ int iommu_domain_set_attr(struct iommu_d +@@ -1557,20 +1751,38 @@ int iommu_domain_set_attr(struct iommu_d } EXPORT_SYMBOL_GPL(iommu_domain_set_attr); @@ -1604,7 +1635,16 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> extern void iommu_group_put(struct iommu_group *group); extern int iommu_group_register_notifier(struct iommu_group *group, struct notifier_block *nb); -@@ -439,16 +460,22 @@ static inline void iommu_set_fault_handl +@@ -330,6 +351,8 @@ static inline size_t iommu_map_sg(struct + extern struct iommu_group *pci_device_group(struct device *dev); + /* Generic device grouping function */ + extern struct iommu_group *generic_device_group(struct device *dev); ++/* FSL-MC device grouping function */ ++struct iommu_group *fsl_mc_device_group(struct device *dev); + + /** + * struct iommu_fwspec - per-device IOMMU instance data +@@ -439,16 +462,22 @@ static inline void iommu_set_fault_handl { } |