1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2018 Intel Corporation */
3 /* Copyright 2018 Google LLC. */
8 #define IPU3_PAGE_SHIFT 12
9 #define IPU3_PAGE_SIZE (1UL << IPU3_PAGE_SHIFT)
12 * struct imgu_mmu_info - Describes mmu geometry
14 * @aperture_start: First address that can be mapped
15 * @aperture_end: Last address that can be mapped
17 struct imgu_mmu_info {
18 dma_addr_t aperture_start;
19 dma_addr_t aperture_end;
25 struct imgu_mmu_info *imgu_mmu_init(struct device *parent, void __iomem *base);
26 void imgu_mmu_exit(struct imgu_mmu_info *info);
27 void imgu_mmu_suspend(struct imgu_mmu_info *info);
28 void imgu_mmu_resume(struct imgu_mmu_info *info);
30 int imgu_mmu_map(struct imgu_mmu_info *info, unsigned long iova,
31 phys_addr_t paddr, size_t size);
32 size_t imgu_mmu_unmap(struct imgu_mmu_info *info, unsigned long iova,
34 size_t imgu_mmu_map_sg(struct imgu_mmu_info *info, unsigned long iova,
35 struct scatterlist *sg, unsigned int nents);