gro: Allow tunnel stacking in the case of FOU/GUE
[linux/fpc-iii.git] / arch / arm / mach-shmobile / pm-r8a7740.c
blob34608fcf064808b8d660710ee5e9e8a482155efb
1 /*
2 * r8a7740 power management support
4 * Copyright (C) 2012 Renesas Solutions Corp.
5 * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
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.
11 #include <linux/console.h>
12 #include <linux/io.h>
13 #include <linux/suspend.h>
15 #include "common.h"
16 #include "pm-rmobile.h"
18 #define SYSC_BASE IOMEM(0xe6180000)
20 #if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
21 static int r8a7740_pd_a3sm_suspend(void)
24 * The A3SM domain contains the CPU core and therefore it should
25 * only be turned off if the CPU is not in use.
27 return -EBUSY;
30 static int r8a7740_pd_a3sp_suspend(void)
33 * Serial consoles make use of SCIF hardware located in A3SP,
34 * keep such power domain on if "no_console_suspend" is set.
36 return console_suspend_enabled ? 0 : -EBUSY;
39 static int r8a7740_pd_d4_suspend(void)
42 * The D4 domain contains the Coresight-ETM hardware block and
43 * therefore it should only be turned off if the debug module is
44 * not in use.
46 return -EBUSY;
49 static struct rmobile_pm_domain r8a7740_pm_domains[] = {
51 .genpd.name = "A4LC",
52 .base = SYSC_BASE,
53 .bit_shift = 1,
54 }, {
55 .genpd.name = "A4MP",
56 .base = SYSC_BASE,
57 .bit_shift = 2,
58 }, {
59 .genpd.name = "D4",
60 .base = SYSC_BASE,
61 .bit_shift = 3,
62 .gov = &pm_domain_always_on_gov,
63 .suspend = r8a7740_pd_d4_suspend,
64 }, {
65 .genpd.name = "A4R",
66 .base = SYSC_BASE,
67 .bit_shift = 5,
68 }, {
69 .genpd.name = "A3RV",
70 .base = SYSC_BASE,
71 .bit_shift = 6,
72 }, {
73 .genpd.name = "A4S",
74 .base = SYSC_BASE,
75 .bit_shift = 10,
76 .no_debug = true,
77 }, {
78 .genpd.name = "A3SP",
79 .base = SYSC_BASE,
80 .bit_shift = 11,
81 .gov = &pm_domain_always_on_gov,
82 .no_debug = true,
83 .suspend = r8a7740_pd_a3sp_suspend,
84 }, {
85 .genpd.name = "A3SM",
86 .base = SYSC_BASE,
87 .bit_shift = 12,
88 .gov = &pm_domain_always_on_gov,
89 .suspend = r8a7740_pd_a3sm_suspend,
90 }, {
91 .genpd.name = "A3SG",
92 .base = SYSC_BASE,
93 .bit_shift = 13,
94 }, {
95 .genpd.name = "A4SU",
96 .base = SYSC_BASE,
97 .bit_shift = 20,
101 void __init r8a7740_init_pm_domains(void)
103 rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
104 pm_genpd_add_subdomain_names("A4R", "A3RV");
105 pm_genpd_add_subdomain_names("A4S", "A3SP");
106 pm_genpd_add_subdomain_names("A4S", "A3SM");
107 pm_genpd_add_subdomain_names("A4S", "A3SG");
109 #endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
111 #ifdef CONFIG_SUSPEND
112 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
114 cpu_do_idle();
115 return 0;
118 static void r8a7740_suspend_init(void)
120 shmobile_suspend_ops.enter = r8a7740_enter_suspend;
122 #else
123 static void r8a7740_suspend_init(void) {}
124 #endif
126 void __init r8a7740_pm_init(void)
128 r8a7740_suspend_init();