2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2017-04-14 02:10:22 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015, Linaro Limited
|
|
|
|
*/
|
|
|
|
#include <linux/linkage.h>
|
|
|
|
#include <linux/arm-smccc.h>
|
2017-04-14 02:10:23 +00:00
|
|
|
#include <generated/asm-offsets.h>
|
2017-04-14 02:10:22 +00:00
|
|
|
|
2019-02-11 14:07:17 +00:00
|
|
|
#ifdef CONFIG_EFI_LOADER
|
2018-10-18 10:29:40 +00:00
|
|
|
.section .text.efi_runtime
|
2019-02-11 14:07:17 +00:00
|
|
|
#endif
|
2018-10-18 10:29:40 +00:00
|
|
|
|
2017-04-14 02:10:22 +00:00
|
|
|
.macro SMCCC instr
|
|
|
|
.cfi_startproc
|
|
|
|
\instr #0
|
|
|
|
ldr x4, [sp]
|
|
|
|
stp x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS]
|
|
|
|
stp x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS]
|
|
|
|
ldr x4, [sp, #8]
|
|
|
|
cbz x4, 1f /* no quirk structure */
|
|
|
|
ldr x9, [x4, #ARM_SMCCC_QUIRK_ID_OFFS]
|
|
|
|
cmp x9, #ARM_SMCCC_QUIRK_QCOM_A6
|
|
|
|
b.ne 1f
|
|
|
|
str x6, [x4, ARM_SMCCC_QUIRK_STATE_OFFS]
|
|
|
|
1: ret
|
|
|
|
.cfi_endproc
|
|
|
|
.endm
|
|
|
|
|
|
|
|
/*
|
|
|
|
* void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,
|
|
|
|
* unsigned long a3, unsigned long a4, unsigned long a5,
|
|
|
|
* unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
|
|
|
|
* struct arm_smccc_quirk *quirk)
|
|
|
|
*/
|
|
|
|
ENTRY(__arm_smccc_smc)
|
|
|
|
SMCCC smc
|
|
|
|
ENDPROC(__arm_smccc_smc)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
|
|
|
|
* unsigned long a3, unsigned long a4, unsigned long a5,
|
|
|
|
* unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
|
|
|
|
* struct arm_smccc_quirk *quirk)
|
|
|
|
*/
|
|
|
|
ENTRY(__arm_smccc_hvc)
|
|
|
|
SMCCC hvc
|
|
|
|
ENDPROC(__arm_smccc_hvc)
|