common: Drop net.h from common header
[oweals/u-boot.git] / arch / arm / mach-imx / sip.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright 2017 NXP
4  */
5
6 #include <common.h>
7 #include <asm/arch/sys_proto.h>
8 #include <asm/cache.h>
9
10 unsigned long call_imx_sip(unsigned long id, unsigned long reg0,
11                            unsigned long reg1, unsigned long reg2,
12                            unsigned long reg3)
13 {
14         struct pt_regs regs;
15
16         regs.regs[0] = id;
17         regs.regs[1] = reg0;
18         regs.regs[2] = reg1;
19         regs.regs[3] = reg2;
20         regs.regs[4] = reg3;
21
22         smc_call(&regs);
23
24         return regs.regs[0];
25 }
26
27 /*
28  * Do an SMC call to return 2 registers by having reg1 passed in by reference
29  */
30 unsigned long call_imx_sip_ret2(unsigned long id, unsigned long reg0,
31                                 unsigned long *reg1, unsigned long reg2,
32                                 unsigned long reg3)
33 {
34         struct pt_regs regs;
35
36         regs.regs[0] = id;
37         regs.regs[1] = reg0;
38         regs.regs[2] = *reg1;
39         regs.regs[3] = reg2;
40         regs.regs[4] = reg3;
41
42         smc_call(&regs);
43
44         *reg1 = regs.regs[1];
45
46         return regs.regs[0];
47 }