feat(lib/realm): modify struct granule

This patch makes the following changes:
- val of spinlock_t type changes from unsigned int
 to unsigned char;
- 'enum granule_state' removed and replaced with
 macro definitions;
- type of 'struct granule' state changed to unsigned char;
- type of 'struct granule' refcount changed from unsigned long
  to unsigned short, as its maximum value cannot exceed 512.
- 'refcount' access functions modified to use 16-bit values.
These modifications change the size of 'struct granule' from
16 to 4 bytes and reduce the total size of 'granules[]'
array from 16MB to 4MB for default RMM_MAX_GRANULES = 0x100000.

Change-Id: I611ed3f349806b033e03c52c5f60a0f903f93e11
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
diff --git a/runtime/rsi/psci.c b/runtime/rsi/psci.c
index 1b42da1..fa2401a 100644
--- a/runtime/rsi/psci.c
+++ b/runtime/rsi/psci.c
@@ -335,7 +335,7 @@
 					  unsigned long caller_sctlr_el1,
 					  unsigned long status)
 {
-	if ((granule_refcount_read_acquire(target_rec->g_rec) != 0UL) ||
+	if ((granule_refcount_read_acquire(target_rec->g_rec) != 0U) ||
 		target_rec->runnable) {
 		return PSCI_RETURN_ALREADY_ON;
 	}
@@ -357,7 +357,7 @@
 
 static unsigned long complete_psci_affinity_info(struct rec *target_rec)
 {
-	if ((granule_refcount_read_acquire(target_rec->g_rec) != 0UL) ||
+	if ((granule_refcount_read_acquire(target_rec->g_rec) != 0U) ||
 		target_rec->runnable) {
 		return PSCI_AFFINITY_INFO_ON;
 	}