aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/mach-mx31moboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx/mach-mx31moboard.c')
-rw-r--r--arch/arm/mach-imx/mach-mx31moboard.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index 1d01ef28f25d..fff7791b7e7c 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -28,6 +28,9 @@
28#include <linux/spi/spi.h> 28#include <linux/spi/spi.h>
29#include <linux/types.h> 29#include <linux/types.h>
30#include <linux/memblock.h> 30#include <linux/memblock.h>
31#include <linux/clk.h>
32#include <linux/io.h>
33#include <linux/err.h>
31 34
32#include <linux/usb/otg.h> 35#include <linux/usb/otg.h>
33#include <linux/usb/ulpi.h> 36#include <linux/usb/ulpi.h>
@@ -490,6 +493,18 @@ err:
490 493
491} 494}
492 495
496static void mx31moboard_poweroff(void)
497{
498 struct clk *clk = clk_get_sys("imx2-wdt.0", NULL);
499
500 if (!IS_ERR(clk))
501 clk_enable(clk);
502
503 mxc_iomux_mode(MX31_PIN_WATCHDOG_RST__WATCHDOG_RST);
504
505 __raw_writew(1 << 6 | 1 << 2, MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR));
506}
507
493static int mx31moboard_baseboard; 508static int mx31moboard_baseboard;
494core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444); 509core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444);
495 510
@@ -528,6 +543,8 @@ static void __init mx31moboard_init(void)
528 543
529 moboard_usbh2_init(); 544 moboard_usbh2_init();
530 545
546 pm_power_off = mx31moboard_poweroff;
547
531 switch (mx31moboard_baseboard) { 548 switch (mx31moboard_baseboard) {
532 case MX31NOBOARD: 549 case MX31NOBOARD:
533 break; 550 break;
@@ -572,6 +589,7 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
572 .map_io = mx31_map_io, 589 .map_io = mx31_map_io,
573 .init_early = imx31_init_early, 590 .init_early = imx31_init_early,
574 .init_irq = mx31_init_irq, 591 .init_irq = mx31_init_irq,
592 .handle_irq = imx31_handle_irq,
575 .timer = &mx31moboard_timer, 593 .timer = &mx31moboard_timer,
576 .init_machine = mx31moboard_init, 594 .init_machine = mx31moboard_init,
577MACHINE_END 595MACHINE_END