2 * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
9 #include <common/debug.h>
10 #include <common/runtime_svc.h>
11 #include <lib/pmf/pmf.h>
12 #include <tools_share/uuid.h>
14 #include <hisi_sip_svc.h>
16 /* Hisi SiP Service UUID */
17 DEFINE_SVC_UUID2(hisi_sip_svc_uid
,
18 0x74df99e5, 0x8276, 0xaa40, 0x9f, 0xf8,
19 0xc0, 0x85, 0x52, 0xbc, 0x39, 0x3f);
21 static int hisi_sip_setup(void)
29 * This function handles Hisi defined SiP Calls
31 static uintptr_t hisi_sip_handler(unsigned int smc_fid
,
43 * Dispatch PMF calls to PMF SMC handler and return its return
46 if (is_pmf_fid(smc_fid
)) {
47 return pmf_smc_handler(smc_fid
, x1
, x2
, x3
, x4
, cookie
,
52 case HISI_SIP_SVC_CALL_COUNT
:
54 call_count
+= PMF_NUM_SMC_CALLS
;
56 /* State switch call */
59 SMC_RET1(handle
, call_count
);
61 case HISI_SIP_SVC_UID
:
62 /* Return UID to the caller */
63 SMC_UUID_RET(handle
, hisi_sip_svc_uid
);
65 case HISI_SIP_SVC_VERSION
:
66 /* Return the version of current implementation */
67 SMC_RET2(handle
, HISI_SIP_SVC_VERSION_MAJOR
, HISI_SIP_SVC_VERSION_MINOR
);
70 WARN("Unimplemented HISI SiP Service Call: 0x%x \n", smc_fid
);
71 SMC_RET1(handle
, SMC_UNK
);
77 /* Define a runtime service descriptor for fast SMC calls */