diff options
Diffstat (limited to 'arch/arm/mach-pxa/reset.c')
| -rw-r--r-- | arch/arm/mach-pxa/reset.c | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c index 9996c612c3d..263b15249b5 100644 --- a/arch/arm/mach-pxa/reset.c +++ b/arch/arm/mach-pxa/reset.c @@ -7,11 +7,13 @@ #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 <asm/system_misc.h> -#include <mach/pxa-regs.h> +#include <mach/regs-ost.h> #include <mach/reset.h> +#include <mach/smemc.h> unsigned int reset_status; EXPORT_SYMBOL(reset_status); @@ -20,7 +22,7 @@ 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; @@ -30,9 +32,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; } @@ -73,26 +78,36 @@ static void do_gpio_reset(void) static void do_hw_reset(void) { /* Initialize the watchdog and let it fire */ - OWER = OWER_WME; - OSSR = OSSR_M3; - OSMR3 = OSCR + 368640; /* ... in 100 ms */ + writel_relaxed(OWER_WME, OWER); + writel_relaxed(OSSR_M3, OSSR); + /* ... in 100 ms */ + writel_relaxed(readl_relaxed(OSCR) + 368640, OSMR3); + /* + * SDRAM hangs on watchdog reset on Marvell PXA270 (erratum 71) + * we put SDRAM into self-refresh to prevent that + */ + while (1) + writel_relaxed(MDREFR_SLFRSH, MDREFR); } -void arch_reset(char mode) +void pxa_restart(enum reboot_mode mode, const char *cmd) { + local_irq_disable(); + local_fiq_disable(); + clear_reset_status(RESET_STATUS_ALL); switch (mode) { - case 's': + case REBOOT_SOFT: /* Jump into ROM at address 0 */ - cpu_reset(0); - break; - case 'h': - do_hw_reset(); + soft_restart(0); break; - case 'g': + case REBOOT_GPIO: do_gpio_reset(); break; + case REBOOT_HARD: + default: + do_hw_reset(); + break; } } - |
