Lines Matching full:rproc

73  * struct omap_rproc_timer - data structure for a timer used by a omap rproc
91 * @num_timers: number of rproc timer(s)
92 * @num_wd_timers: number of rproc watchdog timers
93 * @timers: timer(s) info used by rproc
96 * @rproc: rproc handle
113 struct rproc *rproc; member
181 * @timer: handle to a OMAP rproc timer
197 * @timer: handle to a OMAP rproc timer
214 * @timer: handle to a OMAP rproc timer
229 * @timer: handle to a OMAP rproc timer
244 * @timer: handle to a OMAP rproc timer
262 * timers associated with a rproc (like IPUs which have 2 watchdog timers,
273 struct rproc *rproc = data; in omap_rproc_watchdog_isr() local
274 struct omap_rproc *oproc = rproc->priv; in omap_rproc_watchdog_isr()
275 struct device *dev = rproc->dev.parent; in omap_rproc_watchdog_isr()
295 rproc_report_crash(rproc, RPROC_WATCHDOG); in omap_rproc_watchdog_isr()
302 * @rproc: handle of a remote processor
312 static int omap_rproc_enable_timers(struct rproc *rproc, bool configure) in omap_rproc_enable_timers() argument
319 struct omap_rproc *oproc = rproc->priv; in omap_rproc_enable_timers()
321 struct device *dev = rproc->dev.parent; in omap_rproc_enable_timers()
393 "rproc-wdt", rproc); in omap_rproc_enable_timers()
430 free_irq(timers[i].irq, rproc); in omap_rproc_enable_timers()
442 * @rproc: handle of a remote processor
452 static int omap_rproc_disable_timers(struct rproc *rproc, bool configure) in omap_rproc_disable_timers() argument
455 struct omap_rproc *oproc = rproc->priv; in omap_rproc_disable_timers()
466 free_irq(timers[i].irq, rproc); in omap_rproc_disable_timers()
495 struct device *dev = oproc->rproc->dev.parent; in omap_rproc_mbox_callback()
496 const char *name = oproc->rproc->name; in omap_rproc_mbox_callback()
504 * remoteproc detected an exception, notify the rproc core. in omap_rproc_mbox_callback()
507 dev_err(dev, "omap rproc %s crashed\n", name); in omap_rproc_mbox_callback()
508 rproc_report_crash(oproc->rproc, RPROC_FATAL_ERROR); in omap_rproc_mbox_callback()
521 if (msg > oproc->rproc->max_notifyid) { in omap_rproc_mbox_callback()
526 if (rproc_vq_interrupt(oproc->rproc, msg) == IRQ_NONE) in omap_rproc_mbox_callback()
532 static void omap_rproc_kick(struct rproc *rproc, int vqid) in omap_rproc_kick() argument
534 struct omap_rproc *oproc = rproc->priv; in omap_rproc_kick()
535 struct device *dev = rproc->dev.parent; in omap_rproc_kick()
538 /* wake up the rproc before kicking it */ in omap_rproc_kick()
559 * @rproc: handle of a remote processor
565 static int omap_rproc_write_dsp_boot_addr(struct rproc *rproc) in omap_rproc_write_dsp_boot_addr() argument
567 struct device *dev = rproc->dev.parent; in omap_rproc_write_dsp_boot_addr()
568 struct omap_rproc *oproc = rproc->priv; in omap_rproc_write_dsp_boot_addr()
574 if (rproc->bootaddr & (SZ_1K - 1)) { in omap_rproc_write_dsp_boot_addr()
576 rproc->bootaddr); in omap_rproc_write_dsp_boot_addr()
580 value = rproc->bootaddr >> bdata->boot_reg_shift; in omap_rproc_write_dsp_boot_addr()
589 * This function will be invoked only after the firmware for this rproc
593 static int omap_rproc_start(struct rproc *rproc) in omap_rproc_start() argument
595 struct omap_rproc *oproc = rproc->priv; in omap_rproc_start()
596 struct device *dev = rproc->dev.parent; in omap_rproc_start()
601 ret = omap_rproc_write_dsp_boot_addr(rproc); in omap_rproc_start()
633 ret = omap_rproc_enable_timers(rproc, true); in omap_rproc_start()
660 omap_rproc_disable_timers(rproc, true); in omap_rproc_start()
667 static int omap_rproc_stop(struct rproc *rproc) in omap_rproc_stop() argument
669 struct device *dev = rproc->dev.parent; in omap_rproc_stop()
670 struct omap_rproc *oproc = rproc->priv; in omap_rproc_stop()
691 ret = omap_rproc_disable_timers(rproc, true); in omap_rproc_stop()
719 * @rproc: remote processor to apply the address translation for
723 * Custom function implementing the rproc .da_to_va ops to provide address
731 static void *omap_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len) in omap_rproc_da_to_va() argument
733 struct omap_rproc *oproc = rproc->priv; in omap_rproc_da_to_va()
771 static int _omap_rproc_suspend(struct rproc *rproc, bool auto_suspend) in _omap_rproc_suspend() argument
773 struct device *dev = rproc->dev.parent; in _omap_rproc_suspend()
774 struct omap_rproc *oproc = rproc->priv; in _omap_rproc_suspend()
820 ret = omap_rproc_disable_timers(rproc, false); in _omap_rproc_suspend()
833 ret = omap_iommu_domain_deactivate(rproc->domain); in _omap_rproc_suspend()
845 omap_rproc_enable_timers(rproc, false); in _omap_rproc_suspend()
851 static int _omap_rproc_resume(struct rproc *rproc, bool auto_suspend) in _omap_rproc_resume() argument
853 struct device *dev = rproc->dev.parent; in _omap_rproc_resume()
854 struct omap_rproc *oproc = rproc->priv; in _omap_rproc_resume()
863 ret = omap_iommu_domain_activate(rproc->domain); in _omap_rproc_resume()
872 ret = omap_rproc_write_dsp_boot_addr(rproc); in _omap_rproc_resume()
879 ret = omap_rproc_enable_timers(rproc, false); in _omap_rproc_resume()
894 omap_rproc_disable_timers(rproc, false); in _omap_rproc_resume()
897 omap_iommu_domain_deactivate(rproc->domain); in _omap_rproc_resume()
905 struct rproc *rproc = platform_get_drvdata(pdev); in omap_rproc_suspend() local
906 struct omap_rproc *oproc = rproc->priv; in omap_rproc_suspend()
909 mutex_lock(&rproc->lock); in omap_rproc_suspend()
910 if (rproc->state == RPROC_OFFLINE) in omap_rproc_suspend()
913 if (rproc->state == RPROC_SUSPENDED) in omap_rproc_suspend()
916 if (rproc->state != RPROC_RUNNING) { in omap_rproc_suspend()
921 ret = _omap_rproc_suspend(rproc, false); in omap_rproc_suspend()
932 rproc->state = RPROC_SUSPENDED; in omap_rproc_suspend()
935 mutex_unlock(&rproc->lock); in omap_rproc_suspend()
942 struct rproc *rproc = platform_get_drvdata(pdev); in omap_rproc_resume() local
943 struct omap_rproc *oproc = rproc->priv; in omap_rproc_resume()
946 mutex_lock(&rproc->lock); in omap_rproc_resume()
947 if (rproc->state == RPROC_OFFLINE) in omap_rproc_resume()
950 if (rproc->state != RPROC_SUSPENDED) { in omap_rproc_resume()
963 ret = _omap_rproc_resume(rproc, false); in omap_rproc_resume()
970 rproc->state = RPROC_RUNNING; in omap_rproc_resume()
974 mutex_unlock(&rproc->lock); in omap_rproc_resume()
980 struct rproc *rproc = dev_get_drvdata(dev); in omap_rproc_runtime_suspend() local
981 struct omap_rproc *oproc = rproc->priv; in omap_rproc_runtime_suspend()
984 mutex_lock(&rproc->lock); in omap_rproc_runtime_suspend()
985 if (rproc->state == RPROC_CRASHED) { in omap_rproc_runtime_suspend()
986 dev_dbg(dev, "rproc cannot be runtime suspended when crashed!\n"); in omap_rproc_runtime_suspend()
991 if (WARN_ON(rproc->state != RPROC_RUNNING)) { in omap_rproc_runtime_suspend()
992 dev_err(dev, "rproc cannot be runtime suspended when not running!\n"); in omap_rproc_runtime_suspend()
1006 ret = _omap_rproc_suspend(rproc, true); in omap_rproc_runtime_suspend()
1010 rproc->state = RPROC_SUSPENDED; in omap_rproc_runtime_suspend()
1011 mutex_unlock(&rproc->lock); in omap_rproc_runtime_suspend()
1017 mutex_unlock(&rproc->lock); in omap_rproc_runtime_suspend()
1023 struct rproc *rproc = dev_get_drvdata(dev); in omap_rproc_runtime_resume() local
1026 mutex_lock(&rproc->lock); in omap_rproc_runtime_resume()
1027 if (WARN_ON(rproc->state != RPROC_SUSPENDED)) { in omap_rproc_runtime_resume()
1028 dev_err(dev, "rproc cannot be runtime resumed if not suspended! state=%d\n", in omap_rproc_runtime_resume()
1029 rproc->state); in omap_rproc_runtime_resume()
1034 ret = _omap_rproc_resume(rproc, true); in omap_rproc_runtime_resume()
1040 rproc->state = RPROC_RUNNING; in omap_rproc_runtime_resume()
1042 mutex_unlock(&rproc->lock); in omap_rproc_runtime_resume()
1132 struct rproc *rproc) in omap_rproc_get_boot_data() argument
1135 struct omap_rproc *oproc = rproc->priv; in omap_rproc_get_boot_data()
1171 struct rproc *rproc) in omap_rproc_of_get_internal_memories() argument
1173 struct omap_rproc *oproc = rproc->priv; in omap_rproc_of_get_internal_memories()
1246 struct rproc *rproc) in omap_rproc_of_get_timers() argument
1249 struct omap_rproc *oproc = rproc->priv; in omap_rproc_of_get_timers()
1285 struct rproc *rproc; in omap_rproc_probe() local
1309 rproc = rproc_alloc(&pdev->dev, dev_name(&pdev->dev), &omap_rproc_ops, in omap_rproc_probe()
1311 if (!rproc) in omap_rproc_probe()
1314 oproc = rproc->priv; in omap_rproc_probe()
1315 oproc->rproc = rproc; in omap_rproc_probe()
1318 rproc->has_iommu = true; in omap_rproc_probe()
1320 ret = omap_rproc_of_get_internal_memories(pdev, rproc); in omap_rproc_probe()
1324 ret = omap_rproc_get_boot_data(pdev, rproc); in omap_rproc_probe()
1328 ret = omap_rproc_of_get_timers(pdev, rproc); in omap_rproc_probe()
1353 platform_set_drvdata(pdev, rproc); in omap_rproc_probe()
1355 ret = rproc_add(rproc); in omap_rproc_probe()
1364 rproc_free(rproc); in omap_rproc_probe()
1370 struct rproc *rproc = platform_get_drvdata(pdev); in omap_rproc_remove() local
1372 rproc_del(rproc); in omap_rproc_remove()
1373 rproc_free(rproc); in omap_rproc_remove()
1389 .name = "omap-rproc",