1 /*
2  * Copyright (C) 2005 Sigmatel Inc
3  *
4  * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
5  * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6  */
7 
8 /*
9  * The code contained herein is licensed under the GNU General Public
10  * License. You may obtain a copy of the GNU General Public License
11  * Version 2 or later at the following locations:
12  *
13  * http://www.opensource.org/licenses/gpl-license.html
14  * http://www.gnu.org/copyleft/gpl.html
15  */
16 #ifndef __ASM_ARCH_SYSTEM_H
17 #define __ASM_ARCH_SYSTEM_H
18 
19 #include <asm/proc-fns.h>
20 #include <mach/platform.h>
21 #include <mach/regs-clkctrl.h>
22 #include <mach/regs-power.h>
23 
arch_idle(void)24 static inline void arch_idle(void)
25 {
26 	/*
27 	 * This should do all the clock switching
28 	 * and wait for interrupt tricks
29 	 */
30 
31 	cpu_do_idle();
32 }
33 
arch_reset(char mode,const char * cmd)34 static inline void arch_reset(char mode, const char *cmd)
35 {
36 	/* Set BATTCHRG to default value */
37 	__raw_writel(0x00010000, REGS_POWER_BASE + HW_POWER_CHARGE);
38 
39 	/* Set MINPWR to default value   */
40 	__raw_writel(0, REGS_POWER_BASE + HW_POWER_MINPWR);
41 
42 	/* Reset digital side of chip (but not power or RTC) */
43 	__raw_writel(BM_CLKCTRL_RESET_DIG,
44 			REGS_CLKCTRL_BASE + HW_CLKCTRL_RESET);
45 
46 	/* Should not return */
47 }
48 
49 #endif
50