2 * Copyright (c) 2014, NVIDIA Corporation. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 #include <linux/linkage.h>
15 #include <linux/init.h>
19 ENTRY(tlk_irq_handler)
21 movk x0, #0x3200, lsl #16 // TE_SMC_NS_IRQ_DONE
24 ENDPROC(tlk_irq_handler)
26 /* uint32_t tlk_generic_smc(uint32_t arg0, uint32_t arg1, uint32_t arg2) */
27 ENTRY(_tlk_generic_smc)
30 ENDPROC(_tlk_generic_smc)
32 /* allows MAX_EXT_SMC_ARGS (r0-r11) to be passed in registers */
34 /* uint32_t tlk_extended_smc(uint32_t *regs) */
35 ENTRY(_tlk_extended_smc)
37 * Allows MAX_EXT_SMC_ARGS (r0-r11) to be passed in registers
38 * (for aarch64, these are scratch, so no need to save them)
41 ldp x0, x1, [x12], #16
42 ldp x2, x3, [x12], #16
43 ldp x4, x5, [x12], #16
44 ldp x6, x7, [x12], #16
45 ldp x8, x9, [x12], #16
46 ldp x10, x11, [x12], #16
49 ENDPROC(_tlk_extended_smc)
53 ENTRY(tlk_irq_handler)
55 movt r0, #0x3200 @ TE_SMC_NS_IRQ_DONE
59 ENDPROC(tlk_irq_handler)
61 ENTRY(_tlk_generic_smc)
64 ENDPROC(_tlk_generic_smc)
66 ENTRY(_tlk_extended_smc)
67 stmfd sp!, {r4-r12} @ save reg state
68 mov r12, r0 @ reg ptr to r12
69 ldmia r12, {r0-r11} @ load arg regs
71 ldmfd sp!, {r4-r12} @ restore saved regs
72 ENDPROC(_tlk_extended_smc)