Arnaud Pouliquen
edf696f268
remoteproc: stm32: add capability to detach
...
A mechanism similar to the shutdown mailbox signal is implemented to
detach a remote processor.
Upon detachment, a signal is sent to the remote firmware, allowing it
to perform specific actions such as stopping rpmsg communication.
The Cortex-M hold boot is also disabled to allow the remote processor
to restart in case of crash.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Tested-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210331073347.8293-3-arnaud.pouliquen@foss.st.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-14 09:59:21 -05:00
Arnaud Pouliquen
aca8f94e5b
dt-bindings: remoteproc: stm32-rproc: add new mailbox channel for detach
...
Add the "detach" mailbox item, that allows to define a mailbox to
send a IPCC signal to the remote processor on remoteproc detach action.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20210331073347.8293-2-arnaud.pouliquen@foss.st.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-14 09:59:17 -05:00
Peng Fan
5e4c124307
remoteproc: imx_rproc: support remote cores booted before Linux Kernel
...
- When remote cores are kicked before Linux Kernel, we are not able
to get resource table from the firmware elf file, so we need to add
rsc_table to hold the resource table published by remote cores and
imx_rproc_get_loaded_rsc_table is to get the resource table.
- Per remoteproc framework, add attach hook for processor in a detached
state.
- Add imx_rproc_detect_mode to detect remote cores' working mode to
set the state which is required by remoteproc framework.
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Link: https://lore.kernel.org/r/1617846289-13496-5-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 21:10:32 -05:00
Peng Fan
10a3d4079e
remoteproc: imx_rproc: move memory parsing to rproc_ops
...
Use the rproc_ops::prepare() hook for doing memory resources
reallocation when reattaching a remote procesor.
Suggested-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Link: https://lore.kernel.org/r/1617846289-13496-4-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 21:10:32 -05:00
Peng Fan
f638a19775
remoteproc: imx_rproc: enlarge IMX7D_RPROC_MEM_MAX
...
8 is not enough when we need more, such as resource table for remote cores
that booted before Linux Kernel, so enlarge IMX7D_RPROC_MEM_MAX to 32.
And also rename it to IMX_RPROC_MEM_MAX which make more sense.
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/1617846289-13496-3-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 21:10:32 -05:00
Peng Fan
6e962bfe56
remoteproc: imx_rproc: add missing of_node_put
...
After of_parse_phandle, we need of_node_put to decrease the refcount
of the device_node.
Reported-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/1617846289-13496-2-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 21:10:32 -05:00
Wei Yongjun
889cb0d43d
remoteproc: imx_rproc: fix build error without CONFIG_MAILBOX
...
Fix build error when CONFIG_MAILBOX is not set:
arm-linux-gnueabi-ld: drivers/remoteproc/imx_rproc.o: in function `imx_rproc_kick':
imx_rproc.c:(.text+0x328): undefined reference to `mbox_send_message'
arm-linux-gnueabi-ld: drivers/remoteproc/imx_rproc.o: in function `imx_rproc_probe':
imx_rproc.c:(.text+0x52c): undefined reference to `mbox_request_channel_byname'
arm-linux-gnueabi-ld: imx_rproc.c:(.text+0x548): undefined reference to `mbox_request_channel_byname'
arm-linux-gnueabi-ld: imx_rproc.c:(.text+0x76c): undefined reference to `mbox_free_channel'
arm-linux-gnueabi-ld: imx_rproc.c:(.text+0x774): undefined reference to `mbox_free_channel'
arm-linux-gnueabi-ld: imx_rproc.c:(.text+0x7c4): undefined reference to `mbox_free_channel'
arm-linux-gnueabi-ld: drivers/remoteproc/imx_rproc.o: in function `imx_rproc_remove':
imx_rproc.c:(.text+0x86c): undefined reference to `mbox_free_channel'
arm-linux-gnueabi-ld: imx_rproc.c:(.text+0x874): undefined reference to `mbox_free_channel'
make: *** [Makefile:1292: vmlinux] Error 1
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Fixes: 2df7062002 ("remoteproc: imx_proc: enable virtio/mailbox")
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com >
Link: https://lore.kernel.org/r/20210331122709.3935521-1-weiyongjun1@huawei.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 21:10:32 -05:00
Junlin Yang
6353da47ee
remoteproc: qcom: wcss: Remove unnecessary PTR_ERR()
...
Remove unnecessary PTR_ERR(), it has been assigned to ret before,
so return ret directly.
Signed-off-by: Junlin Yang <yangjunlin@yulong.com >
Link: https://lore.kernel.org/r/20210408143322.1647-1-angkery@163.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 21:10:32 -05:00
Wei Yongjun
ca0e89406b
remoteproc: qcom: wcss: Fix wrong pointer passed to PTR_ERR()
...
PTR_ERR should access the value just tested by IS_ERR, otherwise
the wrong error code will be returned.
This commit fix it by return 'ret' directly.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com >
Fixes: 0af65b9b91 ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404")
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com >
Link: https://lore.kernel.org/r/20210326024741.841267-1-weiyongjun1@huawei.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 21:10:32 -05:00
Manivannan Sadhasivam
3fdba9d27c
remoteproc: qcom: pas: Add modem support for SDX55
...
Add remoteproc support for Hexagon modem found on the Qualcomm SDX55
platform.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Link: https://lore.kernel.org/r/20210408171211.92141-1-manivannan.sadhasivam@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 21:10:32 -05:00
Manivannan Sadhasivam
7a64a5c2e0
dt-bindings: remoteproc: qcom: pas: Add binding for SDX55
...
Add devicetree binding for SDX55 remoteproc.
Acked-by: Rob Herring <robh@kernel.org >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: devicetree@vger.kernel.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org >
Link: https://lore.kernel.org/r/20210408170457.91409-15-manivannan.sadhasivam@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 21:10:32 -05:00
Wei Yongjun
859fd2418b
remoteproc: qcom: wcss: Fix return value check in q6v5_wcss_init_mmio()
...
In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.
Fixes: 0af65b9b91 ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404")
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com >
Link: https://lore.kernel.org/r/20210319094100.4185044-1-weiyongjun1@huawei.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 15:44:21 -05:00
Suman Anna
880a66e026
remoteproc: pru: Fix and cleanup firmware interrupt mapping logic
...
The PRU firmware interrupt mappings are configured and unconfigured in
.start() and .stop() callbacks respectively using the variables 'evt_count'
and a 'mapped_irq' pointer. These variables are modified only during these
callbacks but are not re-initialized/reset properly during unwind or
failure paths. These stale values caused a kernel crash while stopping a
PRU remoteproc running a different firmware with no events on a subsequent
run after a previous run that was running a firmware with events.
Fix this crash by ensuring that the evt_count is 0 and the mapped_irq
pointer is set to NULL in pru_dispose_irq_mapping(). Also, reset these
variables properly during any failures in the .start() callback. While
at this, the pru_dispose_irq_mapping() callsites are all made to look
the same, moving any conditional logic to inside the function.
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Fixes: c75c9fdac6 ("remoteproc: pru: Add support for PRU specific interrupt configuration")
Reported-by: Vignesh Raghavendra <vigneshr@ti.com >
Signed-off-by: Suman Anna <s-anna@ti.com >
Link: https://lore.kernel.org/r/20210407155641.5501-4-s-anna@ti.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 15:43:38 -05:00
Suman Anna
1fe72bcfac
remoteproc: pru: Fix wrong success return value for fw events
...
The irq_create_fwspec_mapping() returns a proper virq value on success
and 0 upon any failure. The pru_handle_intrmap() treats this as an error
and disposes all firmware event mappings correctly, but is returning
this incorrect value as is, letting the pru_rproc_start() interpret it
as a success and boot the PRU.
Fix this by returning an error value back upon any such failure. While
at this, revise the error trace to print some meaningful info about the
failed event.
Fixes: c75c9fdac6 ("remoteproc: pru: Add support for PRU specific interrupt configuration")
Signed-off-by: Suman Anna <s-anna@ti.com >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210407155641.5501-3-s-anna@ti.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 15:43:26 -05:00
Suman Anna
6d1f2803cb
remoteproc: pru: Fixup interrupt-parent logic for fw events
...
The PRU firmware interrupt mapping logic in pru_handle_intrmap() uses
of_irq_find_parent() with PRU device node to get a handle to the PRUSS
Interrupt Controller at present. This logic however requires that the
PRU nodes always define a interrupt-parent property. This property is
neither a required/defined property as per the PRU remoteproc binding,
nor is relevant from a DT node point of view without any associated
interrupts. The current logic finds a wrong interrupt controller and
fails to perform proper mapping without any interrupt-parent property
in the PRU nodes.
Fix this logic to always find and use the sibling interrupt controller.
Also, while at this, fix the acquired interrupt controller device node
reference properly.
Fixes: c75c9fdac6 ("remoteproc: pru: Add support for PRU specific interrupt configuration")
Signed-off-by: Suman Anna <s-anna@ti.com >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210407155641.5501-2-s-anna@ti.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-04-13 15:42:45 -05:00
Bjorn Andersson
48073935b9
remoteproc: qcom: wcnss: Allow specifying firmware-name
...
Introduce a firmware-name property, in order to be able to support
device/platform specific firmware for the wireless connectivity
subsystem; in line with other Qualcomm remoteproc drivers.
Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Link: https://lore.kernel.org/r/20210312002441.3273183-1-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 09:44:18 -05:00
Govind Singh
bb91c9ee51
remoteproc: qcom: wcss: explicitly request exclusive reset control
...
Use request exclusive reset control for wcss reset controls.
Signed-off-by: Govind Singh <govinds@codeaurora.org >
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org >
Link: https://lore.kernel.org/r/1611859695-11824-5-git-send-email-gokulsri@codeaurora.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 08:02:30 -05:00
Govind Singh
0af65b9b91
remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404
...
Add non PAS WCSS remoteproc driver support for QCS404 SOC.
Add WCSS q6 bootup and shutdown sequence handled from
Application Processor SubSystem(APSS).
Signed-off-by: Govind Singh <govinds@codeaurora.org >
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org >
Link: https://lore.kernel.org/r/1611859695-11824-4-git-send-email-gokulsri@codeaurora.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 08:02:11 -05:00
Govind Singh
34364712fc
dt-bindings: remoteproc: qcom: Add Q6V5 Modem PIL binding for QCS404
...
Add a new modem compatible string for Qualcomm QCS404 SoCs
Signed-off-by: Govind Singh <govinds@codeaurora.org >
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org >
Acked-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/1611859695-11824-3-git-send-email-gokulsri@codeaurora.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 08:02:11 -05:00
Govind Singh
6549f42c3d
remoteproc: qcom: wcss: populate hardcoded param using driver data
...
Q6 based WiFi fw loading is supported across
different targets, ex: IPQ8074/QCS404. In order to
support different fw names/pas id etc, populate
hardcoded param using driver data.
Signed-off-by: Govind Singh <govinds@codeaurora.org >
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org >
Link: https://lore.kernel.org/r/1611859695-11824-2-git-send-email-gokulsri@codeaurora.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 08:02:11 -05:00
Mathieu Poirier
6e71d2b2a2
remoteproc: Refactor function rproc_cdev_release()
...
Refactor function rproc_cdev_release() to take into account the
current state of the remote processor when choosing the state to
transition to.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210312162453.1234145-18-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 08:02:10 -05:00
Mathieu Poirier
5daaeb5f07
remoteproc: Properly deal with a detach request when attached
...
This patch introduces the capability to detach a remote processor
that has been attached to by the remoteproc core. For that to happen
a rproc::ops::detach() operation needs to be available.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-17-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 08:02:10 -05:00
Mathieu Poirier
d2008a9683
remoteproc: Properly deal with a stop request when attached
...
Allow a remote processor that was started by another entity to be
switched off by the remoteproc core. For that to happen a
rproc::ops::stop() operation needs to be available.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-16-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 08:02:09 -05:00
Mathieu Poirier
83d4e6712c
remoteproc: Properly deal with a start request when attached
...
This patch takes into account scenarios where a remote processor
has been attached to when receiving a "start" command from sysfs.
As with the case with the running state, the command can't be
carried out if the remote processor is already in operation.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-15-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 08:02:09 -05:00
Mathieu Poirier
800dad0025
remoteproc: Properly deal with a kernel panic when attached
...
The panic handler operation of registered remote processors
should also be called when remote processors have been
attached to.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Peng Fan <peng.fan@nxp.com >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-14-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 08:02:08 -05:00
Mathieu Poirier
8088dd4d93
remoteproc: Properly deal with the resource table when stopping
...
When a remote processor that was attached to is stopped, special care
must be taken to make sure the shutdown process is similar to what
it would be had it been started by the remoteproc core.
This patch takes care of that by making a copy of the resource
table currently used by the remote processor. From that point on
the copy is used, as if the remote processor had been started by
the remoteproc core.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Reported-by: kernel test robot <lkp@intel.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-13-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 08:02:08 -05:00
Mathieu Poirier
9dc9507f18
remoteproc: Properly deal with the resource table when detaching
...
If it is possible to detach the remote processor, keep an untouched
copy of the resource table. That way we can start from the same
resource table without having to worry about original values or what
elements the startup code has changed when re-attaching to the remote
processor.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-12-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 08:00:51 -05:00
Mathieu Poirier
d3962a3978
remoteproc: Introduce function rproc_detach()
...
Introduce function rproc_detach() to enable the remoteproc
core to release the resources associated with a remote processor
without stopping its operation.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-11-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 07:55:47 -05:00
Mathieu Poirier
6070203fe4
remoteproc: Introduce function __rproc_detach()
...
Introduce function __rproc_detach() to perform the same kind of
operation as rproc_stop(), but instead of switching off the
remote processor using rproc->ops->stop(), it uses
rproc->ops->detach(). That way it is possible for the core
to release the resources associated with a remote processor while
the latter is kept operating.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Peng Fan <peng.fan@nxp.com >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-10-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 07:55:47 -05:00
Mathieu Poirier
7f3bd0c019
remoteproc: Add new detach() remoteproc operation
...
Add an new detach() operation in order to support scenarios where
the remoteproc core is going away but the remote processor is
kept operating. This could be the case when the system is
rebooted or when the platform driver is removed.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Peng Fan <peng.fan@nxp.com >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-9-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 07:55:46 -05:00
Arnaud POULIQUEN
6e20a05104
remoteproc: stm32: Move memory parsing to rproc_ops
...
Some actions such as memory resources reallocation are needed when
trying to reattach a co-processor. Use the prepare() operation for
these actions.
Co-developed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Signed-off-by: Arnaud POULIQUEN <arnaud.pouliquen@foss.st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-8-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 07:55:46 -05:00
Mathieu Poirier
8a471396d2
remoteproc: stm32: Move resource table setup to rproc_ops
...
Move the setting of the resource table installed by an external
entity to rproc_ops::get_loaded_rsc_table(). This is to support
scenarios where a remote processor has been attached to but is
detached at a later stage. To re-attach the remote processor,
the address of the resource table needs to be available
at a later time than the platform driver's probe() function.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-7-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 07:55:45 -05:00
Mathieu Poirier
1a631382be
remoteproc: Add new get_loaded_rsc_table() to rproc_ops
...
Add a new get_loaded_rsc_table() operation in order to support
scenarios where the remoteproc core has booted a remote processor
and detaches from it. When re-attaching to the remote processor,
the core needs to know where the resource table has been placed
in memory.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-6-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 07:54:53 -05:00
Mathieu Poirier
76f4c87587
remoteproc: Properly represent the attached state
...
There is a need to know when a remote processor has been attached
to rather than booted by the remoteproc core. In order to avoid
manipulating two variables, i.e rproc::autonomous and
rproc::state, get rid of the former and simply use the newly
introduced RPROC_ATTACHED state.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Peng Fan <peng.fan@nxp.com >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-5-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 07:54:52 -05:00
Mathieu Poirier
4196d18903
remoteproc: Add new RPROC_ATTACHED state
...
Add a new RPROC_ATTACHED state to take into account scenarios
where the remoteproc core needs to attach to a remote processor
that is booted by another entity.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Peng Fan <peng.fan@nxp.com >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-4-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 07:54:52 -05:00
Mathieu Poirier
6a6c4dc0e5
remoteproc: Rename function rproc_actuate()
...
Rename function rproc_actuate() to rproc_attach(). That way it is
easy to understand that it does the opposite of rproc_detach().
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Peng Fan <peng.fan@nxp.com >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-3-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 07:54:52 -05:00
Mathieu Poirier
16324fc8de
remoteproc: Remove useless check in rproc_del()
...
Whether started at probe() time or thereafter from the command
line, a remote processor needs to be shut down before the final
cleanup phases can happen. Otherwise the system may be left in
an unpredictable state where the remote processor is expecting
the remoteproc core to be providing services when in fact it
no longer exist.
Invariably calling rproc_shutdown() is fine since it will return
immediately if the remote processor has already been switched
off.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reviewed-by: Peng Fan <peng.fan@nxp.com >
Reviewed-by: Arnaud Pouliquen <arnaud.pouliquen@st.com >
Link: https://lore.kernel.org/r/20210312162453.1234145-2-mathieu.poirier@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 07:54:51 -05:00
Bjorn Andersson
3d2ee78906
remoteproc: qcom_q6v5_mss: Validate p_filesz in ELF loader
...
Analog to the issue in the common mdt_loader code the MSS ELF loader
does not validate that p_filesz bytes will fit in the memory region and
that the loaded segments are not truncated. Fix this in the same way
as proposed for the mdt_loader.
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Fixes: 135b9e8d1c ("remoteproc: qcom_q6v5_mss: Validate modem blob firmware size before load")
Link: https://lore.kernel.org/r/20210312232002.3466791-1-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 07:54:44 -05:00
Bjorn Andersson
9af2a2a9c6
remoteproc: qcom_q6v5_mss: Provide errors for firmware-name parsing
...
Failing to read the "firmware-name" DT property without informing the
developer is annoying, add some helpful debug prints.
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/20210312002605.3273255-1-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-18 07:54:31 -05:00
Wei Yongjun
18cda8018a
remoteproc: imx_rproc: fix return value check in imx_rproc_addr_init()
...
In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.
Fixes: ecadcc4749 ("remoteproc: imx_rproc: use devm_ioremap")
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com >
Link: https://lore.kernel.org/r/20210312080420.277151-1-weiyongjun1@huawei.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-12 18:07:19 -06:00
Peng Fan
2df7062002
remoteproc: imx_proc: enable virtio/mailbox
...
Use virtio/mailbox to build connection between Remote Proccessors
and Linux. Add work queue to handle incoming messages.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com >
Reviewed-by: Mathieu Poirier <mathieu.poirer@linaro.org >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Link: https://lore.kernel.org/r/1615029865-23312-11-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-11 12:03:08 -06:00
Peng Fan
8f2d896164
remoteproc: imx_rproc: ignore mapping vdev regions
...
vdev regions are vdev0vring0, vdev0vring1, vdevbuffer and similar.
They are handled by remoteproc common code, no need to map in imx
rproc driver.
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/1615029865-23312-10-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-11 12:02:45 -06:00
Peng Fan
4ab8f9607a
remoteproc: imx_rproc: support i.MX8MQ/M
...
Add i.MX8MQ dev/sys addr map and configuration data structure
i.MX8MM share i.MX8MQ settings.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Link: https://lore.kernel.org/r/1615029865-23312-9-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-11 12:02:44 -06:00
Peng Fan
b29b4249f8
remoteproc: imx_rproc: add i.MX specific parse fw hook
...
The hook is used to parse memory-regions and load resource table
from the address the remote processor published.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Link: https://lore.kernel.org/r/1615029865-23312-8-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-11 12:02:44 -06:00
Peng Fan
ecadcc4749
remoteproc: imx_rproc: use devm_ioremap
...
We might need to map an region multiple times, becaue the region might
be shared between remote processors, such i.MX8QM with dual M4 cores.
So use devm_ioremap, not devm_ioremap_resource.
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de >
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: https://lore.kernel.org/r/1615029865-23312-7-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-11 12:02:43 -06:00
Peng Fan
1896b3d82c
remoteproc: imx_rproc: correct err message
...
It is using devm_ioremap, so not devm_ioremap_resource. Correct
the error message and print out sa/size.
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Link: https://lore.kernel.org/r/1615029865-23312-6-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-11 12:02:43 -06:00
Peng Fan
40df0a91b2
remoteproc: add is_iomem to da_to_va
...
Introduce an extra parameter is_iomem to da_to_va, then the caller
could take the memory as normal memory or io mapped memory.
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Reported-by: kernel test robot <lkp@intel.com >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Link: https://lore.kernel.org/r/1615029865-23312-5-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-11 12:02:41 -06:00
Peng Fan
2cfc056ef2
remoteproc: introduce is_iomem to rproc_mem_entry
...
Introduce is_iomem to indicate this piece memory is iomem or not.
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org >
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Link: https://lore.kernel.org/r/1615029865-23312-4-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-11 12:02:40 -06:00
Peng Fan
bc403b4dfc
dt-bindings: remoteproc: imx_rproc: add i.MX8MQ/M support
...
Add i.MX8MQ/M support, also include mailbox for rpmsg/virtio usage.
Reviewed-by: Rob Herring <robh@kernel.org >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Link: https://lore.kernel.org/r/1615029865-23312-3-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-11 12:02:40 -06:00
Peng Fan
9e4c31799c
dt-bindings: remoteproc: convert imx rproc bindings to json-schema
...
Convert the imx rproc binding to DT schema format using json-schema.
Reviewed-by: Rob Herring <robh@kernel.org >
Signed-off-by: Peng Fan <peng.fan@nxp.com >
Link: https://lore.kernel.org/r/1615029865-23312-2-git-send-email-peng.fan@oss.nxp.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org >
2021-03-11 12:02:35 -06:00