GNU Linux-libre 4.14.332-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / hive_isp_css_common / host / mmu.c
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2010-2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14
15 /* The name "mmu.h is already taken" */
16 #include "mmu_device.h"
17
18 #ifndef __INLINE_MMU__
19 #include "mmu_private.h"
20 #endif /* __INLINE_MMU__ */
21
22 void mmu_set_page_table_base_index(
23         const mmu_ID_t          ID,
24         const hrt_data          base_index)
25 {
26         mmu_reg_store(ID, _HRT_MMU_PAGE_TABLE_BASE_ADDRESS_REG_IDX, base_index);
27 return;
28 }
29
30 hrt_data mmu_get_page_table_base_index(
31         const mmu_ID_t          ID)
32 {
33 return mmu_reg_load(ID, _HRT_MMU_PAGE_TABLE_BASE_ADDRESS_REG_IDX);
34 }
35
36 void mmu_invalidate_cache(
37         const mmu_ID_t          ID)
38 {
39         mmu_reg_store(ID, _HRT_MMU_INVALIDATE_TLB_REG_IDX, 1);
40 return;
41 }
42
43 void mmu_invalidate_cache_all(void)
44 {
45         mmu_ID_t        mmu_id;
46         for (mmu_id = (mmu_ID_t)0;mmu_id < N_MMU_ID; mmu_id++) {
47                 mmu_invalidate_cache(mmu_id);
48         }
49 }
50