From 65b4ab65538e0da8e03e05d137001f10c78273d0 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Thu, 23 Oct 2014 17:35:07 -0700 Subject: ARM: qcom: scm: Clarify boot interface The secure world only knows about 32-bit wide physical addresses for the boot API. Clarify the kernel interface by explicitly stating a u32 instead of phys_addr_t which could be 32 or 64 bits depending on LPAE or not. Signed-off-by: Stephen Boyd Signed-off-by: Kumar Gala --- arch/arm/mach-qcom/scm-boot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-qcom/scm-boot.c') diff --git a/arch/arm/mach-qcom/scm-boot.c b/arch/arm/mach-qcom/scm-boot.c index 45cee3e469a5..f2fa32834631 100644 --- a/arch/arm/mach-qcom/scm-boot.c +++ b/arch/arm/mach-qcom/scm-boot.c @@ -24,11 +24,11 @@ /* * Set the cold/warm boot address for one of the CPU cores. */ -int scm_set_boot_addr(phys_addr_t addr, int flags) +int scm_set_boot_addr(u32 addr, int flags) { struct { unsigned int flags; - phys_addr_t addr; + u32 addr; } cmd; cmd.addr = addr; -- cgit From 7279db9287f226fbb3f349c3244f8dc4b783e645 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 21 Jan 2015 11:21:15 -0800 Subject: ARM: qcom: Fix SCM interface for big-endian kernels The secure environment only runs in little-endian mode, so any buffers shared with the secure environment should have their contents converted to little-endian. We also mark such elements with __le32 to allow sparse to catch such problems. Signed-off-by: Stephen Boyd Signed-off-by: Kumar Gala --- arch/arm/mach-qcom/scm-boot.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-qcom/scm-boot.c') diff --git a/arch/arm/mach-qcom/scm-boot.c b/arch/arm/mach-qcom/scm-boot.c index f2fa32834631..e8ff7beb6218 100644 --- a/arch/arm/mach-qcom/scm-boot.c +++ b/arch/arm/mach-qcom/scm-boot.c @@ -27,12 +27,12 @@ int scm_set_boot_addr(u32 addr, int flags) { struct { - unsigned int flags; - u32 addr; + __le32 flags; + __le32 addr; } cmd; - cmd.addr = addr; - cmd.flags = flags; + cmd.addr = cpu_to_le32(addr); + cmd.flags = cpu_to_le32(flags); return scm_call(SCM_SVC_BOOT, SCM_BOOT_ADDR, &cmd, sizeof(cmd), NULL, 0); } -- cgit