]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/arm/mach-ixp4xx/common.c
Merge branch 'restart' into for-linus
[karo-tx-linux.git] / arch / arm / mach-ixp4xx / common.c
index b86a0055ab969694dc931be487a33aaef4368a4c..3841ab4146ba6cd30300eb6946a4fb75c32d431a 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/serial.h>
-#include <linux/sched.h>
 #include <linux/tty.h>
 #include <linux/platform_device.h>
 #include <linux/serial_core.h>
@@ -403,18 +402,9 @@ void __init ixp4xx_sys_init(void)
 /*
  * sched_clock()
  */
-static DEFINE_CLOCK_DATA(cd);
-
-unsigned long long notrace sched_clock(void)
-{
-       u32 cyc = *IXP4XX_OSTS;
-       return cyc_to_sched_clock(&cd, cyc, (u32)~0);
-}
-
-static void notrace ixp4xx_update_sched_clock(void)
+static u32 notrace ixp4xx_read_sched_clock(void)
 {
-       u32 cyc = *IXP4XX_OSTS;
-       update_sched_clock(&cd, cyc, (u32)~0);
+       return *IXP4XX_OSTS;
 }
 
 /*
@@ -430,7 +420,7 @@ unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ;
 EXPORT_SYMBOL(ixp4xx_timer_freq);
 static void __init ixp4xx_clocksource_init(void)
 {
-       init_sched_clock(&cd, ixp4xx_update_sched_clock, 32, ixp4xx_timer_freq);
+       setup_sched_clock(ixp4xx_read_sched_clock, 32, ixp4xx_timer_freq);
 
        clocksource_mmio_init(NULL, "OSTS", ixp4xx_timer_freq, 200, 32,
                        ixp4xx_clocksource_read);
@@ -501,3 +491,23 @@ static void __init ixp4xx_clockevent_init(void)
 
        clockevents_register_device(&clockevent_ixp4xx);
 }
+
+void ixp4xx_restart(char mode, const char *cmd)
+{
+       if ( 1 && mode == 's') {
+               /* Jump into ROM at address 0 */
+               soft_restart(0);
+       } else {
+               /* Use on-chip reset capability */
+
+               /* set the "key" register to enable access to
+                * "timer" and "enable" registers
+                */
+               *IXP4XX_OSWK = IXP4XX_WDT_KEY;
+
+               /* write 0 to the timer register for an immediate reset */
+               *IXP4XX_OSWT = 0;
+
+               *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
+       }
+}