1 // SPDX-License-Identifier: GPL-2.0
3 * Support for Intel Camera Imaging ISP subsystem.
4 * Copyright (c) 2015, Intel Corporation.
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.
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
16 #include "ia_css_mmu.h"
17 #include "ia_css_mmu_private.h"
18 #include <ia_css_debug.h>
19 #include "sh_css_sp.h"
20 #include "sh_css_firmware.h"
22 #include "mmu_device.h"
25 ia_css_mmu_invalidate_cache(void)
27 const struct ia_css_fw_info *fw = &sh_css_sp_fw;
28 unsigned int HIVE_ADDR_ia_css_dmaproxy_sp_invalidate_tlb;
30 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
31 "ia_css_mmu_invalidate_cache() enter\n");
33 /* if the SP is not running we should not access its dmem */
34 if (sh_css_sp_is_running()) {
35 HIVE_ADDR_ia_css_dmaproxy_sp_invalidate_tlb = fw->info.sp.invalidate_tlb;
37 (void)HIVE_ADDR_ia_css_dmaproxy_sp_invalidate_tlb; /* Suppres warnings in CRUN */
39 sp_dmem_store_uint32(SP0_ID,
40 (unsigned int)sp_address_of(ia_css_dmaproxy_sp_invalidate_tlb),
43 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
44 "ia_css_mmu_invalidate_cache() leave\n");
48 sh_css_mmu_set_page_table_base_index(hrt_data base_index)
52 IA_CSS_ENTER_PRIVATE("base_index=0x%08x\n", base_index);
53 for (i = 0; i < N_MMU_ID; i++) {
56 mmu_set_page_table_base_index(mmu_id, base_index);
57 mmu_invalidate_cache(mmu_id);
59 IA_CSS_LEAVE_PRIVATE("");