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
315S: Terni 05100315S: Terni 05100
316S: Italy316S: Italy
317 317
318N: Ohad Ben Cohen
319E: ohad@wizery.com
320D: Remote Processor (remoteproc) subsystem
321D: Remote Processor Messaging (rpmsg) subsystem
322
318N: Krzysztof Benedyczak323N: Krzysztof Benedyczak
319E: golbi@mat.uni.torun.pl324E: golbi@mat.uni.torun.pl
320W: http://www.mat.uni.torun.pl/~golbi325W: http://www.mat.uni.torun.pl/~golbi
Documentation/devicetree/bindings/remoteproc/qcom,adsp.yaml+28−0
@@ -33,6 +33,9 @@ properties: · 32 unmodified lines
33 - qcom,sdm845-adsp-pas33 - qcom,sdm845-adsp-pas
34 - qcom,sdm845-cdsp-pas34 - qcom,sdm845-cdsp-pas
35 - qcom,sdx55-mpss-pas35 - qcom,sdx55-mpss-pas
36 - qcom,sm6350-adsp-pas
37 - qcom,sm6350-cdsp-pas
38 - qcom,sm6350-mpss-pas
36 - qcom,sm8150-adsp-pas39 - qcom,sm8150-adsp-pas
37 - qcom,sm8150-cdsp-pas40 - qcom,sm8150-cdsp-pas
38 - qcom,sm8150-mpss-pas41 - qcom,sm8150-mpss-pas
@@ -158,6 +161,9 @@ allOf: · 119 unmodified lines
158 - qcom,sc8180x-mpss-pas161 - qcom,sc8180x-mpss-pas
159 - qcom,sdm845-adsp-pas162 - qcom,sdm845-adsp-pas
160 - qcom,sdm845-cdsp-pas163 - qcom,sdm845-cdsp-pas
164 - qcom,sm6350-adsp-pas
165 - qcom,sm6350-cdsp-pas
166 - qcom,sm6350-mpss-pas
161 - qcom,sm8150-adsp-pas167 - qcom,sm8150-adsp-pas
162 - qcom,sm8150-cdsp-pas168 - qcom,sm8150-cdsp-pas
163 - qcom,sm8150-mpss-pas169 - qcom,sm8150-mpss-pas
@@ -266,6 +272,8 @@ allOf: · 102 unmodified lines
266 - qcom,sc8180x-cdsp-pas272 - qcom,sc8180x-cdsp-pas
267 - qcom,sdm845-adsp-pas273 - qcom,sdm845-adsp-pas
268 - qcom,sdm845-cdsp-pas274 - qcom,sdm845-cdsp-pas
275 - qcom,sm6350-adsp-pas
276 - qcom,sm6350-cdsp-pas
269 - qcom,sm8150-adsp-pas277 - qcom,sm8150-adsp-pas
270 - qcom,sm8150-cdsp-pas278 - qcom,sm8150-cdsp-pas
271 - qcom,sm8150-slpi-pas279 - qcom,sm8150-slpi-pas
@@ -301,6 +309,7 @@ allOf: · 29 unmodified lines
301 - qcom,sc7280-mpss-pas309 - qcom,sc7280-mpss-pas
302 - qcom,sc8180x-mpss-pas310 - qcom,sc8180x-mpss-pas
303 - qcom,sdx55-mpss-pas311 - qcom,sdx55-mpss-pas
312 - qcom,sm6350-mpss-pas
304 - qcom,sm8150-mpss-pas313 - qcom,sm8150-mpss-pas
305 - qcom,sm8350-mpss-pas314 - qcom,sm8350-mpss-pas
306 then:315 then:
@@ -385,6 +394,23 @@ allOf: · 78 unmodified lines
385 - const: mx394 - const: mx
386 - const: mss395 - const: mss
387 396
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
388 - if:414 - if:
389 properties:415 properties:
390 compatible:416 compatible:
@@ -405,6 +431,7 @@ allOf: · 14 unmodified lines
405 enum:431 enum:
406 - qcom,sc7280-mpss-pas432 - qcom,sc7280-mpss-pas
407 - qcom,sdx55-mpss-pas433 - qcom,sdx55-mpss-pas
434 - qcom,sm6350-mpss-pas
408 - qcom,sm8150-mpss-pas435 - qcom,sm8150-mpss-pas
409 - qcom,sm8350-mpss-pas436 - qcom,sm8350-mpss-pas
410 then:437 then:
@@ -425,6 +452,7 @@ allOf: · 14 unmodified lines
425 enum:452 enum:
426 - qcom,sc8180x-adsp-pas453 - qcom,sc8180x-adsp-pas
427 - qcom,sc8180x-cdsp-pas454 - qcom,sc8180x-cdsp-pas
455 - qcom,sm6350-adsp-pas
428 - qcom,sm8150-slpi-pas456 - qcom,sm8150-slpi-pas
429 - qcom,sm8250-adsp-pas457 - qcom,sm8250-adsp-pas
430 - qcom,sm8250-slpi-pas458 - 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
7title: Renesas R-Car remote processor controller bindings
8
9maintainers:
10 - Julien Massot <julien.massot@iot.bzh>
11
12description: |
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
18properties:
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
36required:
37 - compatible
38 - resets
39 - memory-region
40 - power-domains
41
42additionalProperties: false
43
44examples:
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
33 enum:33 enum:
34 - ti,j721e-c66-dsp34 - ti,j721e-c66-dsp
35 - ti,j721e-c71-dsp35 - ti,j721e-c71-dsp
36 - ti,j721s2-c71-dsp
36 description:37 description:
37 Use "ti,j721e-c66-dsp" for C66x DSPs on K3 J721E SoCs38 Use "ti,j721e-c66-dsp" for C66x DSPs on K3 J721E SoCs
38 Use "ti,j721e-c71-dsp" for C71x DSPs on K3 J721E SoCs39 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
39 41
40 resets:42 resets:
41 description: |43 description: |
@@ -106,6 +108,7 @@ else: · 64 unmodified lines
106 compatible:108 compatible:
107 enum:109 enum:
108 - ti,j721e-c71-dsp110 - ti,j721e-c71-dsp
111 - ti,j721s2-c71-dsp
109 then:112 then:
110 properties:113 properties:
111 reg:114 reg:
Documentation/devicetree/bindings/remoteproc/ti,k3-r5f-rproc.yaml+5−3
@@ -38,6 +38,7 @@ properties: · 37 unmodified lines
38 - ti,j721e-r5fss38 - ti,j721e-r5fss
39 - ti,j7200-r5fss39 - ti,j7200-r5fss
40 - ti,am64-r5fss40 - ti,am64-r5fss
41 - ti,j721s2-r5fss
41 42
42 power-domains:43 power-domains:
43 description: |44 description: |
@@ -64,9 +65,9 @@ properties: · 20 unmodified lines
64 description: |65 description: |
65 Configuration Mode for the Dual R5F cores within the R5F cluster.66 Configuration Mode for the Dual R5F cores within the R5F cluster.
66 Should be either a value of 1 (LockStep mode) or 0 (Split mode) on67 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 most SoCs (AM65x, J721E, J7200, J721s2), default is LockStep mode if
68 and should be either a value of 0 (Split mode) or 2 (Single-CPU mode)69 omitted; and should be either a value of 0 (Split mode) or 2
69 on AM64x SoCs, default is Split mode if omitted.70 (Single-CPU mode) on AM64x SoCs, default is Split mode if omitted.
70 71
71# R5F Processor Child Nodes:72# R5F Processor Child Nodes:
72# ==========================73# ==========================
@@ -104,6 +105,7 @@ patternProperties: · 31 unmodified lines
104 - ti,j721e-r5f105 - ti,j721e-r5f
105 - ti,j7200-r5f106 - ti,j7200-r5f
106 - ti,am64-r5f107 - ti,am64-r5f
108 - ti,j721s2-r5f
107 109
108 reg:110 reg:
109 items:111 items:
MAINTAINERS+0−2
@@ -16400,7 +16400,6 @@ S: Supported · 16399 unmodified lines
16400F: fs/reiserfs/16400F: fs/reiserfs/
16401 16401
16402REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM16402REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM
16403M: Ohad Ben-Cohen <ohad@wizery.com>
16404M: Bjorn Andersson <bjorn.andersson@linaro.org>16403M: Bjorn Andersson <bjorn.andersson@linaro.org>
16405M: Mathieu Poirier <mathieu.poirier@linaro.org>16404M: Mathieu Poirier <mathieu.poirier@linaro.org>
16406L: linux-remoteproc@vger.kernel.org16405L: linux-remoteproc@vger.kernel.org
@@ -16414,7 +16413,6 @@ F: include/linux/remoteproc.h · 7 unmodified lines
16414F: include/linux/remoteproc/16413F: include/linux/remoteproc/
16415 16414
16416REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM16415REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM
16417M: Ohad Ben-Cohen <ohad@wizery.com>
16418M: Bjorn Andersson <bjorn.andersson@linaro.org>16416M: Bjorn Andersson <bjorn.andersson@linaro.org>
16419M: Mathieu Poirier <mathieu.poirier@linaro.org>16417M: Mathieu Poirier <mathieu.poirier@linaro.org>
16420L: linux-remoteproc@vger.kernel.org16418L: linux-remoteproc@vger.kernel.org
drivers/remoteproc/Kconfig+11−0
@@ -283,6 +283,17 @@ config QCOM_WCNSS_PIL · 282 unmodified lines
283 verified and booted with the help of the Peripheral Authentication283 verified and booted with the help of the Peripheral Authentication
284 System (PAS) in TrustZone.284 System (PAS) in TrustZone.
285 285
286config 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
286config ST_REMOTEPROC297config ST_REMOTEPROC
287 tristate "ST remoteproc support"298 tristate "ST remoteproc support"
288 depends on ARCH_STI299 depends on ARCH_STI
drivers/remoteproc/Makefile+1−0
@@ -32,6 +32,7 @@ obj-$(CONFIG_QCOM_SYSMON) += qcom_sysmon.o · 31 unmodified lines
32obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss_pil.o32obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss_pil.o
33qcom_wcnss_pil-y += qcom_wcnss.o33qcom_wcnss_pil-y += qcom_wcnss.o
34qcom_wcnss_pil-y += qcom_wcnss_iris.o34qcom_wcnss_pil-y += qcom_wcnss_iris.o
35obj-$(CONFIG_RCAR_REMOTEPROC) += rcar_rproc.o
35obj-$(CONFIG_ST_REMOTEPROC) += st_remoteproc.o36obj-$(CONFIG_ST_REMOTEPROC) += st_remoteproc.o
36obj-$(CONFIG_ST_SLIM_REMOTEPROC) += st_slim_rproc.o37obj-$(CONFIG_ST_SLIM_REMOTEPROC) += st_slim_rproc.o
37obj-$(CONFIG_STM32_RPROC) += stm32_rproc.o38obj-$(CONFIG_STM32_RPROC) += stm32_rproc.o
drivers/remoteproc/imx_rproc.c+6−3
@@ -34,7 +34,8 @@ · 33 unmodified lines
34 34
35#define IMX7D_M4_START (IMX7D_ENABLE_M4 | IMX7D_SW_M4P_RST \35#define IMX7D_M4_START (IMX7D_ENABLE_M4 | IMX7D_SW_M4P_RST \
36 | IMX7D_SW_M4C_RST)36 | IMX7D_SW_M4C_RST)
37#define IMX7D_M4_STOP IMX7D_SW_M4C_NON_SCLR_RST37#define IMX7D_M4_STOP (IMX7D_ENABLE_M4 | IMX7D_SW_M4C_RST | \
38 IMX7D_SW_M4C_NON_SCLR_RST)
38 39
39/* Address: 0x020D8000 */40/* Address: 0x020D8000 */
40#define IMX6SX_SRC_SCR 0x0041#define IMX6SX_SRC_SCR 0x00
@@ -45,7 +46,8 @@ · 4 unmodified lines
45 46
46#define IMX6SX_M4_START (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4P_RST \47#define IMX6SX_M4_START (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4P_RST \
47 | IMX6SX_SW_M4C_RST)48 | IMX6SX_SW_M4C_RST)
48#define IMX6SX_M4_STOP IMX6SX_SW_M4C_NON_SCLR_RST49#define IMX6SX_M4_STOP (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4C_RST | \
50 IMX6SX_SW_M4C_NON_SCLR_RST)
49#define IMX6SX_M4_RST_MASK (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4P_RST \51#define IMX6SX_M4_RST_MASK (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4P_RST \
50 | IMX6SX_SW_M4C_NON_SCLR_RST \52 | IMX6SX_SW_M4C_NON_SCLR_RST \
51 | IMX6SX_SW_M4C_RST)53 | IMX6SX_SW_M4C_RST)
@@ -684,7 +686,7 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv) · 632 unmodified lines
684 return ret;686 return ret;
685 }687 }
686 688
687 if (!(val & dcfg->src_stop))689 if ((val & dcfg->src_mask) != dcfg->src_stop)
688 priv->rproc->state = RPROC_DETACHED;690 priv->rproc->state = RPROC_DETACHED;
689 691
690 return 0;692 return 0;
@@ -804,6 +806,7 @@ static int imx_rproc_remove(struct platform_device *pdev) · 113 unmodified lines
804 clk_disable_unprepare(priv->clk);806 clk_disable_unprepare(priv->clk);
805 rproc_del(rproc);807 rproc_del(rproc);
806 imx_rproc_free_mbox(rproc);808 imx_rproc_free_mbox(rproc);
809 destroy_workqueue(priv->workqueue);
807 rproc_free(rproc);810 rproc_free(rproc);
808 811
809 return 0;812 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
218 if (vpu->irq < 0)218 if (vpu->irq < 0)
219 return vpu->irq;219 return vpu->irq;
220 220
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);
222 if (ret < 0) {223 if (ret < 0) {
223 dev_err(dev, "Failed to request IRQ\n");224 dev_err(dev, "Failed to request IRQ\n");
224 return ret;225 return ret;
225 }226 }
226 227
227 disable_irq(vpu->irq);
228
229 ret = devm_rproc_add(dev, rproc);228 ret = devm_rproc_add(dev, rproc);
230 if (ret) {229 if (ret) {
231 dev_err(dev, "Failed to register remote processor\n");230 dev_err(dev, "Failed to register remote processor\n");
drivers/remoteproc/mtk_scp_ipi.c+2−2
@@ -23,7 +23,7 @@ · 22 unmodified lines
23 *23 *
24 * Register an ipi function to receive ipi interrupt from SCP.24 * Register an ipi function to receive ipi interrupt from SCP.
25 *25 *
26 * Returns 0 if ipi registers successfully, -error on error.26 * Return: 0 if ipi registers successfully, -error on error.
27 */27 */
28int scp_ipi_register(struct mtk_scp *scp,28int scp_ipi_register(struct mtk_scp *scp,
29 u32 id,29 u32 id,
@@ -150,7 +150,7 @@ EXPORT_SYMBOL_GPL(scp_ipi_unlock); · 120 unmodified lines
150 * When the processing completes, IPI handler registered150 * When the processing completes, IPI handler registered
151 * by scp_ipi_register will be called in interrupt context.151 * by scp_ipi_register will be called in interrupt context.
152 *152 *
153 * Returns 0 if sending data successfully, -error on error.153 * Return: 0 if sending data successfully, -error on error.
154 **/154 **/
155int scp_ipi_send(struct mtk_scp *scp, u32 id, void *buf, unsigned int len,155int scp_ipi_send(struct mtk_scp *scp, u32 id, void *buf, unsigned int len,
156 unsigned int wait)156 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
104 return -ENOMEM;104 return -ENOMEM;
105 105
106found_unused:106found_unused:
107 memcpy_toio(entry, image, PIL_RELOC_NAME_LEN);107 memcpy_toio(entry, image, strnlen(image, PIL_RELOC_NAME_LEN));
108found_existing:108found_existing:
109 /* Use two writel() as base is only aligned to 4 bytes on odd entries */109 /* Use two writel() as base is only aligned to 4 bytes on odd entries */
110 writel(base, entry + PIL_RELOC_NAME_LEN);110 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
524 .ssctl_id = 0x14,524 .ssctl_id = 0x14,
525};525};
526 526
527static 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
527static const struct adsp_data sm8150_adsp_resource = {544static const struct adsp_data sm8150_adsp_resource = {
528 .crash_reason_smem = 423,545 .crash_reason_smem = 423,
529 .firmware_name = "adsp.mdt",546 .firmware_name = "adsp.mdt",
@@ -612,6 +629,23 @@ static const struct adsp_data sdm845_cdsp_resource_init = { · 82 unmodified lines
612 .ssctl_id = 0x17,629 .ssctl_id = 0x17,
613};630};
614 631
632static 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
615static const struct adsp_data sm8150_cdsp_resource = {649static const struct adsp_data sm8150_cdsp_resource = {
616 .crash_reason_smem = 601,650 .crash_reason_smem = 601,
617 .firmware_name = "cdsp.mdt",651 .firmware_name = "cdsp.mdt",
@@ -652,6 +686,7 @@ static const struct adsp_data sm8350_cdsp_resource = { · 34 unmodified lines
652 .auto_boot = true,686 .auto_boot = true,
653 .proxy_pd_names = (char*[]){687 .proxy_pd_names = (char*[]){
654 "cx",688 "cx",
689 "mxc",
655 NULL690 NULL
656 },691 },
657 .load_state = "cdsp",692 .load_state = "cdsp",
@@ -804,6 +839,9 @@ static const struct of_device_id adsp_of_match[] = { · 146 unmodified lines
804 { .compatible = "qcom,sdm845-adsp-pas", .data = &sdm845_adsp_resource_init},839 { .compatible = "qcom,sdm845-adsp-pas", .data = &sdm845_adsp_resource_init},
805 { .compatible = "qcom,sdm845-cdsp-pas", .data = &sdm845_cdsp_resource_init},840 { .compatible = "qcom,sdm845-cdsp-pas", .data = &sdm845_cdsp_resource_init},
806 { .compatible = "qcom,sdx55-mpss-pas", .data = &sdx55_mpss_resource},841 { .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},
807 { .compatible = "qcom,sm8150-adsp-pas", .data = &sm8150_adsp_resource},845 { .compatible = "qcom,sm8150-adsp-pas", .data = &sm8150_adsp_resource},
808 { .compatible = "qcom,sm8150-cdsp-pas", .data = &sm8150_cdsp_resource},846 { .compatible = "qcom,sm8150-cdsp-pas", .data = &sm8150_cdsp_resource},
809 { .compatible = "qcom,sm8150-mpss-pas", .data = &mpss_resource_init},847 { .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
17struct rcar_rproc {
18 struct reset_control *rst;
19};
20
21static 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
41static 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
50static 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
91static 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
102static 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
123static 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
135static 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
147static 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
189pm_disable:
190 pm_runtime_disable(dev);
191
192 return ret;
193}
194
195static 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
204static const struct of_device_id rcar_rproc_of_match[] = {
205 { .compatible = "renesas,rcar-cr7" },
206 {},
207};
208
209MODULE_DEVICE_TABLE(of, rcar_rproc_of_match);
210
211static 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
220module_platform_driver(rcar_rproc_driver);
221
222MODULE_LICENSE("GPL v2");
223MODULE_DESCRIPTION("Renesas R-Car Gen3 remote processor control driver");
224MODULE_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
577 dma_get_mask(rproc->dev.parent));577 dma_get_mask(rproc->dev.parent));
578 if (ret) {578 if (ret) {
579 dev_warn(dev,579 dev_warn(dev,
580 "Failed to set DMA mask %llx. Trying to continue... %x\n",580 "Failed to set DMA mask %llx. Trying to continue... (%pe)\n",
581 dma_get_mask(rproc->dev.parent), ret);581 dma_get_mask(rproc->dev.parent), ERR_PTR(ret));
582 }582 }
583 583
584 /* parse the vrings */584 /* 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
166 memset(dest, 0xff, size);166 memset(dest, 0xff, size);
167 } else {167 } else {
168 if (is_iomem)168 if (is_iomem)
169 memcpy_fromio(dest, ptr, size);169 memcpy_fromio(dest, (void const __iomem *)ptr, size);
170 else170 else
171 memcpy(dest, ptr, size);171 memcpy(dest, ptr, size);
172 }172 }
drivers/remoteproc/st_slim_rproc.c+1−1
@@ -216,7 +216,7 @@ static const struct rproc_ops slim_rproc_ops = { · 215 unmodified lines
216 * obtains and enables any clocks required by the SLIM core and also216 * obtains and enables any clocks required by the SLIM core and also
217 * ioremaps the various IO.217 * ioremaps the various IO.
218 *218 *
219 * Returns st_slim_rproc pointer or PTR_ERR() on error.219 * Return: st_slim_rproc pointer or PTR_ERR() on error.
220 */220 */
221 221
222struct st_slim_rproc *st_slim_rproc_alloc(struct platform_device *pdev,222struct 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
494 int err, idx;494 int err, idx;
495 495
496 /* request shutdown of the remote processor */496 /* request shutdown of the remote processor */
497 if (rproc->state != RPROC_OFFLINE) {497 if (rproc->state != RPROC_OFFLINE && rproc->state != RPROC_CRASHED) {
498 idx = stm32_rproc_mbox_idx(rproc, STM32_MBX_SHUTDOWN);498 idx = stm32_rproc_mbox_idx(rproc, STM32_MBX_SHUTDOWN);
499 if (idx >= 0 && ddata->mb[idx].chan) {499 if (idx >= 0 && ddata->mb[idx].chan) {
500 err = mbox_send_message(ddata->mb[idx].chan, "detach");500 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
767static const struct of_device_id k3_dsp_of_match[] = {767static const struct of_device_id k3_dsp_of_match[] = {
768 { .compatible = "ti,j721e-c66-dsp", .data = &c66_data, },768 { .compatible = "ti,j721e-c66-dsp", .data = &c66_data, },
769 { .compatible = "ti,j721e-c71-dsp", .data = &c71_data, },769 { .compatible = "ti,j721e-c71-dsp", .data = &c71_data, },
770 { .compatible = "ti,j721s2-c71-dsp", .data = &c71_data, },
770 { /* sentinel */ },771 { /* sentinel */ },
771};772};
772MODULE_DEVICE_TABLE(of, k3_dsp_of_match);773MODULE_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
1535 .single_cpu_mode = false,1535 .single_cpu_mode = false,
1536};1536};
1537 1537
1538static const struct k3_r5_soc_data j7200_soc_data = {1538static const struct k3_r5_soc_data j7200_j721s2_soc_data = {
1539 .tcm_is_double = true,1539 .tcm_is_double = true,
1540 .tcm_ecc_autoinit = true,1540 .tcm_ecc_autoinit = true,
1541 .single_cpu_mode = false,1541 .single_cpu_mode = false,
@@ -1550,8 +1550,9 @@ static const struct k3_r5_soc_data am64_soc_data = { · 8 unmodified lines
1550static const struct of_device_id k3_r5_of_match[] = {1550static const struct of_device_id k3_r5_of_match[] = {
1551 { .compatible = "ti,am654-r5fss", .data = &am65_j721e_soc_data, },1551 { .compatible = "ti,am654-r5fss", .data = &am65_j721e_soc_data, },
1552 { .compatible = "ti,j721e-r5fss", .data = &am65_j721e_soc_data, },1552 { .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, },
1554 { .compatible = "ti,am64-r5fss", .data = &am64_soc_data, },1554 { .compatible = "ti,am64-r5fss", .data = &am64_soc_data, },
1555 { .compatible = "ti,j721s2-r5fss", .data = &j7200_j721s2_soc_data, },
1555 { /* sentinel */ },1556 { /* sentinel */ },
1556};1557};
1557MODULE_DEVICE_TABLE(of, k3_r5_of_match);1558MODULE_DEVICE_TABLE(of, k3_r5_of_match);