[target]: Add code to get LINUX_MACHTYPE by calling a function for all targets

Add code to read the hardware platform and return the corresponding
LINUX_MACHTYPE for msm7630_surf target.
diff --git a/target/surf-msm7k/init.c b/target/surf-msm7k/init.c
index e559ef8..956ea49 100644
--- a/target/surf-msm7k/init.c
+++ b/target/surf-msm7k/init.c
@@ -37,6 +37,8 @@
 
 #define BOARD_FLASH_OFFSET	378
 
+#define LINUX_MACHTYPE  0x0000059F
+
 static struct ptable flash_ptable;
 
 /* for these partitions, start will be offset by either what we get from
@@ -111,3 +113,8 @@
 	ptable_dump(&flash_ptable);
 	flash_set_ptable(&flash_ptable);
 }
+
+unsigned board_machtype(void)
+{
+    return LINUX_MACHTYPE;
+}
diff --git a/target/surf-msm7k/rules.mk b/target/surf-msm7k/rules.mk
index b762c13..53828fc 100644
--- a/target/surf-msm7k/rules.mk
+++ b/target/surf-msm7k/rules.mk
@@ -7,8 +7,6 @@
 MEMBASE := 0x00000000 # SMI
 MEMSIZE := 0x00800000 # 8MB
 
-LINUX_MACHTYPE   := 0x0000059F
-
 BASE_ADDR        := 0x10000000
 
 TAGS_ADDR        := BASE_ADDR+0x00000100
@@ -27,7 +25,6 @@
 DEFINES += \
 	SDRAM_SIZE=$(MEMSIZE) \
 	MEMBASE=$(MEMBASE) \
-	LINUX_MACHTYPE=$(LINUX_MACHTYPE) \
 	BASE_ADDR=$(BASE_ADDR) \
 	TAGS_ADDR=$(TAGS_ADDR) \
 	KERNEL_ADDR=$(KERNEL_ADDR) \