Skip to content

Commit c35f902

Browse files
committed
Merge tag 'rproc-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux
Pull remoteproc updates from Bjorn Andersson: - Enable coredump support for the i.MX HiFi core remoteproc, and clean up the i.MX remoteproc driver. - Introduce remoteprocs on the Qualcomm Milos platform. Gracefully shut own the ADSP remoteproc when bootloader has loaded the "Lite" firmware on X Elite. Improve the resource handover procedure to avoid possibly duplicate handling. - Transition the TI DA8xx, TI Keystone, and TI Wakeup M3 remoteproc drivers to handle resources using devres. * tag 'rproc-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (29 commits) remoteproc: pru: Fix potential NULL pointer dereference in pru_rproc_set_ctable() remoteproc: qcom: pas: Drop redundant assignment to ret remoteproc: qcom: pas: Shutdown lite ADSP DTB on X1E remoteproc: qcom: q6v5: Avoid handling handover twice remoteproc: qcom: q6v5: Avoid disabling handover IRQ twice remoteproc: qcom: pas: Add Milos remoteproc support dt-bindings: remoteproc: qcom,milos-pas: Document remoteprocs remoteproc: qcom_q6v5_mss: support loading MBN file on msm8974 remoteproc: imx_rproc: Clean up after ops introduction remoteproc: imx_rproc: Simplify IMX_RPROC_SMC switch case remoteproc: imx_rproc: Simplify IMX_RPROC_SCU_API switch case remoteproc: imx_rproc: Simplify IMX_RPROC_MMIO switch case remoteproc: imx_rproc: Move imx_rproc_dcfg closer to imx_rproc_of_match remoteproc: imx_rproc: Introduce start/stop/detect_mode ops for imx_rproc_dcfg remoteproc: k3: Correctly release some resources allocated in k3_rproc_request_mbox() remoteproc: wkup_m3: Use devm_rproc_add() helper remoteproc: wkup_m3: Use devm_rproc_alloc() helper remoteproc: wkup_m3: Use devm action to call PM runtime put sync remoteproc: wkup_m3: Use devm_pm_runtime_enable() helper remoteproc: keystone: Use devm_rproc_add() helper ...
2 parents 54ba6d9 + d41e075 commit c35f902

File tree

14 files changed

+635
-364
lines changed

14 files changed

+635
-364
lines changed
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/remoteproc/qcom,milos-pas.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm Milos SoC Peripheral Authentication Service
8+
9+
maintainers:
10+
- Luca Weiss <[email protected]>
11+
12+
description:
13+
Qualcomm Milos SoC Peripheral Authentication Service loads and boots firmware
14+
on the Qualcomm DSP Hexagon cores.
15+
16+
properties:
17+
compatible:
18+
enum:
19+
- qcom,milos-adsp-pas
20+
- qcom,milos-cdsp-pas
21+
- qcom,milos-mpss-pas
22+
- qcom,milos-wpss-pas
23+
24+
reg:
25+
maxItems: 1
26+
27+
clocks:
28+
items:
29+
- description: XO clock
30+
31+
clock-names:
32+
items:
33+
- const: xo
34+
35+
interrupts:
36+
minItems: 6
37+
maxItems: 6
38+
39+
interrupt-names:
40+
minItems: 6
41+
maxItems: 6
42+
43+
qcom,qmp:
44+
$ref: /schemas/types.yaml#/definitions/phandle
45+
description: Reference to the AOSS side-channel message RAM.
46+
47+
smd-edge: false
48+
49+
firmware-name:
50+
minItems: 1
51+
items:
52+
- description: Firmware name of the Hexagon core
53+
- description: Firmware name of the Hexagon Devicetree
54+
55+
memory-region:
56+
minItems: 1
57+
items:
58+
- description: Memory region for core Firmware authentication
59+
- description: Memory region for Devicetree Firmware authentication
60+
61+
required:
62+
- compatible
63+
- reg
64+
- memory-region
65+
66+
allOf:
67+
- $ref: /schemas/remoteproc/qcom,pas-common.yaml#
68+
- if:
69+
properties:
70+
compatible:
71+
enum:
72+
- qcom,milos-adsp-pas
73+
- qcom,milos-cdsp-pas
74+
then:
75+
properties:
76+
memory-region:
77+
minItems: 2
78+
firmware-name:
79+
minItems: 2
80+
else:
81+
properties:
82+
memory-region:
83+
maxItems: 1
84+
firmware-name:
85+
maxItems: 1
86+
87+
- if:
88+
properties:
89+
compatible:
90+
contains:
91+
enum:
92+
- qcom,milos-adsp-pas
93+
then:
94+
properties:
95+
power-domains:
96+
items:
97+
- description: LCX power domain
98+
- description: LMX power domain
99+
power-domain-names:
100+
items:
101+
- const: lcx
102+
- const: lmx
103+
104+
- if:
105+
properties:
106+
compatible:
107+
enum:
108+
- qcom,milos-cdsp-pas
109+
- qcom,milos-wpss-pas
110+
then:
111+
properties:
112+
power-domains:
113+
items:
114+
- description: CX power domain
115+
- description: MX power domain
116+
power-domain-names:
117+
items:
118+
- const: cx
119+
- const: mx
120+
121+
- if:
122+
properties:
123+
compatible:
124+
enum:
125+
- qcom,milos-mpss-pas
126+
then:
127+
properties:
128+
power-domains:
129+
items:
130+
- description: CX power domain
131+
- description: MSS power domain
132+
power-domain-names:
133+
items:
134+
- const: cx
135+
- const: mss
136+
137+
unevaluatedProperties: false
138+
139+
examples:
140+
- |
141+
#include <dt-bindings/clock/qcom,rpmh.h>
142+
#include <dt-bindings/interconnect/qcom,icc.h>
143+
#include <dt-bindings/interconnect/qcom,milos-rpmh.h>
144+
#include <dt-bindings/interrupt-controller/irq.h>
145+
#include <dt-bindings/mailbox/qcom-ipcc.h>
146+
#include <dt-bindings/power/qcom,rpmhpd.h>
147+
148+
remoteproc@3000000 {
149+
compatible = "qcom,milos-adsp-pas";
150+
reg = <0x03000000 0x10000>;
151+
152+
interrupts-extended = <&pdc 6 IRQ_TYPE_EDGE_RISING>,
153+
<&smp2p_adsp_in 0 IRQ_TYPE_EDGE_RISING>,
154+
<&smp2p_adsp_in 1 IRQ_TYPE_EDGE_RISING>,
155+
<&smp2p_adsp_in 2 IRQ_TYPE_EDGE_RISING>,
156+
<&smp2p_adsp_in 3 IRQ_TYPE_EDGE_RISING>,
157+
<&smp2p_adsp_in 7 IRQ_TYPE_EDGE_RISING>;
158+
interrupt-names = "wdog",
159+
"fatal",
160+
"ready",
161+
"handover",
162+
"stop-ack",
163+
"shutdown-ack";
164+
165+
clocks = <&rpmhcc RPMH_CXO_CLK>;
166+
clock-names = "xo";
167+
168+
power-domains = <&rpmhpd RPMHPD_LCX>,
169+
<&rpmhpd RPMHPD_LMX>;
170+
power-domain-names = "lcx",
171+
"lmx";
172+
173+
interconnects = <&lpass_ag_noc MASTER_LPASS_PROC QCOM_ICC_TAG_ALWAYS
174+
&mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>;
175+
176+
memory-region = <&adspslpi_mem>, <&q6_adsp_dtb_mem>;
177+
178+
firmware-name = "qcom/milos/vendor/device/adsp.mbn",
179+
"qcom/milos/vendor/device/adsp_dtb.mbn";
180+
181+
qcom,qmp = <&aoss_qmp>;
182+
183+
qcom,smem-states = <&smp2p_adsp_out 0>;
184+
qcom,smem-state-names = "stop";
185+
186+
glink-edge {
187+
interrupts-extended = <&ipcc IPCC_CLIENT_LPASS
188+
IPCC_MPROC_SIGNAL_GLINK_QMP
189+
IRQ_TYPE_EDGE_RISING>;
190+
mboxes = <&ipcc IPCC_CLIENT_LPASS
191+
IPCC_MPROC_SIGNAL_GLINK_QMP>;
192+
193+
label = "lpass";
194+
qcom,remote-pid = <2>;
195+
196+
/* ... */
197+
};
198+
};

drivers/remoteproc/da8xx_remoteproc.c

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ static int da8xx_rproc_get_internal_memories(struct platform_device *pdev,
233233
return 0;
234234
}
235235

236+
static void da8xx_rproc_mem_release(void *data)
237+
{
238+
struct device *dev = data;
239+
240+
of_reserved_mem_device_release(dev);
241+
}
242+
236243
static int da8xx_rproc_probe(struct platform_device *pdev)
237244
{
238245
struct device *dev = &pdev->dev;
@@ -274,14 +281,13 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
274281
ret = of_reserved_mem_device_init(dev);
275282
if (ret)
276283
return dev_err_probe(dev, ret, "device does not have specific CMA pool\n");
284+
devm_add_action_or_reset(&pdev->dev, da8xx_rproc_mem_release, &pdev->dev);
277285
}
278286

279-
rproc = rproc_alloc(dev, "dsp", &da8xx_rproc_ops, da8xx_fw_name,
280-
sizeof(*drproc));
281-
if (!rproc) {
282-
ret = -ENOMEM;
283-
goto free_mem;
284-
}
287+
rproc = devm_rproc_alloc(dev, "dsp", &da8xx_rproc_ops, da8xx_fw_name,
288+
sizeof(*drproc));
289+
if (!rproc)
290+
return -ENOMEM;
285291

286292
/* error recovery is not supported at present */
287293
rproc->recovery_disabled = true;
@@ -294,17 +300,15 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
294300

295301
ret = da8xx_rproc_get_internal_memories(pdev, drproc);
296302
if (ret)
297-
goto free_rproc;
298-
299-
platform_set_drvdata(pdev, rproc);
303+
return ret;
300304

301305
/* everything the ISR needs is now setup, so hook it up */
302306
ret = devm_request_threaded_irq(dev, irq, da8xx_rproc_callback,
303307
handle_event, 0, "da8xx-remoteproc",
304308
rproc);
305309
if (ret) {
306310
dev_err(dev, "devm_request_threaded_irq error: %d\n", ret);
307-
goto free_rproc;
311+
return ret;
308312
}
309313

310314
/*
@@ -314,47 +318,21 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
314318
*/
315319
ret = reset_control_assert(dsp_reset);
316320
if (ret)
317-
goto free_rproc;
321+
return ret;
318322

319323
drproc->chipsig = chipsig;
320324
drproc->bootreg = bootreg;
321325
drproc->ack_fxn = irq_data->chip->irq_ack;
322326
drproc->irq_data = irq_data;
323327
drproc->irq = irq;
324328

325-
ret = rproc_add(rproc);
329+
ret = devm_rproc_add(dev, rproc);
326330
if (ret) {
327331
dev_err(dev, "rproc_add failed: %d\n", ret);
328-
goto free_rproc;
332+
return ret;
329333
}
330334

331335
return 0;
332-
333-
free_rproc:
334-
rproc_free(rproc);
335-
free_mem:
336-
if (dev->of_node)
337-
of_reserved_mem_device_release(dev);
338-
return ret;
339-
}
340-
341-
static void da8xx_rproc_remove(struct platform_device *pdev)
342-
{
343-
struct rproc *rproc = platform_get_drvdata(pdev);
344-
struct da8xx_rproc *drproc = rproc->priv;
345-
struct device *dev = &pdev->dev;
346-
347-
/*
348-
* The devm subsystem might end up releasing things before
349-
* freeing the irq, thus allowing an interrupt to sneak in while
350-
* the device is being removed. This should prevent that.
351-
*/
352-
disable_irq(drproc->irq);
353-
354-
rproc_del(rproc);
355-
rproc_free(rproc);
356-
if (dev->of_node)
357-
of_reserved_mem_device_release(dev);
358336
}
359337

360338
static const struct of_device_id davinci_rproc_of_match[] __maybe_unused = {
@@ -365,7 +343,6 @@ MODULE_DEVICE_TABLE(of, davinci_rproc_of_match);
365343

366344
static struct platform_driver da8xx_rproc_driver = {
367345
.probe = da8xx_rproc_probe,
368-
.remove = da8xx_rproc_remove,
369346
.driver = {
370347
.name = "davinci-rproc",
371348
.of_match_table = of_match_ptr(davinci_rproc_of_match),

0 commit comments

Comments
 (0)