Merge branch 'master' into next
[safe/jmp/linux-2.6] / arch / arm / mach-pxa / reset.c
index fabead7..01e9d64 100644 (file)
@@ -7,17 +7,20 @@
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
-#include <asm/io.h>
+#include <linux/io.h>
 #include <asm/proc-fns.h>
 
-#include <mach/pxa-regs.h>
-#include <mach/pxa2xx-regs.h>
+#include <mach/regs-ost.h>
+#include <mach/reset.h>
+
+unsigned int reset_status;
+EXPORT_SYMBOL(reset_status);
 
 static void do_hw_reset(void);
 
 static int reset_gpio = -1;
 
-int init_gpio_reset(int gpio)
+int init_gpio_reset(int gpio, int output, int level)
 {
        int rc;
 
@@ -27,9 +30,12 @@ int init_gpio_reset(int gpio)
                goto out;
        }
 
-       rc = gpio_direction_input(gpio);
+       if (output)
+               rc = gpio_direction_output(gpio, level);
+       else
+               rc = gpio_direction_input(gpio);
        if (rc) {
-               printk(KERN_ERR "Can't configure reset_gpio for input\n");
+               printk(KERN_ERR "Can't configure reset_gpio\n");
                gpio_free(gpio);
                goto out;
        }
@@ -75,22 +81,22 @@ static void do_hw_reset(void)
        OSMR3 = OSCR + 368640;  /* ... in 100 ms */
 }
 
-void arch_reset(char mode)
+void arch_reset(char mode, const char *cmd)
 {
-       if (cpu_is_pxa2xx())
-               RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
+       clear_reset_status(RESET_STATUS_ALL);
 
        switch (mode) {
        case 's':
                /* Jump into ROM at address 0 */
                cpu_reset(0);
                break;
-       case 'h':
-               do_hw_reset();
-               break;
        case 'g':
                do_gpio_reset();
                break;
+       case 'h':
+       default:
+               do_hw_reset();
+               break;
        }
 }