platform: Fix platform boot dev mask

Platform boot device mask is unique only for few platforms
& common otherwise. Define the API only for the platforms
which need an unique mask and use weak API otherwise. This
way we dont need to duplicate the API across platforms.

Change-Id: I0b2bceea691c75067421e91e39b059342315a9c0
diff --git a/platform/apq8084/platform.c b/platform/apq8084/platform.c
index 923588d..cf13b5a 100644
--- a/platform/apq8084/platform.c
+++ b/platform/apq8084/platform.c
@@ -167,8 +167,3 @@
 	/* Using 1-1 mapping on this platform. */
 	return phys_addr;
 }
-
-int boot_device_mask(int val)
-{
-	return ((val & 0x3E) >> 1);
-}
diff --git a/platform/init.c b/platform/init.c
index 095f6e2..4783eba 100644
--- a/platform/init.c
+++ b/platform/init.c
@@ -130,3 +130,8 @@
 {
         return 0;
 }
+
+__WEAK int boot_device_mask(int val)
+{
+	return ((val & 0x3E) >> 1);
+}
diff --git a/platform/msm8994/platform.c b/platform/msm8994/platform.c
index 80f4ad3..560a021 100644
--- a/platform/msm8994/platform.c
+++ b/platform/msm8994/platform.c
@@ -180,8 +180,3 @@
 	else
 		return ((addr_t)BS_INFO_ADDR2);
 }
-
-int boot_device_mask(int val)
-{
-	return ((val & 0x3E) >> 1);
-}