Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Masahiro Yamada | c2da86f | 2017-04-14 11:10:22 +0900 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2015, Linaro Limited |
Masahiro Yamada | c2da86f | 2017-04-14 11:10:22 +0900 | [diff] [blame] | 4 | */ |
| 5 | #include <linux/linkage.h> |
| 6 | #include <linux/arm-smccc.h> |
Masahiro Yamada | c54bcf6 | 2017-04-14 11:10:23 +0900 | [diff] [blame] | 7 | #include <generated/asm-offsets.h> |
Masahiro Yamada | c2da86f | 2017-04-14 11:10:22 +0900 | [diff] [blame] | 8 | |
Alexander Graf | 2f8ab12 | 2019-02-11 15:07:17 +0100 | [diff] [blame] | 9 | #ifdef CONFIG_EFI_LOADER |
Heinrich Schuchardt | 81ea008 | 2018-10-18 12:29:40 +0200 | [diff] [blame] | 10 | .section .text.efi_runtime |
Alexander Graf | 2f8ab12 | 2019-02-11 15:07:17 +0100 | [diff] [blame] | 11 | #endif |
Heinrich Schuchardt | 81ea008 | 2018-10-18 12:29:40 +0200 | [diff] [blame] | 12 | |
Masahiro Yamada | c2da86f | 2017-04-14 11:10:22 +0900 | [diff] [blame] | 13 | .macro SMCCC instr |
| 14 | .cfi_startproc |
| 15 | \instr #0 |
| 16 | ldr x4, [sp] |
| 17 | stp x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS] |
| 18 | stp x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS] |
| 19 | ldr x4, [sp, #8] |
| 20 | cbz x4, 1f /* no quirk structure */ |
| 21 | ldr x9, [x4, #ARM_SMCCC_QUIRK_ID_OFFS] |
| 22 | cmp x9, #ARM_SMCCC_QUIRK_QCOM_A6 |
| 23 | b.ne 1f |
| 24 | str x6, [x4, ARM_SMCCC_QUIRK_STATE_OFFS] |
| 25 | 1: ret |
| 26 | .cfi_endproc |
| 27 | .endm |
| 28 | |
| 29 | /* |
| 30 | * void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2, |
| 31 | * unsigned long a3, unsigned long a4, unsigned long a5, |
| 32 | * unsigned long a6, unsigned long a7, struct arm_smccc_res *res, |
| 33 | * struct arm_smccc_quirk *quirk) |
| 34 | */ |
| 35 | ENTRY(__arm_smccc_smc) |
| 36 | SMCCC smc |
| 37 | ENDPROC(__arm_smccc_smc) |
| 38 | |
| 39 | /* |
| 40 | * void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2, |
| 41 | * unsigned long a3, unsigned long a4, unsigned long a5, |
| 42 | * unsigned long a6, unsigned long a7, struct arm_smccc_res *res, |
| 43 | * struct arm_smccc_quirk *quirk) |
| 44 | */ |
| 45 | ENTRY(__arm_smccc_hvc) |
| 46 | SMCCC hvc |
| 47 | ENDPROC(__arm_smccc_hvc) |