refactor(lib/realm): remove 'lib/realm' library

This patch removes the lib/realm library by refactoring its code and
moving its components to related submodules. It also introduces two
new libraries, 'lib/granule' and 'lib/slot_buf' with sources from
'lib/realm'

Change-Id: Id41eb2da20172d8da9a5f066b3e78ec4f1a6d35d
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
diff --git a/lib/s2tt/src/s2tt.c b/lib/s2tt/src/s2tt.c
index b603640..61e6d6a 100644
--- a/lib/s2tt/src/s2tt.c
+++ b/lib/s2tt/src/s2tt.c
@@ -6,6 +6,7 @@
 #include <arch_helpers.h>
 #include <assert.h>
 #include <bitmap.h>
+#include <buffer.h>
 #include <granule.h>
 #include <ripas.h>
 #include <s2tt.h>
@@ -238,7 +239,7 @@
 
 	(void)s2_ctx;
 
-	table = granule_map(g_tbl, SLOT_RTT);
+	table = buffer_granule_map(g_tbl, SLOT_RTT);
 	assert(table != NULL);
 
 	entry = s2tte_read(&table[idx]);