Commit f97f0357 authored by Suman Anna's avatar Suman Anna Committed by Sekhar Nori

ARM: davinci: da8xx: Create DSP device only when assigned memory

The DSP device on Davinci platforms does not have an MMU and requires
specific DDR memory to boot. This memory is reserved using the rproc_mem
kernel boot parameter and is assigned to the device on non-DT boots.
The remoteproc core uses the DMA API and so will fall back to assigning
random memory if this memory is not assigned to the device, but the DSP
remote processor boot will not be successful in such cases. So, check
that memory has been reserved and assigned to the device specifically
before even creating the DSP device.
Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 2ea659a9
...@@ -814,6 +814,8 @@ static struct platform_device da8xx_dsp = { ...@@ -814,6 +814,8 @@ static struct platform_device da8xx_dsp = {
.resource = da8xx_rproc_resources, .resource = da8xx_rproc_resources,
}; };
static bool rproc_mem_inited __initdata;
#if IS_ENABLED(CONFIG_DA8XX_REMOTEPROC) #if IS_ENABLED(CONFIG_DA8XX_REMOTEPROC)
static phys_addr_t rproc_base __initdata; static phys_addr_t rproc_base __initdata;
...@@ -852,6 +854,8 @@ void __init da8xx_rproc_reserve_cma(void) ...@@ -852,6 +854,8 @@ void __init da8xx_rproc_reserve_cma(void)
ret = dma_declare_contiguous(&da8xx_dsp.dev, rproc_size, rproc_base, 0); ret = dma_declare_contiguous(&da8xx_dsp.dev, rproc_size, rproc_base, 0);
if (ret) if (ret)
pr_err("%s: dma_declare_contiguous failed %d\n", __func__, ret); pr_err("%s: dma_declare_contiguous failed %d\n", __func__, ret);
else
rproc_mem_inited = true;
} }
#else #else
...@@ -866,6 +870,12 @@ int __init da8xx_register_rproc(void) ...@@ -866,6 +870,12 @@ int __init da8xx_register_rproc(void)
{ {
int ret; int ret;
if (!rproc_mem_inited) {
pr_warn("%s: memory not reserved for DSP, not registering DSP device\n",
__func__);
return -ENOMEM;
}
ret = platform_device_register(&da8xx_dsp); ret = platform_device_register(&da8xx_dsp);
if (ret) if (ret)
pr_err("%s: can't register DSP device: %d\n", __func__, ret); pr_err("%s: can't register DSP device: %d\n", __func__, ret);
......
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