blob: 86de4b4089d6ce1082c35bf8904158b4224d9498 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Masahiro Yamadaa93297e2017-04-14 11:10:22 +09002/*
3 * Copyright (c) 2015, Linaro Limited
Masahiro Yamadaa93297e2017-04-14 11:10:22 +09004 */
5#include <linux/linkage.h>
6#include <linux/arm-smccc.h>
Masahiro Yamadae8ead732017-04-14 11:10:23 +09007#include <generated/asm-offsets.h>
Masahiro Yamadaa93297e2017-04-14 11:10:22 +09008
Heinrich Schuchardt26f09d02018-10-18 12:29:40 +02009 .section .text.efi_runtime
10
Masahiro Yamadaa93297e2017-04-14 11:10:22 +090011 .macro SMCCC instr
12 .cfi_startproc
13 \instr #0
14 ldr x4, [sp]
15 stp x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS]
16 stp x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS]
17 ldr x4, [sp, #8]
18 cbz x4, 1f /* no quirk structure */
19 ldr x9, [x4, #ARM_SMCCC_QUIRK_ID_OFFS]
20 cmp x9, #ARM_SMCCC_QUIRK_QCOM_A6
21 b.ne 1f
22 str x6, [x4, ARM_SMCCC_QUIRK_STATE_OFFS]
231: ret
24 .cfi_endproc
25 .endm
26
27/*
28 * void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,
29 * unsigned long a3, unsigned long a4, unsigned long a5,
30 * unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
31 * struct arm_smccc_quirk *quirk)
32 */
33ENTRY(__arm_smccc_smc)
34 SMCCC smc
35ENDPROC(__arm_smccc_smc)
36
37/*
38 * void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
39 * unsigned long a3, unsigned long a4, unsigned long a5,
40 * unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
41 * struct arm_smccc_quirk *quirk)
42 */
43ENTRY(__arm_smccc_hvc)
44 SMCCC hvc
45ENDPROC(__arm_smccc_hvc)