feat(lib/granule): Add dev_granule object type

Define dev_granule structure type and add device granule
objects to manage device memory in PCI regions.
Define device granule states:
- DEV_GRANULE_STATE_NS
- DEV_GRANULE_STATE_DELEGATED
- DEV_GRANULE_STATE_MAPPED
Add locking primitives and access functions for
dev_granule objects.
Add dev_granules[RMM_MAX_DEV_GRANULES] array of
dev_granule structures.

Change-Id: I857095a997f78d2c39b3958056460112f3b34595
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
diff --git a/cmake/CommonConfigs.cmake b/cmake/CommonConfigs.cmake
index 44dd760..89d4c27 100644
--- a/cmake/CommonConfigs.cmake
+++ b/cmake/CommonConfigs.cmake
@@ -37,7 +37,7 @@
     NAME RMM_MAX_COH_GRANULES
     HELP "Maximum number of coherent device granules supported"
     TYPE STRING
-    DEFAULT 0x0)
+    DEFAULT 1)
 
 #
 # RMM_MAX_NCOH_GRANULES. Maximum number of non-coherent device granules supported.
@@ -46,7 +46,7 @@
     NAME RMM_MAX_NCOH_GRANULES
     HELP "Maximum number of non-coherent device granules supported"
     TYPE STRING
-    DEFAULT 0x0)
+    DEFAULT 1)
 
 arm_config_option(
     NAME RMM_NUM_PAGES_PER_STACK
@@ -121,11 +121,15 @@
 target_compile_definitions(rmm-common
     INTERFACE "RMM_MAX_GRANULES=U(${RMM_MAX_GRANULES})")
 
+if (RMM_MAX_COH_GRANULES EQUAL 0x0)
+    message (FATAL_ERROR "RMM_MAX_COH_GRANULES cannot be set to 0")
+endif()
+
 target_compile_definitions(rmm-common
     INTERFACE "RMM_MAX_COH_GRANULES=U(${RMM_MAX_COH_GRANULES})")
 
 if (RMM_MAX_NCOH_GRANULES EQUAL 0x0)
-    message (FATAL_ERROR "RMM_MAX_NCOH_GRANULES not configured")
+    message (FATAL_ERROR "RMM_MAX_NCOH_GRANULES cannot be set to 0")
 endif()
 
 target_compile_definitions(rmm-common