ARM: shmobile: Move r8a7791.h
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-shmobile / pm-r8a7791.c
1 /*
2  * r8a7791 Power management support
3  *
4  * Copyright (C) 2014  Renesas Electronics Corporation
5  * Copyright (C) 2011  Renesas Solutions Corp.
6  * Copyright (C) 2011  Magnus Damm
7  *
8  * This file is subject to the terms and conditions of the GNU General Public
9  * License.  See the file "COPYING" in the main directory of this archive
10  * for more details.
11  */
12
13 #include <linux/kernel.h>
14
15 #include <asm/io.h>
16
17 #include "pm-rcar.h"
18 #include "r8a7791.h"
19
20 /* SYSC */
21 #define SYSCIER 0x0c
22 #define SYSCIMR 0x10
23
24 #if defined(CONFIG_SMP)
25
26 static void __init r8a7791_sysc_init(void)
27 {
28         void __iomem *base = rcar_sysc_init(0xe6180000);
29
30         /* enable all interrupt sources, but do not use interrupt handler */
31         iowrite32(0x0131000e, base + SYSCIER);
32         iowrite32(0, base + SYSCIMR);
33 }
34
35 #else /* CONFIG_SMP */
36
37 static inline void r8a7791_sysc_init(void) {}
38
39 #endif /* CONFIG_SMP */
40
41 void __init r8a7791_pm_init(void)
42 {
43         static int once;
44
45         if (once++)
46                 return;
47
48         r8a7791_sysc_init();
49 }