aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorPeter De Schrijver <pdeschrijver@nvidia.com>2012-02-09 18:47:49 -0500
committerOlof Johansson <olof@lixom.net>2012-02-26 17:44:45 -0500
commit65fe31da5cede3597938b0f3bba99f604369018d (patch)
treec5a8545f4dcf1f19a4ef0edcf637feb6338d5f6f /arch/arm/mach-tegra
parent6cafa97d3ca6a480dc39e20bb2d12ec2c5ca025e (diff)
ARM: tegra: support for Tegra30 CPU powerdomains
Secondary CPU powerdomains can be powergated on Tegra30. Add the necessary functions to do this. This will be used to boot the secondary CPUs later on. Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com> Acked-by: Stephen Warren <swarren@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/common.c3
-rw-r--r--arch/arm/mach-tegra/include/mach/powergate.h3
-rw-r--r--arch/arm/mach-tegra/powergate.c19
3 files changed, 24 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 04a54c96d72c..09dc37fc4299 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -28,6 +28,7 @@
28 28
29#include <mach/iomap.h> 29#include <mach/iomap.h>
30#include <mach/system.h> 30#include <mach/system.h>
31#include <mach/powergate.h>
31 32
32#include "board.h" 33#include "board.h"
33#include "clock.h" 34#include "clock.h"
@@ -119,6 +120,7 @@ void __init tegra20_init_early(void)
119 tegra_clk_init_from_table(tegra20_clk_init_table); 120 tegra_clk_init_from_table(tegra20_clk_init_table);
120 tegra_init_cache(0x331, 0x441); 121 tegra_init_cache(0x331, 0x441);
121 tegra_pmc_init(); 122 tegra_pmc_init();
123 tegra_powergate_init();
122} 124}
123#endif 125#endif
124#ifdef CONFIG_ARCH_TEGRA_3x_SOC 126#ifdef CONFIG_ARCH_TEGRA_3x_SOC
@@ -128,5 +130,6 @@ void __init tegra30_init_early(void)
128 tegra30_init_clocks(); 130 tegra30_init_clocks();
129 tegra_init_cache(0x441, 0x551); 131 tegra_init_cache(0x441, 0x551);
130 tegra_pmc_init(); 132 tegra_pmc_init();
133 tegra_powergate_init();
131} 134}
132#endif 135#endif
diff --git a/arch/arm/mach-tegra/include/mach/powergate.h b/arch/arm/mach-tegra/include/mach/powergate.h
index ca41186a545f..4752b1a68f35 100644
--- a/arch/arm/mach-tegra/include/mach/powergate.h
+++ b/arch/arm/mach-tegra/include/mach/powergate.h
@@ -38,6 +38,9 @@
38#define TEGRA_POWERGATE_CPU0 TEGRA_POWERGATE_CPU 38#define TEGRA_POWERGATE_CPU0 TEGRA_POWERGATE_CPU
39#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D 39#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D
40 40
41int __init tegra_powergate_init(void);
42
43int tegra_cpu_powergate_id(int cpuid);
41int tegra_powergate_is_powered(int id); 44int tegra_powergate_is_powered(int id);
42int tegra_powergate_power_on(int id); 45int tegra_powergate_power_on(int id);
43int tegra_powergate_power_off(int id); 46int tegra_powergate_power_off(int id);
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index 7120ad7e1355..c238699ae86f 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -41,6 +41,14 @@
41#define PWRGATE_STATUS 0x38 41#define PWRGATE_STATUS 0x38
42 42
43static int tegra_num_powerdomains; 43static int tegra_num_powerdomains;
44static int tegra_num_cpu_domains;
45static u8 *tegra_cpu_domains;
46static u8 tegra30_cpu_domains[] = {
47 TEGRA_POWERGATE_CPU0,
48 TEGRA_POWERGATE_CPU1,
49 TEGRA_POWERGATE_CPU2,
50 TEGRA_POWERGATE_CPU3,
51};
44 52
45static DEFINE_SPINLOCK(tegra_powergate_lock); 53static DEFINE_SPINLOCK(tegra_powergate_lock);
46 54
@@ -161,6 +169,14 @@ err_power:
161 return ret; 169 return ret;
162} 170}
163 171
172int tegra_cpu_powergate_id(int cpuid)
173{
174 if (cpuid > 0 && cpuid < tegra_num_cpu_domains)
175 return tegra_cpu_domains[cpuid];
176
177 return -EINVAL;
178}
179
164int __init tegra_powergate_init(void) 180int __init tegra_powergate_init(void)
165{ 181{
166 switch (tegra_chip_id) { 182 switch (tegra_chip_id) {
@@ -169,6 +185,8 @@ int __init tegra_powergate_init(void)
169 break; 185 break;
170 case TEGRA30: 186 case TEGRA30:
171 tegra_num_powerdomains = 14; 187 tegra_num_powerdomains = 14;
188 tegra_num_cpu_domains = 4;
189 tegra_cpu_domains = tegra30_cpu_domains;
172 break; 190 break;
173 default: 191 default:
174 /* Unknown Tegra variant. Disable powergating */ 192 /* Unknown Tegra variant. Disable powergating */
@@ -178,7 +196,6 @@ int __init tegra_powergate_init(void)
178 196
179 return 0; 197 return 0;
180} 198}
181arch_initcall(tegra_powergate_init);
182 199
183#ifdef CONFIG_DEBUG_FS 200#ifdef CONFIG_DEBUG_FS
184 201