summaryrefslogtreecommitdiff
path: root/drivers/remoteproc/qcom_q6v5_adsp.c
AgeCommit message (Collapse)AuthorFilesLines
2023-02-26Merge tag 'rproc-v6.3' of ↵Linus Torvalds1-4/+121
git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull remoteproc updates from Bjorn Andersson: - Support for PRU clients to acquire a control reference to the PRU instances is introduced, and the PRU now allows specifying firmware-name in Devicetree. sysfs is requested to be read-only when the remoteproc instance is consumed by another kernel driver - Support for the C7xv DSP on AM62A SoC is introduced - The Devicetree binding for the Qualcomm PAS devices are split up in multiple files, to better account for the differences in resources between them. A number of missing Devicetree bindings are added, and the Qualcomm WCNSS binding is converted to YAML - A few cleanups are introduced for the Mediatek SCP driver. And a sanity check of the firmware image is introduced in the Mediatek driver - For Qualcomm SC7280 ADSP support is added, MSM8953 gains ADSP and modem support, SM6115 and SM8550 gains ADSP, CDSP and modem support, and support for pronto v3 support (used on e.g. MSM8953) is added - The Qualcomm modem remoteproc driver is modified to use a no-map reserved-memory region for it's authentication metadata, in order to avoid fatal security violations caused by accesses from Linux during the authentication process - Support for separate loading of a Devicetree blob is added to the PAS driver, and support for the PAS driver to carve out DSM memory for the modem is added as well - The Qualcomm ADSP remoteproc driver gains support for mapping memory into specific range using the IOMMU. The sysmon driver is transitioned to strlcpy() * tag 'rproc-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (69 commits) dt-bindings: mailbox: qcom,apcs-kpss-global: drop mbox-names from example dt-bindings: remoteproc: qcom,glink-edge: correct label description dt-bindings: remoteproc: qcom,glink-rpm-edge: convert to DT schema dt-bindings: remoteproc: qcom,sm8550-pas: correct power domains remoteproc: qcom_q6v5_pas: enable sm8550 adsp & cdsp autoboot dt-bindings: remoteproc: qcom: Add sm6115 pas yaml file remoteproc: qcom: pas: Add sm6115 remoteprocs remoteproc: qcom: pas: Adjust the phys addr wrt the mem region remoteproc: qcom: fix sparse warnings remoteproc: qcom: replace kstrdup with kstrndup remoteproc: mediatek: Check the SCP image format remoteproc: qcom_q6v5_mss: Use a carveout to authenticate modem headers Revert "remoteproc: qcom_q6v5_mss: map/unmap metadata region before/after use" dt-bindings: remoteproc: qcom,sc7280-mss-pil: Update memory-region dt-bindings: remoteproc: qcom,sc7180-mss-pil: Update memory-region dt-bindings: remoteproc: qcom,msm8996-mss-pil: Update memory region dt-bindings: remoteproc: qcom,q6v5: Move MSM8996 to schema remoteproc: qcom_q6v5_pas: add sm8550 adsp, cdsp & mpss compatible & data remoteproc: qcom_q6v5_pas: add support for assigning memory to firmware remoteproc: qcom_q6v5_pas: add support for dtb co-firmware loading ...
2022-12-28remoteproc: qcom: Add support for memory sandboxSrinivasa Rao Mandadapu1-1/+55
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
2022-12-28remoteproc: qcom: Add efuse evb selection controlSrinivasa Rao Mandadapu1-0/+17
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
2022-12-28remoteproc: qcom: Replace hard coded values with macrosSrinivasa Rao Mandadapu1-2/+5
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
2022-12-28remoteproc: qcom: Update rproc parse firmware callbackSrinivasa Rao Mandadapu1-1/+22
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
2022-12-28remoteproc: qcom: Add compatible name for SC7280 ADSPSrinivasa Rao Mandadapu1-0/+16
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
2022-12-28remoteproc: qcom: Add flag in adsp private data structureSrinivasa Rao Mandadapu1-0/+5
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
2022-07-18remoteproc: qcom: using pm_runtime_resume_and_get to simplify the coderan jianping1-2/+1
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
2022-03-11remoteproc: qcom: q6v5_wpss: Add support for sc7280 WPSSRakesh Pillai1-16/+211
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
2022-03-11remoteproc: qcom: Fix missing of_node_put in adsp_alloc_memory_regionMiaoqian Lin1-0/+1
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
2021-09-27remoteproc: qcom: q6v5: Use qmp_send to update co-processor load stateSibi Sankar1-2/+5
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
2021-03-11remoteproc: add is_iomem to da_to_vaPeng Fan1-1/+1
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>
2020-12-10remoteproc: qcom: Fix potential NULL dereference in adsp_init_mmio()Zhang Changzhong1-6/+3
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>
2020-12-10remoteproc: qcom: fix reference leak in adsp_startZhang Qilong1-1/+3
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>
2020-11-26remoteproc: qcom: q6v5: Query sysmon before graceful shutdownBjorn Andersson1-1/+1
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>
2020-07-02remoteproc: qcom: Update PIL relocation info on loadBjorn Andersson1-3/+13
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>
2020-05-07remoteproc: qcom: Pass ssr_name to glink subdeviceBjorn Andersson1-1/+1
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>
2020-04-20remoteproc: use rproc_coredump_set_elf_info in driversClement Leger1-0/+1
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>
2020-03-26remoteproc: qcom: Introduce panic handler for PAS and ADSPBjorn Andersson1-0/+8
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>
2020-03-26remoteproc: Use size_t type for len in da_to_vaClement Leger1-1/+1
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>
2019-05-22remoteproc: qcom: qdsp6-adsp: Add support for QCS404 CDSPBjorn Andersson1-18/+55
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>
2019-02-18remoteproc: q6v5_adsp: Remove voting for lpass_aon clockRohit kumar1-1/+1
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>
2019-01-22remoteproc: qcom: Add shutdown-ack irqSibi Sankar1-0/+4
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>
2018-10-10remoteproc: qcom: qcom_q6v5_adsp: Fix some return value checkWei Yongjun1-8/+4
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>
2018-10-06remoteproc: qcom: Introduce Non-PAS ADSP PIL driverRohit kumar1-0/+501
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>