Lines Matching full:smmu
10 #include "arm-smmu.h"
20 * The third instance usage is through standard arm-smmu driver itself and
26 struct arm_smmu_device smmu; member
30 static inline void __iomem *nvidia_smmu_page(struct arm_smmu_device *smmu, in nvidia_smmu_page() argument
35 nvidia_smmu = container_of(smmu, struct nvidia_smmu, smmu); in nvidia_smmu_page()
36 return nvidia_smmu->bases[inst] + (page << smmu->pgshift); in nvidia_smmu_page()
39 static u32 nvidia_smmu_read_reg(struct arm_smmu_device *smmu, in nvidia_smmu_read_reg() argument
42 void __iomem *reg = nvidia_smmu_page(smmu, 0, page) + offset; in nvidia_smmu_read_reg()
47 static void nvidia_smmu_write_reg(struct arm_smmu_device *smmu, in nvidia_smmu_write_reg() argument
53 void __iomem *reg = nvidia_smmu_page(smmu, i, page) + offset; in nvidia_smmu_write_reg()
59 static u64 nvidia_smmu_read_reg64(struct arm_smmu_device *smmu, in nvidia_smmu_read_reg64() argument
62 void __iomem *reg = nvidia_smmu_page(smmu, 0, page) + offset; in nvidia_smmu_read_reg64()
67 static void nvidia_smmu_write_reg64(struct arm_smmu_device *smmu, in nvidia_smmu_write_reg64() argument
73 void __iomem *reg = nvidia_smmu_page(smmu, i, page) + offset; in nvidia_smmu_write_reg64()
79 static void nvidia_smmu_tlb_sync(struct arm_smmu_device *smmu, int page, in nvidia_smmu_tlb_sync() argument
84 arm_smmu_writel(smmu, page, sync, 0); in nvidia_smmu_tlb_sync()
96 reg = nvidia_smmu_page(smmu, i, page) + status; in nvidia_smmu_tlb_sync()
109 dev_err_ratelimited(smmu->dev, in nvidia_smmu_tlb_sync()
110 "TLB sync timed out -- SMMU may be deadlocked\n"); in nvidia_smmu_tlb_sync()
113 static int nvidia_smmu_reset(struct arm_smmu_device *smmu) in nvidia_smmu_reset() argument
119 void __iomem *reg = nvidia_smmu_page(smmu, i, ARM_SMMU_GR0) + in nvidia_smmu_reset()
131 struct arm_smmu_device *smmu, in nvidia_smmu_global_fault_inst() argument
135 void __iomem *gr0_base = nvidia_smmu_page(smmu, inst, 0); in nvidia_smmu_global_fault_inst()
145 dev_err_ratelimited(smmu->dev, in nvidia_smmu_global_fault_inst()
147 dev_err_ratelimited(smmu->dev, in nvidia_smmu_global_fault_inst()
159 struct arm_smmu_device *smmu = dev; in nvidia_smmu_global_fault() local
164 irq_ret = nvidia_smmu_global_fault_inst(irq, smmu, inst); in nvidia_smmu_global_fault()
173 struct arm_smmu_device *smmu, in nvidia_smmu_context_fault_bank() argument
178 void __iomem *gr1_base = nvidia_smmu_page(smmu, inst, 1); in nvidia_smmu_context_fault_bank()
179 void __iomem *cb_base = nvidia_smmu_page(smmu, inst, smmu->numpage + idx); in nvidia_smmu_context_fault_bank()
189 dev_err_ratelimited(smmu->dev, in nvidia_smmu_context_fault_bank()
202 struct arm_smmu_device *smmu; in nvidia_smmu_context_fault() local
207 smmu = smmu_domain->smmu; in nvidia_smmu_context_fault()
216 for (idx = 0; idx < smmu->num_context_banks; idx++) { in nvidia_smmu_context_fault()
217 irq_ret = nvidia_smmu_context_fault_bank(irq, smmu, in nvidia_smmu_context_fault()
238 struct arm_smmu_device *nvidia_smmu_impl_init(struct arm_smmu_device *smmu) in nvidia_smmu_impl_init() argument
241 struct device *dev = smmu->dev; in nvidia_smmu_impl_init()
250 * Copy the data from struct arm_smmu_device *smmu allocated in in nvidia_smmu_impl_init()
251 * arm-smmu.c. The smmu from struct nvidia_smmu replaces the smmu in nvidia_smmu_impl_init()
252 * pointer used in arm-smmu.c once this function returns. in nvidia_smmu_impl_init()
253 * This is necessary to derive nvidia_smmu from smmu pointer passed in nvidia_smmu_impl_init()
256 nvidia_smmu->smmu = *smmu; in nvidia_smmu_impl_init()
257 /* Instance 0 is ioremapped by arm-smmu.c. */ in nvidia_smmu_impl_init()
258 nvidia_smmu->bases[0] = smmu->base; in nvidia_smmu_impl_init()
268 nvidia_smmu->smmu.impl = &nvidia_smmu_impl; in nvidia_smmu_impl_init()
271 * Free the struct arm_smmu_device *smmu allocated in arm-smmu.c. in nvidia_smmu_impl_init()
272 * Once this function returns, arm-smmu.c would use arm_smmu_device in nvidia_smmu_impl_init()
275 devm_kfree(dev, smmu); in nvidia_smmu_impl_init()
277 return &nvidia_smmu->smmu; in nvidia_smmu_impl_init()