summaryrefslogtreecommitdiff
path: root/drivers/remoteproc
AgeCommit message (Collapse)AuthorFilesLines
2023-10-16remoteproc: st: Fix sometimes uninitialized ret in st_rproc_probe()Nathan Chancellor1-1/+3
Clang warns (or errors with CONFIG_WERROR=y): drivers/remoteproc/st_remoteproc.c:357:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] 357 | if (!ddata->config) | ^~~~~~~~~~~~~~ drivers/remoteproc/st_remoteproc.c:442:9: note: uninitialized use occurs here 442 | return ret; | ^~~ drivers/remoteproc/st_remoteproc.c:357:2: note: remove the 'if' if its condition is always false 357 | if (!ddata->config) | ^~~~~~~~~~~~~~~~~~~ 358 | goto free_rproc; | ~~~~~~~~~~~~~~~ drivers/remoteproc/st_remoteproc.c:348:9: note: initialize the variable 'ret' to silence this warning 348 | int ret, i; | ^ | = 0 1 error generated. Set ret to -ENODEV, which seems to be a standard return code when device_get_match_data() returns NULL. Closes: https://github.com/ClangBuiltLinux/linux/issues/1944 Fixes: 5c77ebcd05ac ("remoteproc: st: Use device_get_match_data()") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Link: https://lore.kernel.org/r/20231012-st_remoteproc-fix-sometimes-uninit-v1-1-f64d0f2d5b37@kernel.org Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-10-11remoteproc: st: Use device_get_match_data()Rob Herring1-10/+4
Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Link: https://lore.kernel.org/r/20231009211356.3242037-10-robh@kernel.org Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-29remoteproc: zynqmp: Change tcm address translation methodTanmay Shah1-38/+20
Introduce device address in hardcode TCM table. Device address is used for address translation. Also, previous method(hack) to mask few bits from address to achieve address translation is removed Signed-off-by: Tanmay Shah <tanmay.shah@amd.com> Link: https://lore.kernel.org/r/20230925172648.2339048-1-tanmay.shah@amd.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-21remoteproc: mediatek: Refactor single core check and fix retrocompatibilityAngeloGioacchino Del Regno1-11/+7
In older devicetrees we had the ChromeOS EC in a node called "cros-ec" instead of the newer "cros-ec-rpmsg", but this driver is now checking only for the latter, breaking compatibility with those. Besides, we can check if the SCP is single or dual core by simply walking through the children of the main SCP node and checking if if there's more than one "mediatek,scp-core" compatible node. Fixes: 1fdbf0cdde98 ("remoteproc: mediatek: Probe SCP cluster on multi-core SCP") Reported-by: "kernelci.org bot" <bot@kernelci.org> Tested-by: Laura Nao <laura.nao@collabora.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Tested-by: Chen-Yu Tsai <wenst@chromium.org> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230919092336.51007-1-angelogioacchino.delregno@collabora.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-20remoteproc: qcom: q6v5-mss: Remove PNoC clock from 8996 MSSKonrad Dybcio1-1/+0
The PNoC clock is a clock for the entire PNoC bus, managed from within the interconnect driver. Attaching it to MSS was a total hack. Get rid of it. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230721-topic-rpm_clk_cleanup-v2-10-1e506593b1bd@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-09-20remoteproc: qcom: pas: Add SM6375 MPSSKonrad Dybcio1-0/+16
Add a config for the MPSS present on SM6375. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230725-topic-6375_rproc-v5-3-a8e9cde56a20@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-09-20remoteproc: qcom: pas: Add SM6375 ADSP & CDSPKonrad Dybcio1-0/+2
Add a config for the ADSP&CDSP present on SM6375. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230725-topic-6375_rproc-v5-2-a8e9cde56a20@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-09-20remoteproc: qcom: pas: Add sc7180 adspNikita Travkin1-0/+1
sc7180 has a dedicated ADSP similar to the one found in sm8250. Add it's compatible to the driver reusing the existing config so the devices that use the adsp can probe it. Signed-off-by: Nikita Travkin <nikita@trvn.ru> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20230907-sc7180-adsp-rproc-v3-2-6515c3fbe0a3@trvn.ru Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-09-14remoteproc: zynqmp: fix TCM carveouts in lockstep modeTanmay Shah1-23/+43
In lockstep mode following is TCM address map: | *TCM* | *R5 View* | *Linux view* | | R5_0 ATCM (128 KB) | 0x0000_0000 | 0xFFE0_0000 | | R5_0 BTCM (128 KB) | 0x0002_0000 | 0xFFE2_0000 | Current driver keeps single TCM carveout in lockstep mode as ATCM and BTCM addresses form contiguous memory region. Although the addresses are contiguous, it is not same type of memory. ATCM typically holds interrupt or exception code that must be accessed at high speed. BTCM typically holds a block of data for intensive processing, such as audio or video processing. As both are different types of memory, they should be allocated as different carveout. This patch is fixing TCM carveout allocation in lockstep mode. Signed-off-by: Tanmay Shah <tanmay.shah@amd.com> Link: https://lore.kernel.org/r/20230913024323.2768114-1-tanmay.shah@amd.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-13remoteproc: mediatek: Refine ipi handler error messageTinghan Shen1-1/+1
The error message doesn't accurately reflect the cause of the error. The error is due to a handler not being found, not an invalid IPI ID. Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230901080935.14571-14-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-13remoteproc: mediatek: Report watchdog crash to all coresTinghan Shen1-1/+7
To ensure consistent behavior, the watchdog timeout handling of the multi-core SCP should reset the whole SCP sub-system when watchdog timeout. Triggering the rproc recovery flow on all instances will ensure proper recovery of the SCP sub-system. Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230901080935.14571-13-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-13remoteproc: mediatek: Handle MT8195 SCP core 1 watchdog timeoutTinghan Shen2-1/+29
The MT8195 SCP core 1 watchdog timeout needs to be handled in the SCP core 0 IRQ handler because the MT8195 SCP core 1 watchdog timeout IRQ is wired on the same IRQ entry for core 0 watchdog timeout. MT8195 SCP has a watchdog status register to identify the watchdog timeout source when IRQ triggered. Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230901080935.14571-12-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-13remoteproc: mediatek: Setup MT8195 SCP core 1 SRAM offsetTinghan Shen2-0/+35
Because MT8195 SCP core 0 and core 1 both boot from head of SRAM and have the same viewpoint of SRAM, SCP has a "core 1 SRAM offset" configuration to control the access destination of SCP core 1 to boot core 1 from different SRAM location. The "core 1 SRAM offset" configuration is composed by a range and an offset. It works like a simple memory mapped mechanism. When SCP core 1 accesses a SRAM address located in the range, the SCP bus adds the configured offset to the address to shift the physical destination address on SCP SRAM. This shifting is transparent to the software running on SCP core 1. Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230901080935.14571-11-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-13remoteproc: mediatek: Remove dependency of MT8195 SCP L2TCM power control on ↵Tinghan Shen2-15/+59
dual-core SCP Previously, SCP core 0 controlled the power of L2TCM and dictated that SCP core 1 could only boot after SCP core 0. To address this constraint, extracted the power control flow of L2TCM and made it shared between both cores, enabling support for arbitrary boot order. The flow for controlling L2TCM power has been incorporated into the mt8195_scp_before_load() and mt8195_scp_stop() APIs, which are respectively invoked during the rproc->ops->start() and rproc->ops->stop() operations. These APIs effectively serve the same purpose as the rproc prepare()/unprepare() APIs." Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230901080935.14571-10-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-13remoteproc: mediatek: Probe SCP cluster on multi-core SCPTinghan Shen1-5/+119
The difference of single-core SCP and multi-core SCP device tree is the presence of child device nodes described SCP cores. The SCP driver populates the platform device and checks the child nodes to identify whether it's a single-core SCP or a multi-core SCP. Add the remoteproc instances of multi-core SCP to the SCP cluster list. When the SCP driver is removed, it cleanup resources by walking through the cluster list. Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230901080935.14571-9-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-13remoteproc: mediatek: Probe SCP cluster on single-core SCPTinghan Shen2-25/+63
This is the 3rd preliminary step for probing multi-core SCP. Rewrite the probing flow of single-core SCP to adapt with the 'cluster' concept needed by the multi-core SCP. The SCP core object(s) is maintained at the cluster list. Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230901080935.14571-8-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-13remoteproc: mediatek: Revise SCP rproc initialization flow for multi-core SCPTinghan Shen1-24/+39
This is the 2nd preliminary step for probing multi-core SCP. Initialization of configuration and L1TCM registers is extracted to only performed once on multi-core SCP. The rest of remoteproc initialization procedure is similar for both single and multi-core SCP and is applied to each core. Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230901080935.14571-7-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-13remoteproc: mediatek: Extract SCP common registersTinghan Shen3-85/+96
This is the 1st preliminary steps for probing multi-core SCP. The registers of config and l1tcm are common on single-core SCP and multi-core SCP. Extract these registers out to reduce duplicated fields in mtk_scp when multiple SCP instances are created. Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230901080935.14571-6-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-13remoteproc: mediatek: Add MT8195 SCP core 1 operationsTinghan Shen2-0/+64
The SCP rproc driver has a set of chip dependent callbacks for boot sequence and IRQ handling. Implement these callbacks for MT8195 SCP core 1. Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230901080935.14571-5-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-13remoteproc: stm32: Clean up redundant dev_err_probe()Chen Jiahao1-2/+2
Referring to platform_get_irq()'s definition, the return value has already been checked if ret < 0, and printed via dev_err_probe(). Calling dev_err_probe() one more time outside platform_get_irq() is obviously redundant. Removing outside dev_err_probe() to clean it up. Besides, switch to use platform_get_irq_optional() since the irq is optional here. Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Link: https://lore.kernel.org/r/20230817083336.404635-1-chenjiahao16@huawei.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-09-05Merge tag 'rproc-v6.6' of ↵Linus Torvalds21-146/+264
git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull remoteproc updates from Bjorn Andersson: "Support for booting the iMX remoteprocs using MMIO, instead of SMCCC is added. The iMX driver is also extended to support delivering interrupts from an arbitrary number of vdev. Support is added to the TI PRU driver, to allow GPMUX to be controlled from DeviceTree. The Qualcomm coredump collector is extended to fall back to generating a full coredump, in the case that the loaded firmware doesn't support generating minidump. The overly terse MD abbreviation of "MINIDUMP" is expanded, to make the code easier on the eye. The list of Qualcomm Sensor Low Power Island (SLPI) instances supported is cleaned up, and SDM845 is added. SDM630/636/660 support for the modem subsystem (mss) is added. All the Qualcomm drivers are transitioned to of_reserved_mem_lookup() instead of open coding the resolution of reserved-memory regions, to gain handling of error cases. A couple of drivers are transitioned to use devm_platform_ioremap_resource_byname(). The stm32 remoteproc driver's PM operations are updated to modern macros, to avoid the "unused variable"-warning in some configurations. Drivers are transitioned away from directly including of_device.h" * tag 'rproc-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (23 commits) remoteproc: pru: add support for configuring GPMUX based on client setup remoteproc: stm32: fix incorrect optional pointers remoteproc: imx_rproc: Switch iMX8MN/MP from SMCCC to MMIO dt-bindings: remoteproc: imx_rproc: Support i.MX8MN/P MMIO dt-bindings: remoteproc: qcom,msm8996-mss-pil: Fix 8996 clocks remoteproc: qcom: pas: add SDM845 SLPI compatible remoteproc: qcom: q6v5-mss: Add support for SDM630/636/660 dt-bindings: remoteproc: qcom,msm8996-mss-pil: Add SDM660 compatible remoteproc: qcom: Expand MD_* as MINIDUMP_* remoteproc: qcom: pas: refactor SLPI remoteproc init dt-bindings: remoteproc: qcom: adsp: add qcom,sdm845-slpi-pas compatible remoteproc: qcom: wcnss: use devm_platform_ioremap_resource_byname() remoteproc: qcom: q6v5: use devm_platform_ioremap_resource_byname() dt-bindings: remoteproc: qcom: sm6115-pas: Add QCM2290 remoteproc: qcom: Add full coredump fallback mechanism remoteproc: core: Export the rproc coredump APIs remoteproc: qcom: Use of_reserved_mem_lookup() remoteproc: imx_rproc: iterate all notifiyids in rx callback dt-bindings: remoteproc: qcom,adsp: bring back firmware-name dt-bindings: remoteproc: qcom,sm8550-pas: require memory-region ...
2023-08-22remoteproc: pru: add support for configuring GPMUX based on client setupTero Kristo1-0/+22
The GPMUX config value for a PRU device can now be configured by client by specifying it in the device node ti,pruss-gp-mux-sel. Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: MD Danish Anwar <danishanwar@ti.com> Link: https://lore.kernel.org/r/20230802064925.1895750-1-danishanwar@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-08-22remoteproc: stm32: fix incorrect optional pointersArnd Bergmann1-6/+6
Compile-testing without CONFIG_OF shows that the of_match_ptr() macro was used incorrectly here: drivers/remoteproc/stm32_rproc.c:662:34: warning: unused variable 'stm32_rproc_match' [-Wunused-const-variable] As in almost every driver, the solution is simply to remove the use of this macro. The same thing happened with the deprecated SIMPLE_DEV_PM_OPS(), but the corresponding warning was already shut up with __maybe_unused annotations, so fix those as well by using the correct DEFINE_SIMPLE_DEV_PM_OPS() macros and removing the extraneous __maybe_unused modifiers. For completeness, also add a pm_ptr() to let the PM ops be eliminated completely when CONFIG_PM is turned off. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202307242300.ia82qBTp-lkp@intel.com Fixes: 03bd158e1535 ("remoteproc: stm32: use correct format strings on 64-bit") Fixes: 410119ee29b6 ("remoteproc: stm32: wakeup the system by wdg irq") Fixes: 13140de09cc2 ("remoteproc: stm32: add an ST stm32_rproc driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Link: https://lore.kernel.org/r/20230724195704.2432382-1-arnd@kernel.org Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-08-14soc: qcom: aoss: Tidy up qmp_send() callersBjorn Andersson1-7/+1
With qmp_send() handling variable length messages and string formatting he callers of qmp_send() can be cleaned up to not care about these things. Drop the QMP_MSG_LEN sized buffers and use the message formatting, as appropriate. Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Link: https://lore.kernel.org/r/20230811205839.727373-5-quic_bjorande@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-08-14soc: qcom: aoss: Move length requirements from callerBjorn Andersson1-1/+1
The existing implementation of qmp_send() requires the caller to provide a buffer which is of word-aligned. The underlying reason for this is that message ram only supports word accesses, but pushing this requirement onto the clients results in the same boiler plate code sprinkled in every call site. By using a temporary buffer in qmp_send() we can hide the underlying hardware limitations from the clients and allow them to pass their NUL-terminates C string directly. Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230811205839.727373-2-quic_bjorande@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-07-27remoteproc: imx_rproc: Switch iMX8MN/MP from SMCCC to MMIOMarek Vasut2-2/+58
The MX8M CM7 boot via SMC call is problematic, since not all versions of ATF support this interface. Extend the MMIO support so it can boot the CM7 on MX8MN/MP instead and discern the two alternatives using DT compatible strings. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20230724222418.163220-2-marex@denx.de Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-07-16remoteproc: qcom: pas: add SDM845 SLPI compatibleDylan Van Assche1-0/+1
Add a compatible for the SDM845 SLPI to the Qualcomm remoteproc q6v5_pas driver. The SLPI is the same as in SM8150, SM8250, SM8350, and SM8450, so use the same resource in the driver. Signed-off-by: Dylan Van Assche <me@dylanvanassche.be> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230330164633.117335-4-me@dylanvanassche.be Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-07-16remoteproc: qcom: q6v5-mss: Add support for SDM630/636/660Alexey Minnekhanov1-2/+49
Snapdragon 630/660 modem subsystem is similar to one in MSM8998 and can almost reuse it's reset sequence. Downstream sources call this q6v5 version "qdsp6v62-1-5" and its code path has additional checks for QDSP6v55_BHS_EN_REST_ACK status [2]. Inspiration is taken from Konrad Dybcio's work in [1], but reworked to use common code path with MSM8996/8998, instead of completely separate "if" block for SDM660. [1] https://github.com/SoMainline/linux/commit/7dd6dd9b936dc8d6c1f1abe299e5b065c33741e8 [2] https://github.com/MiCode/Xiaomi_Kernel_OpenSource/blob/lavender-q-oss/drivers/soc/qcom/pil-q6v5.c#L393 Co-developed-by: Konrad Dybcio <konradybcio@gmail.com> Signed-off-by: Konrad Dybcio <konradybcio@gmail.com> Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230621175046.61521-2-alexeymin@postmarketos.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-07-15remoteproc: qcom: Expand MD_* as MINIDUMP_*Mukesh Ojha1-6/+6
Expand MD_* as MINIDUMP_* which makes more sense than the abbreviation. Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com> Link: https://lore.kernel.org/r/1683133352-10046-2-git-send-email-quic_mojha@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-07-15remoteproc: qcom: pas: refactor SLPI remoteproc initDylan Van Assche1-40/+8
SLPI remoteproc initialization is the same for SDM845, SM8150, SM8250, SM8350 but is duplicated for each compatible. Refactor initialization structs for these 4 compatibles as a single struct. Signed-off-by: Dylan Van Assche <me@dylanvanassche.be> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230330164633.117335-3-me@dylanvanassche.be Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-07-15remoteproc: qcom: wcnss: use devm_platform_ioremap_resource_byname()Ye Xingchen1-3/+1
Convert platform_get_resource_byname(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource_byname(), as this is exactly what this function does. Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202303221116427329010@zte.com.cn Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-07-15remoteproc: qcom: q6v5: use devm_platform_ioremap_resource_byname()Ye Xingchen1-2/+1
Convert platform_get_resource_byname(),devm_ioremap_resource() to a single call to devm_platform_ioremap_resource_byname(), as this is exactly what this function does. Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202303221115145068959@zte.com.cn Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-07-15remoteproc: qcom: Add full coredump fallback mechanismSiddharth Gupta2-2/+12
If a remoteproc's firmware does not support minidump but the driver adds an ID, the minidump driver does not collect any coredumps when the remoteproc crashes. This hinders the purpose of coredump collection. This change adds a fallback mechanism in the event of a crash. Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com> Link: https://lore.kernel.org/r/20230224211707.30916-3-quic_gokukris@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-07-15remoteproc: core: Export the rproc coredump APIsSiddharth Gupta2-4/+2
The remoteproc coredump APIs are currently only part of the internal remoteproc header. This prevents the remoteproc platform drivers from using these APIs when needed. This change moves the rproc_coredump() and rproc_coredump_cleanup() APIs to the linux header and marks them as exported symbols. Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org> Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com> Link: https://lore.kernel.org/r/20230224211707.30916-2-quic_gokukris@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-07-15remoteproc: qcom: Use of_reserved_mem_lookup()Stephan Gerhold4-62/+69
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>
2023-07-15remoteproc: imx_rproc: iterate all notifiyids in rx callbackPeng Fan1-2/+11
The current code only supports one vdev and a single callback, but there are cases need more vdevs. So iterate all notifyids to support more vdevs with the single callback. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20230629093327.3376308-1-peng.fan@oss.nxp.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-07-15remoteproc: Explicitly include correct DT includesRob Herring16-17/+20
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>
2023-07-04Merge tag 'rproc-v6.5' of ↵Linus Torvalds18-100/+97
git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull remoteproc updates from Bjorn Andersson: "The bulk of these patches relates to the moving to a void-returning remove callback. The i.MX HiFi remoteproc driver gets its pm_ops helpers updated to resolve build warnings about 'defined but not used' variables in certain configurations. The ST STM32 remoteproc driver is extended to allow using a SCMI reset controller to hold boot, and has an error message corrected. The Qualcomm Q6V5 PAS driver gains a missing 'static' qualifier on adsp_segment_dump()" * tag 'rproc-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (23 commits) remoteproc: qcom_q6v5_pas: staticize adsp_segment_dump() remoteproc: stm32: Fix error code in stm32_rproc_parse_dt() remoteproc: stm32: Allow hold boot management by the SCMI reset controller dt-bindings: remoteproc: st,stm32-rproc: Rework reset declarations remoteproc: imx_dsp_rproc: use modern pm_ops remoteproc: wkup_m3: Convert to platform remove callback returning void remoteproc: stm32: Convert to platform remove callback returning void remoteproc: st: Convert to platform remove callback returning void remoteproc: virtio: Convert to platform remove callback returning void remoteproc: rcar: Convert to platform remove callback returning void remoteproc: qcom_wcnss: Convert to platform remove callback returning void remoteproc: qcom_q6v5_wcss: Convert to platform remove callback returning void remoteproc: qcom_q6v5_pas: Convert to platform remove callback returning void remoteproc: qcom_q6v5_mss: Convert to platform remove callback returning void remoteproc: qcom_q6v5_adsp: Convert to platform remove callback returning void remoteproc: pru: Convert to platform remove callback returning void remoteproc: omap: Convert to platform remove callback returning void remoteproc: mtk_scp: Convert to platform remove callback returning void remoteproc: meson_mx_ao_arc: Convert to platform remove callback returning void remoteproc: keystone: Convert to platform remove callback returning void ...
2023-06-30Merge tag 'soc-drivers-6.5' of ↵Linus Torvalds1-15/+0
git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC driver updates from Arnd Bergmann: "Nothing surprising in the SoC specific drivers, with the usual updates: - Added or improved SoC driver support for Tegra234, Exynos4121, RK3588, as well as multiple Mediatek and Qualcomm chips - SCMI firmware gains support for multiple SMC/HVC transport and version 3.2 of the protocol - Cleanups amd minor changes for the reset controller, memory controller, firmware and sram drivers - Minor changes to amd/xilinx, samsung, tegra, nxp, ti, qualcomm, amlogic and renesas SoC specific drivers" * tag 'soc-drivers-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (118 commits) dt-bindings: interrupt-controller: Convert Amlogic Meson GPIO interrupt controller binding MAINTAINERS: add PHY-related files to Amlogic SoC file list drivers: meson: secure-pwrc: always enable DMA domain tee: optee: Use kmemdup() to replace kmalloc + memcpy soc: qcom: geni-se: Do not bother about enable/disable of interrupts in secondary sequencer dt-bindings: sram: qcom,imem: document qdu1000 soc: qcom: icc-bwmon: Fix MSM8998 count unit dt-bindings: soc: qcom,rpmh-rsc: Require power-domains soc: qcom: socinfo: Add Soc ID for IPQ5300 dt-bindings: arm: qcom,ids: add SoC ID for IPQ5300 soc: qcom: Fix a IS_ERR() vs NULL bug in probe soc: qcom: socinfo: Add support for new fields in revision 19 soc: qcom: socinfo: Add support for new fields in revision 18 dt-bindings: firmware: scm: Add compatible for SDX75 soc: qcom: mdt_loader: Fix split image detection dt-bindings: memory-controllers: drop unneeded quotes soc: rockchip: dtpm: use C99 array init syntax firmware: tegra: bpmp: Add support for DRAM MRQ GSCs soc/tegra: pmc: Use devm_clk_notifier_register() soc/tegra: pmc: Simplify debugfs initialization ...
2023-06-22remoteproc: stm32: use correct format strings on 64-bitArnd Bergmann2-4/+4
With CONFIG_ARCH_STM32 making it into arch/arm64, a couple of format strings no longer work, since they rely on size_t being compatible with %x, or they print an 'int' using %z: drivers/remoteproc/stm32_rproc.c: In function 'stm32_rproc_mem_alloc': drivers/remoteproc/stm32_rproc.c:122:22: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=] drivers/remoteproc/stm32_rproc.c:122:40: note: format string is defined here 122 | dev_dbg(dev, "map memory: %pa+%x\n", &mem->dma, mem->len); | ~^ | | | unsigned int | %lx drivers/remoteproc/stm32_rproc.c:125:30: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Werror=format=] drivers/remoteproc/stm32_rproc.c:125:65: note: format string is defined here 125 | dev_err(dev, "Unable to map memory region: %pa+%x\n", | ~^ | | | unsigned int | %lx drivers/remoteproc/stm32_rproc.c: In function 'stm32_rproc_get_loaded_rsc_table': drivers/remoteproc/stm32_rproc.c:646:30: error: format '%zx' expects argument of type 'size_t', but argument 4 has type 'int' [-Werror=format=] drivers/remoteproc/stm32_rproc.c:646:66: note: format string is defined here 646 | dev_err(dev, "Unable to map memory region: %pa+%zx\n", | ~~^ | | | long unsigned int | %x Fix up all three instances to work across architectures, and enable compile testing for this driver to ensure it builds everywhere. Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-06-14remoteproc: qcom_q6v5_pas: staticize adsp_segment_dump()Krzysztof Kozlowski1-1/+1
adsp_segment_dump() is not used outside of this unit, so add missing static to fix: drivers/remoteproc/qcom_q6v5_pas.c:108:6: warning: no previous prototype for ‘adsp_segment_dump’ [-Wmissing-prototypes] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230507144826.193067-1-krzysztof.kozlowski@linaro.org
2023-05-23remoteproc: stm32: Fix error code in stm32_rproc_parse_dt()Dan Carpenter1-1/+1
There is a cut and paste bug so this code was returning the wrong variable. It should have been "ddata->hold_boot_rst" instead of "ddata->rst". Fixes: de598695a2ad ("remoteproc: stm32: Allow hold boot management by the SCMI reset controller") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Link: https://lore.kernel.org/r/6f457246-6446-42cb-81ae-d37221d726b1@kili.mountain Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-05-17soc: ti: pruss: Add helper functions to set GPI mode, MII_RT_event and XFRSuman Anna1-15/+0
The PRUSS CFG module is represented as a syscon node and is currently managed by the PRUSS platform driver. Add easy accessor functions to set GPI mode, MII_RT event enable/disable and XFR (XIN XOUT) enable/disable to enable the PRUSS Ethernet usecase. These functions reuse the generic pruss_cfg_update() API function. Signed-off-by: Suman Anna <s-anna@ti.com> Co-developed-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org> Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org> Signed-off-by: Puranjay Mohan <p-mohan@ti.com> Reviewed-by: Roger Quadros <rogerq@kernel.org> Reviewed-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: MD Danish Anwar <danishanwar@ti.com> Link: https://lore.kernel.org/r/20230414045542.3249939-5-danishanwar@ti.com Signed-off-by: Nishanth Menon <nm@ti.com>
2023-05-15remoteproc: stm32: Allow hold boot management by the SCMI reset controllerArnaud Pouliquen1-21/+55
The hold boot can be managed by the SCMI controller as a reset. If the "hold_boot" reset is defined in the device tree, use it. Else use the syscon controller directly to access to the register. The support of the SMC call is deprecated but kept for legacy support. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Link: https://lore.kernel.org/r/20230512093926.661509-3-arnaud.pouliquen@foss.st.com
2023-05-09remoteproc: imx_dsp_rproc: use modern pm_opsArnd Bergmann1-6/+5
Without CONFIG_PM, the driver warns about unused functions: drivers/remoteproc/imx_dsp_rproc.c:1210:12: error: 'imx_dsp_runtime_suspend' defined but not used [-Werror=unused-function] 1210 | static int imx_dsp_runtime_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/remoteproc/imx_dsp_rproc.c:1178:12: error: 'imx_dsp_runtime_resume' defined but not used [-Werror=unused-function] 1178 | static int imx_dsp_runtime_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~ Change the old SET_SYSTEM_SLEEP_PM_OPS()/SET_RUNTIME_PM_OPS() helpers to their modern replacements that avoid the warning, and remove the now unnecessary __maybe_unused annotations on the other PM helper functions. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com> Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com> Link: https://lore.kernel.org/r/20230420213610.2219080-1-arnd@kernel.org Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-05-09remoteproc: wkup_m3: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
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> Link: https://lore.kernel.org/r/20230504194453.1150368-19-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-05-09remoteproc: stm32: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
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: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Link: https://lore.kernel.org/r/20230504194453.1150368-18-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-05-09remoteproc: st: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
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: Patrice Chotard <patrice.chotard@foss.st.com> Link: https://lore.kernel.org/r/20230504194453.1150368-17-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-05-09remoteproc: virtio: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
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> Link: https://lore.kernel.org/r/20230504194453.1150368-16-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-05-09remoteproc: rcar: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
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> Link: https://lore.kernel.org/r/20230504194453.1150368-15-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>