platform: msm_shared: Update the boot device in hlos subtype

Hlos subtype is updated with boot device in the init of board driver.
For some platforms the fuse address for boot device varies base on soc
version. Boot device driver depends on board driver for soc version.
This creates a circular dependency. In order to avoid this, update the
boot device in hlos subtype after boot device is read.

Change-Id: I1309152bd7bd38a9e3afbf1e71884aafdbe70cce
diff --git a/platform/msm_shared/board.c b/platform/msm_shared/board.c
index a2ea734..03f794c 100644
--- a/platform/msm_shared/board.c
+++ b/platform/msm_shared/board.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -362,3 +362,13 @@
 {
 	return board.platform_hlos_subtype;
 }
+
+void board_update_boot_dev(uint32_t boot_dev)
+{
+	/* HLOS subtype
+	 * bit no                        |31    20 | 19        16|15    13 |12      11 | 10          8 | 7     0|
+	 * board.platform_hlos_subtype = |reserved | Boot device |Reserved | Panel     | DDR detection | subtype|
+	 *                               |  bits   |             |  bits   | Detection |
+	 */
+	board.platform_hlos_subtype |= (boot_dev << 16);
+}
diff --git a/platform/msm_shared/boot_device.c b/platform/msm_shared/boot_device.c
index f74bdd1..3416ad9 100644
--- a/platform/msm_shared/boot_device.c
+++ b/platform/msm_shared/boot_device.c
@@ -28,6 +28,7 @@
 #include <debug.h>
 #include <mmc.h>
 #include <ufs.h>
+#include <board.h>
 #include <platform/iomap.h>
 #include <boot_device.h>
 #include <qpic_nand.h>
@@ -37,6 +38,7 @@
 void platform_read_boot_config()
 {
 	boot_device = BOOT_DEVICE_MASK(readl(BOOT_CONFIG_REG));
+	board_update_boot_dev(boot_device);
 }
 
 uint32_t platform_get_boot_dev()
diff --git a/platform/msm_shared/include/board.h b/platform/msm_shared/include/board.h
index d65ed64..834b203 100644
--- a/platform/msm_shared/include/board.h
+++ b/platform/msm_shared/include/board.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -85,4 +85,6 @@
 };
 
 uint32_t board_foundry_id(void);
+void board_update_boot_dev(uint32_t);
+
 #endif