mtk_iommu.c (05aed9412b0bd0d9a985d94010c42ff0a5c6cc29) mtk_iommu.c (abfd6fe0cd535d31ee83b668be6eb59ce6a8469d)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (c) 2015-2016 MediaTek Inc.
4 * Author: Yong Wu <yong.wu@mediatek.com>
5 */
6#include <linux/memblock.h>
7#include <linux/bug.h>
8#include <linux/clk.h>

--- 188 unchanged lines hidden (view full) ---

197
198static void mtk_iommu_tlb_flush_leaf(unsigned long iova, size_t size,
199 size_t granule, void *cookie)
200{
201 mtk_iommu_tlb_add_flush_nosync(iova, size, granule, true, cookie);
202 mtk_iommu_tlb_sync(cookie);
203}
204
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (c) 2015-2016 MediaTek Inc.
4 * Author: Yong Wu <yong.wu@mediatek.com>
5 */
6#include <linux/memblock.h>
7#include <linux/bug.h>
8#include <linux/clk.h>

--- 188 unchanged lines hidden (view full) ---

197
198static void mtk_iommu_tlb_flush_leaf(unsigned long iova, size_t size,
199 size_t granule, void *cookie)
200{
201 mtk_iommu_tlb_add_flush_nosync(iova, size, granule, true, cookie);
202 mtk_iommu_tlb_sync(cookie);
203}
204
205static void mtk_iommu_tlb_flush_page_nosync(unsigned long iova, size_t granule,
206 void *cookie)
207{
208 mtk_iommu_tlb_add_flush_nosync(iova, granule, granule, true, cookie);
209}
210
205static const struct iommu_flush_ops mtk_iommu_flush_ops = {
206 .tlb_flush_all = mtk_iommu_tlb_flush_all,
207 .tlb_flush_walk = mtk_iommu_tlb_flush_walk,
208 .tlb_flush_leaf = mtk_iommu_tlb_flush_leaf,
211static const struct iommu_flush_ops mtk_iommu_flush_ops = {
212 .tlb_flush_all = mtk_iommu_tlb_flush_all,
213 .tlb_flush_walk = mtk_iommu_tlb_flush_walk,
214 .tlb_flush_leaf = mtk_iommu_tlb_flush_leaf,
209 .tlb_add_flush = mtk_iommu_tlb_add_flush_nosync,
215 .tlb_add_page = mtk_iommu_tlb_flush_page_nosync,
210 .tlb_sync = mtk_iommu_tlb_sync,
211};
212
213static irqreturn_t mtk_iommu_isr(int irq, void *dev_id)
214{
215 struct mtk_iommu_data *data = dev_id;
216 struct mtk_iommu_domain *dom = data->m4u_dom;
217 u32 int_state, regval, fault_iova, fault_pa;

--- 568 unchanged lines hidden ---
216 .tlb_sync = mtk_iommu_tlb_sync,
217};
218
219static irqreturn_t mtk_iommu_isr(int irq, void *dev_id)
220{
221 struct mtk_iommu_data *data = dev_id;
222 struct mtk_iommu_domain *dom = data->m4u_dom;
223 u32 int_state, regval, fault_iova, fault_pa;

--- 568 unchanged lines hidden ---