perf session: Add storage for seperating event types in report
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / mach-mxc91231 / system.c
blob736f7efd874a7e2182a9d48640b64bec787a020a
1 /*
2 * Copyright 2009 Dmitriy Taychenachev <dimichxp@gmail.com>
4 * This file is released under the GPLv2 or later.
5 */
7 #include <linux/delay.h>
8 #include <linux/io.h>
10 #include <asm/proc-fns.h>
11 #include <mach/hardware.h>
13 #include "crm_regs.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)
21 u16 wcr;
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)
31 u32 amcr;
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);
38 mdelay(10);
39 cpu_reset(0);
42 void mxc91231_prepare_idle(void)
44 u32 crm_ctl;
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);