linux/drivers/gpu/drm/msm/msm_iommu.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <[email protected]>
 */

#include <linux/adreno-smmu-priv.h>
#include <linux/io-pgtable.h>
#include "msm_drv.h"
#include "msm_mmu.h"

struct msm_iommu {};

#define to_msm_iommu(x)

struct msm_iommu_pagetable {};
static struct msm_iommu_pagetable *to_pagetable(struct msm_mmu *mmu)
{}

/* based on iommu_pgsize() in iommu.c: */
static size_t calc_pgsize(struct msm_iommu_pagetable *pagetable,
			   unsigned long iova, phys_addr_t paddr,
			   size_t size, size_t *count)
{}

static int msm_iommu_pagetable_unmap(struct msm_mmu *mmu, u64 iova,
		size_t size)
{}

static int msm_iommu_pagetable_map(struct msm_mmu *mmu, u64 iova,
		struct sg_table *sgt, size_t len, int prot)
{}

static void msm_iommu_pagetable_destroy(struct msm_mmu *mmu)
{}

int msm_iommu_pagetable_params(struct msm_mmu *mmu,
		phys_addr_t *ttbr, int *asid)
{}

struct iommu_domain_geometry *msm_iommu_get_geometry(struct msm_mmu *mmu)
{}

static const struct msm_mmu_funcs pagetable_funcs =;

static void msm_iommu_tlb_flush_all(void *cookie)
{}

static void msm_iommu_tlb_flush_walk(unsigned long iova, size_t size,
		size_t granule, void *cookie)
{}

static void msm_iommu_tlb_add_page(struct iommu_iotlb_gather *gather,
		unsigned long iova, size_t granule, void *cookie)
{}

static const struct iommu_flush_ops tlb_ops =;

static int msm_fault_handler(struct iommu_domain *domain, struct device *dev,
		unsigned long iova, int flags, void *arg);

struct msm_mmu *msm_iommu_pagetable_create(struct msm_mmu *parent)
{}

static int msm_fault_handler(struct iommu_domain *domain, struct device *dev,
		unsigned long iova, int flags, void *arg)
{}

static void msm_iommu_resume_translation(struct msm_mmu *mmu)
{}

static void msm_iommu_detach(struct msm_mmu *mmu)
{}

static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova,
		struct sg_table *sgt, size_t len, int prot)
{}

static int msm_iommu_unmap(struct msm_mmu *mmu, uint64_t iova, size_t len)
{}

static void msm_iommu_destroy(struct msm_mmu *mmu)
{}

static const struct msm_mmu_funcs funcs =;

struct msm_mmu *msm_iommu_new(struct device *dev, unsigned long quirks)
{}

struct msm_mmu *msm_iommu_gpu_new(struct device *dev, struct msm_gpu *gpu, unsigned long quirks)
{}