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