summaryrefslogtreecommitdiff
path: root/drivers/remoteproc/imx_rproc.c
AgeCommit message (Collapse)AuthorFilesLines
2023-07-27remoteproc: imx_rproc: Switch iMX8MN/MP from SMCCC to MMIOMarek Vasut1-2/+56
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-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 Herring1-1/+1
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-05-09remoteproc: imx: 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: Iuliana Prodan <iuliana.prodan@nxp.com> Link: https://lore.kernel.org/r/20230504194453.1150368-4-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2023-04-03remoteproc: imx_rproc: Call of_node_put() on iteration errorMathieu Poirier1-2/+5
Function of_phandle_iterator_next() calls of_node_put() on the last device_node it iterated over, but when the loop exits prematurely it has to be called explicitly. Fixes: b29b4249f8f0 ("remoteproc: imx_rproc: add i.MX specific parse fw hook") Cc: stable@vger.kernel.org Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reviewed-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20230320221826.2728078-5-mathieu.poirier@linaro.org Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2022-11-15remoteproc: imx_rproc: Correct i.MX93 DRAM mappingPeng Fan1-2/+2
According to updated reference mannual, the M33 DRAM view of 0x[C,D]0000000 maps to A55 0xC0000000, so correct it. Fixes: 9222fabf0e39 ("remoteproc: imx_rproc: Support i.MX93") Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20221102111410.38737-1-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2022-10-24remoteproc: imx_rproc: Enable attach recovery for i.MX8QM/QXPPeng Fan1-1/+2
i.MX8QM/QXP M4 could recover without help from Linux, so to support it: - enable feature RPROC_FEAT_ATTACH_ON_RECOVERY - set recovery_disabled as false Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20221021041526.3696483-8-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2022-10-24remoteproc: imx_rproc: Request mbox channel laterPeng Fan1-2/+46
It is possible that when remote processor crash, the communication channel will be broken with garbage value in mailbox, such as when Linux is issuing a message through mailbox, remote processor crashes, we need free & rebuild the mailbox channels to make sure no garbage value in mailbox channels. So move the request/free to start/stop for managing remote procesosr in Linux, move to attach/detach for remote processor is out of control of Linux. Previous, we just request mbox when attach for CM4 boot early before Linux, but if mbox defer probe, remoteproc core will do resource cleanup and corrupt resource table for later probe. So move request mbox ealier and still keep mbox request when attach for self recovery case, but keep a check when request/free mbox. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20221021041526.3696483-7-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2022-10-24remoteproc: imx_rproc: Support i.MX8QMPeng Fan1-3/+44
Most logic are same as i.MX8QXP, but i.MX8QM has two general purpose M4 cores, the two cores runs independently and they have different resource id, different start address from SCFW view. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20221021041526.3696483-6-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2022-10-24remoteproc: imx_rproc: Support kicking Mcore from Linux for i.MX8QXPPeng Fan1-3/+93
When M4 is in the same hardware partition with Cortex-A, it could be start/stop by Linux. Added power domain to make sure M4 could run, it requires several power domains to work. Make clock always optional for i.MX8QXP, because SCFW handles it when power up M4 core. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20221021041526.3696483-5-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2022-10-24remoteproc: imx_rproc: Support attaching to i.MX8QXP M4Peng Fan1-1/+107
When M4 is kicked by SCFW, M4 runs in its own hardware partition, Linux could only do IPC with M4, it could not start, stop, update image. We disable recovery reboot when M4 is managed by SCFW, because remoteproc core still not support M4 auto-recovery without loading image. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20221021041526.3696483-4-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2022-08-23remoteproc: imx_rproc: Simplify some error messageChristophe JAILLET1-9/+5
dev_err_probe() already prints the error code in a human readable way, so there is no need to duplicate it as a numerical value at the end of the message. While at it, remove 'ret' that is mostly useless. Fixes: 2df7062002d0 ("remoteproc: imx_proc: enable virtio/mailbox") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/6b9343c2688117a340661d8ee491c2962c54a09a.1659736936.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2022-06-22remoteproc: imx_rproc: Fix refcount leak in imx_rproc_addr_initMiaoqian Lin1-3/+4
of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not needed anymore. This function has two paths missing of_node_put(). Fixes: 6e962bfe56b9 ("remoteproc: imx_rproc: add missing of_node_put") Fixes: a0ff4aa6f010 ("remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driver") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220512045558.7142-1-linmq006@gmail.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2022-05-09remoteproc: imx_rproc: Support i.MX93Peng Fan1-0/+33
i.MX93 features a Cortex-M33 core which could be kicked by ROM/Bootloader /Linux. Similar with i.MX8MN/P, we use SMC to trap into Arm Trusted Firmware to start/stop the M33 core. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20220429005346.2108279-3-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2022-04-18remoteproc: imx_rproc: Ignore create mem entry for resource tablePeng Fan1-0/+3
Resource table is used by Linux to get information published by remote processor. It should be not be used for memory allocation, so not create rproc mem entry. Fixes: b29b4249f8f0 ("remoteproc: imx_rproc: add i.MX specific parse fw hook") Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20220415025737.1561976-1-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2021-12-14remoteproc: imx_rproc: correct firmware reloadPeng Fan1-3/+5
ENABLE_M4 should be set to 1 when loading code to TCM, otherwise you will not able to replace the firmware after you stop m4. Besides ENABLE_M4, we still need set SW_M4C_RST, because this bit will be automatically set with SW_M4C_NON_SCLR_RST set. Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20210602064206.27004-1-peng.fan@oss.nxp.com
2021-11-17remoteproc: imx_rproc: Fix a resource leak in the remove functionChristophe JAILLET1-0/+1
'priv->workqueue' is destroyed in the error handling path of the probe but not in the remove function. Add the missing call to release some resources. Cc: stable <stable@vger.kernel.org> Fixes: 2df7062002d0 ("remoteproc: imx_proc: enable virtio/mailbox") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Peng Fan <peng.fan@nxp.com> Tested-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/d28ca94a4031bd7297d47c2164e18885a5a6ec19.1634366546.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2021-10-12remoteproc: imx_rproc: Move common structure to header fileShengjiu Wang1-27/+1
Move common structure imx_rproc_att, imx_rproc_method and imx_rproc_dcfg to header file which can be shared with imx_dsp_rproc driver. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1633944015-789-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2021-09-28remoteproc: imx_rproc: Change to ioremap_wc for dramDong Aisheng1-1/+1
DRAM is not io memory, so changed to ioremap_wc. This is also aligned with core io accessories. e.g. memcpy/memset and cpu direct access. Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Peng Fan <peng.fan@nxp.com> Reviewed-and-tested-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20210910090621.3073540-7-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-09-28remoteproc: imx_rproc: Fix rsc-table nameDong Aisheng1-1/+1
Usually the dash '-' is preferred in node name. So far, not dts in upstream kernel, so we just update node name in driver. Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Fixes: 5e4c1243071d ("remoteproc: imx_rproc: support remote cores booted before Linux Kernel") Reviewed-and-tested-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210910090621.3073540-6-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-09-28remoteproc: imx_rproc: Fix ignoring mapping vdev regionsDong Aisheng1-2/+2
vdev regions are typically named vdev0buffer, vdev0ring0, vdev0ring1 and etc. Change to strncmp to cover them all. Fixes: 8f2d8961640f ("remoteproc: imx_rproc: ignore mapping vdev regions") Reviewed-and-tested-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210910090621.3073540-5-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-09-28remoteproc: imx_rproc: Fix TCM io memory typeDong Aisheng1-14/+21
is_iomem was introduced in the commit 40df0a91b2a5 ("remoteproc: add is_iomem to da_to_va"), but the driver seemed missed to provide the io type correctly. This patch updates remoteproc driver to indicate the TCM on IMX are io memories. Without the change, remoteproc kick will fail. Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Peng Fan <peng.fan@nxp.com> Reviewed-and-tested-by: Peng Fan <peng.fan@nxp.com> Fixes: 79806d32d5aa ("remoteproc: imx_rproc: support i.MX8MN/P") Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210910090621.3073540-4-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-06-23remoteproc: imx_rproc: support i.MX8ULPPeng Fan1-0/+13
i.MX8ULP is a new SoC with Ultra low power support, it has a Cortex-M33 core and two Cortex-A35 cores. We need to add new configuration because it could not reuse the previous i.MX7/8 configuration. i.MX8ULP M33 core is kicked by ROM, it is not under control of A35 core. So need to mark the method is IMX_RPROC_NONE. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20210622060148.18411-3-peng.fan@oss.nxp.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-06-01remoteproc: imx_rproc: support i.MX8MN/PPeng Fan1-7/+80
Add i.MX8MN/P remote processor(Cortex-M7) support, we are using ARM SMCCC to start/stop M core, not using regmap interface. Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/1620274123-1461-9-git-send-email-peng.fan@oss.nxp.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-06-01remoteproc: imx_rproc: support i.MX7ULPPeng Fan1-11/+38
i.MX7ULP A7 core runs under control of M4 core, M4 core starts by ROM and powers most services used by A7 core, so A7 core has no power to start and stop M4 core. And the M4 core's state is default RPROC_DETACHED and remoteproc framework not able to stop the M4 core. Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/1620274123-1461-8-git-send-email-peng.fan@oss.nxp.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-06-01remoteproc: imx_rproc: make clk optionalPeng Fan1-15/+31
To i.MX7ULP, M4 is the master to control everything, no need to provide clk from Linux side. So make clk optional when method is IMX_RPROC_NONE. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/1620274123-1461-7-git-send-email-peng.fan@oss.nxp.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-06-01remoteproc: imx_rproc: initial support for mutilple start/stop methodPeng Fan1-0/+13
Add three methods IMX_RPROC_NONE(no need start/stop), IMX_RPROC_MMIO (start/stop through mmio) and IMX_RPROC_SMC(start/stop through ARM SMCCC). The current SoCs supported are all using IMX_RPROC_MMIO. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/1620274123-1461-6-git-send-email-peng.fan@oss.nxp.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-06-01remoteproc: imx_rproc: parse fsl,auto-bootPeng Fan1-0/+3
Parse fsl,auto-boot to indicate whether need remoteproc framework auto boot or not. When remote processor is booted before Linux Kernel up, do not parse fsl,auto-boot, so only need to parse the property when rproc state is RPROC_DETACHED. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/1620274123-1461-5-git-send-email-peng.fan@oss.nxp.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-04-14remoteproc: imx_rproc: support remote cores booted before Linux KernelPeng Fan1-0/+45
- 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-14remoteproc: imx_rproc: move memory parsing to rproc_opsPeng Fan1-5/+3
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-14remoteproc: imx_rproc: enlarge IMX7D_RPROC_MEM_MAXPeng Fan1-5/+5
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-14remoteproc: imx_rproc: add missing of_node_putPeng Fan1-0/+2
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-03-13remoteproc: imx_rproc: fix return value check in imx_rproc_addr_init()Wei Yongjun1-3/+2
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: ecadcc47492c ("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-11remoteproc: imx_proc: enable virtio/mailboxPeng Fan1-3/+113
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-11remoteproc: imx_rproc: ignore mapping vdev regionsPeng Fan1-0/+3
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-11remoteproc: imx_rproc: support i.MX8MQ/MPeng Fan1-1/+40
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-11remoteproc: imx_rproc: add i.MX specific parse fw hookPeng Fan1-0/+93
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-11remoteproc: imx_rproc: use devm_ioremapPeng Fan1-1/+2
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-11remoteproc: imx_rproc: correct err messagePeng Fan1-2/+2
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-11remoteproc: add is_iomem to da_to_vaPeng Fan1-1/+1
Introduce an extra parameter is_iomem to da_to_va, then the caller could take the memory as normal memory or io mapped memory. Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/1615029865-23312-5-git-send-email-peng.fan@oss.nxp.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-03-26remoteproc: Use size_t type for len in da_to_vaClement Leger1-5/+6
With upcoming changes in elf loader for elf64 support, section size will be a u64. When used with da_to_va, this will potentially lead to overflow if using the current "int" type for len argument. Change da_to_va prototype to use a size_t for len and fix all users of this function. Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Clement Leger <cleger@kalray.eu> Link: https://lore.kernel.org/r/20200302093902.27849-2-cleger@kalray.eu Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2019-07-17Merge tag 'rproc-v5.3' of git://github.com/andersson/remoteprocLinus Torvalds1-4/+4
Pull remoteproc updates from Bjorn Andersson: "This adds support for the STM32 remoteproc, additional i.MX platforms with Cortex M4 remoteprocs and Qualcomm's QCS404 Compute DSP. Also initial support for vendor specific resource table entries and support for unprocessed Qualcomm firmware files" * tag 'rproc-v5.3' of git://github.com/andersson/remoteproc: remoteproc: stm32: fix building without ARM SMCC remoteproc: qcom: q6v5-mss: Fix build error without QCOM_MDT_LOADER remoteproc: copy parent dma_pfn_offset for vdev remoteproc: qcom: q6v5-mss: Support loading non-split images soc: qcom: mdt_loader: Support loading non-split images remoteproc: stm32: add an ST stm32_rproc driver dt-bindings: remoteproc: add bindings for stm32 remote processor driver dt-bindings: stm32: add bindings for ML-AHB interconnect remoteproc: Use struct_size() helper remoteproc: add vendor resources handling remoteproc: imx: Fix typo in "failed" remoteproc: imx: Broaden the Kconfig selection logic remoteproc,rpmsg: add missing MAINTAINERS file entries remoteproc: qcom: qdsp6-adsp: Add support for QCS404 CDSP dt-bindings: remoteproc: Rename and amend Hexagon v56 binding
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-4/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-04remoteproc: imx: Fix typo in "failed"Fabio Estevam1-4/+4
There are several places where "failed" is spelled incorrectly. Fix them all. Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-19remoteproc: imx_rproc: Slightly simplify code in 'imx_rproc_probe()'Christophe JAILLET1-6/+4
We can return directly at the beginning of the function and save the 'err' label. We can also explicitly return 0 when the probe succeed. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-19remoteproc: imx_rproc: Re-use existing error handling path in ↵Christophe JAILLET1-4/+3
'imx_rproc_probe()' Avoid some code ducplication and be more future-proof. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-03-19remoteproc: imx_rproc: Fix an error handling path in 'imx_rproc_probe()'Christophe JAILLET1-2/+4
If 'of_device_get_match_data()' fails, we must undo the previous 'rproc_alloc()' call. Fixes: a0ff4aa6f010 ("remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-10-11remoteproc: imx_rproc: fix return value check in imx_rproc_addr_init()Wei Yongjun1-3/+2
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. Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-10-10remoteproc: imx_rproc: fix a couple off by one bugsDan Carpenter1-2/+2
The priv->mem[] array has IMX7D_RPROC_MEM_MAX elements so the > should be >= to avoid writing one element beyond the end of the array. Fixes: a0ff4aa6f010 ("remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2017-08-31remoteproc: imx_rproc: add a NXP/Freescale imx_rproc driverOleksij Rempel1-0/+426
Provide a basic driver to control Cortex M4 co-processor found on NXP i.MX7D and i.MX6SX. Currently it is able to resolve addresses between M4 and main CPU, start and stop the co-processor. Other functionality is not provided or test. This driver was tested on NXP i.MX7D and expected to work on i.MX6SX as well. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>