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 | |
Geert Uytterhoeven | be32bcb | 2016-04-20 14:02:36 +0200 | [diff] [blame] | 12 | #include <linux/soc/renesas/rcar-sysc.h> |
| 13 | |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 14 | #include <asm/io.h> |
Geert Uytterhoeven | 1b55353 | 2014-06-20 18:53:05 +0200 | [diff] [blame] | 15 | |
Geert Uytterhoeven | 1b55353 | 2014-06-20 18:53:05 +0200 | [diff] [blame] | 16 | #include "r8a7779.h" |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 17 | |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 18 | /* SYSC */ |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 19 | #define SYSCIER 0x0c |
| 20 | #define SYSCIMR 0x10 |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 21 | |
Magnus Damm | f40aaf6 | 2012-01-10 17:44:39 +0900 | [diff] [blame] | 22 | #if defined(CONFIG_PM) || defined(CONFIG_SMP) |
| 23 | |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 24 | static void __init r8a7779_sysc_init(void) |
| 25 | { |
Geert Uytterhoeven | 0532399 | 2016-06-28 16:10:33 +0200 | [diff] [blame] | 26 | rcar_sysc_init(0xffd85000, 0x0131000e); |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 27 | } |
| 28 | |
Magnus Damm | f40aaf6 | 2012-01-10 17:44:39 +0900 | [diff] [blame] | 29 | #else /* CONFIG_PM || CONFIG_SMP */ |
| 30 | |
| 31 | static inline void r8a7779_sysc_init(void) {} |
| 32 | |
| 33 | #endif /* CONFIG_PM || CONFIG_SMP */ |
| 34 | |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 35 | void __init r8a7779_pm_init(void) |
| 36 | { |
Magnus Damm | f40aaf6 | 2012-01-10 17:44:39 +0900 | [diff] [blame] | 37 | static int once; |
| 38 | |
| 39 | if (!once++) |
| 40 | r8a7779_sysc_init(); |
Magnus Damm | a662c08 | 2012-01-10 15:50:01 +0900 | [diff] [blame] | 41 | } |