aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkeita kobayashi <keita.kobayashi.ym@renesas.com>2014-05-30 01:18:48 -0400
committerSimon Horman <horms+renesas@verge.net.au>2014-06-17 04:51:50 -0400
commit5f6108bb9643949bf5ec0bc9f5cbde588c542c7f (patch)
treeca20c5c5e6422eaaeed44684b054a09649d7e2fe
parent62872989bdbf1245d7239b9f4c05a8ee7c775ed5 (diff)
ARM: shmobile: r8a7791 SYSC setup code
Add r8a7791 SYSC power management support. Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com> Acked-by: Magnus Damm <damm+renesas@opensource.se> [horms+renesas@verge.net.au: rebased] Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--arch/arm/mach-shmobile/Makefile1
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7791.h1
-rw-r--r--arch/arm/mach-shmobile/pm-r8a7791.c47
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7791.c2
4 files changed, 51 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 38d5fe825e93..9c0ad3e115a6 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -53,6 +53,7 @@ obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o
53obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o 53obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o
54obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o pm-rcar.o 54obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o pm-rcar.o
55obj-$(CONFIG_ARCH_R8A7790) += pm-r8a7790.o pm-rcar.o 55obj-$(CONFIG_ARCH_R8A7790) += pm-r8a7790.o pm-rcar.o
56obj-$(CONFIG_ARCH_R8A7791) += pm-r8a7791.o pm-rcar.o
56 57
57# Board objects 58# Board objects
58ifdef CONFIG_ARCH_SHMOBILE_MULTI 59ifdef CONFIG_ARCH_SHMOBILE_MULTI
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7791.h b/arch/arm/mach-shmobile/include/mach/r8a7791.h
index 664274cc4b64..86eae7bceb6f 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7791.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7791.h
@@ -5,6 +5,7 @@ void r8a7791_add_standard_devices(void);
5void r8a7791_add_dt_devices(void); 5void r8a7791_add_dt_devices(void);
6void r8a7791_clock_init(void); 6void r8a7791_clock_init(void);
7void r8a7791_pinmux_init(void); 7void r8a7791_pinmux_init(void);
8void r8a7791_pm_init(void);
8extern struct smp_operations r8a7791_smp_ops; 9extern struct smp_operations r8a7791_smp_ops;
9 10
10#endif /* __ASM_R8A7791_H__ */ 11#endif /* __ASM_R8A7791_H__ */
diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c
new file mode 100644
index 000000000000..15190875d507
--- /dev/null
+++ b/arch/arm/mach-shmobile/pm-r8a7791.c
@@ -0,0 +1,47 @@
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 <asm/io.h>
14#include <linux/kernel.h>
15#include <mach/r8a7791.h>
16#include "pm-rcar.h"
17
18/* SYSC */
19#define SYSCIER 0x0c
20#define SYSCIMR 0x10
21
22#if defined(CONFIG_SMP)
23
24static void __init r8a7791_sysc_init(void)
25{
26 void __iomem *base = rcar_sysc_init(0xe6180000);
27
28 /* enable all interrupt sources, but do not use interrupt handler */
29 iowrite32(0x0131000e, base + SYSCIER);
30 iowrite32(0, base + SYSCIMR);
31}
32
33#else /* CONFIG_SMP */
34
35static inline void r8a7791_sysc_init(void) {}
36
37#endif /* CONFIG_SMP */
38
39void __init r8a7791_pm_init(void)
40{
41 static int once;
42
43 if (once++)
44 return;
45
46 r8a7791_sysc_init();
47}
diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c
index 2648d68650e4..17720860f0dd 100644
--- a/arch/arm/mach-shmobile/smp-r8a7791.c
+++ b/arch/arm/mach-shmobile/smp-r8a7791.c
@@ -50,6 +50,8 @@ static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus)
50 writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, 50 writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000,
51 p + CA15RESCNT); 51 p + CA15RESCNT);
52 iounmap(p); 52 iounmap(p);
53
54 r8a7791_pm_init();
53} 55}
54 56
55static int r8a7791_smp_boot_secondary(unsigned int cpu, 57static int r8a7791_smp_boot_secondary(unsigned int cpu,