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