fix(rmm): change failure conditions

This patch makes the changes in failure conditions
as per RMM Specifications 1.0-eac1 and 1.0-eac2:
- in RMI_RTT_INIT_RIPAS and RMI_RTT_SET_RIPAS
  command handlers:
  - added condition
  "size_valid  pre: UInt(top) <= UInt(base)"
- in RMI_RTT_INIT_RIPAS handler:
  - in "top_bound" condition "top" parameter passed
  to addr_in_par() changed to "top - GRANULE_SIZE";
  - "top_align" condition changed as per 1.0-eac2.

Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: I1ba051986a88bc56434b6e632dbeb4e37e996876
diff --git a/lib/realm/src/s2tt.c b/lib/realm/src/s2tt.c
index 077a641..c5fda16 100644
--- a/lib/realm/src/s2tt.c
+++ b/lib/realm/src/s2tt.c
@@ -4,7 +4,6 @@
  */
 
 #include <arch_helpers.h>
-#include <attestation_token.h>
 #include <bitmap.h>
 #include <buffer.h>
 #include <gic.h>
@@ -258,7 +257,7 @@
 	return addr;
 }
 
-static unsigned long addr_level_mask(unsigned long addr, long level)
+unsigned long addr_level_mask(unsigned long addr, long level)
 {
 	int levels = RTT_PAGE_LEVEL - level;
 	unsigned int lsb = levels * S2TTE_STRIDE + GRANULE_SHIFT;