Murali Nalajala | 41786ab | 2012-03-06 10:47:32 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2007-2009,2012 Code Aurora Forum. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #ifndef _ARCH_ARM_MACH_MSM_IDLE_H_ |
| 15 | #define _ARCH_ARM_MACH_MSM_IDLE_H_ |
| 16 | |
Steve Muckle | fcece05 | 2012-02-18 20:09:58 -0800 | [diff] [blame] | 17 | /* 11 general purpose registers (r4-r14), 10 cp15 registers */ |
| 18 | #define CPU_SAVED_STATE_SIZE (4 * 11 + 4 * 10) |
Steve Muckle | fcece05 | 2012-02-18 20:09:58 -0800 | [diff] [blame] | 19 | |
Murali Nalajala | 93f2999 | 2012-03-21 15:59:27 +0530 | [diff] [blame] | 20 | #define ON 1 |
| 21 | #define OFF 0 |
| 22 | #define TARGET_IS_8625 1 |
Murali Nalajala | 73c1333 | 2012-05-15 11:30:59 +0530 | [diff] [blame] | 23 | #define POWER_COLLAPSED 1 |
Murali Nalajala | 93f2999 | 2012-03-21 15:59:27 +0530 | [diff] [blame] | 24 | |
Steve Muckle | fcece05 | 2012-02-18 20:09:58 -0800 | [diff] [blame] | 25 | #ifndef __ASSEMBLY__ |
| 26 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 27 | int msm_arch_idle(void); |
| 28 | int msm_pm_collapse(void); |
| 29 | void msm_pm_collapse_exit(void); |
Steve Muckle | fcece05 | 2012-02-18 20:09:58 -0800 | [diff] [blame] | 30 | extern void *msm_saved_state; |
Girish Mahadevan | 5594499 | 2012-10-26 11:03:07 -0600 | [diff] [blame] | 31 | extern void (*msm_pm_disable_l2_fn)(void); |
| 32 | extern void (*msm_pm_enable_l2_fn)(void); |
| 33 | extern void (*msm_pm_flush_l2_fn)(void); |
Steve Muckle | fcece05 | 2012-02-18 20:09:58 -0800 | [diff] [blame] | 34 | extern unsigned long msm_saved_state_phys; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 35 | |
| 36 | #ifdef CONFIG_CPU_V7 |
| 37 | void msm_pm_boot_entry(void); |
Maheshkumar Sivasubramanian | a012e09 | 2011-08-18 10:13:03 -0600 | [diff] [blame] | 38 | void msm_pm_set_l2_flush_flag(unsigned int flag); |
Praveen Chidambaram | c594a09 | 2012-09-18 19:48:29 -0600 | [diff] [blame] | 39 | int msm_pm_get_l2_flush_flag(void); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 40 | extern unsigned long msm_pm_pc_pgd; |
Steve Muckle | c25a936 | 2012-03-22 16:40:01 -0700 | [diff] [blame] | 41 | extern unsigned long msm_pm_boot_vector[NR_CPUS]; |
Murali Nalajala | 93f2999 | 2012-03-21 15:59:27 +0530 | [diff] [blame] | 42 | extern uint32_t target_type; |
Murali Nalajala | 73c1333 | 2012-05-15 11:30:59 +0530 | [diff] [blame] | 43 | extern uint32_t apps_power_collapse; |
| 44 | extern uint32_t *l2x0_base_addr; |
Maheshkumar Sivasubramanian | a012e09 | 2011-08-18 10:13:03 -0600 | [diff] [blame] | 45 | #else |
| 46 | static inline void msm_pm_set_l2_flush_flag(unsigned int flag) |
| 47 | { |
| 48 | /* empty */ |
| 49 | } |
Murali Nalajala | 41786ab | 2012-03-06 10:47:32 +0530 | [diff] [blame] | 50 | static inline void msm_pm_boot_entry(void) |
| 51 | { |
| 52 | /* empty */ |
| 53 | } |
| 54 | static inline void msm_pm_write_boot_vector(unsigned int cpu, |
| 55 | unsigned long address) |
| 56 | { |
| 57 | /* empty */ |
| 58 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 59 | #endif |
Steve Muckle | fcece05 | 2012-02-18 20:09:58 -0800 | [diff] [blame] | 60 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 61 | #endif |