msm: scm-boot: Clarify types for scm_set_boot_addr()
The boot address is a physical address (even if the secure
monitor only considers it to be 32 bits). Move to using
phys_addr_t to clarify this is a physical address and to ease
any support of LPAE in the future. Also make the flags unsigned
so that we can use the highest bit if necessary.
Change-Id: I1aa5ca9cb75ea94b4df72c5a536cf42f73ff8051
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
index c8980a1..f6b44c6 100644
--- a/arch/arm/mach-msm/platsmp.c
+++ b/arch/arm/mach-msm/platsmp.c
@@ -184,7 +184,7 @@
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
{
int ret;
- int flag = 0;
+ unsigned int flag = 0;
unsigned long timeout;
pr_debug("Starting secondary CPU %d\n", cpu);
@@ -198,8 +198,7 @@
__WARN();
if (per_cpu(cold_boot_done, cpu) == false) {
- ret = scm_set_boot_addr((void *)
- virt_to_phys(msm_secondary_startup),
+ ret = scm_set_boot_addr(virt_to_phys(msm_secondary_startup),
flag);
if (ret == 0)
release_secondary(cpu);
diff --git a/arch/arm/mach-msm/pm-boot.c b/arch/arm/mach-msm/pm-boot.c
index 079ed9c..ed15a0c 100644
--- a/arch/arm/mach-msm/pm-boot.c
+++ b/arch/arm/mach-msm/pm-boot.c
@@ -43,7 +43,7 @@
#ifdef CONFIG_MSM_SCM
static int __devinit msm_pm_tz_boot_init(void)
{
- int flag = 0;
+ unsigned int flag = 0;
if (num_possible_cpus() == 1)
flag = SCM_FLAG_WARMBOOT_CPU0;
else if (num_possible_cpus() == 2)
@@ -54,7 +54,7 @@
else
__WARN();
- return scm_set_boot_addr((void *)virt_to_phys(msm_pm_boot_entry), flag);
+ return scm_set_boot_addr(virt_to_phys(msm_pm_boot_entry), flag);
}
static void msm_pm_config_tz_before_pc(unsigned int cpu,
diff --git a/arch/arm/mach-msm/scm-boot.c b/arch/arm/mach-msm/scm-boot.c
index e377633..01d0853 100644
--- a/arch/arm/mach-msm/scm-boot.c
+++ b/arch/arm/mach-msm/scm-boot.c
@@ -19,11 +19,11 @@
/*
* Set the cold/warm boot address for one of the CPU cores.
*/
-int scm_set_boot_addr(void *addr, int flags)
+int scm_set_boot_addr(phys_addr_t addr, unsigned int flags)
{
struct {
unsigned int flags;
- void *addr;
+ unsigned long addr;
} cmd;
cmd.addr = addr;
diff --git a/arch/arm/mach-msm/scm-boot.h b/arch/arm/mach-msm/scm-boot.h
index 221ffca..0d0e6aa 100644
--- a/arch/arm/mach-msm/scm-boot.h
+++ b/arch/arm/mach-msm/scm-boot.h
@@ -22,9 +22,12 @@
#define SCM_FLAG_WARMBOOT_CPU3 0x40
#ifdef CONFIG_MSM_SCM
-int scm_set_boot_addr(void *addr, int flags);
+int scm_set_boot_addr(phys_addr_t addr, unsigned int flags);
#else
-static inline int scm_set_boot_addr(void *addr, int flags) { return 0; }
+static inline int scm_set_boot_addr(phys_addr_t addr, unsigned int flags)
+{
+ return 0;
+}
#endif
#endif