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 ...
Unified · Split
| @@ -315,6 +315,11 @@ S: Via Delle Palme, 9 · 314 unmodified lines | ||
| 315 | 315 | S: Terni 05100 |
| 316 | 316 | S: Italy |
| 317 | 317 | |
| 318 | +N: Ohad Ben Cohen | |
| 319 | +E: ohad@wizery.com | |
| 320 | +D: Remote Processor (remoteproc) subsystem | |
| 321 | +D: Remote Processor Messaging (rpmsg) subsystem | |
| 322 | + | |
| 318 | 323 | N: Krzysztof Benedyczak |
| 319 | 324 | E: golbi@mat.uni.torun.pl |
| 320 | 325 | W: http://www.mat.uni.torun.pl/~golbi |
| @@ -33,6 +33,9 @@ properties: · 32 unmodified lines | ||
| 33 | 33 | - qcom,sdm845-adsp-pas |
| 34 | 34 | - qcom,sdm845-cdsp-pas |
| 35 | 35 | - qcom,sdx55-mpss-pas |
| 36 | + - qcom,sm6350-adsp-pas | |
| 37 | + - qcom,sm6350-cdsp-pas | |
| 38 | + - qcom,sm6350-mpss-pas | |
| 36 | 39 | - qcom,sm8150-adsp-pas |
| 37 | 40 | - qcom,sm8150-cdsp-pas |
| 38 | 41 | - qcom,sm8150-mpss-pas |
| @@ -158,6 +161,9 @@ allOf: · 119 unmodified lines | ||
| 158 | 161 | - qcom,sc8180x-mpss-pas |
| 159 | 162 | - qcom,sdm845-adsp-pas |
| 160 | 163 | - qcom,sdm845-cdsp-pas |
| 164 | + - qcom,sm6350-adsp-pas | |
| 165 | + - qcom,sm6350-cdsp-pas | |
| 166 | + - qcom,sm6350-mpss-pas | |
| 161 | 167 | - qcom,sm8150-adsp-pas |
| 162 | 168 | - qcom,sm8150-cdsp-pas |
| 163 | 169 | - qcom,sm8150-mpss-pas |
| @@ -266,6 +272,8 @@ allOf: · 102 unmodified lines | ||
| 266 | 272 | - qcom,sc8180x-cdsp-pas |
| 267 | 273 | - qcom,sdm845-adsp-pas |
| 268 | 274 | - qcom,sdm845-cdsp-pas |
| 275 | + - qcom,sm6350-adsp-pas | |
| 276 | + - qcom,sm6350-cdsp-pas | |
| 269 | 277 | - qcom,sm8150-adsp-pas |
| 270 | 278 | - qcom,sm8150-cdsp-pas |
| 271 | 279 | - qcom,sm8150-slpi-pas |
| @@ -301,6 +309,7 @@ allOf: · 29 unmodified lines | ||
| 301 | 309 | - qcom,sc7280-mpss-pas |
| 302 | 310 | - qcom,sc8180x-mpss-pas |
| 303 | 311 | - qcom,sdx55-mpss-pas |
| 312 | + - qcom,sm6350-mpss-pas | |
| 304 | 313 | - qcom,sm8150-mpss-pas |
| 305 | 314 | - qcom,sm8350-mpss-pas |
| 306 | 315 | then: |
| @@ -385,6 +394,23 @@ allOf: · 78 unmodified lines | ||
| 385 | 394 | - const: mx |
| 386 | 395 | - 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 | 414 | - if: |
| 389 | 415 | properties: |
| 390 | 416 | compatible: |
| @@ -405,6 +431,7 @@ allOf: · 14 unmodified lines | ||
| 405 | 431 | enum: |
| 406 | 432 | - qcom,sc7280-mpss-pas |
| 407 | 433 | - qcom,sdx55-mpss-pas |
| 434 | + - qcom,sm6350-mpss-pas | |
| 408 | 435 | - qcom,sm8150-mpss-pas |
| 409 | 436 | - qcom,sm8350-mpss-pas |
| 410 | 437 | then: |
| @@ -425,6 +452,7 @@ allOf: · 14 unmodified lines | ||
| 425 | 452 | enum: |
| 426 | 453 | - qcom,sc8180x-adsp-pas |
| 427 | 454 | - qcom,sc8180x-cdsp-pas |
| 455 | + - qcom,sm6350-adsp-pas | |
| 428 | 456 | - qcom,sm8150-slpi-pas |
| 429 | 457 | - qcom,sm8250-adsp-pas |
| 430 | 458 | - qcom,sm8250-slpi-pas |
| @@ -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 | +... | |
| @@ -33,9 +33,11 @@ properties: · 32 unmodified lines | ||
| 33 | 33 | enum: |
| 34 | 34 | - ti,j721e-c66-dsp |
| 35 | 35 | - ti,j721e-c71-dsp |
| 36 | + - ti,j721s2-c71-dsp | |
| 36 | 37 | description: |
| 37 | 38 | Use "ti,j721e-c66-dsp" for C66x DSPs on K3 J721E SoCs |
| 38 | 39 | 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 | 42 | resets: |
| 41 | 43 | description: | |
| @@ -106,6 +108,7 @@ else: · 64 unmodified lines | ||
| 106 | 108 | compatible: |
| 107 | 109 | enum: |
| 108 | 110 | - ti,j721e-c71-dsp |
| 111 | + - ti,j721s2-c71-dsp | |
| 109 | 112 | then: |
| 110 | 113 | properties: |
| 111 | 114 | reg: |
| @@ -38,6 +38,7 @@ properties: · 37 unmodified lines | ||
| 38 | 38 | - ti,j721e-r5fss |
| 39 | 39 | - ti,j7200-r5fss |
| 40 | 40 | - ti,am64-r5fss |
| 41 | + - ti,j721s2-r5fss | |
| 41 | 42 | |
| 42 | 43 | power-domains: |
| 43 | 44 | description: | |
| @@ -64,9 +65,9 @@ properties: · 20 unmodified lines | ||
| 64 | 65 | description: | |
| 65 | 66 | Configuration Mode for the Dual R5F cores within the R5F cluster. |
| 66 | 67 | 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. | |
| 70 | 71 | |
| 71 | 72 | # R5F Processor Child Nodes: |
| 72 | 73 | # ========================== |
| @@ -104,6 +105,7 @@ patternProperties: · 31 unmodified lines | ||
| 104 | 105 | - ti,j721e-r5f |
| 105 | 106 | - ti,j7200-r5f |
| 106 | 107 | - ti,am64-r5f |
| 108 | + - ti,j721s2-r5f | |
| 107 | 109 | |
| 108 | 110 | reg: |
| 109 | 111 | items: |
| @@ -16400,7 +16400,6 @@ S: Supported · 16399 unmodified lines | ||
| 16400 | 16400 | F: fs/reiserfs/ |
| 16401 | 16401 | |
| 16402 | 16402 | REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM |
| 16403 | −M: Ohad Ben-Cohen <ohad@wizery.com> | |
| 16404 | 16403 | M: Bjorn Andersson <bjorn.andersson@linaro.org> |
| 16405 | 16404 | M: Mathieu Poirier <mathieu.poirier@linaro.org> |
| 16406 | 16405 | L: linux-remoteproc@vger.kernel.org |
| @@ -16414,7 +16413,6 @@ F: include/linux/remoteproc.h · 7 unmodified lines | ||
| 16414 | 16413 | F: include/linux/remoteproc/ |
| 16415 | 16414 | |
| 16416 | 16415 | REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM |
| 16417 | −M: Ohad Ben-Cohen <ohad@wizery.com> | |
| 16418 | 16416 | M: Bjorn Andersson <bjorn.andersson@linaro.org> |
| 16419 | 16417 | M: Mathieu Poirier <mathieu.poirier@linaro.org> |
| 16420 | 16418 | L: linux-remoteproc@vger.kernel.org |
| @@ -283,6 +283,17 @@ config QCOM_WCNSS_PIL · 282 unmodified lines | ||
| 283 | 283 | verified and booted with the help of the Peripheral Authentication |
| 284 | 284 | System (PAS) in TrustZone. |
| 285 | 285 | |
| 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 | + | |
| 286 | 297 | config ST_REMOTEPROC |
| 287 | 298 | tristate "ST remoteproc support" |
| 288 | 299 | depends on ARCH_STI |
| @@ -32,6 +32,7 @@ obj-$(CONFIG_QCOM_SYSMON) += qcom_sysmon.o · 31 unmodified lines | ||
| 32 | 32 | obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss_pil.o |
| 33 | 33 | qcom_wcnss_pil-y += qcom_wcnss.o |
| 34 | 34 | qcom_wcnss_pil-y += qcom_wcnss_iris.o |
| 35 | +obj-$(CONFIG_RCAR_REMOTEPROC) += rcar_rproc.o | |
| 35 | 36 | obj-$(CONFIG_ST_REMOTEPROC) += st_remoteproc.o |
| 36 | 37 | obj-$(CONFIG_ST_SLIM_REMOTEPROC) += st_slim_rproc.o |
| 37 | 38 | obj-$(CONFIG_STM32_RPROC) += stm32_rproc.o |
| @@ -34,7 +34,8 @@ · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | #define IMX7D_M4_START (IMX7D_ENABLE_M4 | IMX7D_SW_M4P_RST \ |
| 36 | 36 | | 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) | |
| 38 | 39 | |
| 39 | 40 | /* Address: 0x020D8000 */ |
| 40 | 41 | #define IMX6SX_SRC_SCR 0x00 |
| @@ -45,7 +46,8 @@ · 4 unmodified lines | ||
| 45 | 46 | |
| 46 | 47 | #define IMX6SX_M4_START (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4P_RST \ |
| 47 | 48 | | 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) | |
| 49 | 51 | #define IMX6SX_M4_RST_MASK (IMX6SX_ENABLE_M4 | IMX6SX_SW_M4P_RST \ |
| 50 | 52 | | IMX6SX_SW_M4C_NON_SCLR_RST \ |
| 51 | 53 | | IMX6SX_SW_M4C_RST) |
| @@ -684,7 +686,7 @@ static int imx_rproc_detect_mode(struct imx_rproc *priv) · 632 unmodified lines | ||
| 684 | 686 | return ret; |
| 685 | 687 | } |
| 686 | 688 | |
| 687 | − if (!(val & dcfg->src_stop)) | |
| 689 | + if ((val & dcfg->src_mask) != dcfg->src_stop) | |
| 688 | 690 | priv->rproc->state = RPROC_DETACHED; |
| 689 | 691 | |
| 690 | 692 | return 0; |
| @@ -804,6 +806,7 @@ static int imx_rproc_remove(struct platform_device *pdev) · 113 unmodified lines | ||
| 804 | 806 | clk_disable_unprepare(priv->clk); |
| 805 | 807 | rproc_del(rproc); |
| 806 | 808 | imx_rproc_free_mbox(rproc); |
| 809 | + destroy_workqueue(priv->workqueue); | |
| 807 | 810 | rproc_free(rproc); |
| 808 | 811 | |
| 809 | 812 | return 0; |
| @@ -218,14 +218,13 @@ static int ingenic_rproc_probe(struct platform_device *pdev) · 217 unmodified lines | ||
| 218 | 218 | if (vpu->irq < 0) |
| 219 | 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 | 223 | if (ret < 0) { |
| 223 | 224 | dev_err(dev, "Failed to request IRQ\n"); |
| 224 | 225 | return ret; |
| 225 | 226 | } |
| 226 | 227 | |
| 227 | − disable_irq(vpu->irq); | |
| 228 | − | |
| 229 | 228 | ret = devm_rproc_add(dev, rproc); |
| 230 | 229 | if (ret) { |
| 231 | 230 | dev_err(dev, "Failed to register remote processor\n"); |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | * |
| 24 | 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 | */ |
| 28 | 28 | int scp_ipi_register(struct mtk_scp *scp, |
| 29 | 29 | u32 id, |
| @@ -150,7 +150,7 @@ EXPORT_SYMBOL_GPL(scp_ipi_unlock); · 120 unmodified lines | ||
| 150 | 150 | * When the processing completes, IPI handler registered |
| 151 | 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 | **/ |
| 155 | 155 | int scp_ipi_send(struct mtk_scp *scp, u32 id, void *buf, unsigned int len, |
| 156 | 156 | unsigned int wait) |
| @@ -104,7 +104,7 @@ int qcom_pil_info_store(const char *image, phys_addr_t base, size_t size) · 103 unmodified lines | ||
| 104 | 104 | return -ENOMEM; |
| 105 | 105 | |
| 106 | 106 | found_unused: |
| 107 | − memcpy_toio(entry, image, PIL_RELOC_NAME_LEN); | |
| 107 | + memcpy_toio(entry, image, strnlen(image, PIL_RELOC_NAME_LEN)); | |
| 108 | 108 | found_existing: |
| 109 | 109 | /* Use two writel() as base is only aligned to 4 bytes on odd entries */ |
| 110 | 110 | writel(base, entry + PIL_RELOC_NAME_LEN); |
| @@ -524,6 +524,23 @@ static const struct adsp_data sdm845_adsp_resource_init = { · 523 unmodified lines | ||
| 524 | 524 | .ssctl_id = 0x14, |
| 525 | 525 | }; |
| 526 | 526 | |
| 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 | + | |
| 527 | 544 | static const struct adsp_data sm8150_adsp_resource = { |
| 528 | 545 | .crash_reason_smem = 423, |
| 529 | 546 | .firmware_name = "adsp.mdt", |
| @@ -612,6 +629,23 @@ static const struct adsp_data sdm845_cdsp_resource_init = { · 82 unmodified lines | ||
| 612 | 629 | .ssctl_id = 0x17, |
| 613 | 630 | }; |
| 614 | 631 | |
| 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 | + | |
| 615 | 649 | static const struct adsp_data sm8150_cdsp_resource = { |
| 616 | 650 | .crash_reason_smem = 601, |
| 617 | 651 | .firmware_name = "cdsp.mdt", |
| @@ -652,6 +686,7 @@ static const struct adsp_data sm8350_cdsp_resource = { · 34 unmodified lines | ||
| 652 | 686 | .auto_boot = true, |
| 653 | 687 | .proxy_pd_names = (char*[]){ |
| 654 | 688 | "cx", |
| 689 | + "mxc", | |
| 655 | 690 | NULL |
| 656 | 691 | }, |
| 657 | 692 | .load_state = "cdsp", |
| @@ -804,6 +839,9 @@ static const struct of_device_id adsp_of_match[] = { · 146 unmodified lines | ||
| 804 | 839 | { .compatible = "qcom,sdm845-adsp-pas", .data = &sdm845_adsp_resource_init}, |
| 805 | 840 | { .compatible = "qcom,sdm845-cdsp-pas", .data = &sdm845_cdsp_resource_init}, |
| 806 | 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 | 845 | { .compatible = "qcom,sm8150-adsp-pas", .data = &sm8150_adsp_resource}, |
| 808 | 846 | { .compatible = "qcom,sm8150-cdsp-pas", .data = &sm8150_cdsp_resource}, |
| 809 | 847 | { .compatible = "qcom,sm8150-mpss-pas", .data = &mpss_resource_init}, |
| @@ -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>"); | |
| @@ -577,8 +577,8 @@ static int rproc_handle_vdev(struct rproc *rproc, void *ptr, · 576 unmodified lines | ||
| 577 | 577 | dma_get_mask(rproc->dev.parent)); |
| 578 | 578 | if (ret) { |
| 579 | 579 | 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)); | |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | /* parse the vrings */ |
| @@ -166,7 +166,7 @@ static void rproc_copy_segment(struct rproc *rproc, void *dest, · 165 unmodified lines | ||
| 166 | 166 | memset(dest, 0xff, size); |
| 167 | 167 | } else { |
| 168 | 168 | if (is_iomem) |
| 169 | − memcpy_fromio(dest, ptr, size); | |
| 169 | + memcpy_fromio(dest, (void const __iomem *)ptr, size); | |
| 170 | 170 | else |
| 171 | 171 | memcpy(dest, ptr, size); |
| 172 | 172 | } |
| @@ -216,7 +216,7 @@ static const struct rproc_ops slim_rproc_ops = { · 215 unmodified lines | ||
| 216 | 216 | * obtains and enables any clocks required by the SLIM core and also |
| 217 | 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 | |
| 222 | 222 | struct st_slim_rproc *st_slim_rproc_alloc(struct platform_device *pdev, |
| @@ -494,7 +494,7 @@ static int stm32_rproc_stop(struct rproc *rproc) · 493 unmodified lines | ||
| 494 | 494 | int err, idx; |
| 495 | 495 | |
| 496 | 496 | /* request shutdown of the remote processor */ |
| 497 | − if (rproc->state != RPROC_OFFLINE) { | |
| 497 | + if (rproc->state != RPROC_OFFLINE && rproc->state != RPROC_CRASHED) { | |
| 498 | 498 | idx = stm32_rproc_mbox_idx(rproc, STM32_MBX_SHUTDOWN); |
| 499 | 499 | if (idx >= 0 && ddata->mb[idx].chan) { |
| 500 | 500 | err = mbox_send_message(ddata->mb[idx].chan, "detach"); |
| @@ -767,6 +767,7 @@ static const struct k3_dsp_dev_data c71_data = { · 766 unmodified lines | ||
| 767 | 767 | static const struct of_device_id k3_dsp_of_match[] = { |
| 768 | 768 | { .compatible = "ti,j721e-c66-dsp", .data = &c66_data, }, |
| 769 | 769 | { .compatible = "ti,j721e-c71-dsp", .data = &c71_data, }, |
| 770 | + { .compatible = "ti,j721s2-c71-dsp", .data = &c71_data, }, | |
| 770 | 771 | { /* sentinel */ }, |
| 771 | 772 | }; |
| 772 | 773 | MODULE_DEVICE_TABLE(of, k3_dsp_of_match); |
| @@ -1535,7 +1535,7 @@ static const struct k3_r5_soc_data am65_j721e_soc_data = { · 1534 unmodified lines | ||
| 1535 | 1535 | .single_cpu_mode = false, |
| 1536 | 1536 | }; |
| 1537 | 1537 | |
| 1538 | −static const struct k3_r5_soc_data j7200_soc_data = { | |
| 1538 | +static const struct k3_r5_soc_data j7200_j721s2_soc_data = { | |
| 1539 | 1539 | .tcm_is_double = true, |
| 1540 | 1540 | .tcm_ecc_autoinit = true, |
| 1541 | 1541 | .single_cpu_mode = false, |
| @@ -1550,8 +1550,9 @@ static const struct k3_r5_soc_data am64_soc_data = { · 8 unmodified lines | ||
| 1550 | 1550 | static const struct of_device_id k3_r5_of_match[] = { |
| 1551 | 1551 | { .compatible = "ti,am654-r5fss", .data = &am65_j721e_soc_data, }, |
| 1552 | 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 | 1554 | { .compatible = "ti,am64-r5fss", .data = &am64_soc_data, }, |
| 1555 | + { .compatible = "ti,j721s2-r5fss", .data = &j7200_j721s2_soc_data, }, | |
| 1555 | 1556 | { /* sentinel */ }, |
| 1556 | 1557 | }; |
| 1557 | 1558 | MODULE_DEVICE_TABLE(of, k3_r5_of_match); |