target: msm8226: Add support for board detection apis.
Change-Id: I52e87500294a823046655f15d8b790c3f5b6b8c2
diff --git a/target/msm8226/init.c b/target/msm8226/init.c
index 8f39ca7..a1c322a 100644
--- a/target/msm8226/init.c
+++ b/target/msm8226/init.c
@@ -35,6 +35,8 @@
#include <mmc.h>
#include <spmi.h>
#include <board.h>
+#include <smem.h>
+#include <baseband.h>
#include <pm8x41.h>
#define PMIC_ARB_CHANNEL_NUM 0
@@ -88,6 +90,48 @@
pm8x41_set_boot_done();
}
+/* Detect the target type */
+void target_detect(struct board_data *board)
+{
+ board->target = LINUX_MACHTYPE_UNKNOWN;
+}
+
+/* Detect the modem type */
+void target_baseband_detect(struct board_data *board)
+{
+ uint32_t platform;
+ uint32_t platform_subtype;
+
+ platform = board->platform;
+ platform_subtype = board->platform_subtype;
+
+ /*
+ * Look for platform subtype if present, else
+ * check for platform type to decide on the
+ * baseband type
+ */
+ switch(platform_subtype)
+ {
+ case HW_PLATFORM_SUBTYPE_UNKNOWN:
+ break;
+ default:
+ dprintf(CRITICAL, "Platform Subtype : %u is not supported\n", platform_subtype);
+ ASSERT(0);
+ };
+
+ switch(platform)
+ {
+ case MSM8826:
+ case MSM8626:
+ case MSM8226:
+ board->baseband = BASEBAND_MSM;
+ break;
+ default:
+ dprintf(CRITICAL, "Platform type: %u is not supported\n", platform);
+ ASSERT(0);
+ };
+}
+
void target_serialno(unsigned char *buf)
{
uint32_t serialno;