aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Lo <josephl@nvidia.com>2013-02-26 11:28:06 -0500
committerStephen Warren <swarren@nvidia.com>2013-03-11 16:29:45 -0400
commit7e56474456221541aab7b2fe415ff400d7c9910a (patch)
treebc335ae0b3576bbf5370983358855d268ebf90a1
parentc141753fc385df98a33790b59a22894537031a24 (diff)
ARM: tegra: replace the CPU power on function with PMC call
Using the CPU power on function in PMC driver to bring up secondary CPUs, because we are going to re-factor powergate driver to support generic power domain. It will be removed later and added the generic power domain support in PMC driver. Signed-off-by: Joseph Lo <josephl@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/platsmp.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index 41971ac9376f..601bd0c3f983 100644
--- a/arch/arm/mach-tegra/platsmp.c
+++ b/arch/arm/mach-tegra/platsmp.c
@@ -26,11 +26,10 @@
26#include <asm/smp_scu.h> 26#include <asm/smp_scu.h>
27#include <asm/smp_plat.h> 27#include <asm/smp_plat.h>
28 28
29#include <mach/powergate.h>
30
31#include "fuse.h" 29#include "fuse.h"
32#include "flowctrl.h" 30#include "flowctrl.h"
33#include "reset.h" 31#include "reset.h"
32#include "pmc.h"
34 33
35#include "common.h" 34#include "common.h"
36#include "iomap.h" 35#include "iomap.h"
@@ -80,14 +79,10 @@ static int tegra20_boot_secondary(unsigned int cpu, struct task_struct *idle)
80 79
81static int tegra30_boot_secondary(unsigned int cpu, struct task_struct *idle) 80static int tegra30_boot_secondary(unsigned int cpu, struct task_struct *idle)
82{ 81{
83 int ret, pwrgateid; 82 int ret;
84 unsigned long timeout; 83 unsigned long timeout;
85 84
86 cpu = cpu_logical_map(cpu); 85 cpu = cpu_logical_map(cpu);
87 pwrgateid = tegra_cpu_powergate_id(cpu);
88 if (pwrgateid < 0)
89 return pwrgateid;
90
91 tegra_put_cpu_in_reset(cpu); 86 tegra_put_cpu_in_reset(cpu);
92 flowctrl_write_cpu_halt(cpu, 0); 87 flowctrl_write_cpu_halt(cpu, 0);
93 88
@@ -108,7 +103,7 @@ static int tegra30_boot_secondary(unsigned int cpu, struct task_struct *idle)
108 if (cpumask_test_cpu(cpu, &tegra_cpu_init_mask)) { 103 if (cpumask_test_cpu(cpu, &tegra_cpu_init_mask)) {
109 timeout = jiffies + msecs_to_jiffies(50); 104 timeout = jiffies + msecs_to_jiffies(50);
110 do { 105 do {
111 if (tegra_powergate_is_powered(pwrgateid)) 106 if (tegra_pmc_cpu_is_powered(cpu))
112 goto remove_clamps; 107 goto remove_clamps;
113 udelay(10); 108 udelay(10);
114 } while (time_before(jiffies, timeout)); 109 } while (time_before(jiffies, timeout));
@@ -120,14 +115,14 @@ static int tegra30_boot_secondary(unsigned int cpu, struct task_struct *idle)
120 * be un-gated by un-toggling the power gate register 115 * be un-gated by un-toggling the power gate register
121 * manually. 116 * manually.
122 */ 117 */
123 if (!tegra_powergate_is_powered(pwrgateid)) { 118 if (!tegra_pmc_cpu_is_powered(cpu)) {
124 ret = tegra_powergate_power_on(pwrgateid); 119 ret = tegra_pmc_cpu_power_on(cpu);
125 if (ret) 120 if (ret)
126 return ret; 121 return ret;
127 122
128 /* Wait for the power to come up. */ 123 /* Wait for the power to come up. */
129 timeout = jiffies + msecs_to_jiffies(100); 124 timeout = jiffies + msecs_to_jiffies(100);
130 while (tegra_powergate_is_powered(pwrgateid)) { 125 while (tegra_pmc_cpu_is_powered(cpu)) {
131 if (time_after(jiffies, timeout)) 126 if (time_after(jiffies, timeout))
132 return -ETIMEDOUT; 127 return -ETIMEDOUT;
133 udelay(10); 128 udelay(10);
@@ -140,7 +135,7 @@ remove_clamps:
140 udelay(10); 135 udelay(10);
141 136
142 /* Remove I/O clamps. */ 137 /* Remove I/O clamps. */
143 ret = tegra_powergate_remove_clamping(pwrgateid); 138 ret = tegra_pmc_cpu_remove_clamping(cpu);
144 if (ret) 139 if (ret)
145 return ret; 140 return ret;
146 141