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

Commit f0484ca7 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: spcom: add kernel-pil support for SPU"

parents d65289ee f88175ac
Loading
Loading
Loading
Loading
+28 −1
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@
#include <linux/atomic.h>
#include <linux/list.h>
#include <uapi/linux/spcom.h>
#include <soc/qcom/subsystem_restart.h>

/**
 * Request buffer size.
@@ -521,6 +522,28 @@ static int spcom_handle_create_channel_command(void *cmd_buf, int cmd_size)
	return ret;
}

/**
 * spcom_handle_restart_sp_command() - Handle Restart SP command from
 * user space.
 *
 * Return: 0 on successful operation, negative value otherwise.
 */
static int spcom_handle_restart_sp_command(void)
{
	void *subsystem_get_retval = NULL;

	pr_err("restart - PIL FW loading process initiated\n");

	subsystem_get_retval = subsystem_get("spss");
	if (!subsystem_get_retval) {
		pr_err("restart - unable to trigger PIL process for FW loading\n");
		return -EINVAL;
	}

	pr_err("restart - PIL FW loading process is complete\n");
	return 0;
}

/**
 * spcom_handle_send_command() - Handle send request/response from user space.
 *
@@ -981,7 +1004,8 @@ static int spcom_handle_write(struct spcom_channel *ch,

	pr_debug("cmd_id [0x%x]\n", cmd_id);

	if (!ch && cmd_id != SPCOM_CMD_CREATE_CHANNEL) {
	if (!ch && cmd_id != SPCOM_CMD_CREATE_CHANNEL
			&& cmd_id != SPCOM_CMD_RESTART_SP) {
		pr_err("channel context is null\n");
		return -EINVAL;
	}
@@ -1002,6 +1026,9 @@ static int spcom_handle_write(struct spcom_channel *ch,
	case SPCOM_CMD_CREATE_CHANNEL:
		ret = spcom_handle_create_channel_command(buf, buf_size);
		break;
	case SPCOM_CMD_RESTART_SP:
		ret = spcom_handle_restart_sp_command();
		break;
	default:
		pr_err("Invalid Command Id [0x%x].\n", (int) cmd->cmd_id);
		ret = -EINVAL;
+3 −0
Original line number Diff line number Diff line
@@ -57,6 +57,9 @@ enum spcom_cmd_id {
	SPCOM_CMD_UNLOCK_ION_BUF = 0x554C434B, /* "ULCK" = 0x4C4F434B */
	SPCOM_CMD_FSSR		= 0x46535352, /* "FSSR" = 0x46535352 */
	SPCOM_CMD_CREATE_CHANNEL = 0x43524554, /* "CRET" = 0x43524554 */
#define SPCOM_CMD_RESTART_SP \
	SPCOM_CMD_RESTART_SP
	SPCOM_CMD_RESTART_SP    = 0x52535452, /* "RSTR" = 0x52535452 */
};

/*