Commit Graph

992 Commits

Author SHA1 Message Date
Luca Weiss 300ed425df remoteproc: qcom_q6v5_pas: Add SC7280 ADSP, CDSP & WPSS
Add support for the ADSP, CDSP and WPSS remoteprocs found on the SC7280
SoC using the q6v5-pas driver.

This driver can be used on regular LA ("Linux Android") based releases,
however the SC7280 ChromeOS devices need different driver support due to
firmware differences.

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://lore.kernel.org/r/20231208-sc7280-remoteprocs-v3-6-6aa394d33edf@fairphone.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2023-12-17 10:06:32 -08:00
Uwe Kleine-König 3f978d9889 remoteproc: k3-dsp: 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

There is no change in behaviour as .remove() already returned zero
unconditionally.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231123211657.518181-8-u.kleine-koenig@pengutronix.de
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-11-30 09:41:44 -07:00
Uwe Kleine-König cfd0b5c4fd remoteproc: k3-dsp: Use symbolic error codes in error messages
The error message

	failed to send mailbox message (-EINVAL)

is (for a human) more useful than

	failed to send mailbox message, status = -22

Adapt all error messages to use the symbolic names instead of the
numeric constants. The error paths in .probe() make use of
dev_err_probe() which automatically handles EPROBE_DEFER.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231123211657.518181-7-u.kleine-koenig@pengutronix.de>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-11-30 09:40:37 -07:00
Uwe Kleine-König bddae3e7ae remoteproc: k3-dsp: Suppress duplicate error message in .remove()
When the remove callback returns non-zero, the driver core emits an
error message about the error value being ignored. As the driver already
emits an error message already, return zero. This has no effect apart
from suppressing the core's message. The platform device gets unbound
irrespective of the return value.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231123211657.518181-6-u.kleine-koenig@pengutronix.de
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-11-30 09:39:29 -07:00
Iuliana Prodan fb49b6f65a remoteproc: imx_dsp_rproc: Add mandatory find_loaded_rsc_table op
Add the .find_loaded_rsc_table operation for i.MX DSP.
We need it for inter-process communication between DSP
and main core.

This callback is used to find the resource table (defined
in remote processor linker script) where the address of the
vrings along with the other allocated resources (carveouts etc)
are stored.
If this is not found, the vrings are not allocated and
the IPC between cores will not work.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20231013152731.23471-2-iuliana.prodan@oss.nxp.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-11-20 13:58:49 -07:00
Nathan Chancellor 3d8a18697a remoteproc: st: Fix sometimes uninitialized ret in st_rproc_probe()
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: 5c77ebcd05 ("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-16 11:24:34 -06:00
Rob Herring 5c77ebcd05 remoteproc: st: Use device_get_match_data()
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-10-11 11:38:20 -06:00
Tanmay Shah 6013727fc3 remoteproc: zynqmp: Change tcm address translation method
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-29 10:29:52 -06:00
AngeloGioacchino Del Regno 34eb78f28e remoteproc: mediatek: Refactor single core check and fix retrocompatibility
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: 1fdbf0cdde ("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-21 06:43:21 -06:00
Konrad Dybcio e1592981c5 remoteproc: qcom: q6v5-mss: Remove PNoC clock from 8996 MSS
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-20 11:25:14 -07:00
Konrad Dybcio 93f875645c remoteproc: qcom: pas: Add SM6375 MPSS
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-20 08:22:19 -07:00
Konrad Dybcio a6df21cf0c remoteproc: qcom: pas: Add SM6375 ADSP & CDSP
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-20 08:22:19 -07:00
Nikita Travkin 8de60bbab9 remoteproc: qcom: pas: Add sc7180 adsp
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-20 08:17:46 -07:00
Tanmay Shah 9af45bbdcb remoteproc: zynqmp: fix TCM carveouts in lockstep mode
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-14 11:04:43 -06:00
Tinghan Shen d1a8ac11ee remoteproc: mediatek: Refine ipi handler error message
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-13 11:46:31 -06:00
Tinghan Shen b0cdc6a4df remoteproc: mediatek: Report watchdog crash to all cores
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-13 11:46:24 -06:00
Tinghan Shen 5d5cfce480 remoteproc: mediatek: Handle MT8195 SCP core 1 watchdog timeout
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-13 11:46:16 -06:00
Tinghan Shen c01fb97cf2 remoteproc: mediatek: Setup MT8195 SCP core 1 SRAM offset
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-13 11:46:08 -06:00
Tinghan Shen c6eda63f33 remoteproc: mediatek: Remove dependency of MT8195 SCP L2TCM power control on 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-13 11:45:59 -06:00
Tinghan Shen 1fdbf0cdde remoteproc: mediatek: Probe SCP cluster on multi-core SCP
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-13 11:45:51 -06:00
Tinghan Shen eaf5b89953 remoteproc: mediatek: Probe SCP cluster on single-core SCP
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-13 11:45:40 -06:00
Tinghan Shen fcc14c9cd5 remoteproc: mediatek: Revise SCP rproc initialization flow for multi-core SCP
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-13 11:44:25 -06:00
Tinghan Shen 9ea166698f remoteproc: mediatek: Extract SCP common registers
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-13 11:44:17 -06:00
Tinghan Shen 6a1c9aaf04 remoteproc: mediatek: Add MT8195 SCP core 1 operations
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-13 11:43:55 -06:00
Chen Jiahao 99f998733d remoteproc: stm32: Clean up redundant dev_err_probe()
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-13 10:21:37 -06:00
Linus Torvalds 2a3a850ed0 remoteproc updates for v6.6
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.
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmT2AqkVHGFuZGVyc3Nv
 bkBrZXJuZWwub3JnAAoJEAsfOT8Nma3FvWMQALC4zy9ZNMLDNmfD4uO8u5R65eWv
 MzZqqsIVjmdcNcrJykKdIw33gBo50zw6AHcZjSdhOHdGvi/g8vQERhVO1k4dMzII
 JepoWG5HHY2nffr8LNQzG2HD0n4l6CQV3Ftg0/JlAhO1ADJz70HME3tUOiizLQUP
 TfIfF0pkmcjHERFNe+ESdWqkw+DUGGHXSs+b4f8jjqBvKSYayPo02wSAw/koV44a
 DJlw4U2omP76NWu30prqGqGvdB1ADwLcVLAFJg7+1c5ttqsZcz/SOZRlHbss200F
 5JuM5IF6HJgq2E9Cst+iWlH1ZtiMFFf+ZRmHv48BImpaBdeTcZuEz9k42ay3eVwJ
 FghK77c63MbICBOQiQv+QeGr5c49pU1UbioxtIKa3MmNE6gE/qHaLerHXyxd5XTq
 dhxuqFNgq4xClq9H8CUTkugSvHLvXiaZim240N2715GYL2VR4ZfAkM1xywBEKu32
 WZ61ueb0oZWYFUui2KrPgjvlQzf5ZtTs+1y000WJypaoCXU2kcq/zAvjMJlReYDu
 d97sntyy2Deae7ko/sMz4XrICQCug0WTE5PFXOCttWsYOJ8DvSvhND5fVmxc/uA3
 Gd+HdnLOc+RfKXiL5BoVf+BUIeuKTNaMutkIabcGTvgPPbJlic7iw6kR8NqCQ+mr
 U8E4hulg1I9aXwu4
 =BV3w
 -----END PGP SIGNATURE-----

Merge tag 'rproc-v6.6' of 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-09-04 15:12:26 -07:00
Tero Kristo 18cf4fcd7b remoteproc: pru: add support for configuring GPMUX based on client setup
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-21 15:19:28 -06:00
Arnd Bergmann fb2bdd32b2 remoteproc: stm32: fix incorrect optional pointers
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: 03bd158e15 ("remoteproc: stm32: use correct format strings on 64-bit")
Fixes: 410119ee29 ("remoteproc: stm32: wakeup the system by wdg irq")
Fixes: 13140de09c ("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-21 15:18:24 -06:00
Bjorn Andersson b4f63bbff9 soc: qcom: aoss: Tidy up qmp_send() callers
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-13 19:27:32 -07:00
Bjorn Andersson 59e0910083 soc: qcom: aoss: Move length requirements from caller
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-08-13 19:26:48 -07:00
Marek Vasut 49f80a7ab9 remoteproc: imx_rproc: Switch iMX8MN/MP from SMCCC to MMIO
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-27 10:44:17 -06:00
Dylan Van Assche ba3125b470 remoteproc: qcom: pas: add SDM845 SLPI compatible
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-15 15:18:34 -07:00
Alexey Minnekhanov 10b6fec2c8 remoteproc: qcom: q6v5-mss: Add support for SDM630/636/660
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] 7dd6dd9b93
[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-15 15:01:40 -07:00
Mukesh Ojha 318da13712 remoteproc: qcom: Expand MD_* as MINIDUMP_*
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-15 13:26:52 -07:00
Dylan Van Assche 637e98bfe2 remoteproc: qcom: pas: refactor SLPI remoteproc init
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-15 13:11:59 -07:00
Ye Xingchen 92d24d0927 remoteproc: qcom: wcnss: use devm_platform_ioremap_resource_byname()
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-15 13:10:34 -07:00
Ye Xingchen 5b2b675adf remoteproc: qcom: q6v5: use devm_platform_ioremap_resource_byname()
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-15 13:09:35 -07:00
Siddharth Gupta 5c43ed8ad2 remoteproc: qcom: Add full coredump fallback mechanism
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-15 12:56:49 -07:00
Siddharth Gupta f247f08da0 remoteproc: core: Export the rproc coredump APIs
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-15 12:56:48 -07:00
Stephan Gerhold 0ee55c188a 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>
2023-07-15 12:39:48 -07:00
Peng Fan 0b6c3bc88b remoteproc: imx_rproc: iterate all notifiyids in rx callback
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-15 12:36:22 -07:00
Rob Herring 3440d8da79 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>
2023-07-15 10:35:50 -07:00
Linus Torvalds 02676ecca7 remoteproc updates for v6.5
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().
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCAAzFiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmSjLeMVHGFuZGVyc3Nv
 bkBrZXJuZWwub3JnAAoJEAsfOT8Nma3FrC0P/jRxXCckwudaZFEQW3LTr8QDI/zV
 +ZkVBV9VUfjV64mY0Z6dAihXcONVYCNhKXX+6h+I/nxUfAqAJY7wbQBDmB/C7EL0
 qm185BBHNr8XmxezwmttKpeiCibcRoLbSCOeJXjXbOU3op/h7zTu6zLE2gLPWvWM
 s+x784cbiK5W/IY8DWoSHKW5XXMjgTta8pk8VhovnB/EokHjdbEHXQgpn/HVogvk
 ErczPWli8+bmzlAwd5RUNUW6q/Lnx3ffjC5dsVhlqK0iGNIu6fa0YUk35Uc7ig09
 0D2iZBqZLff/2WTW+PMHfdNl6dfzcLBLgoDpnFwOX2QO17qjKHTQfAwDshJkhKw6
 9BiJifXaVX2vrBCd7REUrAeHmzIbgO+yCnKFr1UyLmbj0x/DXQLCQHrkPXycKgKi
 Z9ujdJC7XsFyn1DSgxNSSWSpDhJOuMX77Umi/ASRWPha15H3YlOjqXV/Vaoy0iPg
 E7iCL2dd11X9s/LXp16ahcAgb7c6vEXclWm1CsTQzhMDLMmVBysMa/AWg8Gtq4hW
 pxCwsGWG7CTTAE2/E7N6AX/caNRs2Z++b6MLRVrIvvokgnk2Ofhqlyn71r7FstlV
 uBWUM9BszeIzG6NYAKWjRo036tVgTWnMWsy+i5uSOEUD6JsaMm7TnjVEOAtz1cQE
 VWbln8J7plG5ly6g
 =9t2a
 -----END PGP SIGNATURE-----

Merge tag 'rproc-v6.5' of 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-07-03 17:03:05 -07:00
Linus Torvalds e4c8d01865 ARM: SoC drivers for 6.5
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
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmSdmbIACgkQYKtH/8kJ
 UicewQ/6Aq8j5pBFYBimZoyQ0bi9z+prGrHoDDYLew2vKjtOXJl5z7ZnM3J1oyPt
 Zvis3IaGkHJCuuqotPdsquZrzHq8slzXzwkHPfHORJBC4gV0V/vMS8w32tO5FfTq
 ULrMyWnbsU7Udeywc2xuEpAoC9+bXX9brnCpa3H41peIGZKM+0g7EE6FASt3YaOk
 O+ZMSGqF8QbCqSQrUH3GudFlFMy/VxIvwuUsbLt8aNkRACunQZXVgUdArvLV49nX
 SElFN7hOVRoVDv0rgYMxlwElymrta/kMyjLba8GU1GIhzyDGozVqIJQAnsQ3f6CC
 yyzaJm27zzJH0mx9jx4W+JLBdjqDL4ctE2WyllRVIpTGYMHiMQtutHNwtNupIuD5
 j9j/fIVQWZqOdWXnA6V/CHYN1MZBRTH3KQcnLlYPC01dWKThPDnrHGfwOkfsrwtN
 zuERJJ+gd5b8KW4dmy1ueDOSB8162LxbS7iHxpOBGySmqVOYj3XUqACZhKRfXfIQ
 BVj9punCE/gO2fMb9IZByjeOzgtV+PBRmPxoglyaGkT4fVfL06kEbpKFYbXXq9b/
 aAS/U84gGr8ebWsOXszwDnBzTZRzjMVv/T9KDTTJuWbBEPNyCR7fUG0cZ50rSKnJ
 2cTPe3a0sS6LaBt71qfExCIfxG+cJ2c3N1U5/jb2C49Aob45obs=
 =zvLr
 -----END PGP SIGNATURE-----

Merge tag 'soc-drivers-6.5' of 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-29 15:22:19 -07:00
Arnd Bergmann 03bd158e15 remoteproc: stm32: use correct format strings on 64-bit
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-22 09:54:44 +02:00
Krzysztof Kozlowski 181da4bcc3 remoteproc: qcom_q6v5_pas: staticize adsp_segment_dump()
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-06-14 08:16:04 -07:00
Dan Carpenter 1ca04f21b2 remoteproc: stm32: Fix error code in stm32_rproc_parse_dt()
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: de598695a2 ("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-23 13:50:48 -06:00
Suman Anna 0211cc1e4f soc: ti: pruss: Add helper functions to set GPI mode, MII_RT_event and XFR
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-17 09:15:40 -05:00
Arnaud Pouliquen de598695a2 remoteproc: stm32: Allow hold boot management by the SCMI reset controller
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-15 11:21:45 -06:00
Arnd Bergmann 47f64e7ef9 remoteproc: imx_dsp_rproc: use modern pm_ops
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-09 13:48:54 -06:00