Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d51152fe authored by Banajit Goswami's avatar Banajit Goswami
Browse files

ASoC: msm: qdsp6v2: add support for new scm_call2 API



There is a new secure world interface added to scm
library which is more aligned to the ARMv8 SCM calling
convention. Use the new API for APR driver while maintaining
backward compatibility.

CRs-fixed: 860055
Change-Id: I346b523ddd9b041c1593c2e688edc986cb101314
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent c3b02802
Loading
Loading
Loading
Loading
+22 −3
Original line number Diff line number Diff line
@@ -783,6 +783,7 @@ static int lpass_notifier_cb(struct notifier_block *this, unsigned long code,
{
	static int boot_count = 2;
	struct notif_data *data = (struct notif_data *)_cmd;
	struct scm_desc desc;

	if (boot_count) {
		boot_count--;
@@ -796,7 +797,15 @@ static int lpass_notifier_cb(struct notifier_block *this, unsigned long code,
		dispatch_event(code, APR_DEST_QDSP6);
		if (data && data->crashed) {
			/* Send NMI to QDSP6 via an SCM call. */
			scm_call_atomic1(SCM_SVC_UTIL, SCM_Q6_NMI_CMD, 0x1);
			if (!is_scm_armv8()) {
				scm_call_atomic1(SCM_SVC_UTIL,
						 SCM_Q6_NMI_CMD, 0x1);
			} else {
				desc.args[0] = 0x1;
				desc.arginfo = SCM_ARGS(1);
				scm_call2_atomic(SCM_SIP_FNID(SCM_SVC_UTIL,
						 SCM_Q6_NMI_CMD), &desc);
			}
			/* The write should go through before q6 is shutdown */
			mb();
			pr_debug("L-Notify: Q6 NMI was sent.\n");
@@ -830,9 +839,19 @@ static struct notifier_block lnb = {
static int panic_handler(struct notifier_block *this,
				unsigned long event, void *ptr)
{
	if (powered_on)
	struct scm_desc desc;

	if (powered_on) {
		/* Send NMI to QDSP6 via an SCM call. */
		if (!is_scm_armv8()) {
			scm_call_atomic1(SCM_SVC_UTIL, SCM_Q6_NMI_CMD, 0x1);
		} else {
			desc.args[0] = 0x1;
			desc.arginfo = SCM_ARGS(1);
			scm_call2_atomic(SCM_SIP_FNID(SCM_SVC_UTIL,
					 SCM_Q6_NMI_CMD), &desc);
		}
	}
	return NOTIFY_DONE;
}