msm: cleanup timer code

Moves platform dependent code to platform dirs.

Change-Id: I003d40d807932643a1c1c75f6199b972c89eb4c5
diff --git a/platform/msm7x27a/include/platform/iomap.h b/platform/msm7x27a/include/platform/iomap.h
index 6b3b441..ce0da18 100644
--- a/platform/msm7x27a/include/platform/iomap.h
+++ b/platform/msm7x27a/include/platform/iomap.h
@@ -41,6 +41,19 @@
 
 #define MSM_VIC_BASE	0xC0000000
 #define MSM_GPT_BASE	0xC0100000
+
+#define GPT_REG(off)    (MSM_GPT_BASE + (off))
+
+#define GPT_MATCH_VAL     GPT_REG(0x0000)
+#define GPT_COUNT_VAL     GPT_REG(0x0004)
+#define GPT_ENABLE        GPT_REG(0x0008)
+#define GPT_CLEAR         GPT_REG(0x000C)
+#define DGT_MATCH_VAL     GPT_REG(0x0010)
+#define DGT_COUNT_VAL     GPT_REG(0x0014)
+#define DGT_ENABLE        GPT_REG(0x0018)
+#define DGT_CLEAR         GPT_REG(0x001C)
+#define SPSS_TIMER_STATUS GPT_REG(0x0034)
+
 #define MSM_CSR_BASE	0xC0100000
 #define MSM_CLK_CTL_BASE	0xA8600000
 
diff --git a/platform/msm7x27a/platform.c b/platform/msm7x27a/platform.c
index bda2652..056d8d0 100644
--- a/platform/msm7x27a/platform.c
+++ b/platform/msm7x27a/platform.c
@@ -31,14 +31,18 @@
  * SUCH DAMAGE.
  */
 
+#include <reg.h>
 #include <debug.h>
 #include <kernel/thread.h>
 #include <platform/debug.h>
+#include <platform/iomap.h>
 #include <mddi.h>
 #include <dev/fbcon.h>
 
 static struct fbcon_config *fb_config;
 
+static uint32_t ticks_per_sec = 0;
+
 void platform_init_interrupts(void);
 void platform_init_timer();
 
@@ -86,3 +90,18 @@
 	display_shutdown();
 #endif
 }
+
+/* Initialize DGT timer */
+void platform_init_timer(void)
+{
+	/* disable timer */
+	writel(0, DGT_ENABLE);
+
+	ticks_per_sec = 19200000; /* Uses TCXO (19.2 MHz) */
+}
+
+/* Returns timer ticks per sec */
+uint32_t platform_tick_rate(void)
+{
+	return ticks_per_sec;
+}