Commit c1fe10d2 authored by Sibi Sankar's avatar Sibi Sankar Committed by Bjorn Andersson

remoteproc: qcom: q6v5: Use qmp_send to update co-processor load state

The power domains exposed by the AOSS QMP driver control the load state
resources linked to modem, adsp, cdsp remoteprocs. These are used to
notify the Always on Subsystem (AOSS) that a particular co-processor is
up/down. AOSS uses this information to wait for the co-processors to
suspend before starting its sleep sequence.

These co-processors enter low-power modes independent to that of the
application processor and the load state resources linked to them are
expected to remain unaltered across system suspend/resume cycles. To
achieve this behavior lets stop using the power-domains exposed by the
AOSS QMP node and replace them with generic qmp_send interface instead.
Signed-off-by: default avatarSibi Sankar <sibis@codeaurora.org>
Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
[bjorn: Fixed up build error in q6v5_wcss_remove()]
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/1631800770-371-5-git-send-email-sibis@codeaurora.org
parent 8443ef7b
...@@ -16,8 +16,30 @@ ...@@ -16,8 +16,30 @@
#include "qcom_common.h" #include "qcom_common.h"
#include "qcom_q6v5.h" #include "qcom_q6v5.h"
#define Q6V5_LOAD_STATE_MSG_LEN 64
#define Q6V5_PANIC_DELAY_MS 200 #define Q6V5_PANIC_DELAY_MS 200
static int q6v5_load_state_toggle(struct qcom_q6v5 *q6v5, bool enable)
{
char buf[Q6V5_LOAD_STATE_MSG_LEN];
int ret;
if (!q6v5->qmp)
return 0;
ret = snprintf(buf, sizeof(buf),
"{class: image, res: load_state, name: %s, val: %s}",
q6v5->load_state, enable ? "on" : "off");
WARN_ON(ret >= Q6V5_LOAD_STATE_MSG_LEN);
ret = qmp_send(q6v5->qmp, buf, sizeof(buf));
if (ret)
dev_err(q6v5->dev, "failed to toggle load state\n");
return ret;
}
/** /**
* qcom_q6v5_prepare() - reinitialize the qcom_q6v5 context before start * qcom_q6v5_prepare() - reinitialize the qcom_q6v5 context before start
* @q6v5: reference to qcom_q6v5 context to be reinitialized * @q6v5: reference to qcom_q6v5 context to be reinitialized
...@@ -26,6 +48,12 @@ ...@@ -26,6 +48,12 @@
*/ */
int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5) int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5)
{ {
int ret;
ret = q6v5_load_state_toggle(q6v5, true);
if (ret)
return ret;
reinit_completion(&q6v5->start_done); reinit_completion(&q6v5->start_done);
reinit_completion(&q6v5->stop_done); reinit_completion(&q6v5->stop_done);
...@@ -47,6 +75,7 @@ EXPORT_SYMBOL_GPL(qcom_q6v5_prepare); ...@@ -47,6 +75,7 @@ EXPORT_SYMBOL_GPL(qcom_q6v5_prepare);
int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5) int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5)
{ {
disable_irq(q6v5->handover_irq); disable_irq(q6v5->handover_irq);
q6v5_load_state_toggle(q6v5, false);
return !q6v5->handover_issued; return !q6v5->handover_issued;
} }
...@@ -196,12 +225,13 @@ EXPORT_SYMBOL_GPL(qcom_q6v5_panic); ...@@ -196,12 +225,13 @@ EXPORT_SYMBOL_GPL(qcom_q6v5_panic);
* @pdev: platform_device reference for acquiring resources * @pdev: platform_device reference for acquiring resources
* @rproc: associated remoteproc instance * @rproc: associated remoteproc instance
* @crash_reason: SMEM id for crash reason string, or 0 if none * @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 * @handover: function to be called when proxy resources should be released
* *
* Return: 0 on success, negative errno on failure * Return: 0 on success, negative errno on failure
*/ */
int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev, int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
struct rproc *rproc, int crash_reason, struct rproc *rproc, int crash_reason, const char *load_state,
void (*handover)(struct qcom_q6v5 *q6v5)) void (*handover)(struct qcom_q6v5 *q6v5))
{ {
int ret; int ret;
...@@ -286,9 +316,34 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev, ...@@ -286,9 +316,34 @@ int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
return PTR_ERR(q6v5->state); return PTR_ERR(q6v5->state);
} }
q6v5->load_state = devm_kstrdup_const(&pdev->dev, load_state, GFP_KERNEL);
q6v5->qmp = qmp_get(&pdev->dev);
if (IS_ERR(q6v5->qmp)) {
if (PTR_ERR(q6v5->qmp) != -ENODEV)
return dev_err_probe(&pdev->dev, PTR_ERR(q6v5->qmp),
"failed to acquire load state\n");
q6v5->qmp = NULL;
} else if (!q6v5->load_state) {
if (!load_state)
dev_err(&pdev->dev, "load state resource string empty\n");
qmp_put(q6v5->qmp);
return load_state ? -ENOMEM : -EINVAL;
}
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(qcom_q6v5_init); EXPORT_SYMBOL_GPL(qcom_q6v5_init);
/**
* qcom_q6v5_deinit() - deinitialize the q6v5 common struct
* @q6v5: reference to qcom_q6v5 context to be deinitialized
*/
void qcom_q6v5_deinit(struct qcom_q6v5 *q6v5)
{
qmp_put(q6v5->qmp);
}
EXPORT_SYMBOL_GPL(qcom_q6v5_deinit);
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("Qualcomm Peripheral Image Loader for Q6V5"); MODULE_DESCRIPTION("Qualcomm Peripheral Image Loader for Q6V5");
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/soc/qcom/qcom_aoss.h>
struct rproc; struct rproc;
struct qcom_smem_state; struct qcom_smem_state;
...@@ -15,6 +16,8 @@ struct qcom_q6v5 { ...@@ -15,6 +16,8 @@ struct qcom_q6v5 {
struct rproc *rproc; struct rproc *rproc;
struct qcom_smem_state *state; struct qcom_smem_state *state;
struct qmp *qmp;
unsigned stop_bit; unsigned stop_bit;
int wdog_irq; int wdog_irq;
...@@ -32,12 +35,14 @@ struct qcom_q6v5 { ...@@ -32,12 +35,14 @@ struct qcom_q6v5 {
bool running; bool running;
const char *load_state;
void (*handover)(struct qcom_q6v5 *q6v5); void (*handover)(struct qcom_q6v5 *q6v5);
}; };
int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev, int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
struct rproc *rproc, int crash_reason, struct rproc *rproc, int crash_reason, const char *load_state,
void (*handover)(struct qcom_q6v5 *q6v5)); void (*handover)(struct qcom_q6v5 *q6v5));
void qcom_q6v5_deinit(struct qcom_q6v5 *q6v5);
int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5); int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5);
int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5); int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5);
......
...@@ -185,7 +185,9 @@ static int adsp_start(struct rproc *rproc) ...@@ -185,7 +185,9 @@ static int adsp_start(struct rproc *rproc)
int ret; int ret;
unsigned int val; unsigned int val;
qcom_q6v5_prepare(&adsp->q6v5); ret = qcom_q6v5_prepare(&adsp->q6v5);
if (ret)
return ret;
ret = clk_prepare_enable(adsp->xo); ret = clk_prepare_enable(adsp->xo);
if (ret) if (ret)
...@@ -465,7 +467,7 @@ static int adsp_probe(struct platform_device *pdev) ...@@ -465,7 +467,7 @@ static int adsp_probe(struct platform_device *pdev)
if (ret) if (ret)
goto disable_pm; goto disable_pm;
ret = qcom_q6v5_init(&adsp->q6v5, pdev, rproc, desc->crash_reason_smem, ret = qcom_q6v5_init(&adsp->q6v5, pdev, rproc, desc->crash_reason_smem, NULL,
qcom_adsp_pil_handover); qcom_adsp_pil_handover);
if (ret) if (ret)
goto disable_pm; goto disable_pm;
...@@ -500,6 +502,7 @@ static int adsp_remove(struct platform_device *pdev) ...@@ -500,6 +502,7 @@ static int adsp_remove(struct platform_device *pdev)
rproc_del(adsp->rproc); rproc_del(adsp->rproc);
qcom_q6v5_deinit(&adsp->q6v5);
qcom_remove_glink_subdev(adsp->rproc, &adsp->glink_subdev); qcom_remove_glink_subdev(adsp->rproc, &adsp->glink_subdev);
qcom_remove_sysmon_subdev(adsp->sysmon); qcom_remove_sysmon_subdev(adsp->sysmon);
qcom_remove_ssr_subdev(adsp->rproc, &adsp->ssr_subdev); qcom_remove_ssr_subdev(adsp->rproc, &adsp->ssr_subdev);
......
...@@ -137,7 +137,6 @@ struct rproc_hexagon_res { ...@@ -137,7 +137,6 @@ struct rproc_hexagon_res {
char **proxy_clk_names; char **proxy_clk_names;
char **reset_clk_names; char **reset_clk_names;
char **active_clk_names; char **active_clk_names;
char **active_pd_names;
char **proxy_pd_names; char **proxy_pd_names;
int version; int version;
bool need_mem_protection; bool need_mem_protection;
...@@ -169,12 +168,10 @@ struct q6v5 { ...@@ -169,12 +168,10 @@ struct q6v5 {
struct clk *active_clks[8]; struct clk *active_clks[8];
struct clk *reset_clks[4]; struct clk *reset_clks[4];
struct clk *proxy_clks[4]; struct clk *proxy_clks[4];
struct device *active_pds[1];
struct device *proxy_pds[3]; struct device *proxy_pds[3];
int active_clk_count; int active_clk_count;
int reset_clk_count; int reset_clk_count;
int proxy_clk_count; int proxy_clk_count;
int active_pd_count;
int proxy_pd_count; int proxy_pd_count;
struct reg_info active_regs[1]; struct reg_info active_regs[1];
...@@ -895,18 +892,14 @@ static int q6v5_mba_load(struct q6v5 *qproc) ...@@ -895,18 +892,14 @@ static int q6v5_mba_load(struct q6v5 *qproc)
int xfermemop_ret; int xfermemop_ret;
bool mba_load_err = false; bool mba_load_err = false;
qcom_q6v5_prepare(&qproc->q6v5); ret = qcom_q6v5_prepare(&qproc->q6v5);
if (ret)
ret = q6v5_pds_enable(qproc, qproc->active_pds, qproc->active_pd_count); return ret;
if (ret < 0) {
dev_err(qproc->dev, "failed to enable active power domains\n");
goto disable_irqs;
}
ret = q6v5_pds_enable(qproc, qproc->proxy_pds, qproc->proxy_pd_count); ret = q6v5_pds_enable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
if (ret < 0) { if (ret < 0) {
dev_err(qproc->dev, "failed to enable proxy power domains\n"); dev_err(qproc->dev, "failed to enable proxy power domains\n");
goto disable_active_pds; goto disable_irqs;
} }
ret = q6v5_regulator_enable(qproc, qproc->fallback_proxy_regs, ret = q6v5_regulator_enable(qproc, qproc->fallback_proxy_regs,
...@@ -1039,8 +1032,6 @@ static int q6v5_mba_load(struct q6v5 *qproc) ...@@ -1039,8 +1032,6 @@ static int q6v5_mba_load(struct q6v5 *qproc)
qproc->fallback_proxy_reg_count); qproc->fallback_proxy_reg_count);
disable_proxy_pds: disable_proxy_pds:
q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count); q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
disable_active_pds:
q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count);
disable_irqs: disable_irqs:
qcom_q6v5_unprepare(&qproc->q6v5); qcom_q6v5_unprepare(&qproc->q6v5);
...@@ -1076,7 +1067,6 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc) ...@@ -1076,7 +1067,6 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc)
qproc->active_clk_count); qproc->active_clk_count);
q6v5_regulator_disable(qproc, qproc->active_regs, q6v5_regulator_disable(qproc, qproc->active_regs,
qproc->active_reg_count); qproc->active_reg_count);
q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count);
/* In case of failure or coredump scenario where reclaiming MBA memory /* In case of failure or coredump scenario where reclaiming MBA memory
* could not happen reclaim it here. * could not happen reclaim it here.
...@@ -1756,14 +1746,6 @@ static int q6v5_probe(struct platform_device *pdev) ...@@ -1756,14 +1746,6 @@ static int q6v5_probe(struct platform_device *pdev)
} }
qproc->active_reg_count = ret; qproc->active_reg_count = ret;
ret = q6v5_pds_attach(&pdev->dev, qproc->active_pds,
desc->active_pd_names);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to attach active power domains\n");
goto free_rproc;
}
qproc->active_pd_count = ret;
ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds, ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds,
desc->proxy_pd_names); desc->proxy_pd_names);
/* Fallback to regulators for old device trees */ /* Fallback to regulators for old device trees */
...@@ -1773,12 +1755,12 @@ static int q6v5_probe(struct platform_device *pdev) ...@@ -1773,12 +1755,12 @@ static int q6v5_probe(struct platform_device *pdev)
desc->fallback_proxy_supply); desc->fallback_proxy_supply);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "Failed to get fallback proxy regulators.\n"); dev_err(&pdev->dev, "Failed to get fallback proxy regulators.\n");
goto detach_active_pds; goto free_rproc;
} }
qproc->fallback_proxy_reg_count = ret; qproc->fallback_proxy_reg_count = ret;
} else if (ret < 0) { } else if (ret < 0) {
dev_err(&pdev->dev, "Failed to init power domains\n"); dev_err(&pdev->dev, "Failed to init power domains\n");
goto detach_active_pds; goto free_rproc;
} else { } else {
qproc->proxy_pd_count = ret; qproc->proxy_pd_count = ret;
} }
...@@ -1792,7 +1774,7 @@ static int q6v5_probe(struct platform_device *pdev) ...@@ -1792,7 +1774,7 @@ static int q6v5_probe(struct platform_device *pdev)
qproc->need_mem_protection = desc->need_mem_protection; qproc->need_mem_protection = desc->need_mem_protection;
qproc->has_mba_logs = desc->has_mba_logs; qproc->has_mba_logs = desc->has_mba_logs;
ret = qcom_q6v5_init(&qproc->q6v5, pdev, rproc, MPSS_CRASH_REASON_SMEM, ret = qcom_q6v5_init(&qproc->q6v5, pdev, rproc, MPSS_CRASH_REASON_SMEM, "modem",
qcom_msa_handover); qcom_msa_handover);
if (ret) if (ret)
goto detach_proxy_pds; goto detach_proxy_pds;
...@@ -1822,8 +1804,6 @@ static int q6v5_probe(struct platform_device *pdev) ...@@ -1822,8 +1804,6 @@ static int q6v5_probe(struct platform_device *pdev)
qcom_remove_glink_subdev(rproc, &qproc->glink_subdev); qcom_remove_glink_subdev(rproc, &qproc->glink_subdev);
detach_proxy_pds: detach_proxy_pds:
q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count); q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
detach_active_pds:
q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
free_rproc: free_rproc:
rproc_free(rproc); rproc_free(rproc);
...@@ -1837,13 +1817,13 @@ static int q6v5_remove(struct platform_device *pdev) ...@@ -1837,13 +1817,13 @@ static int q6v5_remove(struct platform_device *pdev)
rproc_del(rproc); rproc_del(rproc);
qcom_q6v5_deinit(&qproc->q6v5);
qcom_remove_sysmon_subdev(qproc->sysmon); qcom_remove_sysmon_subdev(qproc->sysmon);
qcom_remove_ssr_subdev(rproc, &qproc->ssr_subdev); qcom_remove_ssr_subdev(rproc, &qproc->ssr_subdev);
qcom_remove_smd_subdev(rproc, &qproc->smd_subdev); qcom_remove_smd_subdev(rproc, &qproc->smd_subdev);
qcom_remove_glink_subdev(rproc, &qproc->glink_subdev); qcom_remove_glink_subdev(rproc, &qproc->glink_subdev);
q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count); q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
rproc_free(rproc); rproc_free(rproc);
...@@ -1867,10 +1847,6 @@ static const struct rproc_hexagon_res sc7180_mss = { ...@@ -1867,10 +1847,6 @@ static const struct rproc_hexagon_res sc7180_mss = {
"nav", "nav",
NULL NULL
}, },
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
"mx", "mx",
...@@ -1903,10 +1879,6 @@ static const struct rproc_hexagon_res sdm845_mss = { ...@@ -1903,10 +1879,6 @@ static const struct rproc_hexagon_res sdm845_mss = {
"mnoc_axi", "mnoc_axi",
NULL NULL
}, },
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
"mx", "mx",
......
...@@ -37,9 +37,9 @@ struct adsp_data { ...@@ -37,9 +37,9 @@ struct adsp_data {
bool has_aggre2_clk; bool has_aggre2_clk;
bool auto_boot; bool auto_boot;
char **active_pd_names;
char **proxy_pd_names; char **proxy_pd_names;
const char *load_state;
const char *ssr_name; const char *ssr_name;
const char *sysmon_name; const char *sysmon_name;
int ssctl_id; int ssctl_id;
...@@ -57,10 +57,8 @@ struct qcom_adsp { ...@@ -57,10 +57,8 @@ struct qcom_adsp {
struct regulator *cx_supply; struct regulator *cx_supply;
struct regulator *px_supply; struct regulator *px_supply;
struct device *active_pds[1];
struct device *proxy_pds[3]; struct device *proxy_pds[3];
int active_pd_count;
int proxy_pd_count; int proxy_pd_count;
int pas_id; int pas_id;
...@@ -149,15 +147,13 @@ static int adsp_start(struct rproc *rproc) ...@@ -149,15 +147,13 @@ static int adsp_start(struct rproc *rproc)
struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv; struct qcom_adsp *adsp = (struct qcom_adsp *)rproc->priv;
int ret; int ret;
qcom_q6v5_prepare(&adsp->q6v5); ret = qcom_q6v5_prepare(&adsp->q6v5);
if (ret)
ret = adsp_pds_enable(adsp, adsp->active_pds, adsp->active_pd_count); return ret;
if (ret < 0)
goto disable_irqs;
ret = adsp_pds_enable(adsp, adsp->proxy_pds, adsp->proxy_pd_count); ret = adsp_pds_enable(adsp, adsp->proxy_pds, adsp->proxy_pd_count);
if (ret < 0) if (ret < 0)
goto disable_active_pds; goto disable_irqs;
ret = clk_prepare_enable(adsp->xo); ret = clk_prepare_enable(adsp->xo);
if (ret) if (ret)
...@@ -201,8 +197,6 @@ static int adsp_start(struct rproc *rproc) ...@@ -201,8 +197,6 @@ static int adsp_start(struct rproc *rproc)
clk_disable_unprepare(adsp->xo); clk_disable_unprepare(adsp->xo);
disable_proxy_pds: disable_proxy_pds:
adsp_pds_disable(adsp, adsp->proxy_pds, adsp->proxy_pd_count); adsp_pds_disable(adsp, adsp->proxy_pds, adsp->proxy_pd_count);
disable_active_pds:
adsp_pds_disable(adsp, adsp->active_pds, adsp->active_pd_count);
disable_irqs: disable_irqs:
qcom_q6v5_unprepare(&adsp->q6v5); qcom_q6v5_unprepare(&adsp->q6v5);
...@@ -234,7 +228,6 @@ static int adsp_stop(struct rproc *rproc) ...@@ -234,7 +228,6 @@ static int adsp_stop(struct rproc *rproc)
if (ret) if (ret)
dev_err(adsp->dev, "failed to shutdown: %d\n", ret); dev_err(adsp->dev, "failed to shutdown: %d\n", ret);
adsp_pds_disable(adsp, adsp->active_pds, adsp->active_pd_count);
handover = qcom_q6v5_unprepare(&adsp->q6v5); handover = qcom_q6v5_unprepare(&adsp->q6v5);
if (handover) if (handover)
qcom_pas_handover(&adsp->q6v5); qcom_pas_handover(&adsp->q6v5);
...@@ -456,19 +449,13 @@ static int adsp_probe(struct platform_device *pdev) ...@@ -456,19 +449,13 @@ static int adsp_probe(struct platform_device *pdev)
if (ret) if (ret)
goto free_rproc; goto free_rproc;
ret = adsp_pds_attach(&pdev->dev, adsp->active_pds,
desc->active_pd_names);
if (ret < 0)
goto free_rproc;
adsp->active_pd_count = ret;
ret = adsp_pds_attach(&pdev->dev, adsp->proxy_pds, ret = adsp_pds_attach(&pdev->dev, adsp->proxy_pds,
desc->proxy_pd_names); desc->proxy_pd_names);
if (ret < 0) if (ret < 0)
goto detach_active_pds; goto free_rproc;
adsp->proxy_pd_count = ret; adsp->proxy_pd_count = ret;
ret = qcom_q6v5_init(&adsp->q6v5, pdev, rproc, desc->crash_reason_smem, ret = qcom_q6v5_init(&adsp->q6v5, pdev, rproc, desc->crash_reason_smem, desc->load_state,
qcom_pas_handover); qcom_pas_handover);
if (ret) if (ret)
goto detach_proxy_pds; goto detach_proxy_pds;
...@@ -492,8 +479,6 @@ static int adsp_probe(struct platform_device *pdev) ...@@ -492,8 +479,6 @@ static int adsp_probe(struct platform_device *pdev)
detach_proxy_pds: detach_proxy_pds:
adsp_pds_detach(adsp, adsp->proxy_pds, adsp->proxy_pd_count); adsp_pds_detach(adsp, adsp->proxy_pds, adsp->proxy_pd_count);
detach_active_pds:
adsp_pds_detach(adsp, adsp->active_pds, adsp->active_pd_count);
free_rproc: free_rproc:
rproc_free(rproc); rproc_free(rproc);
...@@ -506,6 +491,7 @@ static int adsp_remove(struct platform_device *pdev) ...@@ -506,6 +491,7 @@ static int adsp_remove(struct platform_device *pdev)
rproc_del(adsp->rproc); rproc_del(adsp->rproc);
qcom_q6v5_deinit(&adsp->q6v5);
qcom_remove_glink_subdev(adsp->rproc, &adsp->glink_subdev); qcom_remove_glink_subdev(adsp->rproc, &adsp->glink_subdev);
qcom_remove_sysmon_subdev(adsp->sysmon); qcom_remove_sysmon_subdev(adsp->sysmon);
qcom_remove_smd_subdev(adsp->rproc, &adsp->smd_subdev); qcom_remove_smd_subdev(adsp->rproc, &adsp->smd_subdev);
...@@ -526,20 +512,29 @@ static const struct adsp_data adsp_resource_init = { ...@@ -526,20 +512,29 @@ static const struct adsp_data adsp_resource_init = {
.ssctl_id = 0x14, .ssctl_id = 0x14,
}; };
static const struct adsp_data sdm845_adsp_resource_init = {
.crash_reason_smem = 423,
.firmware_name = "adsp.mdt",
.pas_id = 1,
.has_aggre2_clk = false,
.auto_boot = true,
.load_state = "adsp",
.ssr_name = "lpass",
.sysmon_name = "adsp",
.ssctl_id = 0x14,
};
static const struct adsp_data sm8150_adsp_resource = { static const struct adsp_data sm8150_adsp_resource = {
.crash_reason_smem = 423, .crash_reason_smem = 423,
.firmware_name = "adsp.mdt", .firmware_name = "adsp.mdt",
.pas_id = 1, .pas_id = 1,
.has_aggre2_clk = false, .has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
NULL NULL
}, },
.load_state = "adsp",
.ssr_name = "lpass", .ssr_name = "lpass",
.sysmon_name = "adsp", .sysmon_name = "adsp",
.ssctl_id = 0x14, .ssctl_id = 0x14,
...@@ -551,15 +546,12 @@ static const struct adsp_data sm8250_adsp_resource = { ...@@ -551,15 +546,12 @@ static const struct adsp_data sm8250_adsp_resource = {
.pas_id = 1, .pas_id = 1,
.has_aggre2_clk = false, .has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"lcx", "lcx",
"lmx", "lmx",
NULL NULL
}, },
.load_state = "adsp",
.ssr_name = "lpass", .ssr_name = "lpass",
.sysmon_name = "adsp", .sysmon_name = "adsp",
.ssctl_id = 0x14, .ssctl_id = 0x14,
...@@ -571,15 +563,12 @@ static const struct adsp_data sm8350_adsp_resource = { ...@@ -571,15 +563,12 @@ static const struct adsp_data sm8350_adsp_resource = {
.pas_id = 1, .pas_id = 1,
.has_aggre2_clk = false, .has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"lcx", "lcx",
"lmx", "lmx",
NULL NULL
}, },
.load_state = "adsp",
.ssr_name = "lpass", .ssr_name = "lpass",
.sysmon_name = "adsp", .sysmon_name = "adsp",
.ssctl_id = 0x14, .ssctl_id = 0x14,
...@@ -611,20 +600,29 @@ static const struct adsp_data cdsp_resource_init = { ...@@ -611,20 +600,29 @@ static const struct adsp_data cdsp_resource_init = {
.ssctl_id = 0x17, .ssctl_id = 0x17,
}; };
static const struct adsp_data sdm845_cdsp_resource_init = {
.crash_reason_smem = 601,
.firmware_name = "cdsp.mdt",
.pas_id = 18,
.has_aggre2_clk = false,
.auto_boot = true,
.load_state = "cdsp",
.ssr_name = "cdsp",
.sysmon_name = "cdsp",
.ssctl_id = 0x17,
};
static const struct adsp_data sm8150_cdsp_resource = { static const struct adsp_data sm8150_cdsp_resource = {
.crash_reason_smem = 601, .crash_reason_smem = 601,
.firmware_name = "cdsp.mdt", .firmware_name = "cdsp.mdt",
.pas_id = 18, .pas_id = 18,
.has_aggre2_clk = false, .has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
NULL NULL
}, },
.load_state = "cdsp",
.ssr_name = "cdsp", .ssr_name = "cdsp",
.sysmon_name = "cdsp", .sysmon_name = "cdsp",
.ssctl_id = 0x17, .ssctl_id = 0x17,
...@@ -636,14 +634,11 @@ static const struct adsp_data sm8250_cdsp_resource = { ...@@ -636,14 +634,11 @@ static const struct adsp_data sm8250_cdsp_resource = {
.pas_id = 18, .pas_id = 18,
.has_aggre2_clk = false, .has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
NULL NULL
}, },
.load_state = "cdsp",
.ssr_name = "cdsp", .ssr_name = "cdsp",
.sysmon_name = "cdsp", .sysmon_name = "cdsp",
.ssctl_id = 0x17, .ssctl_id = 0x17,
...@@ -655,14 +650,11 @@ static const struct adsp_data sm8350_cdsp_resource = { ...@@ -655,14 +650,11 @@ static const struct adsp_data sm8350_cdsp_resource = {
.pas_id = 18, .pas_id = 18,
.has_aggre2_clk = false, .has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
NULL NULL
}, },
.load_state = "cdsp",
.ssr_name = "cdsp", .ssr_name = "cdsp",
.sysmon_name = "cdsp", .sysmon_name = "cdsp",
.ssctl_id = 0x17, .ssctl_id = 0x17,
...@@ -675,15 +667,12 @@ static const struct adsp_data mpss_resource_init = { ...@@ -675,15 +667,12 @@ static const struct adsp_data mpss_resource_init = {
.minidump_id = 3, .minidump_id = 3,
.has_aggre2_clk = false, .has_aggre2_clk = false,
.auto_boot = false, .auto_boot = false,
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
"mss", "mss",
NULL NULL
}, },
.load_state = "modem",
.ssr_name = "mpss", .ssr_name = "mpss",
.sysmon_name = "modem", .sysmon_name = "modem",
.ssctl_id = 0x12, .ssctl_id = 0x12,
...@@ -695,14 +684,11 @@ static const struct adsp_data sc8180x_mpss_resource = { ...@@ -695,14 +684,11 @@ static const struct adsp_data sc8180x_mpss_resource = {
.pas_id = 4, .pas_id = 4,
.has_aggre2_clk = false, .has_aggre2_clk = false,
.auto_boot = false, .auto_boot = false,
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"cx", "cx",
NULL NULL
}, },
.load_state = "modem",
.ssr_name = "mpss", .ssr_name = "mpss",
.sysmon_name = "modem", .sysmon_name = "modem",
.ssctl_id = 0x12, .ssctl_id = 0x12,
...@@ -725,15 +711,12 @@ static const struct adsp_data sm8150_slpi_resource = { ...@@ -725,15 +711,12 @@ static const struct adsp_data sm8150_slpi_resource = {
.pas_id = 12, .pas_id = 12,
.has_aggre2_clk = false, .has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"lcx", "lcx",
"lmx", "lmx",
NULL NULL
}, },
.load_state = "slpi",
.ssr_name = "dsps", .ssr_name = "dsps",
.sysmon_name = "slpi", .sysmon_name = "slpi",
.ssctl_id = 0x16, .ssctl_id = 0x16,
...@@ -745,15 +728,12 @@ static const struct adsp_data sm8250_slpi_resource = { ...@@ -745,15 +728,12 @@ static const struct adsp_data sm8250_slpi_resource = {
.pas_id = 12, .pas_id = 12,
.has_aggre2_clk = false, .has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"lcx", "lcx",
"lmx", "lmx",
NULL NULL
}, },
.load_state = "slpi",
.ssr_name = "dsps", .ssr_name = "dsps",
.sysmon_name = "slpi", .sysmon_name = "slpi",
.ssctl_id = 0x16, .ssctl_id = 0x16,
...@@ -765,15 +745,12 @@ static const struct adsp_data sm8350_slpi_resource = { ...@@ -765,15 +745,12 @@ static const struct adsp_data sm8350_slpi_resource = {
.pas_id = 12, .pas_id = 12,
.has_aggre2_clk = false, .has_aggre2_clk = false,
.auto_boot = true, .auto_boot = true,
.active_pd_names = (char*[]){
"load_state",
NULL
},
.proxy_pd_names = (char*[]){ .proxy_pd_names = (char*[]){
"lcx", "lcx",
"lmx", "lmx",
NULL NULL
}, },
.load_state = "slpi",
.ssr_name = "dsps", .ssr_name = "dsps",
.sysmon_name = "slpi", .sysmon_name = "slpi",
.ssctl_id = 0x16, .ssctl_id = 0x16,
...@@ -834,8 +811,8 @@ static const struct of_device_id adsp_of_match[] = { ...@@ -834,8 +811,8 @@ static const struct of_device_id adsp_of_match[] = {
{ .compatible = "qcom,sc8180x-cdsp-pas", .data = &sm8150_cdsp_resource}, { .compatible = "qcom,sc8180x-cdsp-pas", .data = &sm8150_cdsp_resource},
{ .compatible = "qcom,sc8180x-mpss-pas", .data = &sc8180x_mpss_resource}, { .compatible = "qcom,sc8180x-mpss-pas", .data = &sc8180x_mpss_resource},
{ .compatible = "qcom,sdm660-adsp-pas", .data = &adsp_resource_init}, { .compatible = "qcom,sdm660-adsp-pas", .data = &adsp_resource_init},
{ .compatible = "qcom,sdm845-adsp-pas", .data = &adsp_resource_init}, { .compatible = "qcom,sdm845-adsp-pas", .data = &sdm845_adsp_resource_init},
{ .compatible = "qcom,sdm845-cdsp-pas", .data = &cdsp_resource_init}, { .compatible = "qcom,sdm845-cdsp-pas", .data = &sdm845_cdsp_resource_init},
{ .compatible = "qcom,sdx55-mpss-pas", .data = &sdx55_mpss_resource}, { .compatible = "qcom,sdx55-mpss-pas", .data = &sdx55_mpss_resource},
{ .compatible = "qcom,sm8150-adsp-pas", .data = &sm8150_adsp_resource}, { .compatible = "qcom,sm8150-adsp-pas", .data = &sm8150_adsp_resource},
{ .compatible = "qcom,sm8150-cdsp-pas", .data = &sm8150_cdsp_resource}, { .compatible = "qcom,sm8150-cdsp-pas", .data = &sm8150_cdsp_resource},
......
...@@ -1044,8 +1044,7 @@ static int q6v5_wcss_probe(struct platform_device *pdev) ...@@ -1044,8 +1044,7 @@ static int q6v5_wcss_probe(struct platform_device *pdev)
if (ret) if (ret)
goto free_rproc; goto free_rproc;
ret = qcom_q6v5_init(&wcss->q6v5, pdev, rproc, desc->crash_reason_smem, ret = qcom_q6v5_init(&wcss->q6v5, pdev, rproc, desc->crash_reason_smem, NULL, NULL);
NULL);
if (ret) if (ret)
goto free_rproc; goto free_rproc;
...@@ -1074,7 +1073,9 @@ static int q6v5_wcss_probe(struct platform_device *pdev) ...@@ -1074,7 +1073,9 @@ static int q6v5_wcss_probe(struct platform_device *pdev)
static int q6v5_wcss_remove(struct platform_device *pdev) static int q6v5_wcss_remove(struct platform_device *pdev)
{ {
struct rproc *rproc = platform_get_drvdata(pdev); struct rproc *rproc = platform_get_drvdata(pdev);
struct q6v5_wcss *wcss = rproc->priv;
qcom_q6v5_deinit(&wcss->q6v5);
rproc_del(rproc); rproc_del(rproc);
rproc_free(rproc); rproc_free(rproc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment