Commit 80f97f0f73b82444f714651ea053838d27779dca
Committed by
Joerg Roedel
1 parent
bb5547acfc
Exists in
master
and in
20 other branches
iommu/fsl: Add the window permission flag as a parameter to iommu_window_enable API.
Each iommu window can have access permissions associated with it. Extended the window_enable API to incorporate window access permissions. In case of PAMU each window can have its specific set of permissions. Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
Showing 2 changed files with 7 additions and 5 deletions Side-by-side Diff
drivers/iommu/iommu.c
... | ... | @@ -853,12 +853,13 @@ |
853 | 853 | |
854 | 854 | |
855 | 855 | int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, |
856 | - phys_addr_t paddr, u64 size) | |
856 | + phys_addr_t paddr, u64 size, int prot) | |
857 | 857 | { |
858 | 858 | if (unlikely(domain->ops->domain_window_enable == NULL)) |
859 | 859 | return -ENODEV; |
860 | 860 | |
861 | - return domain->ops->domain_window_enable(domain, wnd_nr, paddr, size); | |
861 | + return domain->ops->domain_window_enable(domain, wnd_nr, paddr, size, | |
862 | + prot); | |
862 | 863 | } |
863 | 864 | EXPORT_SYMBOL_GPL(iommu_domain_window_enable); |
864 | 865 |
include/linux/iommu.h
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 | |
105 | 105 | /* Window handling functions */ |
106 | 106 | int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr, |
107 | - phys_addr_t paddr, u64 size); | |
107 | + phys_addr_t paddr, u64 size, int prot); | |
108 | 108 | void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr); |
109 | 109 | /* Set the numer of window per domain */ |
110 | 110 | int (*domain_set_windows)(struct iommu_domain *domain, u32 w_count); |
... | ... | @@ -169,7 +169,8 @@ |
169 | 169 | |
170 | 170 | /* Window handling function prototypes */ |
171 | 171 | extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, |
172 | - phys_addr_t offset, u64 size); | |
172 | + phys_addr_t offset, u64 size, | |
173 | + int prot); | |
173 | 174 | extern void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr); |
174 | 175 | /** |
175 | 176 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework |
... | ... | @@ -255,7 +256,7 @@ |
255 | 256 | |
256 | 257 | static inline int iommu_domain_window_enable(struct iommu_domain *domain, |
257 | 258 | u32 wnd_nr, phys_addr_t paddr, |
258 | - u64 size) | |
259 | + u64 size, int prot) | |
259 | 260 | { |
260 | 261 | return -ENODEV; |
261 | 262 | } |