Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 355289
b: refs/heads/master
c: 130bfed
h: refs/heads/master
i:
  355287: befdb16
v: v3
  • Loading branch information
Joseph Lo authored and Stephen Warren committed Jan 28, 2013
1 parent e112983 commit bcc3509
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c26cefd08990e3a393cc1592efc3f097f608015f
refs/heads/master: 130bfed72c75a36c76ecc82d73818c6fccd2a468
39 changes: 38 additions & 1 deletion trunk/arch/arm/mach-tegra/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <asm/hardware/gic.h>
#include <asm/mach-types.h>
#include <asm/smp_scu.h>
#include <asm/smp_plat.h>

#include <mach/powergate.h>

Expand All @@ -36,6 +37,7 @@

extern void tegra_secondary_startup(void);

static cpumask_t tegra_cpu_init_mask;
static void __iomem *scu_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE);

#define EVP_CPU_RESET_VECTOR \
Expand All @@ -50,6 +52,7 @@ static void __cpuinit tegra_secondary_init(unsigned int cpu)
*/
gic_secondary_init(0);

cpumask_set_cpu(cpu, &tegra_cpu_init_mask);
}

static int tegra20_power_up_cpu(unsigned int cpu)
Expand All @@ -72,7 +75,35 @@ static int tegra30_power_up_cpu(unsigned int cpu)
if (pwrgateid < 0)
return pwrgateid;

/* If this is the first boot, toggle powergates directly. */
/*
* The power up sequence of cold boot CPU and warm boot CPU
* was different.
*
* For warm boot CPU that was resumed from CPU hotplug, the
* power will be resumed automatically after un-halting the
* flow controller of the warm boot CPU. We need to wait for
* the confirmaiton that the CPU is powered then removing
* the IO clamps.
* For cold boot CPU, do not wait. After the cold boot CPU be
* booted, it will run to tegra_secondary_init() and set
* tegra_cpu_init_mask which influences what tegra30_power_up_cpu()
* next time around.
*/
if (cpumask_test_cpu(cpu, &tegra_cpu_init_mask)) {
timeout = jiffies + 5*HZ;
do {
if (!tegra_powergate_is_powered(pwrgateid))
goto remove_clamps;
udelay(10);
} while (time_before(jiffies, timeout));
}

/*
* The power status of the cold boot CPU is power gated as
* default. To power up the cold boot CPU, the power should
* be un-gated by un-toggling the power gate register
* manually.
*/
if (!tegra_powergate_is_powered(pwrgateid)) {
ret = tegra_powergate_power_on(pwrgateid);
if (ret)
Expand All @@ -87,6 +118,7 @@ static int tegra30_power_up_cpu(unsigned int cpu)
}
}

remove_clamps:
/* CPU partition is powered. Enable the CPU clock. */
tegra_enable_cpu_clock(cpu);
udelay(10);
Expand All @@ -105,6 +137,8 @@ static int __cpuinit tegra_boot_secondary(unsigned int cpu, struct task_struct *
{
int status;

cpu = cpu_logical_map(cpu);

/*
* Force the CPU into reset. The CPU must remain in reset when the
* flow controller state is cleared (which will cause the flow
Expand Down Expand Up @@ -165,6 +199,9 @@ static void __init tegra_smp_init_cpus(void)

static void __init tegra_smp_prepare_cpus(unsigned int max_cpus)
{
/* Always mark the boot CPU (CPU0) as initialized. */
cpumask_set_cpu(0, &tegra_cpu_init_mask);

tegra_cpu_reset_handler_init();
scu_enable(scu_base);
}
Expand Down

0 comments on commit bcc3509

Please sign in to comment.