refactor(smccc): move debugfs to vendor el3 calls
Move debugfs to Vendor-Specific EL3 Monitor Service Calls.
Function Identifier for Vendor-Specific EL3 Monitor Service is '7' and
allocated subranges of Function identifiers to different services are:
0x87000000-0x8700FFFF-SMC32: Vendor-Specific EL3 Monitor Service Calls
0xC7000000-0xC700FFFF-SMC64: Vendor-Specific EL3 Monitor Service Calls
Amend Debugfs FID's to use this range and id.
Add a deprecation notice to inform debugfs moved from arm-sip range to
Vendor-Specific EL3 range. Debugfs support from arm-sip range will be
removed and will not be available after TF-A 2.12 release.
Reference to debugfs component level documentation:
https://trustedfirmware-a.readthedocs.io/en/latest/components/debugfs-design.html#overview
Change-Id: I97a50170178f361f70c95ed0049bc4e278de59d7
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
diff --git a/services/el3/ven_el3_svc.c b/services/el3/ven_el3_svc.c
index 327878f..de003ae 100644
--- a/services/el3/ven_el3_svc.c
+++ b/services/el3/ven_el3_svc.c
@@ -8,6 +8,7 @@
#include <common/debug.h>
#include <common/runtime_svc.h>
+#include <lib/debugfs.h>
#include <services/ven_el3_svc.h>
#include <tools_share/uuid.h>
@@ -18,6 +19,12 @@
static int ven_el3_svc_setup(void)
{
+#if USE_DEBUGFS
+ if (debugfs_smc_setup() != 0) {
+ return 1;
+ }
+#endif /* USE_DEBUGFS */
+
return 0;
}
@@ -33,6 +40,17 @@
void *handle,
u_register_t flags)
{
+#if USE_DEBUGFS
+ /*
+ * Dispatch debugfs calls to debugfs SMC handler and return its
+ * return value.
+ */
+ if (is_debugfs_fid(smc_fid)) {
+ return debugfs_smc_handler(smc_fid, x1, x2, x3, x4, cookie,
+ handle, flags);
+ }
+#endif /* USE_DEBUGFS */
+
switch (smc_fid) {
case VEN_EL3_SVC_UID:
/* Return UID to the caller */
@@ -42,7 +60,7 @@
SMC_RET2(handle, VEN_EL3_SVC_VERSION_MAJOR, VEN_EL3_SVC_VERSION_MINOR);
break;
default:
- WARN("Unimplemented Vendor specific EL3 Service call: 0x%x\n", smc_fid);
+ WARN("Unimplemented vendor-specific EL3 Service call: 0x%x\n", smc_fid);
SMC_RET1(handle, SMC_UNK);
break;
}