Enable the EMAC clock in at91_macb_hw_init().
[oweals/u-boot.git] / arch / arm / cpu / arm926ejs / orion5x / timer.c
index f691c99779e5ab7d54e9a4c8e43f8b11201c5289..8a8aaf15d901b440f4437afa56efb68233586866 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include <common.h>
-#include <asm/arch/orion5x.h>
+#include <asm/io.h>
 
 #define UBOOT_CNTR     0       /* counter to use for uboot timer */
 
@@ -95,13 +95,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define timestamp gd->tbl
 #define lastdec gd->lastinc
 
-void reset_timer_masked(void)
-{
-       /* reset time */
-       lastdec = read_timer();
-       timestamp = 0;
-}
-
 ulong get_timer_masked(void)
 {
        ulong now = read_timer();
@@ -119,11 +112,6 @@ ulong get_timer_masked(void)
        return timestamp;
 }
 
-void reset_timer(void)
-{
-       reset_timer_masked();
-}
-
 ulong get_timer(ulong base)
 {
        return get_timer_masked() - base;
@@ -176,5 +164,24 @@ int timer_init(void)
 void timer_init_r(void)
 {
        /* init the timestamp and lastdec value */
-       reset_timer_masked();
+       lastdec = read_timer();
+       timestamp = 0;
+}
+
+/*
+ * This function is derived from PowerPC code (read timebase as long long).
+ * On ARM it just returns the timer value.
+ */
+unsigned long long get_ticks(void)
+{
+       return get_timer(0);
+}
+
+/*
+ * This function is derived from PowerPC code (timebase clock frequency).
+ * On ARM it returns the number of timer ticks per second.
+ */
+ulong get_tbclk (void)
+{
+       return (ulong)CONFIG_SYS_HZ;
 }