From c7b7c609493da428bd5af19d522b14a912b8ea3e Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Tue, 29 Sep 2015 15:48:53 -0400 Subject: qcom-scm: fix endianess issue in __qcom_scm_is_call_available Signed-off-by: Rob Clark Reviewed-by: Stephen Boyd Signed-off-by: Andy Gross --- drivers/firmware/qcom_scm-32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/firmware') diff --git a/drivers/firmware/qcom_scm-32.c b/drivers/firmware/qcom_scm-32.c index 29e6850665eb..0883292f640f 100644 --- a/drivers/firmware/qcom_scm-32.c +++ b/drivers/firmware/qcom_scm-32.c @@ -480,15 +480,15 @@ void __qcom_scm_cpu_power_down(u32 flags) int __qcom_scm_is_call_available(u32 svc_id, u32 cmd_id) { int ret; - u32 svc_cmd = (svc_id << 10) | cmd_id; - u32 ret_val = 0; + __le32 svc_cmd = cpu_to_le32((svc_id << 10) | cmd_id); + __le32 ret_val = 0; ret = qcom_scm_call(QCOM_SCM_SVC_INFO, QCOM_IS_CALL_AVAIL_CMD, &svc_cmd, sizeof(svc_cmd), &ret_val, sizeof(ret_val)); if (ret) return ret; - return ret_val; + return le32_to_cpu(ret_val); } int __qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt, u32 *resp) -- cgit v1.2.3 From 33e38b4f1c54f9c2d3b2034c18ef937a3c09bc66 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 12 Oct 2015 16:56:19 +0200 Subject: firmware: qcom-scm: build for correct architecture level The ".arch_extension sec" directive is only available on ARMv6 or higher, so if we enable the SCM driver while building a kernel for an older CPU, we get a build error: /tmp/ccUyhMOY.s:130: Error: selected processor does not support ARM mode `smc #0' /tmp/ccUyhMOY.s:216: Error: selected processor does not support ARM mode `smc #0' /tmp/ccUyhMOY.s:373: Error: selected processor does not support ARM mode `smc #0' make[4]: *** [drivers/firmware/qcom_scm-32.o] Error 1 This changes the Makefile so we pass the ARMv7 architecture level both for the check and for the actual compilation of the scm driver. Signed-off-by: Arnd Bergmann Signed-off-by: Andy Gross --- drivers/firmware/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/firmware') diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile index 2ee83474a3c1..f0066373b170 100644 --- a/drivers/firmware/Makefile +++ b/drivers/firmware/Makefile @@ -15,7 +15,7 @@ obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o obj-$(CONFIG_QCOM_SCM) += qcom_scm.o obj-$(CONFIG_QCOM_SCM_64) += qcom_scm-64.o obj-$(CONFIG_QCOM_SCM_32) += qcom_scm-32.o -CFLAGS_qcom_scm-32.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1) +CFLAGS_qcom_scm-32.o :=$(call as-instr,.arch armv7-a\n.arch_extension sec,-DREQUIRES_SEC=1) -march=armv7-a obj-y += broadcom/ obj-$(CONFIG_GOOGLE_FIRMWARE) += google/ -- cgit v1.2.3