History

Merge tag 'rproc-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux

Pull remoteproc updates from Bjorn Andersson: "This introduces support for controlling the Cortex R7 co-processor in Renesas Gen3, support for R5F clusters and C71x DSPs on TI J721S2 and compute, audio and modem subsystems on Qualcomm SM6350. It fixes a couple of sparse errors related to memcpy_to/fromio and corrects the kerneldoc spelling of "Return:". The stm32 driver no longer attempts to communicate with the remote after the firmware has crashed" * tag 'rproc-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (22 commits) remoteproc: stm32: Improve crash recovery time remoteproc: rcar_rproc: Remove trailing semicolon remoteproc: rcar_rproc: Fix pm_runtime_get_sync error check remoteproc: qcom: pas: Add SM6350 CDSP support remoteproc: qcom: pas: Add SM6350 ADSP support remoteproc: qcom: pas: Add SM6350 MPSS support dt-bindings: remoteproc: qcom: pas: Add SM6350 adsp, cdsp & mpss remoteproc: qcom: pas: Add missing power-domain "mxc" for CDSP remoteproc: imx_rproc: correct firmware reload remoteproc: qcom: pil_info: Don't memcpy_toio more than is provided remoteproc: Add Renesas rcar driver dt-bindings: remoteproc: Add Renesas R-Car remoteproc: Fix remaining wrong return formatting in documentation MAINTAINERS: Removing Ohad from remoteproc/rpmsg maintenance remoteproc: ingenic: Request IRQ disabled remoteproc: k3-r5: Extend support for R5F clusters on J721S2 SoCs remoteproc: k3-dsp: Extend support for C71x DSPs on J721S2 SoCs dt-bindings: remoteproc: k3-dsp: Update bindings for J721S2 SoCs dt-bindings: remoteproc: k3-r5f: Update bindings for J721S2 SoCs remoteproc: coredump: Correct argument 2 type for memcpy_fromio ...

Linus Torvalds committed 4 years ago

Commit 46a10fc2 parents fc9d695 cfcabbb20 files · +400 −21Browse files

Unified · Split

20 files
  1. CREDITS +5 −0
  2. Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml +28 −0
  3. Documentation/devicetree/bindings/remoteproc/renesas,rcar-rproc.yaml +65 −0
  4. Documentation/devicetree/bindings/remoteproc/ti,k3-dsp-rproc.yaml +3 −0
  5. Documentation/devicetree/bindings/remoteproc/ti,k3-r5f-rproc.yaml +5 −3
  6. MAINTAINERS +0 −2
  7. drivers/remoteproc/Kconfig +11 −0
  8. drivers/remoteproc/Makefile +1 −0
  9. drivers/remoteproc/imx_rproc.c +6 −3
  10. drivers/remoteproc/ingenic_rproc.c +2 −3
  11. drivers/remoteproc/mtk_scp_ipi.c +2 −2
  12. drivers/remoteproc/qcom_pil_info.c +1 −1
  13. drivers/remoteproc/qcom_q6v5_pas.c +38 −0
  14. drivers/remoteproc/rcar_rproc.c +224 −0
  15. drivers/remoteproc/remoteproc_core.c +2 −2
  16. drivers/remoteproc/remoteproc_coredump.c +1 −1
  17. drivers/remoteproc/st_slim_rproc.c +1 −1
  18. drivers/remoteproc/stm32_rproc.c +1 −1
  19. drivers/remoteproc/ti_k3_dsp_remoteproc.c +1 −0
  20. drivers/remoteproc/ti_k3_r5_remoteproc.c +3 −2
CREDITS+5−0
@@ -315,6 +315,11 @@ S: Via Delle Palme, 9 · 314 unmodified lines
315315 S: Terni 05100
316316 S: Italy
317317
318+N: Ohad Ben Cohen
319+E: ohad@wizery.com
320+D: Remote Processor (remoteproc) subsystem
321+D: Remote Processor Messaging (rpmsg) subsystem
322+
318323 N: Krzysztof Benedyczak
319324 E: golbi@mat.uni.torun.pl
320325 W: http://www.mat.uni.torun.pl/~golbi
Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml+28−0
@@ -33,6 +33,9 @@ properties: · 32 unmodified lines
3333 - qcom,sdm845-adsp-pas
3434 - qcom,sdm845-cdsp-pas
3535 - qcom,sdx55-mpss-pas
36+ - qcom,sm6350-adsp-pas
37+ - qcom,sm6350-cdsp-pas
38+ - qcom,sm6350-mpss-pas
3639 - qcom,sm8150-adsp-pas
3740 - qcom,sm8150-cdsp-pas
3841 - qcom,sm8150-mpss-pas
@@ -158,6 +161,9 @@ allOf: · 119 unmodified lines
158161 - qcom,sc8180x-mpss-pas
159162 - qcom,sdm845-adsp-pas
160163 - qcom,sdm845-cdsp-pas
164+ - qcom,sm6350-adsp-pas
165+ - qcom,sm6350-cdsp-pas
166+ - qcom,sm6350-mpss-pas
161167 - qcom,sm8150-adsp-pas
162168 - qcom,sm8150-cdsp-pas
163169 - qcom,sm8150-mpss-pas
@@ -266,6 +272,8 @@ allOf: · 102 unmodified lines
266272 - qcom,sc8180x-cdsp-pas
267273 - qcom,sdm845-adsp-pas
268274 - qcom,sdm845-cdsp-pas
275+ - qcom,sm6350-adsp-pas
276+ - qcom,sm6350-cdsp-pas
269277 - qcom,sm8150-adsp-pas
270278 - qcom,sm8150-cdsp-pas
271279 - qcom,sm8150-slpi-pas
@@ -301,6 +309,7 @@ allOf: · 29 unmodified lines
301309 - qcom,sc7280-mpss-pas
302310 - qcom,sc8180x-mpss-pas
303311 - qcom,sdx55-mpss-pas
312+ - qcom,sm6350-mpss-pas
304313 - qcom,sm8150-mpss-pas
305314 - qcom,sm8350-mpss-pas
306315 then:
@@ -385,6 +394,23 @@ allOf: · 78 unmodified lines
385394 - const: mx
386395 - const: mss
387396
397+ - if:
398+ properties:
399+ compatible:
400+ contains:
401+ enum:
402+ - qcom,sm6350-cdsp-pas
403+ then:
404+ properties:
405+ power-domains:
406+ items:
407+ - description: CX power domain
408+ - description: MX power domain
409+ power-domain-names:
410+ items:
411+ - const: cx
412+ - const: mx
413+
388414 - if:
389415 properties:
390416 compatible:
@@ -405,6 +431,7 @@ allOf: · 14 unmodified lines
405431 enum:
406432 - qcom,sc7280-mpss-pas
407433 - qcom,sdx55-mpss-pas
434+ - qcom,sm6350-mpss-pas
408435 - qcom,sm8150-mpss-pas
409436 - qcom,sm8350-mpss-pas
410437 then:
@@ -425,6 +452,7 @@ allOf: · 14 unmodified lines
425452 enum:
426453 - qcom,sc8180x-adsp-pas
427454 - qcom,sc8180x-cdsp-pas
455+ - qcom,sm6350-adsp-pas
428456 - qcom,sm8150-slpi-pas
429457 - qcom,sm8250-adsp-pas
430458 - qcom,sm8250-slpi-pas
Documentation/devicetree/bindings/remoteproc/renesas,rcar-rproc.yaml+65−0
@@ -0,0 +1,65 @@
1+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: "http://devicetree.org/schemas/remoteproc/renesas,rcar-rproc.yaml#"
5+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6+
7+title: Renesas R-Car remote processor controller bindings
8+
9+maintainers:
10+ - Julien Massot <julien.massot@iot.bzh>
11+
12+description: |
13+ This document defines the bindings for the remoteproc component that loads and
14+ boots firmwares on the Renesas R-Car family chipset.
15+ R-Car gen3 family may have a realtime processor, this processor shares peripheral
16+ and RAM with the host processor with the same address map.
17+
18+properties:
19+ compatible:
20+ const: renesas,rcar-cr7
21+
22+ resets:
23+ maxItems: 1
24+
25+ power-domains:
26+ maxItems: 1
27+
28+ memory-region:
29+ description:
30+ List of phandles to the reserved memory regions associated with the
31+ remoteproc device. This is variable and describes the memories shared with
32+ the remote processor (e.g. remoteproc firmware and carveouts, rpmsg
33+ vrings, ...).
34+ (see ../reserved-memory/reserved-memory.yaml)
35+
36+required:
37+ - compatible
38+ - resets
39+ - memory-region
40+ - power-domains
41+
42+additionalProperties: false
43+
44+examples:
45+ - |
46+ #include <dt-bindings/clock/r8a7795-cpg-mssr.h>
47+ #include <dt-bindings/power/r8a7795-sysc.h>
48+ reserved-memory {
49+ #address-cells = <2>;
50+ #size-cells = <2>;
51+
52+ cr7_ram: cr7_ram@40040000 {
53+ no-map;
54+ reg = <0x0 0x40040000 0x0 0x1fc0000>;
55+ };
56+ };
57+
58+ cr7_rproc: cr7 {
59+ compatible = "renesas,rcar-cr7";
60+ memory-region = <&cr7_ram>;
61+ power-domains = <&sysc R8A7795_PD_CR7>;
62+ resets = <&cpg 222>;
63+ };
64+
65+...
Documentation/devicetree/bindings/remoteproc/ti,k3-dsp-rproc.yaml+3−0
@@ -33,9 +33,11 @@ properties: · 32 unmodified lines
3333 enum:
3434 - ti,j721e-c66-dsp
3535 - ti,j721e-c71-dsp
36+ - ti,j721s2-c71-dsp
3637 description:
3738 Use "ti,j721e-c66-dsp" for C66x DSPs on K3 J721E SoCs
3839 Use "ti,j721e-c71-dsp" for C71x DSPs on K3 J721E SoCs
40+ Use "ti,j721s2-c71-dsp" for C71x DSPs on K3 J721S2 SoCs
3941
4042 resets:
4143 description: |
@@ -106,6 +108,7 @@ else: · 64 unmodified lines
106108 compatible:
107109 enum:
108110 - ti,j721e-c71-dsp
111+ - ti,j721s2-c71-dsp
109112 then:
110113 properties:
111114 reg:
Documentation/devicetree/bindings/remoteproc/ti,k3-r5f-rproc.yaml+5−3
@@ -38,6 +38,7 @@ properties: · 37 unmodified lines
3838 - ti,j721e-r5fss
3939 - ti,j7200-r5fss
4040 - ti,am64-r5fss
41+ - ti,j721s2-r5fss
4142
4243 power-domains:
4344 description: |
@@ -64,9 +65,9 @@ properties: · 20 unmodified lines
6465 description: |
6566 Configuration Mode for the Dual R5F cores within the R5F cluster.
6667 Should be either a value of 1 (LockStep mode) or 0 (Split mode) on
67− most SoCs (AM65x, J721E, J7200), default is LockStep mode if omitted;
68− and should be either a value of 0 (Split mode) or 2 (Single-CPU mode)
69− on AM64x SoCs, default is Split mode if omitted.
68+ most SoCs (AM65x, J721E, J7200, J721s2), default is LockStep mode if
69+ omitted; and should be either a value of 0 (Split mode) or 2
70+ (Single-CPU mode) on AM64x SoCs, default is Split mode if omitted.
7071
7172 # R5F Processor Child Nodes:
7273 # ==========================
@@ -104,6 +105,7 @@ patternProperties: · 31 unmodified lines
104105 - ti,j721e-r5f
105106 - ti,j7200-r5f
106107 - ti,am64-r5f
108+ - ti,j721s2-r5f
107109
108110 reg:
109111 items:
MAINTAINERS+0−2
@@ -16400,7 +16400,6 @@ S: Supported · 16399 unmodified lines
1640016400 F: fs/reiserfs/
1640116401
1640216402 REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM
16403−M: Ohad Ben-Cohen <ohad@wizery.com>
1640416403 M: Bjorn Andersson <bjorn.andersson@linaro.org>
1640516404 M: Mathieu Poirier <mathieu.poirier@linaro.org>
1640616405 L: linux-remoteproc@vger.kernel.org
@@ -16414,7 +16413,6 @@ F: include/linux/remoteproc.h · 7 unmodified lines
1641416413 F: include/linux/remoteproc/
1641516414
1641616415 REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM
16417−M: Ohad Ben-Cohen <ohad@wizery.com>
1641816416 M: Bjorn Andersson <bjorn.andersson@linaro.org>
1641916417 M: Mathieu Poirier <mathieu.poirier@linaro.org>
1642016418 L: linux-remoteproc@vger.kernel.org
drivers/remoteproc/Kconfig+11−0
@@ -283,6 +283,17 @@ config QCOM_WCNSS_PIL · 282 unmodified lines
283283 verified and booted with the help of the Peripheral Authentication
284284 System (PAS) in TrustZone.
285285
286+config RCAR_REMOTEPROC
287+ tristate "Renesas R-Car Gen3 remoteproc support"
288+ depends on ARCH_RENESAS || COMPILE_TEST
289+ help
290+ Say y here to support R-Car realtime processor via the
291+ remote processor framework. An ELF firmware can be loaded
292+ thanks to sysfs remoteproc entries. The remote processor
293+ can be started and stopped.
294+ This can be either built-in or a loadable module.
295+ If compiled as module (M), the module name is rcar_rproc.
296+
286297 config ST_REMOTEPROC
287298 tristate "ST remoteproc support"
288299 depends on ARCH_STI
drivers/remoteproc/Makefile+1−0
@@ -32,6 +32,7 @@ obj-$(CONFIG_QCOM_SYSMON) += qcom_sysmon.o · 31 unmodified lines
3232 obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss_pil.o
3333 qcom_wcnss_pil-y += qcom_wcnss.o
3434 qcom_wcnss_pil-y += qcom_wcnss_iris.o
35+obj-$(CONFIG_RCAR_REMOTEPROC) += rcar_rproc.o
3536 obj-$(CONFIG_ST_REMOTEPROC) += st_remoteproc.o
3637 obj-$(CONFIG_ST_SLIM_REMOTEPROC) += st_slim_rproc.o
3738 obj-$(CONFIG_STM32_RPROC) += stm32_rproc.o
drivers/remoteproc/imx_rproc.c+6−3
@@ -34,7 +34,8 @@ · 33 unmodified lines
3434
3535 #define IMX7D_M4_START (IMX7D_ENABLE_M4 | IMX7D_SW_M4P_RST \
3636 | IMX7D_SW_M4C_RST)
37−#define IMX7D_M4_STOP IMX7D_SW_M4C_NON_SCLR_RST
37+#define IMX7D_M4_STOP (IMX7D_ENABLE_M4 | IMX7D_SW_M4C_RST | \
38+ IMX7D_SW_M4C_NON_SCLR_RST)
3839
3940 /* Address: 0x020D8000 */
4041 #define IMX6SX_SRC_SCR 0x00
@@ -45,7 +46,8 @@ · 4 unmodified lines
4546
4647 #define IMX6SX_M4_START (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4P_RST \
4748 | IMX6SX_SW_M4C_RST)
48−#define IMX6SX_M4_STOP IMX6SX_SW_M4C_NON_SCLR_RST
49+#define IMX6SX_M4_STOP (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4C_RST | \
50+ IMX6SX_SW_M4C_NON_SCLR_RST)
4951 #define IMX6SX_M4_RST_MASK (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4P_RST \
5052 | IMX6SX_SW_M4C_NON_SCLR_RST \
5153 | IMX6SX_SW_M4C_RST)
@@ -684,7 +686,7 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv) · 632 unmodified lines
684686 return ret;
685687 }
686688
687− if (!(val & dcfg->src_stop))
689+ if ((val & dcfg->src_mask) != dcfg->src_stop)
688690 priv->rproc->state = RPROC_DETACHED;
689691
690692 return 0;
@@ -804,6 +806,7 @@ static int imx_rproc_remove(struct platform_device *pdev) · 113 unmodified lines
804806 clk_disable_unprepare(priv->clk);
805807 rproc_del(rproc);
806808 imx_rproc_free_mbox(rproc);
809+ destroy_workqueue(priv->workqueue);
807810 rproc_free(rproc);
808811
809812 return 0;
drivers/remoteproc/ingenic_rproc.c+2−3
@@ -218,14 +218,13 @@ static int ingenic_rproc_probe(struct platform_device *pdev) · 217 unmodified lines
218218 if (vpu->irq < 0)
219219 return vpu->irq;
220220
221− ret = devm_request_irq(dev, vpu->irq, vpu_interrupt, 0, "VPU", rproc);
221+ ret = devm_request_irq(dev, vpu->irq, vpu_interrupt, IRQF_NO_AUTOEN,
222+ "VPU", rproc);
222223 if (ret < 0) {
223224 dev_err(dev, "Failed to request IRQ\n");
224225 return ret;
225226 }
226227
227− disable_irq(vpu->irq);
228−
229228 ret = devm_rproc_add(dev, rproc);
230229 if (ret) {
231230 dev_err(dev, "Failed to register remote processor\n");
drivers/remoteproc/mtk_scp_ipi.c+2−2
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 *
2424 * Register an ipi function to receive ipi interrupt from SCP.
2525 *
26− * Returns 0 if ipi registers successfully, -error on error.
26+ * Return: 0 if ipi registers successfully, -error on error.
2727 */
2828 int scp_ipi_register(struct mtk_scp *scp,
2929 u32 id,
@@ -150,7 +150,7 @@ EXPORT_SYMBOL_GPL(scp_ipi_unlock); · 120 unmodified lines
150150 * When the processing completes, IPI handler registered
151151 * by scp_ipi_register will be called in interrupt context.
152152 *
153− * Returns 0 if sending data successfully, -error on error.
153+ * Return: 0 if sending data successfully, -error on error.
154154 **/
155155 int scp_ipi_send(struct mtk_scp *scp, u32 id, void *buf, unsigned int len,
156156 unsigned int wait)
drivers/remoteproc/qcom_pil_info.c+1−1
@@ -104,7 +104,7 @@ int qcom_pil_info_store(const char *image, phys_addr_t base, size_t size) · 103 unmodified lines
104104 return -ENOMEM;
105105
106106 found_unused:
107− memcpy_toio(entry, image, PIL_RELOC_NAME_LEN);
107+ memcpy_toio(entry, image, strnlen(image, PIL_RELOC_NAME_LEN));
108108 found_existing:
109109 /* Use two writel() as base is only aligned to 4 bytes on odd entries */
110110 writel(base, entry + PIL_RELOC_NAME_LEN);
drivers/remoteproc/qcom_q6v5_pas.c+38−0
@@ -524,6 +524,23 @@ static const struct adsp_data sdm845_adsp_resource_init = { · 523 unmodified lines
524524 .ssctl_id = 0x14,
525525 };
526526
527+static const struct adsp_data sm6350_adsp_resource = {
528+ .crash_reason_smem = 423,
529+ .firmware_name = "adsp.mdt",
530+ .pas_id = 1,
531+ .has_aggre2_clk = false,
532+ .auto_boot = true,
533+ .proxy_pd_names = (char*[]){
534+ "lcx",
535+ "lmx",
536+ NULL
537+ },
538+ .load_state = "adsp",
539+ .ssr_name = "lpass",
540+ .sysmon_name = "adsp",
541+ .ssctl_id = 0x14,
542+};
543+
527544 static const struct adsp_data sm8150_adsp_resource = {
528545 .crash_reason_smem = 423,
529546 .firmware_name = "adsp.mdt",
@@ -612,6 +629,23 @@ static const struct adsp_data sdm845_cdsp_resource_init = { · 82 unmodified lines
612629 .ssctl_id = 0x17,
613630 };
614631
632+static const struct adsp_data sm6350_cdsp_resource = {
633+ .crash_reason_smem = 601,
634+ .firmware_name = "cdsp.mdt",
635+ .pas_id = 18,
636+ .has_aggre2_clk = false,
637+ .auto_boot = true,
638+ .proxy_pd_names = (char*[]){
639+ "cx",
640+ "mx",
641+ NULL
642+ },
643+ .load_state = "cdsp",
644+ .ssr_name = "cdsp",
645+ .sysmon_name = "cdsp",
646+ .ssctl_id = 0x17,
647+};
648+
615649 static const struct adsp_data sm8150_cdsp_resource = {
616650 .crash_reason_smem = 601,
617651 .firmware_name = "cdsp.mdt",
@@ -652,6 +686,7 @@ static const struct adsp_data sm8350_cdsp_resource = { · 34 unmodified lines
652686 .auto_boot = true,
653687 .proxy_pd_names = (char*[]){
654688 "cx",
689+ "mxc",
655690 NULL
656691 },
657692 .load_state = "cdsp",
@@ -804,6 +839,9 @@ static const struct of_device_id adsp_of_match[] = { · 146 unmodified lines
804839 { .compatible = "qcom,sdm845-adsp-pas", .data = &sdm845_adsp_resource_init},
805840 { .compatible = "qcom,sdm845-cdsp-pas", .data = &sdm845_cdsp_resource_init},
806841 { .compatible = "qcom,sdx55-mpss-pas", .data = &sdx55_mpss_resource},
842+ { .compatible = "qcom,sm6350-adsp-pas", .data = &sm6350_adsp_resource},
843+ { .compatible = "qcom,sm6350-cdsp-pas", .data = &sm6350_cdsp_resource},
844+ { .compatible = "qcom,sm6350-mpss-pas", .data = &mpss_resource_init},
807845 { .compatible = "qcom,sm8150-adsp-pas", .data = &sm8150_adsp_resource},
808846 { .compatible = "qcom,sm8150-cdsp-pas", .data = &sm8150_cdsp_resource},
809847 { .compatible = "qcom,sm8150-mpss-pas", .data = &mpss_resource_init},
drivers/remoteproc/rcar_rproc.c+224−0
@@ -0,0 +1,224 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * Copyright (C) IoT.bzh 2021
4+ */
5+
6+#include <linux/limits.h>
7+#include <linux/module.h>
8+#include <linux/of_device.h>
9+#include <linux/of_reserved_mem.h>
10+#include <linux/pm_runtime.h>
11+#include <linux/remoteproc.h>
12+#include <linux/reset.h>
13+#include <linux/soc/renesas/rcar-rst.h>
14+
15+#include "remoteproc_internal.h"
16+
17+struct rcar_rproc {
18+ struct reset_control *rst;
19+};
20+
21+static int rcar_rproc_mem_alloc(struct rproc *rproc,
22+ struct rproc_mem_entry *mem)
23+{
24+ struct device *dev = &rproc->dev;
25+ void *va;
26+
27+ dev_dbg(dev, "map memory: %pa+%zx\n", &mem->dma, mem->len);
28+ va = ioremap_wc(mem->dma, mem->len);
29+ if (!va) {
30+ dev_err(dev, "Unable to map memory region: %pa+%zx\n",
31+ &mem->dma, mem->len);
32+ return -ENOMEM;
33+ }
34+
35+ /* Update memory entry va */
36+ mem->va = va;
37+
38+ return 0;
39+}
40+
41+static int rcar_rproc_mem_release(struct rproc *rproc,
42+ struct rproc_mem_entry *mem)
43+{
44+ dev_dbg(&rproc->dev, "unmap memory: %pa\n", &mem->dma);
45+ iounmap(mem->va);
46+
47+ return 0;
48+}
49+
50+static int rcar_rproc_prepare(struct rproc *rproc)
51+{
52+ struct device *dev = rproc->dev.parent;
53+ struct device_node *np = dev->of_node;
54+ struct of_phandle_iterator it;
55+ struct rproc_mem_entry *mem;
56+ struct reserved_mem *rmem;
57+ u32 da;
58+
59+ /* Register associated reserved memory regions */
60+ of_phandle_iterator_init(&it, np, "memory-region", NULL, 0);
61+ while (of_phandle_iterator_next(&it) == 0) {
62+
63+ rmem = of_reserved_mem_lookup(it.node);
64+ if (!rmem) {
65+ dev_err(&rproc->dev,
66+ "unable to acquire memory-region\n");
67+ return -EINVAL;
68+ }
69+
70+ if (rmem->base > U32_MAX)
71+ return -EINVAL;
72+
73+ /* No need to translate pa to da, R-Car use same map */
74+ da = rmem->base;
75+ mem = rproc_mem_entry_init(dev, NULL,
76+ rmem->base,
77+ rmem->size, da,
78+ rcar_rproc_mem_alloc,
79+ rcar_rproc_mem_release,
80+ it.node->name);
81+
82+ if (!mem)
83+ return -ENOMEM;
84+
85+ rproc_add_carveout(rproc, mem);
86+ }
87+
88+ return 0;
89+}
90+
91+static int rcar_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
92+{
93+ int ret;
94+
95+ ret = rproc_elf_load_rsc_table(rproc, fw);
96+ if (ret)
97+ dev_info(&rproc->dev, "No resource table in elf\n");
98+
99+ return 0;
100+}
101+
102+static int rcar_rproc_start(struct rproc *rproc)
103+{
104+ struct rcar_rproc *priv = rproc->priv;
105+ int err;
106+
107+ if (!rproc->bootaddr)
108+ return -EINVAL;
109+
110+ err = rcar_rst_set_rproc_boot_addr(rproc->bootaddr);
111+ if (err) {
112+ dev_err(&rproc->dev, "failed to set rproc boot addr\n");
113+ return err;
114+ }
115+
116+ err = reset_control_deassert(priv->rst);
117+ if (err)
118+ dev_err(&rproc->dev, "failed to deassert reset\n");
119+
120+ return err;
121+}
122+
123+static int rcar_rproc_stop(struct rproc *rproc)
124+{
125+ struct rcar_rproc *priv = rproc->priv;
126+ int err;
127+
128+ err = reset_control_assert(priv->rst);
129+ if (err)
130+ dev_err(&rproc->dev, "failed to assert reset\n");
131+
132+ return err;
133+}
134+
135+static struct rproc_ops rcar_rproc_ops = {
136+ .prepare = rcar_rproc_prepare,
137+ .start = rcar_rproc_start,
138+ .stop = rcar_rproc_stop,
139+ .load = rproc_elf_load_segments,
140+ .parse_fw = rcar_rproc_parse_fw,
141+ .find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table,
142+ .sanity_check = rproc_elf_sanity_check,
143+ .get_boot_addr = rproc_elf_get_boot_addr,
144+
145+};
146+
147+static int rcar_rproc_probe(struct platform_device *pdev)
148+{
149+ struct device *dev = &pdev->dev;
150+ struct device_node *np = dev->of_node;
151+ struct rcar_rproc *priv;
152+ struct rproc *rproc;
153+ int ret;
154+
155+ rproc = devm_rproc_alloc(dev, np->name, &rcar_rproc_ops,
156+ NULL, sizeof(*priv));
157+ if (!rproc)
158+ return -ENOMEM;
159+
160+ priv = rproc->priv;
161+
162+ priv->rst = devm_reset_control_get_exclusive(dev, NULL);
163+ if (IS_ERR(priv->rst)) {
164+ ret = PTR_ERR(priv->rst);
165+ dev_err_probe(dev, ret, "fail to acquire rproc reset\n");
166+ return ret;
167+ }
168+
169+ pm_runtime_enable(dev);
170+ ret = pm_runtime_resume_and_get(dev);
171+ if (ret) {
172+ dev_err(dev, "failed to power up\n");
173+ return ret;
174+ }
175+
176+ dev_set_drvdata(dev, rproc);
177+
178+ /* Manually start the rproc */
179+ rproc->auto_boot = false;
180+
181+ ret = devm_rproc_add(dev, rproc);
182+ if (ret) {
183+ dev_err(dev, "rproc_add failed\n");
184+ goto pm_disable;
185+ }
186+
187+ return 0;
188+
189+pm_disable:
190+ pm_runtime_disable(dev);
191+
192+ return ret;
193+}
194+
195+static int rcar_rproc_remove(struct platform_device *pdev)
196+{
197+ struct device *dev = &pdev->dev;
198+
199+ pm_runtime_disable(dev);
200+
201+ return 0;
202+}
203+
204+static const struct of_device_id rcar_rproc_of_match[] = {
205+ { .compatible = "renesas,rcar-cr7" },
206+ {},
207+};
208+
209+MODULE_DEVICE_TABLE(of, rcar_rproc_of_match);
210+
211+static struct platform_driver rcar_rproc_driver = {
212+ .probe = rcar_rproc_probe,
213+ .remove = rcar_rproc_remove,
214+ .driver = {
215+ .name = "rcar-rproc",
216+ .of_match_table = rcar_rproc_of_match,
217+ },
218+};
219+
220+module_platform_driver(rcar_rproc_driver);
221+
222+MODULE_LICENSE("GPL v2");
223+MODULE_DESCRIPTION("Renesas R-Car Gen3 remote processor control driver");
224+MODULE_AUTHOR("Julien Massot <julien.massot@iot.bzh>");
drivers/remoteproc/remoteproc_core.c+2−2
@@ -577,8 +577,8 @@ static int rproc_handle_vdev(struct rproc *rproc, void *ptr, · 576 unmodified lines
577577 dma_get_mask(rproc->dev.parent));
578578 if (ret) {
579579 dev_warn(dev,
580− "Failed to set DMA mask %llx. Trying to continue... %x\n",
581− dma_get_mask(rproc->dev.parent), ret);
580+ "Failed to set DMA mask %llx. Trying to continue... (%pe)\n",
581+ dma_get_mask(rproc->dev.parent), ERR_PTR(ret));
582582 }
583583
584584 /* parse the vrings */
drivers/remoteproc/remoteproc_coredump.c+1−1
@@ -166,7 +166,7 @@ static void rproc_copy_segment(struct rproc *rproc, void *dest, · 165 unmodified lines
166166 memset(dest, 0xff, size);
167167 } else {
168168 if (is_iomem)
169− memcpy_fromio(dest, ptr, size);
169+ memcpy_fromio(dest, (void const __iomem *)ptr, size);
170170 else
171171 memcpy(dest, ptr, size);
172172 }
drivers/remoteproc/st_slim_rproc.c+1−1
@@ -216,7 +216,7 @@ static const struct rproc_ops slim_rproc_ops = { · 215 unmodified lines
216216 * obtains and enables any clocks required by the SLIM core and also
217217 * ioremaps the various IO.
218218 *
219− * Returns st_slim_rproc pointer or PTR_ERR() on error.
219+ * Return: st_slim_rproc pointer or PTR_ERR() on error.
220220 */
221221
222222 struct st_slim_rproc *st_slim_rproc_alloc(struct platform_device *pdev,
drivers/remoteproc/stm32_rproc.c+1−1
@@ -494,7 +494,7 @@ static int stm32_rproc_stop(struct rproc *rproc) · 493 unmodified lines
494494 int err, idx;
495495
496496 /* request shutdown of the remote processor */
497− if (rproc->state != RPROC_OFFLINE) {
497+ if (rproc->state != RPROC_OFFLINE && rproc->state != RPROC_CRASHED) {
498498 idx = stm32_rproc_mbox_idx(rproc, STM32_MBX_SHUTDOWN);
499499 if (idx >= 0 && ddata->mb[idx].chan) {
500500 err = mbox_send_message(ddata->mb[idx].chan, "detach");
drivers/remoteproc/ti_k3_dsp_remoteproc.c+1−0
@@ -767,6 +767,7 @@ static const struct k3_dsp_dev_data c71_data = { · 766 unmodified lines
767767 static const struct of_device_id k3_dsp_of_match[] = {
768768 { .compatible = "ti,j721e-c66-dsp", .data = &c66_data, },
769769 { .compatible = "ti,j721e-c71-dsp", .data = &c71_data, },
770+ { .compatible = "ti,j721s2-c71-dsp", .data = &c71_data, },
770771 { /* sentinel */ },
771772 };
772773 MODULE_DEVICE_TABLE(of, k3_dsp_of_match);
drivers/remoteproc/ti_k3_r5_remoteproc.c+3−2
@@ -1535,7 +1535,7 @@ static const struct k3_r5_soc_data am65_j721e_soc_data = { · 1534 unmodified lines
15351535 .single_cpu_mode = false,
15361536 };
15371537
1538−static const struct k3_r5_soc_data j7200_soc_data = {
1538+static const struct k3_r5_soc_data j7200_j721s2_soc_data = {
15391539 .tcm_is_double = true,
15401540 .tcm_ecc_autoinit = true,
15411541 .single_cpu_mode = false,
@@ -1550,8 +1550,9 @@ static const struct k3_r5_soc_data am64_soc_data = { · 8 unmodified lines
15501550 static const struct of_device_id k3_r5_of_match[] = {
15511551 { .compatible = "ti,am654-r5fss", .data = &am65_j721e_soc_data, },
15521552 { .compatible = "ti,j721e-r5fss", .data = &am65_j721e_soc_data, },
1553− { .compatible = "ti,j7200-r5fss", .data = &j7200_soc_data, },
1553+ { .compatible = "ti,j7200-r5fss", .data = &j7200_j721s2_soc_data, },
15541554 { .compatible = "ti,am64-r5fss", .data = &am64_soc_data, },
1555+ { .compatible = "ti,j721s2-r5fss", .data = &j7200_j721s2_soc_data, },
15551556 { /* sentinel */ },
15561557 };
15571558 MODULE_DEVICE_TABLE(of, k3_r5_of_match);