Will Deacon | 2bdd424 | 2012-12-12 19:20:52 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This program is free software; you can redistribute it and/or modify |
| 3 | * it under the terms of the GNU General Public License version 2 as |
| 4 | * published by the Free Software Foundation. |
| 5 | * |
| 6 | * This program is distributed in the hope that it will be useful, |
| 7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 9 | * GNU General Public License for more details. |
| 10 | * |
| 11 | * Copyright (C) 2012 ARM Limited |
| 12 | */ |
| 13 | |
| 14 | #ifndef __ASM_ARM_PSCI_H |
| 15 | #define __ASM_ARM_PSCI_H |
| 16 | |
| 17 | #define PSCI_POWER_STATE_TYPE_STANDBY 0 |
| 18 | #define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 |
Achin Gupta | 88d295a | 2012-12-16 21:46:10 +0000 | [diff] [blame] | 19 | #define PSCI_POWER_STATE_AFFINITY_LEVEL0 0 |
| 20 | #define PSCI_POWER_STATE_AFFINITY_LEVEL1 1 |
| 21 | #define PSCI_POWER_STATE_AFFINITY_LEVEL2 2 |
| 22 | #define PSCI_POWER_STATE_AFFINITY_LEVEL3 3 |
Will Deacon | 2bdd424 | 2012-12-12 19:20:52 +0000 | [diff] [blame] | 23 | |
| 24 | struct psci_power_state { |
| 25 | u16 id; |
| 26 | u8 type; |
| 27 | u8 affinity_level; |
| 28 | }; |
| 29 | |
| 30 | struct psci_operations { |
| 31 | int (*cpu_suspend)(struct psci_power_state state, |
| 32 | unsigned long entry_point); |
| 33 | int (*cpu_off)(struct psci_power_state state); |
| 34 | int (*cpu_on)(unsigned long cpuid, unsigned long entry_point); |
| 35 | int (*migrate)(unsigned long cpuid); |
| 36 | }; |
| 37 | |
| 38 | extern struct psci_operations psci_ops; |
Stefano Stabellini | 23f83a3 | 2013-05-21 14:24:11 +0000 | [diff] [blame] | 39 | extern struct smp_operations psci_smp_ops; |
| 40 | |
| 41 | #ifdef CONFIG_ARM_PSCI |
Mark Brown | 2eb736d | 2015-01-18 13:13:32 +0000 | [diff] [blame] | 42 | void psci_init(void); |
Stefano Stabellini | 23f83a3 | 2013-05-21 14:24:11 +0000 | [diff] [blame] | 43 | bool psci_smp_available(void); |
| 44 | #else |
Mark Brown | 2eb736d | 2015-01-18 13:13:32 +0000 | [diff] [blame] | 45 | static inline void psci_init(void) { } |
Stefano Stabellini | 23f83a3 | 2013-05-21 14:24:11 +0000 | [diff] [blame] | 46 | static inline bool psci_smp_available(void) { return false; } |
| 47 | #endif |
Will Deacon | 2bdd424 | 2012-12-12 19:20:52 +0000 | [diff] [blame] | 48 | |
Achin Gupta | 25366fe | 2012-12-16 23:11:32 +0000 | [diff] [blame] | 49 | #ifdef CONFIG_ARM_PSCI |
| 50 | extern int __init psci_probe(void); |
| 51 | #else |
| 52 | static inline int psci_probe(void) |
| 53 | { |
| 54 | return -ENODEV; |
| 55 | } |
| 56 | #endif |
Will Deacon | 2bdd424 | 2012-12-12 19:20:52 +0000 | [diff] [blame] | 57 | #endif /* __ASM_ARM_PSCI_H */ |