xref: /rk3399_ARM-atf/plat/mediatek/include/lpm_v2/mt_lpm_dispatch.h (revision 10ecd58093a34e95e2dfad65b1180610f29397cc)
1 /*
2  * Copyright (c) 2025, Mediatek Inc. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef MT_LPM_DISPATCH_H
8 #define MT_LPM_DISPATCH_H
9 
10 #include <stdint.h>
11 
12 #include <lpm_v2/mt_lpm_smc.h>
13 #include <mtk_sip_svc.h>
14 
15 #define MTK_DISPATCH_ID_MAX	32
16 
17 typedef uint64_t (*mt_lpm_dispatch_fn)(u_register_t x1, u_register_t x2,
18 				       u_register_t x3, u_register_t x4,
19 				       void *handle,
20 				       struct smccc_res *smccc_ret);
21 
22 struct mt_dispatch_ctrl {
23 	unsigned int enable;
24 	mt_lpm_dispatch_fn fn[MT_LPM_SMC_USER_MAX];
25 };
26 
27 void mt_lpm_dispatcher_registry(unsigned int id, mt_lpm_dispatch_fn fn);
28 
29 void mt_secure_lpm_dispatcher_registry(unsigned int id, mt_lpm_dispatch_fn fn);
30 
31 extern struct mt_dispatch_ctrl mt_dispatcher;
32 extern struct mt_dispatch_ctrl mt_secure_dispatcher;
33 
34 #endif /* MT_LPM_DISPATCH_H */
35 
36