test(realm): add plane PSI interface
Add Plane service routine interface.
Aux plane can communicate with primary plane using PSI
PSI uses hvc conduit from aux plane.
Add initial printf support for planes
Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
Change-Id: I484cbd32791970c6e22c5d63e13b43807f4f3c06
diff --git a/realm/realm_rsi.c b/realm/realm_rsi.c
index 1c6fc8e..b2505cc 100644
--- a/realm/realm_rsi.c
+++ b/realm/realm_rsi.c
@@ -8,6 +8,7 @@
#include <host_realm_rmi.h>
#include <lib/aarch64/arch_features.h>
+#include <realm_helpers.h>
#include <realm_rsi.h>
#include <smccc.h>
@@ -31,30 +32,18 @@
return res.ret1;
}
-/* This function will call the Host to request IPA of the NS shared buffer */
-u_register_t rsi_get_ns_buffer(void)
-{
- smc_ret_values res = {};
- struct rsi_host_call host_cal __aligned(sizeof(struct rsi_host_call));
-
- host_cal.imm = HOST_CALL_GET_SHARED_BUFF_CMD;
- res = tftf_smc(&(smc_args) {RSI_HOST_CALL, (u_register_t)&host_cal,
- 0UL, 0UL, 0UL, 0UL, 0UL, 0UL});
- if (res.ret0 != RSI_SUCCESS) {
- return 0U;
- }
- return host_cal.gprs[0];
-}
-
/* This function call Host and request to exit Realm with proper exit code */
-void rsi_exit_to_host(enum host_call_cmd exit_code)
+u_register_t rsi_exit_to_host(enum host_call_cmd exit_code)
{
struct rsi_host_call host_cal __aligned(sizeof(struct rsi_host_call));
+ smc_ret_values res = {};
host_cal.imm = exit_code;
- host_cal.gprs[0] = read_mpidr_el1();
- tftf_smc(&(smc_args) {RSI_HOST_CALL, (u_register_t)&host_cal,
+ host_cal.gprs[0] = realm_get_my_plane_num();
+ host_cal.gprs[1] = read_mpidr_el1();
+ res = tftf_smc(&(smc_args) {RSI_HOST_CALL, (u_register_t)&host_cal,
0UL, 0UL, 0UL, 0UL, 0UL, 0UL});
+ return res.ret0;
}
/* This function will exit to the Host to request RIPAS CHANGE of IPA range */