xref: /rk3399_ARM-atf/plat/rockchip/rk3568/plat_sip_calls.c (revision 6fb6bee1dfd7fd896c44cc21b02b4ef3aad3bbd0)
1 /*
2  * Copyright (c) 2023-2025, ARM Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <assert.h>
8 #include <errno.h>
9 
10 #include <common/debug.h>
11 #include <common/runtime_svc.h>
12 #include <drivers/scmi-msg.h>
13 
14 #include <plat_sip_calls.h>
15 #include <rockchip_sip_svc.h>
16 
17 uintptr_t rockchip_plat_sip_handler(uint32_t smc_fid,
18 				    u_register_t x1,
19 				    u_register_t x2,
20 				    u_register_t x3,
21 				    u_register_t x4,
22 				    void *cookie,
23 				    void *handle,
24 				    u_register_t flags)
25 {
26 	switch (smc_fid) {
27 	case RK_SIP_SCMI_AGENT0:
28 		scmi_smt_fastcall_smc_entry(0);
29 		SMC_RET1(handle, 0);
30 	default:
31 		ERROR("%s: unhandled SMC (0x%x)\n", __func__, smc_fid);
32 		SMC_RET1(handle, SMC_UNK);
33 	}
34 }
35