Commit deb9bb83 authored by Bjorn Andersson's avatar Bjorn Andersson

remoteproc: q6v5-mss: Active powerdomain for SDM845

The SDM845 MSS needs the load_state powerdomain voted for during the
duration of the MSS being powered on, to let the AOSS know that it may
not perform certain power save measures. So vote for this.
Tested-by: default avatarSibi Sankar <sibis@codeaurora.org>
Reviewed-by: default avatarSibi Sankar <sibis@codeaurora.org>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 4760a896
...@@ -133,6 +133,7 @@ struct rproc_hexagon_res { ...@@ -133,6 +133,7 @@ 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;
...@@ -159,10 +160,12 @@ struct q6v5 { ...@@ -159,10 +160,12 @@ 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];
...@@ -731,10 +734,16 @@ static int q6v5_mba_load(struct q6v5 *qproc) ...@@ -731,10 +734,16 @@ static int q6v5_mba_load(struct q6v5 *qproc)
qcom_q6v5_prepare(&qproc->q6v5); qcom_q6v5_prepare(&qproc->q6v5);
ret = q6v5_pds_enable(qproc, qproc->active_pds, qproc->active_pd_count);
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_irqs; goto disable_active_pds;
} }
ret = q6v5_regulator_enable(qproc, qproc->proxy_regs, ret = q6v5_regulator_enable(qproc, qproc->proxy_regs,
...@@ -840,6 +849,8 @@ static int q6v5_mba_load(struct q6v5 *qproc) ...@@ -840,6 +849,8 @@ static int q6v5_mba_load(struct q6v5 *qproc)
qproc->proxy_reg_count); qproc->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);
...@@ -879,6 +890,7 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc) ...@@ -879,6 +890,7 @@ 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.
...@@ -1441,11 +1453,19 @@ static int q6v5_probe(struct platform_device *pdev) ...@@ -1441,11 +1453,19 @@ 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);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "Failed to init power domains\n"); dev_err(&pdev->dev, "Failed to init power domains\n");
goto free_rproc; goto detach_active_pds;
} }
qproc->proxy_pd_count = ret; qproc->proxy_pd_count = ret;
...@@ -1481,6 +1501,8 @@ static int q6v5_probe(struct platform_device *pdev) ...@@ -1481,6 +1501,8 @@ static int q6v5_probe(struct platform_device *pdev)
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);
...@@ -1498,6 +1520,7 @@ static int q6v5_remove(struct platform_device *pdev) ...@@ -1498,6 +1520,7 @@ static int q6v5_remove(struct platform_device *pdev)
qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev); qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev);
qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev); qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev);
q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count);
q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count); q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count);
rproc_free(qproc->rproc); rproc_free(qproc->rproc);
...@@ -1524,6 +1547,10 @@ static const struct rproc_hexagon_res sdm845_mss = { ...@@ -1524,6 +1547,10 @@ 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",
......
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