rk3188: fix cpu up down bug

This commit is contained in:
黄涛
2013-02-26 15:06:12 +08:00
parent 088e8f5cc6
commit cdac986069

View File

@@ -33,6 +33,7 @@ int platform_cpu_kill(unsigned int cpu)
*/
for (k = 0; k < 1000; k++) {
if (cpumask_test_cpu(cpu, &dead_cpus)) {
mdelay(1);
pmu_set_power_domain(PD_A9_0 + cpu, false);
return 1;
}
@@ -50,12 +51,31 @@ int platform_cpu_kill(unsigned int cpu)
*/
void platform_cpu_die(unsigned int cpu)
{
unsigned int v;
/* hardware shutdown code running on the CPU that is being offlined */
flush_cache_all();
dsb();
/* notify platform_cpu_kill() that hardware shutdown is finished */
cpumask_set_cpu(cpu, &dead_cpus);
clean_dcache_area(&dead_cpus, sizeof(dead_cpus));
asm volatile(
" mcr p15, 0, %1, c7, c5, 0\n"
" mcr p15, 0, %1, c7, c10, 4\n"
/*
* Turn off coherency
*/
" mrc p15, 0, %0, c1, c0, 1\n"
" bic %0, %0, %3\n" // clear ACTLR.SMP | ACTLR.FW
" mcr p15, 0, %0, c1, c0, 1\n"
" mrc p15, 0, %0, c1, c0, 0\n"
" bic %0, %0, %2\n"
" mcr p15, 0, %0, c1, c0, 0\n"
: "=&r" (v)
: "r" (0), "Ir" (CR_C), "Ir" ((1 << 6) | (1 << 0))
: "cc");
/* wait for SoC code in platform_cpu_kill() to shut off CPU core
* power. CPU bring up starts from the reset vector.