GNU Linux-libre 4.14.251-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / include / mmu / sh_mmu.h
1 /*
2  * Support for Medifield PNW Camera Imaging ISP subsystem.
3  *
4  * Copyright (c) 2010 Intel Corporation. All Rights Reserved.
5  *
6  * Copyright (c) 2010 Silicon Hive www.siliconhive.com.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License version
10  * 2 as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  * 02110-1301, USA.
21  *
22  */
23 #ifndef SH_MMU_H_
24 #define SH_MMU_H_
25
26
27 #include <sh_css.h>
28
29 #include "mmu/isp_mmu.h"
30
31
32 /*
33  * include SH header file here
34  */
35
36 /*
37  * set page directory base address (physical address).
38  *
39  * must be provided.
40  */
41 static int sh_set_pd_base(struct isp_mmu *mmu,
42                 unsigned int phys)
43 {
44         sh_css_mmu_set_page_table_base_address((void *)phys);
45         return 0;
46 }
47
48 /*
49  * callback to flush tlb.
50  *
51  * tlb_flush_range will at least flush TLBs containing
52  * address mapping from addr to addr + size.
53  *
54  * tlb_flush_all will flush all TLBs.
55  *
56  * tlb_flush_all is must be provided. if tlb_flush_range is
57  * not valid, it will set to tlb_flush_all by default.
58  */
59 static void sh_tlb_flush(struct isp_mmu *mmu)
60 {
61         sh_css_mmu_invalidate_cache();
62 }
63
64 static struct isp_mmu_driver sh_mmu_driver = {
65         .name = "Silicon Hive ISP3000 MMU",
66         .pte_valid_mask = 0x1,
67         .set_pd_base = sh_set_pd_base,
68         .tlb_flush_all = sh_tlb_flush,
69 };
70
71 #define ISP_VM_START    0x0
72 #define ISP_VM_SIZE     (1 << 30)       /* 1G address space */
73 #define ISP_PTR_NULL    NULL
74
75 #endif /* SH_MMU_H_ */
76