Commit 61696580 authored by Suman Anna's avatar Suman Anna Committed by Bjorn Andersson

remoteproc/davinci: Add device tree support for OMAP-L138 DSP

The Davinci remoteproc driver currently supports the DSP remoteproc
device created in legacy-style on OMAP-L13x SoCs. The driver has been
enhanced to support the DSP remoteproc device created through Device
Tree now. The current DT support handles the C674x DSP processor
subsystem on OMAP-L138 SoCs.
Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent ae67b800
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/remoteproc.h> #include <linux/remoteproc.h>
...@@ -261,10 +262,21 @@ static int da8xx_rproc_probe(struct platform_device *pdev) ...@@ -261,10 +262,21 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
return PTR_ERR(dsp_clk); return PTR_ERR(dsp_clk);
} }
if (dev->of_node) {
ret = of_reserved_mem_device_init(dev);
if (ret) {
dev_err(dev, "device does not have specific CMA pool: %d\n",
ret);
return ret;
}
}
rproc = rproc_alloc(dev, "dsp", &da8xx_rproc_ops, da8xx_fw_name, rproc = rproc_alloc(dev, "dsp", &da8xx_rproc_ops, da8xx_fw_name,
sizeof(*drproc)); sizeof(*drproc));
if (!rproc) if (!rproc) {
return -ENOMEM; ret = -ENOMEM;
goto free_mem;
}
drproc = rproc->priv; drproc = rproc->priv;
drproc->rproc = rproc; drproc->rproc = rproc;
...@@ -311,7 +323,9 @@ static int da8xx_rproc_probe(struct platform_device *pdev) ...@@ -311,7 +323,9 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
free_rproc: free_rproc:
rproc_free(rproc); rproc_free(rproc);
free_mem:
if (dev->of_node)
of_reserved_mem_device_release(dev);
return ret; return ret;
} }
...@@ -319,6 +333,7 @@ static int da8xx_rproc_remove(struct platform_device *pdev) ...@@ -319,6 +333,7 @@ static int da8xx_rproc_remove(struct platform_device *pdev)
{ {
struct rproc *rproc = platform_get_drvdata(pdev); struct rproc *rproc = platform_get_drvdata(pdev);
struct da8xx_rproc *drproc = (struct da8xx_rproc *)rproc->priv; struct da8xx_rproc *drproc = (struct da8xx_rproc *)rproc->priv;
struct device *dev = &pdev->dev;
/* /*
* The devm subsystem might end up releasing things before * The devm subsystem might end up releasing things before
...@@ -329,15 +344,24 @@ static int da8xx_rproc_remove(struct platform_device *pdev) ...@@ -329,15 +344,24 @@ static int da8xx_rproc_remove(struct platform_device *pdev)
rproc_del(rproc); rproc_del(rproc);
rproc_free(rproc); rproc_free(rproc);
if (dev->of_node)
of_reserved_mem_device_release(dev);
return 0; return 0;
} }
static const struct of_device_id davinci_rproc_of_match[] __maybe_unused = {
{ .compatible = "ti,da850-dsp", },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, davinci_rproc_of_match);
static struct platform_driver da8xx_rproc_driver = { static struct platform_driver da8xx_rproc_driver = {
.probe = da8xx_rproc_probe, .probe = da8xx_rproc_probe,
.remove = da8xx_rproc_remove, .remove = da8xx_rproc_remove,
.driver = { .driver = {
.name = "davinci-rproc", .name = "davinci-rproc",
.of_match_table = of_match_ptr(davinci_rproc_of_match),
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment