History log of /linux-master/drivers/remoteproc/qcom_q6v5_adsp.c
Revision Date Author Comments
# 5789e877 22-Jan-2024 Andrew Davis <afd@ti.com>

remoteproc: qcom_q6v5_adsp: Use devm_rproc_alloc() helper

Use the device lifecycle managed allocation function. This helps prevent
mistakes like freeing out of order in cleanup functions and forgetting to
free on error paths.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20240123184632.725054-3-afd@ti.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>


# db34c47d 30-Jan-2024 Ulf Hansson <ulf.hansson@linaro.org>

remoteproc: qcom_q6v5_adsp: Convert to dev_pm_domain_attach|detach_list()

Let's avoid some of the boilerplate code to manage the various PM domain
cases, by converting into using dev_pm_domain_attach|detach_list().

As a part of the conversion, we are moving over to use device_links, which
simplifies the runtime PM support too. Moreover, while attaching let's
trust that an already attached single PM domain is the correct one.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Bjorn Andersson <andersson@kernel.org>
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: <linux-remoteproc@vger.kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20240130123951.236243-5-ulf.hansson@linaro.org


# 0ee55c18 10-Jul-2023 Stephan Gerhold <stephan@gerhold.net>

remoteproc: qcom: Use of_reserved_mem_lookup()

Reserved memory can be either looked up using the generic function
of_address_to_resource() or using the special of_reserved_mem_lookup().
The latter has the advantage that it ensures that the referenced memory
region was really reserved and is not e.g. status = "disabled".

of_reserved_mem also supports allocating reserved memory dynamically at
boot time. This works only when using of_reserved_mem_lookup() since
there won't be a fixed address in the device tree.

Switch the code to use of_reserved_mem_lookup(), similar to
qcom_q6v5_wcss.c which is using it already. There is no functional
difference for static reserved memory allocations.

While at it this also adds two missing of_node_put() calls in
qcom_q6v5_pas.c.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Tested-by: Caleb Connolly <caleb.connolly@linaro.org> # SDM845
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20230710-rproc-of-rmem-v3-1-eea7f0a33590@gerhold.net
Signed-off-by: Bjorn Andersson <andersson@kernel.org>


# 3440d8da 14-Jul-2023 Rob Herring <robh@kernel.org>

remoteproc: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230714174935.4063513-1-robh@kernel.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>


# 52c80094 04-May-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

remoteproc: qcom_q6v5_adsp: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20230504194453.1150368-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>


# 86660713 27-Mar-2023 Yu Zhe <yuzhe@nfschina.com>

remoteproc: Remove unnecessary (void*) conversions

Pointer variables of void * type do not require type cast.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
Link: https://lore.kernel.org/r/20230328024907.29791-1-yuzhe@nfschina.com
[Fixed merge conflict in xlnx_r5_remoteproc.c]
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>


# f22eedff 28-Sep-2022 Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>

remoteproc: qcom: Add support for memory sandbox

Update pil driver with SMMU mapping for allowing authorised
memory access to ADSP firmware, by carveout reserved adsp memory
region from device tree file.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/1664368073-13659-8-git-send-email-quic_srivasam@quicinc.com


# 9ece9619 28-Sep-2022 Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>

remoteproc: qcom: Add efuse evb selection control

Add efuse evb selection control and enable it for starting ADSP.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Sibi Sankar <quic_sibis@quicinc.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/1664368073-13659-7-git-send-email-quic_srivasam@quicinc.com


# c36d6aa6 28-Sep-2022 Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>

remoteproc: qcom: Replace hard coded values with macros

Replace hard coded values of QDSP6 boot control reg params
with appropriate macro names.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Sibi Sankar <quic_sibis@quicinc.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/1664368073-13659-6-git-send-email-quic_srivasam@quicinc.com


# 48ab209c 28-Sep-2022 Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>

remoteproc: qcom: Update rproc parse firmware callback

Change parse_fw callback in rproc ops from qcom_register_dump_segments
to local function such that, it can perform coredump segments registration
and it can parse section header in memory sandboxing required platforms.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/1664368073-13659-5-git-send-email-quic_srivasam@quicinc.com


# 66cab0c5 28-Sep-2022 Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>

remoteproc: qcom: Add compatible name for SC7280 ADSP

Update adsp pil data and compatible name for loading ADSP
binary on SC7280 based platforms.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/1664368073-13659-4-git-send-email-quic_srivasam@quicinc.com


# 272dca8d 28-Sep-2022 Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>

remoteproc: qcom: Add flag in adsp private data structure

Add flag in qcom_adsp private data structure and initialize
it to distinguish ADSP modules, which has iommu requirement,
for using iommu selectively.

Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Sibi Sankar <quic_sibis@quicinc.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/1664368073-13659-3-git-send-email-quic_srivasam@quicinc.com


# 8672e79d 28-Apr-2022 ran jianping <ran.jianping@zte.com.cn>

remoteproc: qcom: using pm_runtime_resume_and_get to simplify the code

Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle. This change is just to simplify the code, no
actual functional changes.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ran jianping <ran.jianping@zte.com.cn>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220428064545.3850057-1-ran.jianping@zte.com.cn


# 358b586f 01-Feb-2022 Rakesh Pillai <pillair@codeaurora.org>

remoteproc: qcom: q6v5_wpss: Add support for sc7280 WPSS

Add support for PIL loading of WPSS processor for SC7280
- WPSS boot will be requested by the wifi driver and hence
disable auto-boot for WPSS.
- Add a separate shutdown sequence handler for WPSS.
- Add multiple power-domain voting support
- Parse firmware-name from dtsi entry

Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/1643712724-12436-4-git-send-email-quic_mpubbise@quicinc.com


# 505b5b16 07-Mar-2022 Miaoqian Lin <linmq006@gmail.com>

remoteproc: qcom: Fix missing of_node_put in adsp_alloc_memory_region

The device_node pointer is returned by of_parse_phandle() with refcount
incremented. We should use of_node_put() on it when done.

Fixes: dc160e449122 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220308031219.4718-1-linmq006@gmail.com


# c1fe10d2 16-Sep-2021 Sibi Sankar <sibis@codeaurora.org>

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: Sibi Sankar <sibis@codeaurora.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
[bjorn: Fixed up build error in q6v5_wcss_remove()]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/1631800770-371-5-git-send-email-sibis@codeaurora.org


# 40df0a91 06-Mar-2021 Peng Fan <peng.fan@nxp.com>

remoteproc: add is_iomem to da_to_va

Introduce an extra parameter is_iomem to da_to_va, then the caller
could take the memory as normal memory or io mapped memory.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/1615029865-23312-5-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# c3d4e5b1 07-Dec-2020 Zhang Changzhong <zhangchangzhong@huawei.com>

remoteproc: qcom: Fix potential NULL dereference in adsp_init_mmio()

platform_get_resource() may fail and in this case a NULL dereference
will occur.

Fix it to use devm_platform_ioremap_resource() instead of calling
platform_get_resource() and devm_ioremap().

This is detected by Coccinelle semantic patch.

@@
expression pdev, res, n, t, e, e1, e2;
@@

res = \(platform_get_resource\|platform_get_resource_byname\)(pdev, t,
n);
+ if (!res)
+ return -EINVAL;
... when != res == NULL
e = devm_ioremap(e1, res->start, e2);

Fixes: dc160e449122 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Link: https://lore.kernel.org/r/1607392460-20516-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# aa37448f 02-Nov-2020 Zhang Qilong <zhangqilong3@huawei.com>

remoteproc: qcom: fix reference leak in adsp_start

pm_runtime_get_sync will increment pm usage counter even it
failed. Forgetting to pm_runtime_put_noidle will result in
reference leak in adsp_start, so we should fix it.

Fixes: dc160e4491222 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20201102143534.144484-1-zhangqilong3@huawei.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# ed5da808 21-Nov-2020 Bjorn Andersson <bjorn.andersson@linaro.org>

remoteproc: qcom: q6v5: Query sysmon before graceful shutdown

Requesting a graceful shutdown through the shared memory state signals
will not be acked in the event that sysmon has already successfully shut
down the remote firmware. So extend the stop request API to optionally
take the remoteproc's sysmon instance and query if there's already been
a successful shutdown attempt, before doing the signal dance.

Tested-by: Steev Klimaszewski <steev@kali.org>
Reviewed-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Link: https://lore.kernel.org/r/20201122054135.802935-4-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# d4c78d21 22-Jun-2020 Bjorn Andersson <bjorn.andersson@linaro.org>

remoteproc: qcom: Update PIL relocation info on load

Update the PIL relocation information in IMEM with information about
where the firmware for various remoteprocs are loaded.

Reviewed-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20200622191942.255460-4-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# cd9fc8f1 22-Apr-2020 Bjorn Andersson <bjorn.andersson@linaro.org>

remoteproc: qcom: Pass ssr_name to glink subdevice

Pass ssr_name to glink subdevice in preparation for tying glink_ssr to
the glink subdevice, rather than having its own "ssr subdevice".

Acked-by: Chris Lew <clew@codeaurora.org>
Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Link: https://lore.kernel.org/r/20200423003736.2027371-2-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 3898fc99 09-Apr-2020 Clement Leger <cleger@kalray.eu>

remoteproc: use rproc_coredump_set_elf_info in drivers

Modify drivers which are using remoteproc coredump functionality to use
rproc_coredump_set_elf_info in order to create correct elf coredump
format.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Clement Leger <cleger@kalray.eu>
Link: https://lore.kernel.org/r/20200410102433.2672-3-cleger@kalray.eu
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 717c21ba 23-Mar-2020 Bjorn Andersson <bjorn.andersson@linaro.org>

remoteproc: qcom: Introduce panic handler for PAS and ADSP

Make the PAS and ADSP/CDSP remoteproc drivers implement the panic
handler that will invoke a stop to prepare the remoteprocs for post
mortem debugging.

Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200324052904.738594-5-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 9ce3bf22 02-Mar-2020 Clement Leger <cleger@kalray.eu>

remoteproc: Use size_t type for len in da_to_va

With upcoming changes in elf loader for elf64 support, section size will
be a u64. When used with da_to_va, this will potentially lead to
overflow if using the current "int" type for len argument. Change
da_to_va prototype to use a size_t for len and fix all users of this
function.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Clement Leger <cleger@kalray.eu>
Link: https://lore.kernel.org/r/20200302093902.27849-2-cleger@kalray.eu
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 0c6de4c2 09-May-2019 Bjorn Andersson <bjorn.andersson@linaro.org>

remoteproc: qcom: qdsp6-adsp: Add support for QCS404 CDSP

Move the clock list to adsp_pil_data, make the pdc_reset optional and
make the driver directly enable the xo, sleep and core clocks.

The three clocks are previously toggled through the clock controller,
but that means the same hardware block needs to be mapped in both
drivers. Making the remoteproc driver enable the clocks is a nop when
using the clock controller, but allow us to remove the clocks from the
clock controller.

Reviewed-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 621eafdb 29-Nov-2018 Rohit kumar <rohitkr@codeaurora.org>

remoteproc: q6v5_adsp: Remove voting for lpass_aon clock

Lpass_aon clock is on by default. Remove it from lpass
clock list to avoid voting for it.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 027045a6 08-Jan-2019 Sibi Sankar <sibis@codeaurora.org>

remoteproc: qcom: Add shutdown-ack irq

Add shutdown-ack irq handling required for sysmon shutdown for
Q6V5 MSS on SDM845/MSM8996 and for WCSS Q6V5 on QCS404 SoC.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
[bjorn: Revert back to qcom_add_sysmon_subdev returning a sysmon object]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# 6e6b1ada 09-Oct-2018 Wei Yongjun <weiyongjun1@huawei.com>

remoteproc: qcom: qcom_q6v5_adsp: Fix some return value check

In case of error, the functions devm_kcalloc() and devm_ioremap()
returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return
value check should be replaced with NULL test.

Also removed -EPROBE_DEFER check since devm_kcalloc never return
this error.

Fixes: dc160e449122 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>


# dc160e44 24-Sep-2018 Rohit kumar <rohitkr@codeaurora.org>

remoteproc: qcom: Introduce Non-PAS ADSP PIL driver

This adds Non PAS ADSP PIL driver for Qualcomm Technologies Inc SoCs.

Added initial support for SDM845 with ADSP bootup and shutdown operation
handled from Application Processor SubSystem(APSS).

Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Tested-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
[bjorn: Renamed driver and Kconfig from qcom_adsp_pil to qcom_q6v5_adsp]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>