Merge remote branch 'common/android-2.6.36' into android-tegra-2.6.36
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-tegra / include / mach / system.h
1 /*
2  * arch/arm/mach-tegra/include/mach/system.h
3  *
4  * Copyright (C) 2010 Google, Inc.
5  *
6  * Author:
7  *      Colin Cross <ccross@google.com>
8  *      Erik Gilling <konkers@google.com>
9  *
10  * This software is licensed under the terms of the GNU General Public
11  * License version 2, as published by the Free Software Foundation, and
12  * may be copied, distributed, and modified under those terms.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  */
20
21 #ifndef __MACH_TEGRA_SYSTEM_H
22 #define __MACH_TEGRA_SYSTEM_H
23
24 #include <mach/hardware.h>
25 #include <mach/iomap.h>
26
27 extern void (*tegra_reset)(char mode, const char *cmd);
28
29 static inline void arch_idle(void)
30 {
31 }
32
33 static inline void tegra_assert_system_reset(void)
34 {
35         void __iomem *reset = IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x04);
36         u32 reg;
37
38         reg = readl_relaxed(reset);
39         reg |= 0x04;
40         writel_relaxed(reg, reset);
41 }
42
43 static inline void arch_reset(char mode, const char *cmd)
44 {
45         if (tegra_reset)
46                 tegra_reset(mode, cmd);
47         else
48                 tegra_assert_system_reset();
49
50         do { } while (1);
51 }
52
53 #endif