xref: /openbmc/u-boot/arch/arm/cpu/armv8/smccc-call.S (revision f77d4410)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (c) 2015, Linaro Limited
4 */
5#include <linux/linkage.h>
6#include <linux/arm-smccc.h>
7#include <generated/asm-offsets.h>
8
9	.macro SMCCC instr
10	.cfi_startproc
11	\instr	#0
12	ldr	x4, [sp]
13	stp	x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS]
14	stp	x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS]
15	ldr	x4, [sp, #8]
16	cbz	x4, 1f /* no quirk structure */
17	ldr	x9, [x4, #ARM_SMCCC_QUIRK_ID_OFFS]
18	cmp	x9, #ARM_SMCCC_QUIRK_QCOM_A6
19	b.ne	1f
20	str	x6, [x4, ARM_SMCCC_QUIRK_STATE_OFFS]
211:	ret
22	.cfi_endproc
23	.endm
24
25/*
26 * void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,
27 *		  unsigned long a3, unsigned long a4, unsigned long a5,
28 *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
29 *		  struct arm_smccc_quirk *quirk)
30 */
31ENTRY(__arm_smccc_smc)
32	SMCCC	smc
33ENDPROC(__arm_smccc_smc)
34
35/*
36 * void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
37 *		  unsigned long a3, unsigned long a4, unsigned long a5,
38 *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
39 *		  struct arm_smccc_quirk *quirk)
40 */
41ENTRY(__arm_smccc_hvc)
42	SMCCC	hvc
43ENDPROC(__arm_smccc_hvc)
44