code style scripts/checkpatch.pl (linux-3.9-rc1) formatting
[linux-2.6.32.60-moxart.git] / arch / arm / mach-moxart / include / mach / system.h
blob6fe6e68d7c34f8866700dfb169cad7e5487a5d9d
1 /* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the License,
5 * or (at your option) any later version. */
7 #ifndef __MACH_SYSTEM_H
8 #define __MACH_SYSTEM_H
10 #include <linux/io.h>
11 #include <mach/hardware.h>
13 static inline void arch_idle(void)
16 * Because of broken hardware we have to enable interrupts or the CPU
17 * will never wakeup... Acctualy it is not very good to enable
18 * interrupts here since scheduler can miss a tick, but there is
19 * no other way around this. Platforms that needs it for power saving
20 * should call enable_hlt() in init code, since by default it is
21 * disabled.
23 local_irq_enable();
24 cpu_do_idle();
29 #define RESET_GLOBAL (1 << 31)
30 #define RESET_CPU1 (1 << 30)
31 #define GLOBAL_RESET 0x0C
34 static inline void arch_reset(char mode, const char *cmd)
36 /* __raw_writel(RESET_GLOBAL | RESET_CPU1,
37 IO_ADDRESS(MOXART_GLOBAL_BASE) + GLOBAL_RESET); */
39 if (mode == 's') { /* Jump to ROM address 0 */
40 cpu_reset(0);
41 } else { /* reset the CPU */
42 /* set counter to 1 */
43 __raw_writel(1, IO_ADDRESS(MOXART_WATCHDOG_BASE)+4);
45 /* start the watch dog */
46 __raw_writel(0x5ab9, IO_ADDRESS(MOXART_WATCHDOG_BASE)+8);
48 /* set to reset the CPU */
49 __raw_writel(0x03, IO_ADDRESS(MOXART_WATCHDOG_BASE)+12);
53 #endif /* __MACH_SYSTEM_H */