Lines Matching +full:dsp +full:- +full:based
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Remote processor machine-specific module for DA8XX
26 "Name of DSP firmware file in /lib/firmware (if not specified defaults to 'rproc-dsp-fw')");
29 * OMAP-L138 Technical References:
30 * http://www.ti.com/product/omap-l138
38 #define DA8XX_RPROC_LOCAL_ADDRESS_MASK (SZ_16M - 1)
41 * struct da8xx_rproc_mem - internal memory structure
44 * @dev_addr: Device address of the memory region from DSP view
55 * struct da8xx_rproc - da8xx remote processor instance state
59 * @dsp_clk: placeholder for platform's DSP clk
60 * @ack_fxn: chip-specific ack function for ack'ing irq
62 * @chipsig: virt ptr to DSP interrupt registers (CHIPSIG & CHIPSIG_CLR)
63 * @bootreg: virt ptr to DSP boot address register (HOST1CFG)
80 * handle_event() - inbound virtqueue message workqueue function
97 * da8xx_rproc_callback() - inbound virtqueue message handler
100 * core (DSP) has modified the state of a virtqueue. There is no
102 * mailbox-based implementations on OMAP4. As such, this handler "polls"
108 struct da8xx_rproc *drproc = rproc->priv; in da8xx_rproc_callback()
111 chipsig = readl(drproc->chipsig); in da8xx_rproc_callback()
114 writel(SYSCFG_CHIPSIG0, drproc->chipsig + 4); in da8xx_rproc_callback()
120 * this function, but since the ARM<->DSP interrupts in the in da8xx_rproc_callback()
125 drproc->ack_fxn(drproc->irq_data); in da8xx_rproc_callback()
135 struct device *dev = rproc->dev.parent; in da8xx_rproc_start()
136 struct da8xx_rproc *drproc = rproc->priv; in da8xx_rproc_start()
137 struct clk *dsp_clk = drproc->dsp_clk; in da8xx_rproc_start()
138 struct reset_control *dsp_reset = drproc->dsp_reset; in da8xx_rproc_start()
142 if (rproc->bootaddr & 0x3ff) { in da8xx_rproc_start()
145 return -EINVAL; in da8xx_rproc_start()
148 writel(rproc->bootaddr, drproc->bootreg); in da8xx_rproc_start()
168 struct da8xx_rproc *drproc = rproc->priv; in da8xx_rproc_stop()
169 struct device *dev = rproc->dev.parent; in da8xx_rproc_stop()
172 ret = reset_control_assert(drproc->dsp_reset); in da8xx_rproc_stop()
178 clk_disable_unprepare(drproc->dsp_clk); in da8xx_rproc_stop()
186 struct da8xx_rproc *drproc = rproc->priv; in da8xx_rproc_kick()
189 writel(SYSCFG_CHIPSIG2, drproc->chipsig); in da8xx_rproc_kick()
203 struct device *dev = &pdev->dev; in da8xx_rproc_get_internal_memories()
207 drproc->mem = devm_kcalloc(dev, num_mems, sizeof(*drproc->mem), in da8xx_rproc_get_internal_memories()
209 if (!drproc->mem) in da8xx_rproc_get_internal_memories()
210 return -ENOMEM; in da8xx_rproc_get_internal_memories()
215 drproc->mem[i].cpu_addr = devm_ioremap_resource(dev, res); in da8xx_rproc_get_internal_memories()
216 if (IS_ERR(drproc->mem[i].cpu_addr)) { in da8xx_rproc_get_internal_memories()
219 return PTR_ERR(drproc->mem[i].cpu_addr); in da8xx_rproc_get_internal_memories()
221 drproc->mem[i].bus_addr = res->start; in da8xx_rproc_get_internal_memories()
222 drproc->mem[i].dev_addr = in da8xx_rproc_get_internal_memories()
223 res->start & DA8XX_RPROC_LOCAL_ADDRESS_MASK; in da8xx_rproc_get_internal_memories()
224 drproc->mem[i].size = resource_size(res); in da8xx_rproc_get_internal_memories()
227 mem_names[i], &drproc->mem[i].bus_addr, in da8xx_rproc_get_internal_memories()
228 drproc->mem[i].size, drproc->mem[i].cpu_addr, in da8xx_rproc_get_internal_memories()
229 drproc->mem[i].dev_addr); in da8xx_rproc_get_internal_memories()
231 drproc->num_mems = num_mems; in da8xx_rproc_get_internal_memories()
238 struct device *dev = &pdev->dev; in da8xx_rproc_probe()
256 return -EINVAL; in da8xx_rproc_probe()
276 if (PTR_ERR(dsp_reset) != -EPROBE_DEFER) in da8xx_rproc_probe()
283 if (dev->of_node) { in da8xx_rproc_probe()
292 rproc = rproc_alloc(dev, "dsp", &da8xx_rproc_ops, da8xx_fw_name, in da8xx_rproc_probe()
295 ret = -ENOMEM; in da8xx_rproc_probe()
300 rproc->recovery_disabled = true; in da8xx_rproc_probe()
302 drproc = rproc->priv; in da8xx_rproc_probe()
303 drproc->rproc = rproc; in da8xx_rproc_probe()
304 drproc->dsp_clk = dsp_clk; in da8xx_rproc_probe()
305 drproc->dsp_reset = dsp_reset; in da8xx_rproc_probe()
306 rproc->has_iommu = false; in da8xx_rproc_probe()
316 handle_event, 0, "da8xx-remoteproc", in da8xx_rproc_probe()
324 * rproc_add() can end up enabling the DSP's clk with the DSP in da8xx_rproc_probe()
325 * *not* in reset, but da8xx_rproc_start() needs the DSP to be in da8xx_rproc_probe()
332 drproc->chipsig = chipsig; in da8xx_rproc_probe()
333 drproc->bootreg = bootreg; in da8xx_rproc_probe()
334 drproc->ack_fxn = irq_data->chip->irq_ack; in da8xx_rproc_probe()
335 drproc->irq_data = irq_data; in da8xx_rproc_probe()
336 drproc->irq = irq; in da8xx_rproc_probe()
349 if (dev->of_node) in da8xx_rproc_probe()
357 struct da8xx_rproc *drproc = rproc->priv; in da8xx_rproc_remove()
358 struct device *dev = &pdev->dev; in da8xx_rproc_remove()
365 disable_irq(drproc->irq); in da8xx_rproc_remove()
369 if (dev->of_node) in da8xx_rproc_remove()
374 { .compatible = "ti,da850-dsp", },
383 .name = "davinci-rproc",