xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/midgard/mali_kbase_mmu_mode.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  *
3  * (C) COPYRIGHT 2014-2015, 2017 ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the
6  * GNU General Public License version 2 as published by the Free Software
7  * Foundation, and any use by you of this program is subject to the terms
8  * of such GNU licence.
9  *
10  * A copy of the licence is included with the program, and can also be obtained
11  * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12  * Boston, MA  02110-1301, USA.
13  *
14  */
15 
16 
17 
18 
19 
20 #ifndef _MALI_KBASE_MMU_MODE_
21 #define _MALI_KBASE_MMU_MODE_
22 
23 #include <linux/types.h>
24 
25 /* Forward declarations */
26 struct kbase_context;
27 struct kbase_device;
28 struct kbase_as;
29 struct kbase_mmu_setup;
30 
31 struct kbase_mmu_mode {
32 	void (*update)(struct kbase_context *kctx);
33 	void (*get_as_setup)(struct kbase_context *kctx,
34 			struct kbase_mmu_setup * const setup);
35 	void (*disable_as)(struct kbase_device *kbdev, int as_nr);
36 	phys_addr_t (*pte_to_phy_addr)(u64 entry);
37 	int (*ate_is_valid)(u64 ate);
38 	int (*pte_is_valid)(u64 pte);
39 	void (*entry_set_ate)(u64 *entry, phys_addr_t phy, unsigned long flags);
40 	void (*entry_set_pte)(u64 *entry, phys_addr_t phy);
41 	void (*entry_invalidate)(u64 *entry);
42 };
43 
44 struct kbase_mmu_mode const *kbase_mmu_mode_get_lpae(void);
45 struct kbase_mmu_mode const *kbase_mmu_mode_get_aarch64(void);
46 
47 #endif /* _MALI_KBASE_MMU_MODE_ */
48