staticint q6v5_load_state_toggle(struct qcom_q6v5 *q6v5, bool enable)
{ int ret;
if (!q6v5->qmp) return 0;
ret = qmp_send(q6v5->qmp, "{class: image, res: load_state, name: %s, val: %s}",
q6v5->load_state, enable ? "on" : "off"); if (ret)
dev_err(q6v5->dev, "failed to toggle load state\n");
return ret;
}
/** * qcom_q6v5_prepare() - reinitialize the qcom_q6v5 context before start * @q6v5: reference to qcom_q6v5 context to be reinitialized * * Return: 0 on success, negative errno on failure
*/ int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5)
{ int ret;
ret = icc_set_bw(q6v5->path, 0, UINT_MAX); if (ret < 0) {
dev_err(q6v5->dev, "failed to set bandwidth request\n"); return ret;
}
ret = q6v5_load_state_toggle(q6v5, true); if (ret) {
icc_set_bw(q6v5->path, 0, 0); return ret;
}
/** * qcom_q6v5_unprepare() - unprepare the qcom_q6v5 context after stop * @q6v5: reference to qcom_q6v5 context to be unprepared * * Return: 0 on success, 1 if handover hasn't yet been called
*/ int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5)
{
disable_irq(q6v5->handover_irq);
q6v5_load_state_toggle(q6v5, false);
/* Disable interconnect vote, in case handover never happened */
icc_set_bw(q6v5->path, 0, 0);
/** * qcom_q6v5_wait_for_start() - wait for remote processor start signal * @q6v5: reference to qcom_q6v5 context * @timeout: timeout to wait for the event, in jiffies * * qcom_q6v5_unprepare() should not be called when this function fails. * * Return: 0 on success, -ETIMEDOUT on timeout
*/ int qcom_q6v5_wait_for_start(struct qcom_q6v5 *q6v5, int timeout)
{ int ret;
/** * qcom_q6v5_request_stop() - request the remote processor to stop * @q6v5: reference to qcom_q6v5 context * @sysmon: reference to the remote's sysmon instance, or NULL * * Return: 0 on success, negative errno on failure
*/ int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5, struct qcom_sysmon *sysmon)
{ int ret;
q6v5->running = false;
/* Don't perform SMP2P dance if remote isn't running */ if (q6v5->rproc->state != RPROC_RUNNING || qcom_sysmon_shutdown_acked(sysmon)) return 0;
return ret == 0 ? -ETIMEDOUT : 0;
}
EXPORT_SYMBOL_GPL(qcom_q6v5_request_stop);
/** * qcom_q6v5_panic() - panic handler to invoke a stop on the remote * @q6v5: reference to qcom_q6v5 context * * Set the stop bit and sleep in order to allow the remote processor to flush * its caches etc for post mortem debugging. * * Return: 200ms
*/ unsignedlong qcom_q6v5_panic(struct qcom_q6v5 *q6v5)
{
qcom_smem_state_update_bits(q6v5->state,
BIT(q6v5->stop_bit), BIT(q6v5->stop_bit));
/** * qcom_q6v5_init() - initializer of the q6v5 common struct * @q6v5: handle to be initialized * @pdev: platform_device reference for acquiring resources * @rproc: associated remoteproc instance * @crash_reason: SMEM id for crash reason string, or 0 if none * @load_state: load state resource string * @handover: function to be called when proxy resources should be released * * Return: 0 on success, negative errno on failure
*/ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev, struct rproc *rproc, int crash_reason, constchar *load_state, void (*handover)(struct qcom_q6v5 *q6v5))
{ int ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.