Channagoud Kadabi | eee0ffd | 2016-08-11 14:18:17 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2010, 2012, 2014, The Linux Foundation. All rights reserved. |
| 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 | #ifndef __MACH_SCM_BOOT_H |
| 13 | #define __MACH_SCM_BOOT_H |
| 14 | |
| 15 | #define SCM_BOOT_ADDR 0x1 |
| 16 | #define SCM_FLAG_COLDBOOT_CPU1 0x01 |
| 17 | #define SCM_FLAG_COLDBOOT_CPU2 0x08 |
| 18 | #define SCM_FLAG_COLDBOOT_CPU3 0x20 |
| 19 | #define SCM_FLAG_WARMBOOT_CPU1 0x02 |
| 20 | #define SCM_FLAG_WARMBOOT_CPU0 0x04 |
| 21 | #define SCM_FLAG_WARMBOOT_CPU2 0x10 |
| 22 | #define SCM_FLAG_WARMBOOT_CPU3 0x40 |
| 23 | |
| 24 | /* Multicluster Variants */ |
| 25 | #define SCM_BOOT_ADDR_MC 0x11 |
| 26 | #define SCM_FLAG_COLDBOOT_MC 0x02 |
| 27 | #define SCM_FLAG_WARMBOOT_MC 0x04 |
| 28 | |
| 29 | #ifdef CONFIG_ARM64 |
| 30 | #define SCM_FLAG_HLOS 0x01 |
| 31 | #else |
| 32 | #define SCM_FLAG_HLOS 0x0 |
| 33 | #endif |
| 34 | |
| 35 | #ifdef CONFIG_QCOM_SCM |
| 36 | int scm_set_boot_addr(phys_addr_t addr, unsigned int flags); |
| 37 | int scm_set_boot_addr_mc(phys_addr_t addr, u32 aff0, |
| 38 | u32 aff1, u32 aff2, u32 flags); |
| 39 | int scm_set_warm_boot_addr_mc_for_all(phys_addr_t addr); |
| 40 | int scm_is_mc_boot_available(void); |
| 41 | #else |
| 42 | static inline int scm_set_boot_addr(phys_addr_t addr, unsigned int flags) |
| 43 | { |
| 44 | WARN_ONCE(1, "CONFIG_QCOM_SCM disabled, SCM call will fail silently\n"); |
| 45 | return 0; |
| 46 | } |
| 47 | static inline int scm_set_boot_addr_mc(phys_addr_t addr, u32 aff0, |
| 48 | u32 aff1, u32 aff2, u32 flags) |
| 49 | { |
| 50 | WARN_ONCE(1, "CONFIG_QCOM_SCM disabled, SCM call will fail silently\n"); |
| 51 | return 0; |
| 52 | } |
| 53 | static inline int scm_set_warm_boot_addr_mc_for_all(phys_addr_t addr) |
| 54 | { |
| 55 | WARN_ONCE(1, "CONFIG_QCOM_SCM disabled, SCM call will fail silently\n"); |
| 56 | return 0; |
| 57 | } |
| 58 | static inline int scm_is_mc_boot_available(void) |
| 59 | { |
| 60 | WARN_ONCE(1, "CONFIG_QCOM_SCM disabled, SCM call will fail silently\n"); |
| 61 | return 0; |
| 62 | } |
| 63 | #endif |
| 64 | |
| 65 | #endif |