diff options
author | Kumar Gala <galak@codeaurora.org> | 2015-02-04 16:46:04 -0500 |
---|---|---|
committer | Kumar Gala <galak@codeaurora.org> | 2015-03-11 16:06:36 -0400 |
commit | 3d9b448bd287f051f5380323d596a133f01c074b (patch) | |
tree | 4036207733a835efd0129771b8f4f6cfe6f7d868 | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) |
ARM: qcom: Merge scm and scm boot code together
Put all scm related code into a single file as a first step in cleaning
up the scm interface to just expose functional behavior insteam of making
direct scm calls.
Signed-off-by: Kumar Gala <galak@codeaurora.org>
-rw-r--r-- | arch/arm/mach-qcom/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-qcom/platsmp.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-qcom/scm-boot.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-qcom/scm-boot.h | 26 | ||||
-rw-r--r-- | arch/arm/mach-qcom/scm.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-qcom/scm.h | 11 |
6 files changed, 30 insertions, 67 deletions
diff --git a/arch/arm/mach-qcom/Makefile b/arch/arm/mach-qcom/Makefile index 8f756ae1ae31..10b684140aa1 100644 --- a/arch/arm/mach-qcom/Makefile +++ b/arch/arm/mach-qcom/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | obj-y := board.o | 1 | obj-y := board.o |
2 | obj-$(CONFIG_SMP) += platsmp.o | 2 | obj-$(CONFIG_SMP) += platsmp.o |
3 | obj-$(CONFIG_QCOM_SCM) += scm.o scm-boot.o | 3 | obj-$(CONFIG_QCOM_SCM) += scm.o |
4 | 4 | ||
5 | CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1) | 5 | CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1) |
diff --git a/arch/arm/mach-qcom/platsmp.c b/arch/arm/mach-qcom/platsmp.c index 09cffed4c0a4..8f4962ebf8c2 100644 --- a/arch/arm/mach-qcom/platsmp.c +++ b/arch/arm/mach-qcom/platsmp.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | #include <asm/smp_plat.h> | 21 | #include <asm/smp_plat.h> |
22 | 22 | ||
23 | #include "scm-boot.h" | 23 | #include "scm.h" |
24 | 24 | ||
25 | #define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x35a0 | 25 | #define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x35a0 |
26 | #define SCSS_CPU1CORE_RESET 0x2d80 | 26 | #define SCSS_CPU1CORE_RESET 0x2d80 |
diff --git a/arch/arm/mach-qcom/scm-boot.c b/arch/arm/mach-qcom/scm-boot.c deleted file mode 100644 index e8ff7beb6218..000000000000 --- a/arch/arm/mach-qcom/scm-boot.c +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* Copyright (c) 2010, Code Aurora Forum. 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 | * You should have received a copy of the GNU General Public License | ||
13 | * along with this program; if not, write to the Free Software | ||
14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
15 | * 02110-1301, USA. | ||
16 | */ | ||
17 | |||
18 | #include <linux/module.h> | ||
19 | #include <linux/slab.h> | ||
20 | |||
21 | #include "scm.h" | ||
22 | #include "scm-boot.h" | ||
23 | |||
24 | /* | ||
25 | * Set the cold/warm boot address for one of the CPU cores. | ||
26 | */ | ||
27 | int scm_set_boot_addr(u32 addr, int flags) | ||
28 | { | ||
29 | struct { | ||
30 | __le32 flags; | ||
31 | __le32 addr; | ||
32 | } cmd; | ||
33 | |||
34 | cmd.addr = cpu_to_le32(addr); | ||
35 | cmd.flags = cpu_to_le32(flags); | ||
36 | return scm_call(SCM_SVC_BOOT, SCM_BOOT_ADDR, | ||
37 | &cmd, sizeof(cmd), NULL, 0); | ||
38 | } | ||
39 | EXPORT_SYMBOL(scm_set_boot_addr); | ||
diff --git a/arch/arm/mach-qcom/scm-boot.h b/arch/arm/mach-qcom/scm-boot.h deleted file mode 100644 index 3e210fb818bb..000000000000 --- a/arch/arm/mach-qcom/scm-boot.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | /* Copyright (c) 2010, Code Aurora Forum. 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_CPU0 0x04 | ||
20 | #define SCM_FLAG_WARMBOOT_CPU1 0x02 | ||
21 | #define SCM_FLAG_WARMBOOT_CPU2 0x10 | ||
22 | #define SCM_FLAG_WARMBOOT_CPU3 0x40 | ||
23 | |||
24 | int scm_set_boot_addr(u32 addr, int flags); | ||
25 | |||
26 | #endif | ||
diff --git a/arch/arm/mach-qcom/scm.c b/arch/arm/mach-qcom/scm.c index 1d9cf18c7091..e20db10e96f4 100644 --- a/arch/arm/mach-qcom/scm.c +++ b/arch/arm/mach-qcom/scm.c | |||
@@ -324,3 +324,20 @@ u32 scm_get_version(void) | |||
324 | return version; | 324 | return version; |
325 | } | 325 | } |
326 | EXPORT_SYMBOL(scm_get_version); | 326 | EXPORT_SYMBOL(scm_get_version); |
327 | |||
328 | /* | ||
329 | * Set the cold/warm boot address for one of the CPU cores. | ||
330 | */ | ||
331 | int scm_set_boot_addr(u32 addr, int flags) | ||
332 | { | ||
333 | struct { | ||
334 | __le32 flags; | ||
335 | __le32 addr; | ||
336 | } cmd; | ||
337 | |||
338 | cmd.addr = cpu_to_le32(addr); | ||
339 | cmd.flags = cpu_to_le32(flags); | ||
340 | return scm_call(SCM_SVC_BOOT, SCM_BOOT_ADDR, | ||
341 | &cmd, sizeof(cmd), NULL, 0); | ||
342 | } | ||
343 | EXPORT_SYMBOL(scm_set_boot_addr); | ||
diff --git a/arch/arm/mach-qcom/scm.h b/arch/arm/mach-qcom/scm.h index 00b31ea58f29..cfe693575d51 100644 --- a/arch/arm/mach-qcom/scm.h +++ b/arch/arm/mach-qcom/scm.h | |||
@@ -18,6 +18,17 @@ | |||
18 | extern int scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf, size_t cmd_len, | 18 | extern int scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf, size_t cmd_len, |
19 | void *resp_buf, size_t resp_len); | 19 | void *resp_buf, size_t resp_len); |
20 | 20 | ||
21 | #define SCM_BOOT_ADDR 0x1 | ||
22 | #define SCM_FLAG_COLDBOOT_CPU1 0x01 | ||
23 | #define SCM_FLAG_COLDBOOT_CPU2 0x08 | ||
24 | #define SCM_FLAG_COLDBOOT_CPU3 0x20 | ||
25 | #define SCM_FLAG_WARMBOOT_CPU0 0x04 | ||
26 | #define SCM_FLAG_WARMBOOT_CPU1 0x02 | ||
27 | #define SCM_FLAG_WARMBOOT_CPU2 0x10 | ||
28 | #define SCM_FLAG_WARMBOOT_CPU3 0x40 | ||
29 | |||
30 | extern int scm_set_boot_addr(u32 addr, int flags); | ||
31 | |||
21 | #define SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF)) | 32 | #define SCM_VERSION(major, minor) (((major) << 16) | ((minor) & 0xFF)) |
22 | 33 | ||
23 | extern u32 scm_get_version(void); | 34 | extern u32 scm_get_version(void); |