fix(lib/s2tt): allow rtt fold till level 1
Allow RMI_RTT_FOLD of Level 2 Assigned RTTs.
Disallow RMI_RTT_FOLD after Level 2 for Assigned NS RTTs.
Note that UNASSIGNED and UNASSIGNED_NS Rtts can be folded
till min block level allowed by Architecture.
Change-Id: I494835b479542529973edb7f253a079d2aced07d
Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
diff --git a/lib/s2tt/src/s2tt.c b/lib/s2tt/src/s2tt.c
index 19dffba..754d912 100644
--- a/lib/s2tt/src/s2tt.c
+++ b/lib/s2tt/src/s2tt.c
@@ -752,9 +752,9 @@
desc_type = s2tte & S2TT_DESC_TYPE_MASK;
- /* Only pages at L3 and valid blocks at L2 allowed */
+ /* Only pages at L3 and valid blocks at L2 and L1 allowed */
if (((level == S2TT_PAGE_LEVEL) && (desc_type == S2TTE_L3_PAGE)) ||
- ((level == S2TT_MIN_BLOCK_LEVEL) && (desc_type == S2TTE_L012_BLOCK))) {
+ ((level >= S2TT_MIN_BLOCK_LEVEL) && (desc_type == S2TTE_L012_BLOCK))) {
return true;
}