Lines Matching full:rproc
74 * struct omap_rproc_timer - data structure for a timer used by a omap rproc
92 * @num_timers: number of rproc timer(s)
93 * @num_wd_timers: number of rproc watchdog timers
94 * @timers: timer(s) info used by rproc
97 * @rproc: rproc handle
114 struct rproc *rproc; member
182 * @timer: handle to a OMAP rproc timer
198 * @timer: handle to a OMAP rproc timer
215 * @timer: handle to a OMAP rproc timer
230 * @timer: handle to a OMAP rproc timer
245 * @timer: handle to a OMAP rproc timer
263 * timers associated with a rproc (like IPUs which have 2 watchdog timers,
274 struct rproc *rproc = data; in omap_rproc_watchdog_isr() local
275 struct omap_rproc *oproc = rproc->priv; in omap_rproc_watchdog_isr()
276 struct device *dev = rproc->dev.parent; in omap_rproc_watchdog_isr()
296 rproc_report_crash(rproc, RPROC_WATCHDOG); in omap_rproc_watchdog_isr()
303 * @rproc: handle of a remote processor
313 static int omap_rproc_enable_timers(struct rproc *rproc, bool configure) in omap_rproc_enable_timers() argument
320 struct omap_rproc *oproc = rproc->priv; in omap_rproc_enable_timers()
322 struct device *dev = rproc->dev.parent; in omap_rproc_enable_timers()
394 "rproc-wdt", rproc); in omap_rproc_enable_timers()
431 free_irq(timers[i].irq, rproc); in omap_rproc_enable_timers()
443 * @rproc: handle of a remote processor
453 static int omap_rproc_disable_timers(struct rproc *rproc, bool configure) in omap_rproc_disable_timers() argument
456 struct omap_rproc *oproc = rproc->priv; in omap_rproc_disable_timers()
467 free_irq(timers[i].irq, rproc); in omap_rproc_disable_timers()
496 struct device *dev = oproc->rproc->dev.parent; in omap_rproc_mbox_callback()
497 const char *name = oproc->rproc->name; in omap_rproc_mbox_callback()
505 * remoteproc detected an exception, notify the rproc core. in omap_rproc_mbox_callback()
508 dev_err(dev, "omap rproc %s crashed\n", name); in omap_rproc_mbox_callback()
509 rproc_report_crash(oproc->rproc, RPROC_FATAL_ERROR); in omap_rproc_mbox_callback()
522 if (msg > oproc->rproc->max_notifyid) { in omap_rproc_mbox_callback()
527 if (rproc_vq_interrupt(oproc->rproc, msg) == IRQ_NONE) in omap_rproc_mbox_callback()
533 static void omap_rproc_kick(struct rproc *rproc, int vqid) in omap_rproc_kick() argument
535 struct omap_rproc *oproc = rproc->priv; in omap_rproc_kick()
536 struct device *dev = rproc->dev.parent; in omap_rproc_kick()
539 /* wake up the rproc before kicking it */ in omap_rproc_kick()
560 * @rproc: handle of a remote processor
566 static int omap_rproc_write_dsp_boot_addr(struct rproc *rproc) in omap_rproc_write_dsp_boot_addr() argument
568 struct device *dev = rproc->dev.parent; in omap_rproc_write_dsp_boot_addr()
569 struct omap_rproc *oproc = rproc->priv; in omap_rproc_write_dsp_boot_addr()
575 if (rproc->bootaddr & (SZ_1K - 1)) { in omap_rproc_write_dsp_boot_addr()
577 rproc->bootaddr); in omap_rproc_write_dsp_boot_addr()
581 value = rproc->bootaddr >> bdata->boot_reg_shift; in omap_rproc_write_dsp_boot_addr()
590 * This function will be invoked only after the firmware for this rproc
594 static int omap_rproc_start(struct rproc *rproc) in omap_rproc_start() argument
596 struct omap_rproc *oproc = rproc->priv; in omap_rproc_start()
597 struct device *dev = rproc->dev.parent; in omap_rproc_start()
602 ret = omap_rproc_write_dsp_boot_addr(rproc); in omap_rproc_start()
634 ret = omap_rproc_enable_timers(rproc, true); in omap_rproc_start()
661 omap_rproc_disable_timers(rproc, true); in omap_rproc_start()
668 static int omap_rproc_stop(struct rproc *rproc) in omap_rproc_stop() argument
670 struct device *dev = rproc->dev.parent; in omap_rproc_stop()
671 struct omap_rproc *oproc = rproc->priv; in omap_rproc_stop()
692 ret = omap_rproc_disable_timers(rproc, true); in omap_rproc_stop()
720 * @rproc: remote processor to apply the address translation for
724 * Custom function implementing the rproc .da_to_va ops to provide address
732 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
734 struct omap_rproc *oproc = rproc->priv; in omap_rproc_da_to_va()
772 static int _omap_rproc_suspend(struct rproc *rproc, bool auto_suspend) in _omap_rproc_suspend() argument
774 struct device *dev = rproc->dev.parent; in _omap_rproc_suspend()
775 struct omap_rproc *oproc = rproc->priv; in _omap_rproc_suspend()
821 ret = omap_rproc_disable_timers(rproc, false); in _omap_rproc_suspend()
834 ret = omap_iommu_domain_deactivate(rproc->domain); in _omap_rproc_suspend()
846 omap_rproc_enable_timers(rproc, false); in _omap_rproc_suspend()
852 static int _omap_rproc_resume(struct rproc *rproc, bool auto_suspend) in _omap_rproc_resume() argument
854 struct device *dev = rproc->dev.parent; in _omap_rproc_resume()
855 struct omap_rproc *oproc = rproc->priv; in _omap_rproc_resume()
864 ret = omap_iommu_domain_activate(rproc->domain); in _omap_rproc_resume()
873 ret = omap_rproc_write_dsp_boot_addr(rproc); in _omap_rproc_resume()
880 ret = omap_rproc_enable_timers(rproc, false); in _omap_rproc_resume()
895 omap_rproc_disable_timers(rproc, false); in _omap_rproc_resume()
898 omap_iommu_domain_deactivate(rproc->domain); in _omap_rproc_resume()
905 struct rproc *rproc = dev_get_drvdata(dev); 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()
941 struct rproc *rproc = dev_get_drvdata(dev); in omap_rproc_resume() local
942 struct omap_rproc *oproc = rproc->priv; in omap_rproc_resume()
945 mutex_lock(&rproc->lock); in omap_rproc_resume()
946 if (rproc->state == RPROC_OFFLINE) in omap_rproc_resume()
949 if (rproc->state != RPROC_SUSPENDED) { in omap_rproc_resume()
962 ret = _omap_rproc_resume(rproc, false); in omap_rproc_resume()
969 rproc->state = RPROC_RUNNING; in omap_rproc_resume()
973 mutex_unlock(&rproc->lock); in omap_rproc_resume()
979 struct rproc *rproc = dev_get_drvdata(dev); in omap_rproc_runtime_suspend() local
980 struct omap_rproc *oproc = rproc->priv; in omap_rproc_runtime_suspend()
983 mutex_lock(&rproc->lock); in omap_rproc_runtime_suspend()
984 if (rproc->state == RPROC_CRASHED) { in omap_rproc_runtime_suspend()
985 dev_dbg(dev, "rproc cannot be runtime suspended when crashed!\n"); in omap_rproc_runtime_suspend()
990 if (WARN_ON(rproc->state != RPROC_RUNNING)) { in omap_rproc_runtime_suspend()
991 dev_err(dev, "rproc cannot be runtime suspended when not running!\n"); in omap_rproc_runtime_suspend()
1005 ret = _omap_rproc_suspend(rproc, true); in omap_rproc_runtime_suspend()
1009 rproc->state = RPROC_SUSPENDED; in omap_rproc_runtime_suspend()
1010 mutex_unlock(&rproc->lock); in omap_rproc_runtime_suspend()
1016 mutex_unlock(&rproc->lock); in omap_rproc_runtime_suspend()
1022 struct rproc *rproc = dev_get_drvdata(dev); in omap_rproc_runtime_resume() local
1025 mutex_lock(&rproc->lock); in omap_rproc_runtime_resume()
1026 if (WARN_ON(rproc->state != RPROC_SUSPENDED)) { in omap_rproc_runtime_resume()
1027 dev_err(dev, "rproc cannot be runtime resumed if not suspended! state=%d\n", in omap_rproc_runtime_resume()
1028 rproc->state); in omap_rproc_runtime_resume()
1033 ret = _omap_rproc_resume(rproc, true); in omap_rproc_runtime_resume()
1039 rproc->state = RPROC_RUNNING; in omap_rproc_runtime_resume()
1041 mutex_unlock(&rproc->lock); in omap_rproc_runtime_resume()
1131 struct rproc *rproc) in omap_rproc_get_boot_data() argument
1134 struct omap_rproc *oproc = rproc->priv; in omap_rproc_get_boot_data()
1170 struct rproc *rproc) in omap_rproc_of_get_internal_memories() argument
1172 struct omap_rproc *oproc = rproc->priv; in omap_rproc_of_get_internal_memories()
1245 struct rproc *rproc) in omap_rproc_of_get_timers() argument
1248 struct omap_rproc *oproc = rproc->priv; in omap_rproc_of_get_timers()
1284 struct rproc *rproc; in omap_rproc_probe() local
1308 rproc = rproc_alloc(&pdev->dev, dev_name(&pdev->dev), &omap_rproc_ops, in omap_rproc_probe()
1310 if (!rproc) in omap_rproc_probe()
1313 oproc = rproc->priv; in omap_rproc_probe()
1314 oproc->rproc = rproc; in omap_rproc_probe()
1317 rproc->has_iommu = true; in omap_rproc_probe()
1319 ret = omap_rproc_of_get_internal_memories(pdev, rproc); in omap_rproc_probe()
1323 ret = omap_rproc_get_boot_data(pdev, rproc); in omap_rproc_probe()
1327 ret = omap_rproc_of_get_timers(pdev, rproc); in omap_rproc_probe()
1352 platform_set_drvdata(pdev, rproc); in omap_rproc_probe()
1354 ret = rproc_add(rproc); in omap_rproc_probe()
1363 rproc_free(rproc); in omap_rproc_probe()
1369 struct rproc *rproc = platform_get_drvdata(pdev); in omap_rproc_remove() local
1371 rproc_del(rproc); in omap_rproc_remove()
1372 rproc_free(rproc); in omap_rproc_remove()
1386 .name = "omap-rproc",