blob: 87abcf278432abe5d25a6b19b28f0c6f37e54c80 [file] [log] [blame]
Sundar Iyer9d704c02010-09-15 10:45:51 +01001/*
2 * Copyright (C) STMicroelectronics 2009
3 * Copyright (C) ST-Ericsson SA 2010
4 *
5 * License Terms: GNU General Public License v2
6 * Based on ARM realview platform
7 *
8 * Author: Sundar Iyer <sundar.iyer@stericsson.com>
9 *
10 */
11#include <linux/kernel.h>
12#include <linux/errno.h>
13#include <linux/smp.h>
Sundar Iyer9d704c02010-09-15 10:45:51 +010014
15#include <asm/cacheflush.h>
Will Deaconeb504392012-01-20 12:01:12 +010016#include <asm/smp_plat.h>
Sundar Iyer9d704c02010-09-15 10:45:51 +010017
Arnd Bergmanne657bcf2013-03-21 22:51:12 +010018#include "setup.h"
Marc Zyngier5ac21a92011-09-08 13:15:22 +010019
Marc Zyngier5ac21a92011-09-08 13:15:22 +010020/*
21 * platform-specific code to shutdown a CPU
22 *
23 * Called with IRQs disabled
24 */
25void __ref ux500_cpu_die(unsigned int cpu)
Sundar Iyer9d704c02010-09-15 10:45:51 +010026{
27 flush_cache_all();
28
Marc Zyngier5ac21a92011-09-08 13:15:22 +010029 /* directly enter low power state, skipping secure registers */
Sundar Iyer9d704c02010-09-15 10:45:51 +010030 for (;;) {
31 __asm__ __volatile__("dsb\n\t" "wfi\n\t"
32 : : : "memory");
Will Deacon28763482011-08-09 12:21:36 +010033 if (pen_release == cpu_logical_map(cpu)) {
Sundar Iyer9d704c02010-09-15 10:45:51 +010034 /*
35 * OK, proper wakeup, we're done
36 */
37 break;
38 }
39 }
40}