|
21 | 21 | #include "ti_sci_proc.h"
|
22 | 22 | #include "ti_k3_common.h"
|
23 | 23 |
|
| 24 | +/* Release the M4 remote processor from reset */ |
| 25 | +static int k3_m4_rproc_release(struct k3_rproc *kproc) |
| 26 | +{ |
| 27 | + struct device *dev = kproc->dev; |
| 28 | + int ret; |
| 29 | + |
| 30 | + if (kproc->data->uses_lreset) { |
| 31 | + ret = reset_control_deassert(kproc->reset); |
| 32 | + if (ret) { |
| 33 | + dev_err(dev, "local-reset deassert failed, ret = %d\n", ret); |
| 34 | + if (kproc->ti_sci->ops.dev_ops.put_device(kproc->ti_sci, |
| 35 | + kproc->ti_sci_id)) |
| 36 | + dev_warn(dev, "module-reset assert back failed\n"); |
| 37 | + } |
| 38 | + } else { |
| 39 | + ret = kproc->ti_sci->ops.dev_ops.get_device(kproc->ti_sci, |
| 40 | + kproc->ti_sci_id); |
| 41 | + if (ret) |
| 42 | + dev_err(dev, "module-reset deassert failed, ret = %d\n", ret); |
| 43 | + } |
| 44 | + |
| 45 | + return ret; |
| 46 | +} |
| 47 | + |
24 | 48 | static int k3_m4_rproc_ping_mbox(struct k3_rproc *kproc)
|
25 | 49 | {
|
26 | 50 | struct device *dev = kproc->dev;
|
@@ -347,20 +371,15 @@ static void k3_m4_release_tsp(void *data)
|
347 | 371 | static int k3_m4_rproc_start(struct rproc *rproc)
|
348 | 372 | {
|
349 | 373 | struct k3_rproc *kproc = rproc->priv;
|
350 |
| - struct device *dev = kproc->dev; |
351 | 374 | int ret;
|
352 | 375 |
|
353 | 376 | ret = k3_m4_rproc_ping_mbox(kproc);
|
354 | 377 | if (ret)
|
355 | 378 | return ret;
|
356 | 379 |
|
357 |
| - ret = reset_control_deassert(kproc->reset); |
358 |
| - if (ret) { |
359 |
| - dev_err(dev, "local-reset deassert failed, ret = %d\n", ret); |
360 |
| - return ret; |
361 |
| - } |
| 380 | + ret = k3_m4_rproc_release(kproc); |
362 | 381 |
|
363 |
| - return 0; |
| 382 | + return ret; |
364 | 383 | }
|
365 | 384 |
|
366 | 385 | /*
|
|
0 commit comments