blob: a449d242e925a27bc9d008d9603935c00fb88730 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Stephen Warren48a4c182016-10-19 15:18:45 -06002/*
3 * Copyright (c) 2016, NVIDIA CORPORATION.
Stephen Warren48a4c182016-10-19 15:18:45 -06004 */
5
6#include <config.h>
7#include <linux/linkage.h>
8
9#define SMC_SIP_INVOKE_MCE 0x82FFFF00
10#define MCE_SMC_ROC_FLUSH_CACHE (SMC_SIP_INVOKE_MCE | 11)
Stephen Warren4146a9a2016-10-19 15:18:47 -060011#define MCE_SMC_ROC_FLUSH_CACHE_ONLY (SMC_SIP_INVOKE_MCE | 14)
12#define MCE_SMC_ROC_CLEAN_CACHE_ONLY (SMC_SIP_INVOKE_MCE | 15)
Stephen Warren48a4c182016-10-19 15:18:45 -060013
Stephen Warren4146a9a2016-10-19 15:18:47 -060014ENTRY(__asm_tegra_cache_smc)
Stephen Warren48a4c182016-10-19 15:18:45 -060015 mov x1, #0
16 mov x2, #0
17 mov x3, #0
18 mov x4, #0
19 mov x5, #0
20 mov x6, #0
21 smc #0
22 mov x0, #0
23 ret
Stephen Warren4146a9a2016-10-19 15:18:47 -060024ENDPROC(__asm_invalidate_l3_dcache)
25
26ENTRY(__asm_invalidate_l3_dcache)
27 mov x0, #(MCE_SMC_ROC_FLUSH_CACHE_ONLY & 0xffff)
28 movk x0, #(MCE_SMC_ROC_FLUSH_CACHE_ONLY >> 16), lsl #16
29 b __asm_tegra_cache_smc
30ENDPROC(__asm_invalidate_l3_dcache)
31
32ENTRY(__asm_flush_l3_dcache)
33 mov x0, #(MCE_SMC_ROC_CLEAN_CACHE_ONLY & 0xffff)
34 movk x0, #(MCE_SMC_ROC_CLEAN_CACHE_ONLY >> 16), lsl #16
35 b __asm_tegra_cache_smc
Stephen Warrenddb0f632016-10-19 15:18:46 -060036ENDPROC(__asm_flush_l3_dcache)
Stephen Warren4146a9a2016-10-19 15:18:47 -060037
38ENTRY(__asm_invalidate_l3_icache)
39 mov x0, #(MCE_SMC_ROC_FLUSH_CACHE & 0xffff)
40 movk x0, #(MCE_SMC_ROC_FLUSH_CACHE >> 16), lsl #16
41 b __asm_tegra_cache_smc
42ENDPROC(__asm_invalidate_l3_icache)