chore(lib/common): rename DEV_RANGE_xx enumerators

Rename enum 'dev_type' to 'dev_coh_type' and its DEV_RANGE_xx
enumerators to DEV_MEM_xx to match RmmDevMemCoherent type
in RMM Specification 1.1-alp12.

Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: I3b477780e1185e7692dfc1872bf923b575f23580
diff --git a/lib/common/include/dev_type.h b/lib/common/include/dev_type.h
index 7f97417..b12835a 100644
--- a/lib/common/include/dev_type.h
+++ b/lib/common/include/dev_type.h
@@ -6,11 +6,11 @@
 #ifndef DEV_TYPE_H
 #define DEV_TYPE_H
 
-/* Types of device memory */
-enum dev_type {
-	DEV_RANGE_COHERENT,
-	DEV_RANGE_NON_COHERENT,
-	DEV_RANGE_MAX
+/* RmmDevMemCoherent type */
+enum dev_coh_type {
+	DEV_MEM_COHERENT,
+	DEV_MEM_NON_COHERENT,
+	DEV_MEM_MAX
 };
 
 #endif /* DEV_TYPE_H */
diff --git a/lib/common/include/platform_api.h b/lib/common/include/platform_api.h
index 34e53b3..1ba1fed 100644
--- a/lib/common/include/platform_api.h
+++ b/lib/common/include/platform_api.h
@@ -27,7 +27,7 @@
  * This function also validates that the dev_granule address is a valid
  * page address and returns device granule type if the addr is valid.
  */
-unsigned long plat_dev_granule_addr_to_idx(unsigned long addr, enum dev_type *type);
+unsigned long plat_dev_granule_addr_to_idx(unsigned long addr, enum dev_coh_type *type);
 
 /*
  * Takes an index in the struct granules array and returns the aligned granule
@@ -41,6 +41,6 @@
  * dev_granule address of the specified device type. The index must be within
  * the number of dev_granules expected by the platform.
  */
-unsigned long plat_dev_granule_idx_to_addr(unsigned long idx, enum dev_type type);
+unsigned long plat_dev_granule_idx_to_addr(unsigned long idx, enum dev_coh_type type);
 
 #endif /* PLATFORM_API_H */
diff --git a/lib/granule/include/dev_granule.h b/lib/granule/include/dev_granule.h
index 0525188..de8d8cf 100644
--- a/lib/granule/include/dev_granule.h
+++ b/lib/granule/include/dev_granule.h
@@ -177,7 +177,7 @@
  * This is purely a lookup, and provides no guarantees about the attributes of
  * the dev_granule (i.e. whether it is locked, its state or its reference count).
  */
-unsigned long dev_granule_addr(const struct dev_granule *g, enum dev_type type);
+unsigned long dev_granule_addr(const struct dev_granule *g, enum dev_coh_type type);
 
 /*
  * Takes an aligned dev_granule address, returns a pointer to the corresponding
@@ -186,7 +186,7 @@
  * This is purely a lookup, and provides no guarantees about the attributes of
  * the granule (i.e. whether it is locked, its state or its reference count).
  */
-struct dev_granule *addr_to_dev_granule(unsigned long addr, enum dev_type *type);
+struct dev_granule *addr_to_dev_granule(unsigned long addr, enum dev_coh_type *type);
 
 /*
  * Verifies whether @addr is a valid dev_granule physical address, returns
@@ -202,7 +202,7 @@
  *     - @addr is not aligned to the size of a granule.
  *     - @addr is out of range.
  */
-struct dev_granule *find_dev_granule(unsigned long addr, enum dev_type *type);
+struct dev_granule *find_dev_granule(unsigned long addr, enum dev_coh_type *type);
 
 /*
  * Obtain a pointer to a locked dev_granule at @addr if @addr is a valid dev_granule
@@ -219,7 +219,7 @@
  */
 struct dev_granule *find_lock_dev_granule(unsigned long addr,
 					  unsigned char expected_state,
-					  enum dev_type *type);
+					  enum dev_coh_type *type);
 /*
  * Refcount field occupies LSB bits of the dev_granule descriptor,
  * and functions which modify its value can operate directly on
diff --git a/lib/granule/src/dev_granule.c b/lib/granule/src/dev_granule.c
index 4ad7e1a..efec5c2 100644
--- a/lib/granule/src/dev_granule.c
+++ b/lib/granule/src/dev_granule.c
@@ -21,7 +21,7 @@
  * This is purely a lookup, and provides no guarantees about the attributes of
  * the dev_granule (i.e. whether it is locked, its state or its reference count).
  */
-unsigned long dev_granule_addr(const struct dev_granule *g, enum dev_type type)
+unsigned long dev_granule_addr(const struct dev_granule *g, enum dev_coh_type type)
 {
 	(void)type;
 	unsigned long idx;
@@ -29,7 +29,7 @@
 	assert(g != NULL);
 
 	/* No coherent device granules */
-	assert(type == DEV_RANGE_NON_COHERENT);
+	assert(type == DEV_MEM_NON_COHERENT);
 
 	idx = ((unsigned long)g - (unsigned long)dev_ncoh_granules) /
 						sizeof(struct dev_granule);
@@ -43,12 +43,12 @@
  * This is purely a lookup, and provides no guarantees about the attributes of
  * the granule (i.e. whether it is locked, its state or its reference count).
  */
-static struct dev_granule *dev_granule_from_idx(unsigned long idx, enum dev_type type)
+static struct dev_granule *dev_granule_from_idx(unsigned long idx, enum dev_coh_type type)
 {
 	(void)type;
 
 	/* No coherent device granules */
-	assert((type == DEV_RANGE_NON_COHERENT) && (idx < RMM_MAX_NCOH_GRANULES));
+	assert((type == DEV_MEM_NON_COHERENT) && (idx < RMM_MAX_NCOH_GRANULES));
 
 	return &dev_ncoh_granules[idx];
 }
@@ -60,7 +60,7 @@
  * This is purely a lookup, and provides no guarantees about the attributes of
  * the granule (i.e. whether it is locked, its state or its reference count).
  */
-struct dev_granule *addr_to_dev_granule(unsigned long addr, enum dev_type *type)
+struct dev_granule *addr_to_dev_granule(unsigned long addr, enum dev_coh_type *type)
 {
 	unsigned long idx;
 
@@ -84,7 +84,7 @@
  *     - @addr is not aligned to the size of a granule.
  *     - @addr is out of range.
  */
-struct dev_granule *find_dev_granule(unsigned long addr, enum dev_type *type)
+struct dev_granule *find_dev_granule(unsigned long addr, enum dev_coh_type *type)
 {
 	unsigned long idx;
 
@@ -115,7 +115,7 @@
  */
 struct dev_granule *find_lock_dev_granule(unsigned long addr,
 					  unsigned char expected_state,
-					  enum dev_type *type)
+					  enum dev_coh_type *type)
 {
 	struct dev_granule *g = find_dev_granule(addr, type);
 
diff --git a/lib/rmm_el3_ifc/include/rmm_el3_ifc.h b/lib/rmm_el3_ifc/include/rmm_el3_ifc.h
index eca8794..f23202d 100644
--- a/lib/rmm_el3_ifc/include/rmm_el3_ifc.h
+++ b/lib/rmm_el3_ifc/include/rmm_el3_ifc.h
@@ -384,7 +384,7 @@
  */
 int rmm_el3_ifc_get_dev_range_validated_pa(unsigned long max_num_banks,
 					   struct memory_info **plat_dev_range_info,
-					   enum dev_type type);
+					   enum dev_coh_type type);
 
 /****************************************************************************
  * RMM-EL3 Runtime interface APIs
diff --git a/lib/rmm_el3_ifc/src/rmm_el3_ifc_manifest.c b/lib/rmm_el3_ifc/src/rmm_el3_ifc_manifest.c
index 651892e..ae9e047 100644
--- a/lib/rmm_el3_ifc/src/rmm_el3_ifc_manifest.c
+++ b/lib/rmm_el3_ifc/src/rmm_el3_ifc_manifest.c
@@ -242,7 +242,7 @@
  */
 int rmm_el3_ifc_get_dev_range_validated_pa(unsigned long max_num_banks,
 					   struct memory_info **plat_dev_range_info,
-					   enum dev_type type)
+					   enum dev_coh_type type)
 {
 	struct memory_info *plat_memory;
 	unsigned int max_granules;
@@ -256,12 +256,12 @@
 		return E_RMM_BOOT_MANIFEST_VERSION_NOT_SUPPORTED;
 	}
 
-	assert(type < DEV_RANGE_MAX);
+	assert(type < DEV_MEM_MAX);
 
 	VERBOSE("Device %scoherent address range:\n",
-		(type == DEV_RANGE_COHERENT) ? "" : "non-");
+		(type == DEV_MEM_COHERENT) ? "" : "non-");
 
-	if (type == DEV_RANGE_COHERENT) {
+	if (type == DEV_MEM_COHERENT) {
 		plat_memory = &local_core_manifest.plat_coh_region;
 		max_granules = RMM_MAX_COH_GRANULES;
 	} else {