developer | e021c15 | 2022-09-09 19:59:09 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Copyright (C) 2022 MediaTek Inc. |
| 4 | * Author: Sam Shih <sam.shih@mediatek.com> |
| 5 | */ |
| 6 | |
| 7 | /* |
| 8 | * Switch from AArch64 EL2 to AArch32 EL2 |
| 9 | * @param inputs: |
| 10 | * x0: argument, zero |
| 11 | * x1: machine nr |
| 12 | * x2: fdt address |
| 13 | * x3: input argument |
| 14 | * x4: kernel entry point |
| 15 | * @param outputs for secure firmware: |
| 16 | * x0: function id |
| 17 | * x1: kernel entry point |
| 18 | * x2: machine nr |
| 19 | * x3: fdt address |
| 20 | * |
| 21 | * [1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/plat/mediatek/common/mtk_sip_svc.c |
| 22 | */ |
| 23 | |
| 24 | .global armv8_el2_to_aarch32 |
| 25 | armv8_el2_to_aarch32: |
| 26 | mov x3, x2 |
| 27 | mov x2, x1 |
| 28 | mov x1, x4 |
| 29 | mov x4, #0 |
| 30 | ldr x0, =0x82000200 /* MTK_SIP_KERNEL_BOOT_AARCH32 */ |
| 31 | SMC #0 |
| 32 | ret |