aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKumar Gala <galak@codeaurora.org>2015-02-04 16:46:04 -0500
committerKumar Gala <galak@codeaurora.org>2015-03-11 16:06:36 -0400
commit3d9b448bd287f051f5380323d596a133f01c074b (patch)
tree4036207733a835efd0129771b8f4f6cfe6f7d868
parentc517d838eb7d07bbe9507871fab3931deccff539 (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/Makefile2
-rw-r--r--arch/arm/mach-qcom/platsmp.c2
-rw-r--r--arch/arm/mach-qcom/scm-boot.c39
-rw-r--r--arch/arm/mach-qcom/scm-boot.h26
-rw-r--r--arch/arm/mach-qcom/scm.c17
-rw-r--r--arch/arm/mach-qcom/scm.h11
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 @@
1obj-y := board.o 1obj-y := board.o
2obj-$(CONFIG_SMP) += platsmp.o 2obj-$(CONFIG_SMP) += platsmp.o
3obj-$(CONFIG_QCOM_SCM) += scm.o scm-boot.o 3obj-$(CONFIG_QCOM_SCM) += scm.o
4 4
5CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1) 5CFLAGS_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 */
27int 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}
39EXPORT_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
24int 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}
326EXPORT_SYMBOL(scm_get_version); 326EXPORT_SYMBOL(scm_get_version);
327
328/*
329 * Set the cold/warm boot address for one of the CPU cores.
330 */
331int 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}
343EXPORT_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 @@
18extern int scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf, size_t cmd_len, 18extern 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
30extern 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
23extern u32 scm_get_version(void); 34extern u32 scm_get_version(void);