Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Copyright (C) 2018 Intel Corporation */
0003 /* Copyright 2018 Google LLC. */
0004 
0005 #ifndef __IPU3_MMU_H
0006 #define __IPU3_MMU_H
0007 
0008 #define IPU3_PAGE_SHIFT     12
0009 #define IPU3_PAGE_SIZE      (1UL << IPU3_PAGE_SHIFT)
0010 
0011 /**
0012  * struct imgu_mmu_info - Describes mmu geometry
0013  *
0014  * @aperture_start: First address that can be mapped
0015  * @aperture_end:   Last address that can be mapped
0016  */
0017 struct imgu_mmu_info {
0018     dma_addr_t aperture_start;
0019     dma_addr_t aperture_end;
0020 };
0021 
0022 struct device;
0023 struct scatterlist;
0024 
0025 struct imgu_mmu_info *imgu_mmu_init(struct device *parent, void __iomem *base);
0026 void imgu_mmu_exit(struct imgu_mmu_info *info);
0027 void imgu_mmu_suspend(struct imgu_mmu_info *info);
0028 void imgu_mmu_resume(struct imgu_mmu_info *info);
0029 
0030 int imgu_mmu_map(struct imgu_mmu_info *info, unsigned long iova,
0031          phys_addr_t paddr, size_t size);
0032 size_t imgu_mmu_unmap(struct imgu_mmu_info *info, unsigned long iova,
0033               size_t size);
0034 size_t imgu_mmu_map_sg(struct imgu_mmu_info *info, unsigned long iova,
0035                struct scatterlist *sg, unsigned int nents);
0036 #endif