Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 1 | /* |
| 2 | * r8a7779 Power management support |
| 3 | * |
| 4 | * Copyright (C) 2011 Renesas Solutions Corp. |
| 5 | * Copyright (C) 2011 Magnus Damm |
| 6 | * |
| 7 | * This file is subject to the terms and conditions of the GNU General Public |
| 8 | * License. See the file "COPYING" in the main directory of this archive |
| 9 | * for more details. |
| 10 | */ |
| 11 | |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 12 | #include <asm/io.h> |
Geert Uytterhoeven | 1b55353 | 2014-06-20 18:53:05 +0200 | [diff] [blame] | 13 | |
Magnus Damm | 585c09d | 2014-06-17 16:47:53 +0900 | [diff] [blame] | 14 | #include "pm-rcar.h" |
Geert Uytterhoeven | 1b55353 | 2014-06-20 18:53:05 +0200 | [diff] [blame] | 15 | #include "r8a7779.h" |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 16 | |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 17 | /* SYSC */ |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 18 | #define SYSCIER 0x0c |
| 19 | #define SYSCIMR 0x10 |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 20 | |
Magnus Damm | f40aaf6 | 2012-01-10 17:44:39 +0900 | [diff] [blame] | 21 | #if defined(CONFIG_PM) || defined(CONFIG_SMP) |
| 22 | |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 23 | static void __init r8a7779_sysc_init(void) |
| 24 | { |
Magnus Damm | a6557eb | 2014-01-15 16:43:08 +0900 | [diff] [blame] | 25 | void __iomem *base = rcar_sysc_init(0xffd85000); |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 26 | |
| 27 | /* enable all interrupt sources, but do not use interrupt handler */ |
Magnus Damm | a6557eb | 2014-01-15 16:43:08 +0900 | [diff] [blame] | 28 | iowrite32(0x0131000e, base + SYSCIER); |
| 29 | iowrite32(0, base + SYSCIMR); |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 30 | } |
| 31 | |
Magnus Damm | f40aaf6 | 2012-01-10 17:44:39 +0900 | [diff] [blame] | 32 | #else /* CONFIG_PM || CONFIG_SMP */ |
| 33 | |
| 34 | static inline void r8a7779_sysc_init(void) {} |
| 35 | |
| 36 | #endif /* CONFIG_PM || CONFIG_SMP */ |
| 37 | |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 38 | void __init r8a7779_pm_init(void) |
| 39 | { |
Magnus Damm | f40aaf6 | 2012-01-10 17:44:39 +0900 | [diff] [blame] | 40 | static int once; |
| 41 | |
| 42 | if (!once++) |
| 43 | r8a7779_sysc_init(); |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 44 | } |