page_pool: remove PP_FLAG_PAGE_FRAG
[platform/kernel/linux-rpi.git] / drivers / iommu / bcm2712-iommu.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * IOMMU driver for BCM2712
4  *
5  * Copyright (c) 2023 Raspberry Pi Ltd.
6  */
7
8 #ifndef _BCM2712_IOMMU_H
9 #define _BCM2712_IOMMU_H
10
11 #include <linux/iommu.h>
12 #include <linux/scatterlist.h>
13
14 struct bcm2712_iommu_cache {
15         struct device *dev;
16         spinlock_t hw_lock; /* to protect HW registers */
17         void __iomem *reg_base;
18 };
19
20 void bcm2712_iommu_cache_flush(struct bcm2712_iommu_cache *cache);
21
22 struct bcm2712_iommu {
23         struct device *dev;
24         struct iommu_device iommu;
25         struct iommu_group *group;
26         struct bcm2712_iommu_domain *domain;
27         char const *name;
28         struct sg_table *sgt; /* allocated memory for page tables */
29         u32 *tables;          /* kernel mapping for page tables */
30         struct bcm2712_iommu_cache *cache;
31         spinlock_t hw_lock;   /* to protect HW registers */
32         void __iomem *reg_base;
33         u64 dma_iova_offset; /* Hack for IOMMU attached to PCIe RC */
34         u32 bigpage_mask;
35         u32 superpage_mask;
36         unsigned int nmapped_pages;
37         bool dirty; /* true when tables are oriented towards CPU */
38 };
39
40 struct bcm2712_iommu_domain {
41         struct iommu_domain base;
42         struct bcm2712_iommu *mmu;
43 };
44
45 #endif