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, bool *is_iomem) 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()
904 struct rproc *rproc = dev_get_drvdata(dev); in omap_rproc_suspend() local
905 struct omap_rproc *oproc = rproc->priv; in omap_rproc_suspend()
908 mutex_lock(&rproc->lock); in omap_rproc_suspend()
909 if (rproc->state == RPROC_OFFLINE) in omap_rproc_suspend()
912 if (rproc->state == RPROC_SUSPENDED) in omap_rproc_suspend()
915 if (rproc->state != RPROC_RUNNING) { in omap_rproc_suspend()
920 ret = _omap_rproc_suspend(rproc, false); in omap_rproc_suspend()
931 rproc->state = RPROC_SUSPENDED; in omap_rproc_suspend()
934 mutex_unlock(&rproc->lock); in omap_rproc_suspend()
940 struct rproc *rproc = dev_get_drvdata(dev); in omap_rproc_resume() local
941 struct omap_rproc *oproc = rproc->priv; in omap_rproc_resume()
944 mutex_lock(&rproc->lock); in omap_rproc_resume()
945 if (rproc->state == RPROC_OFFLINE) in omap_rproc_resume()
948 if (rproc->state != RPROC_SUSPENDED) { in omap_rproc_resume()
961 ret = _omap_rproc_resume(rproc, false); in omap_rproc_resume()
968 rproc->state = RPROC_RUNNING; in omap_rproc_resume()
972 mutex_unlock(&rproc->lock); in omap_rproc_resume()
978 struct rproc *rproc = dev_get_drvdata(dev); in omap_rproc_runtime_suspend() local
979 struct omap_rproc *oproc = rproc->priv; in omap_rproc_runtime_suspend()
982 mutex_lock(&rproc->lock); in omap_rproc_runtime_suspend()
983 if (rproc->state == RPROC_CRASHED) { in omap_rproc_runtime_suspend()
984 dev_dbg(dev, "rproc cannot be runtime suspended when crashed!\n"); in omap_rproc_runtime_suspend()
989 if (WARN_ON(rproc->state != RPROC_RUNNING)) { in omap_rproc_runtime_suspend()
990 dev_err(dev, "rproc cannot be runtime suspended when not running!\n"); in omap_rproc_runtime_suspend()
1004 ret = _omap_rproc_suspend(rproc, true); in omap_rproc_runtime_suspend()
1008 rproc->state = RPROC_SUSPENDED; in omap_rproc_runtime_suspend()
1009 mutex_unlock(&rproc->lock); in omap_rproc_runtime_suspend()
1015 mutex_unlock(&rproc->lock); in omap_rproc_runtime_suspend()
1021 struct rproc *rproc = dev_get_drvdata(dev); in omap_rproc_runtime_resume() local
1024 mutex_lock(&rproc->lock); in omap_rproc_runtime_resume()
1025 if (WARN_ON(rproc->state != RPROC_SUSPENDED)) { in omap_rproc_runtime_resume()
1026 dev_err(dev, "rproc cannot be runtime resumed if not suspended! state=%d\n", in omap_rproc_runtime_resume()
1027 rproc->state); in omap_rproc_runtime_resume()
1032 ret = _omap_rproc_resume(rproc, true); in omap_rproc_runtime_resume()
1038 rproc->state = RPROC_RUNNING; in omap_rproc_runtime_resume()
1040 mutex_unlock(&rproc->lock); in omap_rproc_runtime_resume()
1130 struct rproc *rproc) in omap_rproc_get_boot_data() argument
1133 struct omap_rproc *oproc = rproc->priv; in omap_rproc_get_boot_data()
1169 struct rproc *rproc) in omap_rproc_of_get_internal_memories() argument
1171 struct omap_rproc *oproc = rproc->priv; in omap_rproc_of_get_internal_memories()
1244 struct rproc *rproc) in omap_rproc_of_get_timers() argument
1247 struct omap_rproc *oproc = rproc->priv; in omap_rproc_of_get_timers()
1283 struct rproc *rproc; in omap_rproc_probe() local
1307 rproc = rproc_alloc(&pdev->dev, dev_name(&pdev->dev), &omap_rproc_ops, in omap_rproc_probe()
1309 if (!rproc) in omap_rproc_probe()
1312 oproc = rproc->priv; in omap_rproc_probe()
1313 oproc->rproc = rproc; in omap_rproc_probe()
1316 rproc->has_iommu = true; in omap_rproc_probe()
1318 ret = omap_rproc_of_get_internal_memories(pdev, rproc); in omap_rproc_probe()
1322 ret = omap_rproc_get_boot_data(pdev, rproc); in omap_rproc_probe()
1326 ret = omap_rproc_of_get_timers(pdev, rproc); in omap_rproc_probe()
1351 platform_set_drvdata(pdev, rproc); in omap_rproc_probe()
1353 ret = rproc_add(rproc); in omap_rproc_probe()
1362 rproc_free(rproc); in omap_rproc_probe()
1368 struct rproc *rproc = platform_get_drvdata(pdev); in omap_rproc_remove() local
1370 rproc_del(rproc); in omap_rproc_remove()
1371 rproc_free(rproc); in omap_rproc_remove()
1387 .name = "omap-rproc",