2 * Copyright 2009 Dmitriy Taychenachev <dimichxp@gmail.com>
4 * This file is released under the GPLv2 or later.
7 #include <linux/delay.h>
10 #include <asm/proc-fns.h>
11 #include <mach/hardware.h>
15 #define WDOG_WCR MXC91231_IO_ADDRESS(MXC91231_WDOG1_BASE_ADDR)
16 #define WDOG_WCR_OUT_ENABLE (1 << 6)
17 #define WDOG_WCR_ASSERT (1 << 5)
19 void mxc91231_power_off(void)
23 wcr
= __raw_readw(WDOG_WCR
);
24 wcr
|= WDOG_WCR_OUT_ENABLE
;
25 wcr
&= ~WDOG_WCR_ASSERT
;
26 __raw_writew(wcr
, WDOG_WCR
);
29 void mxc91231_arch_reset(char mode
, const char *cmd
)
33 /* Reset the AP using CRM */
34 amcr
= __raw_readl(MXC_CRMAP_AMCR
);
35 amcr
&= ~MXC_CRMAP_AMCR_SW_AP
;
36 __raw_writel(amcr
, MXC_CRMAP_AMCR
);
42 void mxc91231_prepare_idle(void)
46 /* Go to WAIT mode after WFI */
47 crm_ctl
= __raw_readl(MXC_DSM_CRM_CONTROL
);
48 crm_ctl
&= ~(MXC_DSM_CRM_CTRL_LPMD0
| MXC_DSM_CRM_CTRL_LPMD1
);
49 crm_ctl
|= MXC_DSM_CRM_CTRL_LPMD_WAIT_MODE
;
50 __raw_writel(crm_ctl
, MXC_DSM_CRM_CONTROL
);